/* ═══════════════════════════════════════════════════════════════════
   内容运营中心 · 小说站后台 · 共享样式
   设计系统：Notion（tokens.css 契约，verbatim）
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* ─── Surface ──────────────────────────────────────────────────── */
  --bg:           #ffffff;
  --surface:      #f6f5f4;               /* warm white — section alternation */
  --surface-warm: var(--surface);        /* aliases to warm white tier */

  /* ─── Foreground ───────────────────────────────────────────────── */
  --fg:   rgba(0, 0, 0, 0.95);           /* near-black — primary text */
  --fg-2: #31302e;                       /* warm dark — headings on surfaces */
  --muted: #615d59;                      /* warm gray 500 — secondary text */
  --meta:  #a39e98;                      /* warm gray 300 — placeholder/captions */

  /* ─── Border ───────────────────────────────────────────────────── */
  --border:      rgba(0, 0, 0, 0.1);    /* whisper border — standard */
  --border-soft: rgba(0, 0, 0, 0.06);  /* subtler row dividers */

  /* ─── Accent ───────────────────────────────────────────────────── */
  --accent:        #0075de;             /* Notion Blue — links, primary CTAs */
  --accent-on:     #ffffff;
  --accent-hover:  #005bab;             /* Active Blue — pressed state */
  --accent-active: color-mix(in oklab, var(--accent), black 14%);

  /* ─── Semantic ─────────────────────────────────────────────────── */
  --success: #1aae39;                   /* Notion green — confirmation */
  --warn:    #dd5b00;                   /* Notion orange — warning */
  --danger:  #dc2626;

  /* ─── Typography ───────────────────────────────────────────────── */
  --font-display: "NotionInter", "Inter", -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body:    "NotionInter", "Inter", -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  /* Type scale — DESIGN.md §Typography Hierarchy. */
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-lg:   20px;
  --text-xl:   26px;
  --text-2xl:  40px;
  --text-3xl:  48px;
  --text-4xl:  64px;

  /* Leading + tracking. */
  --leading-body:     1.5;
  --leading-tight:    1.00;
  --tracking-display: -0.033em;

  /* ─── Spacing ──────────────────────────────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;

  /* Section rhythm — DESIGN.md §Responsive Behavior. */
  --section-y-desktop: 80px;
  --section-y-tablet:  48px;
  --section-y-phone:   32px;

  /* ─── Radius ───────────────────────────────────────────────────── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-pill: 9999px;

  /* ─── Elevation ────────────────────────────────────────────────── */
  --elev-flat:   none;
  --elev-ring:   0 0 0 1px var(--border);
  --elev-raised:
    rgba(0, 0, 0, 0.04) 0px 4px 18px,
    rgba(0, 0, 0, 0.027) 0px 2px 7.85px,
    rgba(0, 0, 0, 0.02) 0px 0.8px 2.93px,
    rgba(0, 0, 0, 0.01) 0px 0.175px 1.04px;

  /* ─── Focus ────────────────────────────────────────────────────── */
  --focus-ring: 0 0 0 3px rgba(9, 127, 232, 0.3);

  /* ─── Motion ───────────────────────────────────────────────────── */
  --motion-fast:   150ms;
  --motion-base:   200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* ─── Layout ───────────────────────────────────────────────────── */
  --container-max:            1200px;
  --container-gutter-desktop: 24px;
  --container-gutter-tablet:  16px;
  --container-gutter-phone:   12px;

  /* ─── 组件派生色（源自 DESIGN.md 组件规范，勿用于正文） ────────── */
  --badge-blue-bg:   #f2f9ff;                 /* pill badge 蓝底 */
  --badge-blue-text: #097fe8;                 /* pill badge 蓝字 */
  --input-border:    #dddddd;                 /* 输入框描边 */
  --navy:            #213183;                 /* Deep Navy 品牌深色 */
  --elev-deep:
    rgba(0, 0, 0, 0.01) 0px 1px 3px,
    rgba(0, 0, 0, 0.02) 0px 3px 7px,
    rgba(0, 0, 0, 0.02) 0px 7px 15px,
    rgba(0, 0, 0, 0.04) 0px 14px 28px,
    rgba(0, 0, 0, 0.05) 0px 23px 52px;
  --green-bg:    color-mix(in oklab, var(--success) 11%, var(--bg));
  --green-text:  color-mix(in oklab, var(--success), black 34%);
  --orange-bg:   color-mix(in oklab, var(--warn) 11%, var(--bg));
  --orange-text: color-mix(in oklab, var(--warn), black 22%);
  --red-bg:      color-mix(in oklab, var(--danger) 9%, var(--bg));
  --tint-hover:  color-mix(in oklab, var(--fg) 5%, var(--bg));
  --tint-active: color-mix(in oklab, var(--fg) 8%, var(--bg));
}

