:root {
  color-scheme: light;
  --page: #f4f6f8;
  --surface: #fff;
  --line: #e4e8ec;
  --ink: #18222c;
  --muted: #687481;
  --blue: #236dd1;
  --green: #218760;
  --red: #bf4545;
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--page); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 480px) minmax(24px, 1fr); align-items: center; }
.login-shell { grid-column: 2; padding: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.brand-mark { color: var(--blue); font-size: 13px; font-weight: 700; }
.login-shell h1 { margin: 24px 0 8px; font-size: 25px; line-height: 1.35; }
.login-shell > p { margin: 0 0 30px; color: var(--muted); font-size: 14px; }

.workspace { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 5; height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 95%); backdrop-filter: blur(12px); }
.topbar-brand { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; }
.brand-separator { width: 1px; height: 17px; background: var(--line); }
.topbar-actions, .button-row { display: flex; align-items: center; gap: 9px; }
.user-label { color: var(--muted); font-size: 12px; }
.layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: calc(100vh - 58px); }
.sidebar { padding: 25px 13px; border-right: 1px solid var(--line); background: #fff; }
.nav-title { padding: 0 11px 11px; color: #87919b; font-size: 11px; }
.nav { display: grid; gap: 4px; }
.nav-button { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 11px; border: 0; border-radius: 5px; color: #53606d; background: transparent; text-align: left; font-size: 13px; }
.nav-button:hover { background: #f1f4f7; }
.nav-button.active { color: #1759ac; background: #edf4fd; font-weight: 600; }
.nav-icon { width: 20px; color: inherit; font-size: 14px; text-align: center; }
.content { min-width: 0; max-width: 1240px; width: 100%; margin: 0 auto; padding: 32px 38px 70px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: 23px; line-height: 1.35; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.panel { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.panel + .panel { margin-top: 16px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 14px; font-weight: 650; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 20px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { padding: 17px 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { margin-top: 10px; font-size: 26px; font-weight: 650; }
.metric-note { margin-top: 2px; color: #88939e; font-size: 11px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-action { display: flex; flex-direction: column; align-items: flex-start; min-height: 92px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-align: left; }
.quick-action:hover { border-color: #b7cde8; background: #f8fbff; }
.quick-action strong { font-size: 13px; }
.quick-action span { margin-top: 6px; color: var(--muted); font-size: 12px; }
.form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span, .field > label { color: #35404b; font-size: 12px; font-weight: 600; }
.field small { color: var(--muted); font-size: 11px; font-weight: 400; }
.input, .select, .textarea { min-width: 0; width: 100%; border: 1px solid #d6dde4; border-radius: 5px; outline: 0; color: var(--ink); background: #fff; }
.input, .select { min-height: 39px; padding: 0 11px; }
.textarea { padding: 10px 11px; line-height: 1.7; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: #5790dd; box-shadow: 0 0 0 3px rgb(35 109 209 / 12%); }
.textarea.body-editor { min-height: 390px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.75; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid #d5dce3; border-radius: 5px; color: #38434e; background: #fff; font-size: 12px; white-space: nowrap; }
.button:hover { background: #f4f6f8; }
.button.primary { border-color: #246bc8; color: #fff; background: #276fce; }
.button.primary:hover { background: #1e5eaf; }
.button.danger { color: #ad3b3b; border-color: #edcece; }
.button.small { min-height: 30px; padding: 0 9px; font-size: 11px; }
.button:disabled { opacity: .55; cursor: wait; }
.checkbox-row { display: inline-flex; align-items: center; gap: 8px; min-height: 39px; color: #485460; font-size: 12px; }
.checkbox-row input { width: 15px; height: 15px; accent-color: var(--blue); }
.color-row { display: grid; grid-template-columns: 1fr 92px; gap: 8px; align-items: center; }
.color-input { width: 44px; height: 36px; padding: 3px; border: 1px solid #d6dde4; border-radius: 5px; background: #fff; }
.color-value { min-height: 36px; padding: 0 8px; font-family: ui-monospace, monospace; font-size: 11px; text-transform: uppercase; }
.preview-strip { display: flex; gap: 8px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #f8f9fa; }
.swatch { width: 18px; height: 18px; border: 1px solid rgb(0 0 0 / 10%); border-radius: 50%; }
.preview-strip span:last-child { color: var(--muted); font-size: 11px; }
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.table th { padding: 11px 14px; color: #77828e; background: #f8f9fb; font-size: 10px; font-weight: 600; white-space: nowrap; }
.table td { padding: 13px 14px; border-top: 1px solid #edf0f2; vertical-align: middle; }
.table-title { max-width: 360px; font-weight: 550; line-height: 1.5; }
.table-subtitle { margin-top: 3px; color: var(--muted); font-size: 10px; }
.table-actions { display: flex; gap: 6px; }
.status { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 3px; font-size: 10px; }
.status.published { color: #19724e; background: #e9f5ef; }
.status.draft { color: #865a10; background: #fff4df; }
.status.archived { color: #6c7782; background: #edf0f2; }
.empty { padding: 36px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.hint { padding: 11px 13px; border: 1px solid #e7edf2; border-radius: 5px; color: #63717e; background: #f8fafb; font-size: 11px; line-height: 1.7; }
.hint strong { color: #394653; }
.divider { height: 1px; margin: 4px 0; background: var(--line); }
#toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(420px, calc(100vw - 36px)); padding: 11px 15px; border: 1px solid #d8e0e7; border-radius: 6px; color: #2f3943; background: white; box-shadow: 0 5px 22px rgb(20 35 48 / 12%); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
#toast.show { opacity: 1; transform: translateY(0); }
#toast.error { color: #a83333; border-color: #efcccc; }

@media (max-width: 760px) {
  .topbar { padding: 0 15px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 58px; z-index: 4; padding: 7px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-title { display: none; }
  .nav { display: flex; gap: 4px; overflow-x: auto; }
  .nav-button { flex: 0 0 auto; min-height: 36px; padding: 0 10px; font-size: 11px; }
  .nav-icon { display: none; }
  .content { padding: 25px 16px 54px; }
  .metric-grid { gap: 8px; }
  .metric { padding: 13px 11px; }
  .metric-value { font-size: 22px; }
  .quick-grid, .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .panel-body { padding: 15px; }
}
@media (max-width: 430px) {
  .user-label { display: none; }
  .page-heading { align-items: center; }
  .page-heading h1 { font-size: 20px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric:last-child { grid-column: 1 / -1; }
  .topbar-brand { font-size: 12px; }
  .login-shell { padding: 27px 22px; }
}