/* ─── 基础 ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: var(--leading-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
::selection { background: color-mix(in oklab, var(--accent) 18%, var(--bg)); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.14); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--muted); }
.meta { color: var(--meta); }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }

/* ─── 应用骨架 ─────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  background: var(--bg);
  border-right: 1px solid var(--border);
}
.brand { display: flex; gap: 11px; align-items: center; padding: 2px 6px 20px; }
.brand-mark {
  flex: none; width: 36px; height: 36px; border-radius: 9px;
  background: var(--fg-2); color: var(--surface-warm);
  display: grid; place-items: center;
  box-shadow: var(--elev-raised);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-name { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.25px; line-height: 1.25; }
.brand-sub { display: block; font-size: 11px; color: var(--meta); margin-top: 1px; }

.nav { display: flex; flex-direction: column; }
.nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--meta); padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 2px;
  border-radius: 6px; font-size: 14px; font-weight: 500;
  color: var(--fg); white-space: nowrap;
  transition: background var(--motion-fast) var(--ease-standard);
}
.nav-item:hover { background: var(--tint-hover); }
.nav-item.active { background: var(--tint-active); font-weight: 600; }
.nav-item svg { flex: none; width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-item .nav-label-text { overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  margin-left: auto; flex: none;
  min-width: 20px; padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--badge-blue-bg); color: var(--badge-blue-text);
  font-size: 11px; font-weight: 600; text-align: center;
  font-variant-numeric: tabular-nums;
}
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border-soft); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.foot-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px;
  font-size: 13px; color: var(--muted); white-space: nowrap;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.foot-link:hover { background: var(--tint-hover); color: var(--fg); }
.foot-link svg { flex: none; width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.main { min-width: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  flex: none; height: 56px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.search { position: relative; flex: 0 1 320px; }
.search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--meta);
  stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round;
  pointer-events: none;
}
.search .input { width: 100%; padding-left: 32px; background: var(--surface); border-color: transparent; border-radius: 7px; }
.search .input:focus { background: var(--bg); border-color: var(--accent); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; color: var(--muted);
  transition: background var(--motion-fast), color var(--motion-fast);
}
.icon-btn:hover { background: var(--tint-hover); color: var(--fg); }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.notif-dot {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px;
  background: var(--danger); border-radius: 50%;
  border: 1.5px solid var(--bg);
}
.user-chip {
  display: flex; align-items: center; gap: 9px;
  margin-left: 4px; padding: 4px 6px; border-radius: 8px;
  transition: background var(--motion-fast);
}
.user-chip:hover { background: var(--tint-hover); }
.user-chip svg { width: 14px; height: 14px; color: var(--meta); stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--meta); }
.avatar {
  flex: none; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in oklab, var(--fg) 8%, var(--bg));
  color: var(--fg-2); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-md { width: 34px; height: 34px; font-size: 13px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

.content { flex: 1; overflow-y: auto; padding: 26px 30px 48px; }
.content-inner { max-width: 1280px; margin: 0 auto; }

/* ─── 页头 ─────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.45px; line-height: 1.2; }
.page-title p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── 按钮 ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background var(--motion-fast) var(--ease-standard), border-color var(--motion-fast), transform var(--motion-fast);
}
.btn:hover { background: var(--tint-hover); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-on); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--tint-hover); }
.btn-danger-ghost { border-color: transparent; background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--red-bg); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }

/* ─── 徽章 ─────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap; line-height: 1.5;
}
.pill-blue { background: var(--badge-blue-bg); color: var(--badge-blue-text); }
.pill-green { background: var(--green-bg); color: var(--green-text); }
.pill-orange { background: var(--orange-bg); color: var(--orange-text); }
.pill-red { background: var(--red-bg); color: var(--danger); }
.pill-gray { background: color-mix(in oklab, var(--fg) 6%, var(--bg)); color: var(--muted); }
.pill-navy { background: color-mix(in oklab, var(--navy) 10%, var(--bg)); color: var(--navy); }
.pill-plain { background: transparent; border: 1px solid var(--border); color: var(--muted); }

/* ─── 卡片 ─────────────────────────────────────────────────────── */
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--elev-raised);
  overflow: hidden;
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.card-sub { font-size: 12px; color: var(--meta); font-weight: 400; }
.card-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 20px 20px; }

.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 18px 20px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.kpi-value {
  margin-top: 9px; font-size: 26px; font-weight: 700;
  letter-spacing: -0.8px; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi-foot { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.kpi-note { color: var(--meta); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2.wide-left { grid-template-columns: 1.5fr 1fr; }

/* ─── 表格 ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--muted); padding: 11px 14px 11px 18px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--bg);
}
th.check-cell { padding-left: 14px; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--motion-fast); }
tbody tr:hover { background: color-mix(in oklab, var(--fg) 2.5%, var(--bg)); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-main { font-weight: 600; font-size: 13.5px; letter-spacing: -0.1px; }
.cell-sub { font-size: 12px; color: var(--meta); margin-top: 2px; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; align-items: center; gap: 2px; justify-content: flex-start; white-space: nowrap; }
.link-act {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 7px; border-radius: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition: background var(--motion-fast), color var(--motion-fast);
}
.link-act:hover { background: var(--tint-hover); color: var(--fg); }
.link-act.primary { color: var(--accent); }
.link-act.primary:hover { background: var(--badge-blue-bg); }
.link-act.danger { color: var(--danger); }
.link-act.danger:hover { background: var(--red-bg); }
.link-act svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.empty { padding: 44px 20px; text-align: center; color: var(--meta); font-size: 13px; }

.check { width: 16px; height: 16px; accent-color: var(--fg-2); cursor: pointer; }
.check-cell { width: 40px; padding-right: 0; }

/* ─── 封面占位 ─────────────────────────────────────────────────── */
.cover {
  flex: none; width: 38px; height: 52px; border-radius: 5px;
  border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 6px 5px; overflow: hidden;
}
.cover-title { font-size: 8.5px; font-weight: 700; line-height: 1.2; color: var(--fg-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cover-tag { font-size: 7px; font-weight: 600; letter-spacing: 0.08em; opacity: 0.72; color: var(--fg-2); text-transform: uppercase; }
.cover-a { background: color-mix(in oklab, var(--accent) 9%, var(--bg)); }
.cover-b { background: color-mix(in oklab, var(--navy) 12%, var(--bg)); }
.cover-c { background: color-mix(in oklab, var(--warn) 10%, var(--bg)); }
.cover-d { background: color-mix(in oklab, var(--success) 10%, var(--bg)); }
.cover-e { background: var(--surface); }
.cover-cell { display: flex; align-items: center; gap: 12px; }

/* ─── 表单 ─────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; }
.field label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); font-size: 13.5px; color: var(--fg);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--meta); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23615d59' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; cursor: pointer; }
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.field .err { display: none; font-size: 12px; color: var(--danger); font-weight: 500; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 12%, transparent); }
.field.invalid .err { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: 1 / -1; }
.switch-note { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }

.switch {
  position: relative; flex: none; width: 32px; height: 18px;
  border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--fg) 18%, var(--bg));
  transition: background var(--motion-fast) var(--ease-standard);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-on);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  transition: transform var(--motion-fast) var(--ease-standard);
}
.switch[aria-checked="true"] { background: var(--success); }
.switch[aria-checked="true"]::after { transform: translateX(14px); }

/* ─── Tabs 与筛选栏 ────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; overflow-y: hidden; }
.tab {
  flex: none; padding: 9px 14px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--motion-fast), border-color var(--motion-fast);
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--fg-2); }
.tab .cnt { margin-left: 5px; color: var(--meta); font-weight: 500; font-variant-numeric: tabular-nums; }

.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 150px; }
.filter-bar .search-input { width: 230px; }
.filter-bar .spacer { flex: 1; }
.filter-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ─── 分页 ─────────────────────────────────────────────────────── */
.pager { display: flex; align-items: center; gap: 6px; padding: 14px 4px 2px; flex-wrap: wrap; }
.pager .info { margin-right: auto; font-size: 12.5px; color: var(--meta); }
.page-btn {
  min-width: 30px; height: 30px; padding: 0 9px;
  border-radius: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); border: 1px solid transparent;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.page-btn:hover:not(:disabled) { background: var(--tint-hover); color: var(--fg); }
.page-btn.active { background: var(--tint-active); color: var(--fg); }
.page-btn:disabled { opacity: 0.38; cursor: default; }

/* ─── 弹窗 / 抽屉 / 轻提示 ─────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.34);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: var(--bg); border-radius: 14px;
  box-shadow: var(--elev-deep);
  padding: 22px;
  animation: pop var(--motion-base) var(--ease-standard);
}
@keyframes pop { from { opacity: 0; transform: translateY(9px) scale(0.98); } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-title { font-size: 16px; font-weight: 700; letter-spacing: -0.25px; line-height: 1.3; }
.modal-sub { font-size: 12.5px; color: var(--meta); margin-top: 2px; }
.modal-close {
  margin-left: auto; flex: none; width: 30px; height: 30px;
  border-radius: 6px; display: grid; place-items: center; color: var(--muted);
  transition: background var(--motion-fast), color var(--motion-fast);
}
.modal-close:hover { background: var(--tint-hover); color: var(--fg); }
.modal-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--border-soft);
}

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.22); display: none; }
.drawer-backdrop.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(430px, 92vw);
  background: var(--bg); box-shadow: var(--elev-deep);
  transform: translateX(102%);
  transition: transform 0.25s var(--ease-standard);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border-soft); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border-soft); }

.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--border-soft); font-size: 13px; }
.kv dt { color: var(--muted); flex: none; }
.kv dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; word-break: break-all; }
.kv:last-child { border-bottom: none; }
.section-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--meta); margin: 18px 0 8px; }

.profile { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.profile-main { font-size: 16px; font-weight: 700; letter-spacing: -0.25px; }
.profile-sub { font-size: 12.5px; color: var(--meta); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 4px; }
.stat-cell { background: var(--surface); border-radius: 10px; padding: 11px 8px; text-align: center; }
.stat-v { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 11px; color: var(--meta); margin-top: 2px; }

.mini-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.mini-row:last-child { border-bottom: none; }
.mini-main { font-size: 13px; font-weight: 600; letter-spacing: -0.1px; }
.mini-sub { font-size: 11.5px; color: var(--meta); margin-top: 1px; font-variant-numeric: tabular-nums; }
.mini-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--fg-2); color: var(--surface-warm);
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--elev-deep);
  animation: toastin var(--motion-base) var(--ease-standard);
}
.toast svg { flex: none; width: 15px; height: 15px; stroke: var(--success); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@keyframes toastin { from { opacity: 0; transform: translateY(9px); } }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 0.22s, transform 0.22s; }

/* ─── 图表 ─────────────────────────────────────────────────────── */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { font-size: 11px; fill: var(--meta); font-variant-numeric: tabular-nums; }
.chart-tip {
  position: absolute; display: none; pointer-events: none;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--elev-raised);
  padding: 7px 10px; font-size: 12px; white-space: nowrap;
  transform: translate(-50%, -115%); z-index: 5;
}
.chart-tip .tip-v { font-size: 13px; font-weight: 700; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.chart-tip .tip-l { color: var(--meta); }

.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }

.bars { display: flex; flex-direction: column; gap: 15px; }
.bar-row { display: grid; grid-template-columns: 58px 1fr 74px; gap: 11px; align-items: center; font-size: 12.5px; }
.bar-name { color: var(--muted); white-space: nowrap; }
.bar-track { height: 8px; border-radius: var(--radius-pill); background: color-mix(in oklab, var(--fg) 7%, var(--bg)); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--radius-pill); background: var(--meta); transition: width 0.5s var(--ease-standard); }
.bar-fill.hot { background: var(--fg-2); }
.bar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ─── 待办 / 排行 ──────────────────────────────────────────────── */
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border-soft); }
.todo-item:last-child { border-bottom: none; }
.todo-icon {
  flex: none; width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--fg) 6%, var(--bg)); color: var(--fg-2);
}
.todo-icon svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.todo-main { font-size: 13.5px; font-weight: 600; letter-spacing: -0.1px; }
.todo-sub { font-size: 12px; color: var(--meta); margin-top: 1px; }
.todo-count { margin-left: auto; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.todo-go { margin-left: 12px; flex: none; }

.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--border-soft); }
.rank-row:last-child { border-bottom: none; }
.rank-num { flex: none; width: 22px; font-size: 15px; font-weight: 700; color: var(--meta); font-variant-numeric: tabular-nums; }
.rank-row.top .rank-num { color: var(--fg-2); }
.rank-main { font-size: 13.5px; font-weight: 600; letter-spacing: -0.1px; }
.rank-sub { font-size: 12px; color: var(--meta); margin-top: 1px; }
.rank-val { margin-left: auto; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ─── 启动页 ───────────────────────────────────────────────────── */
.hero-strip { margin-bottom: 24px; }
.hero-title { font-size: 28px; font-weight: 700; letter-spacing: -0.7px; line-height: 1.15; }
.hero-desc { margin-top: 8px; font-size: 14px; color: var(--muted); max-width: 58ch; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.module-card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 20px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--border);
  box-shadow: var(--elev-raised);
  transition: transform var(--motion-base) var(--ease-standard), box-shadow var(--motion-base), border-color var(--motion-base);
}
.module-card:hover { transform: translateY(-2px); border-color: rgba(0, 0, 0, 0.16); box-shadow: var(--elev-deep); }
.module-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--fg) 6%, var(--bg)); color: var(--fg-2);
}
.module-icon svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.module-name { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; display: flex; align-items: center; gap: 8px; }
.module-desc { font-size: 13px; color: var(--muted); line-height: 1.55; }
.module-go { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--fg); }
.module-go svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--motion-fast); }
.module-card:hover .module-go svg { transform: translateX(3px); }
.note-box {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 18px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  font-size: 12.5px; color: var(--muted); line-height: 1.6;
}
.note-box svg { flex: none; width: 15px; height: 15px; margin-top: 2px; stroke: var(--meta); stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ─── 响应式（桌面优先，适配窄屏） ─────────────────────────────── */
@media (max-width: 1180px) {
  .app { grid-template-columns: 64px 1fr; }
  .sidebar { padding: 18px 10px 14px; }
  .brand { justify-content: center; padding: 2px 0 20px; }
  .brand-text, .nav-label, .nav-item .nav-label-text, .foot-link span, .nav-badge { display: none; }
  .nav-item, .foot-link { justify-content: center; padding: 10px 0; }
  .nav-item.active { box-shadow: inset 0 0 0 1px var(--border); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 0 16px; }
  .search { flex: 0 1 190px; }
  .cards-grid { grid-template-columns: 1fr; }
  .user-meta { display: none; }
  .filter-bar .search-input { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}

/* ═══════════════════════════════════════════════════════════════════
   页面级样式（收编自 design/*.html 内联 <style>，保持原型一致）
   ═══════════════════════════════════════════════════════════════════ */

/* ─── 登录页 ─────────────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: var(--surface);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--elev-deep);
  padding: 34px 34px 26px;
}
.brand-row { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.brand-row .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
.brand-row .brand-mark svg { width: 20px; height: 20px; }
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.25; }
.login-sub { font-size: 13px; color: var(--muted); margin-top: 5px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 6px;
  display: grid; place-items: center; color: var(--meta);
}
.pw-toggle:hover { background: var(--tint-hover); color: var(--fg); }
.pw-toggle svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.login-options { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; margin-top: 2px; }
.check-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.check-label input { width: 15px; height: 15px; accent-color: var(--fg-2); cursor: pointer; }
.forgot { color: var(--muted); font-weight: 600; padding: 2px 4px; border-radius: 4px; }
.forgot:hover { color: var(--fg); background: var(--tint-hover); }
.btn-block { width: 100%; justify-content: center; padding: 10px 16px; margin-top: 18px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--meta); font-size: 12px; margin: 18px 0 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }
.sso-btn { width: 100%; justify-content: center; margin-top: 14px; }
.login-foot { margin-top: 22px; font-size: 12.5px; color: var(--meta); display: flex; gap: 12px; align-items: center; }
.login-foot a { color: var(--muted); font-weight: 600; padding: 2px 4px; border-radius: 4px; }
.login-foot a:hover { color: var(--fg); background: var(--tint-hover); }

/* ─── 通用页内堆叠 ─────────────────────────────────────────────── */
.stack-gap { display: flex; flex-direction: column; gap: 14px; }

/* ─── 仪表盘 ───────────────────────────────────────────────────── */
.bars.dash .bar-row { grid-template-columns: 58px 1fr auto; }
.bars.dash .bar-val { min-width: 96px; }
.chart-card { min-width: 0; }
@media (max-width: 1180px) {
  .grid-2.wide-left .chart-card { min-height: 0; }
}

/* ─── 作者管理 ─────────────────────────────────────────────────── */
.share-row { display: flex; align-items: center; gap: 14px; }
.share-row input[type="range"] { flex: 1; accent-color: var(--accent); height: 24px; }
.share-val { min-width: 64px; font-size: 24px; font-weight: 700; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; }

/* ─── 收入管理 ─────────────────────────────────────────────────── */
.ch-bar .bar-val { display: flex; gap: 10px; align-items: center; justify-content: flex-end; min-width: 132px; }
.ch-bar .bar-row { grid-template-columns: 58px 1fr auto; }
