/* ============================================================
   AI 创作平台 · 增长中枢  —  Apple Design Language v3
   Materials / Motion / Depth
   ============================================================ */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* Apple 系统色（浅色） */
  --apple-blue:   #0071e3;
  --apple-indigo: #5e5ce6;
  --apple-purple: #bf5af2;
  --apple-orange: #ff9f0a;
  --apple-teal:   #30b0c7;
  --apple-green:  #34c759;
  --apple-red:    #ff3b30;
  --apple-pink:   #ff6482;

  --brand: var(--apple-blue);
  --brand-weak: rgba(0, 113, 227, .10);
  --c-online:  #0071e3;
  --c-offline: #5e5ce6;
  --c-social:  #ff9f0a;
  --c-paid:    #30b0c7;
  --c-startup: #bf5af2;

  --up: #ff3b30;
  --down: #248a3d;

  /* 材质 */
  --bg: #f5f5f7;
  --bg-soft: rgba(120, 120, 128, .08);
  --card: rgba(255, 255, 255, .72);
  --card-solid: #ffffff;
  --card-2: rgba(255, 255, 255, .55);
  --text: #1d1d1f;
  --text-2: #3c3c43;
  --muted: #6e6e73;
  --hairline: rgba(60, 60, 67, .10);
  --border: rgba(60, 60, 67, .12);
  --border-2: rgba(60, 60, 67, .18);
  --glass-border: rgba(255, 255, 255, .18);
  --specular: inset 0 1px 0 rgba(255, 255, 255, .60);

  /* 多层柔和环境阴影（无硬边） */
  --shadow:  0 1px 2px rgba(0,0,0,.03), 0 4px 14px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.05), 0 14px 34px rgba(0,0,0,.10), 0 34px 68px rgba(0,0,0,.13);
  --shadow-hover: 0 2px 6px rgba(0,0,0,.05), 0 10px 26px rgba(0,0,0,.08), 0 26px 54px rgba(0,0,0,.11);

  --glass-blur: blur(20px) saturate(180%);
  --glass-blur-deep: blur(34px) saturate(190%);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;

  /* 运动：Apple 弹簧物理 */
  --ease-hover: cubic-bezier(.2, 0, 0, 1);      /* 悬停 / 快速响应 */
  --ease-out:   cubic-bezier(.16, 1, .3, 1);    /* 流体减速：模态 / 抽屉 / 缩放 */
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --t-hover: .25s;
  --t-scale: .42s;
  --t-float: .55s;

  --sidebar-w: 244px;
  --topbar-h: 62px;

  --danger: #ff3b30;
  --ok: #248a3d;
  --warn: #ff9f0a;
}

[data-theme="dark"] {
  --apple-blue: #0a84ff;
  --brand-weak: rgba(10, 132, 255, .16);

  --bg: #000000;
  --bg-soft: rgba(118, 118, 128, .16);
  --card: rgba(28, 28, 30, .72);
  --card-solid: #1c1c1e;
  --card-2: rgba(44, 44, 46, .62);
  --text: #f5f5f7;
  --text-2: #d8d8dc;
  --muted: #98989d;
  --hairline: rgba(255, 255, 255, .08);
  --border: rgba(255, 255, 255, .10);
  --border-2: rgba(255, 255, 255, .16);
  --specular: inset 0 1px 0 rgba(255, 255, 255, .10);

  --shadow:  0 1px 2px rgba(0,0,0,.30), 0 6px 18px rgba(0,0,0,.36), 0 16px 40px rgba(0,0,0,.42);
  --shadow-lg: 0 4px 10px rgba(0,0,0,.44), 0 20px 48px rgba(0,0,0,.52), 0 40px 88px rgba(0,0,0,.60);
  --shadow-hover: 0 3px 8px rgba(0,0,0,.40), 0 14px 36px rgba(0,0,0,.48), 0 30px 64px rgba(0,0,0,.54);

  --danger: #ff453a;
  --ok: #30d158;
  --warn: #ffd60a;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "PingFang SC",
               "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* 环境光晕：让毛玻璃材质有内容可折射 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 620px at 8% -8%,  rgba(0,113,227,.13), transparent 62%),
    radial-gradient(980px 560px at 96% 4%,   rgba(94,92,230,.11), transparent 62%),
    radial-gradient(1200px 700px at 62% 108%, rgba(255,159,10,.08), transparent 62%);
  transition: opacity .6s var(--ease-in-out);
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(1100px 620px at 8% -8%,  rgba(10,132,255,.20), transparent 62%),
    radial-gradient(980px 560px at 96% 4%,   rgba(94,92,230,.18), transparent 62%),
    radial-gradient(1200px 700px at 62% 108%, rgba(255,159,10,.10), transparent 62%);
}

/* Apple 风格细滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(120,120,128,.30);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(120,120,128,.52); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: rgba(0,113,227,.22); }

/* ---------- 2. 布局骨架 ---------- */
.app { position: relative; z-index: 1; display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--hairline);
  box-shadow: 1px 0 0 var(--hairline), 24px 0 60px rgba(0,0,0,.03);
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(150deg, #0a84ff, #5e5ce6 60%, #bf5af2);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; letter-spacing: -.5px;
  box-shadow: 0 4px 14px rgba(10,132,255,.34), var(--specular);
  transition: transform var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover);
}
.brand:hover .brand-mark { transform: scale(1.06) rotate(-3deg); }
.brand-text b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.1px; color: var(--text); }
.brand-text span { display: block; font-size: 11px; color: var(--muted); letter-spacing: .2px; }

.nav-group { margin-bottom: 16px; }
.nav-group-title {
  font-size: 11px; color: var(--muted); padding: 0 10px 7px;
  letter-spacing: .6px; font-weight: 600;
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 11px;
  color: var(--text-2); cursor: pointer; font-size: 13.5px;
  transition: transform var(--t-hover) var(--ease-hover),
              background var(--t-hover) var(--ease-hover),
              color .2s ease, box-shadow var(--t-hover) var(--ease-hover);
  user-select: none; margin-bottom: 2px;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t-hover) var(--ease-hover); }
.nav-item:hover { background: var(--bg-soft); color: var(--text); transform: translateX(2px); }
.nav-item:hover svg { transform: scale(1.08); }
.nav-item:active { transform: scale(.98) translateX(0); }
.nav-item.active {
  background: var(--brand-weak); color: var(--brand); font-weight: 600;
  box-shadow: inset 0 0 0 .5px rgba(0,113,227,.18), var(--specular);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-item .badge {
  margin-left: auto; font-size: 11px; background: var(--bg-soft);
  color: var(--muted); padding: 1px 8px; border-radius: 20px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background var(--t-hover) var(--ease-hover), color var(--t-hover) var(--ease-hover);
}
.nav-item.active .badge { background: rgba(0,113,227,.16); color: var(--brand); }

.side-foot { margin-top: auto; border-top: 1px solid var(--hairline); padding-top: 12px; }
.mini-stat { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); padding: 4px 10px; }
.mini-stat b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* 浮动式 sticky 顶栏：滚动时加深模糊、收缩内距 */
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid transparent;
  display: flex; align-items: center; gap: 14px; padding: 0 26px;
  position: sticky; top: 0; z-index: 30;
  transition: height .38s var(--ease-out), padding .38s var(--ease-out),
              background .3s var(--ease-in-out), border-color .3s var(--ease-in-out),
              backdrop-filter .3s var(--ease-in-out), box-shadow .3s var(--ease-in-out);
}
.topbar.scrolled {
  height: 52px; flex-basis: 52px; padding: 0 26px;
  background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur-deep);
  backdrop-filter: var(--glass-blur-deep);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 4px 24px rgba(0,0,0,.05);
}
.topbar h1 {
  font-size: 20px; margin: 0; font-weight: 600; letter-spacing: -.4px;
  transition: font-size .38s var(--ease-out);
}
.topbar.scrolled h1 { font-size: 17px; }
.topbar .sub { font-size: 12px; color: var(--muted); margin-left: 2px; transition: opacity .3s var(--ease-out); }
.topbar.scrolled .sub { opacity: 0; height: 0; overflow: hidden; }
.topbar .spacer { flex: 1; }

/* 分段控件：Apple 风格滑块 */
.seg {
  position: relative; display: flex; background: var(--bg-soft);
  border-radius: 10px; padding: 3px; gap: 2px;
  box-shadow: var(--specular);
}
.seg button {
  position: relative; z-index: 1; border: 0; background: transparent; color: var(--text-2);
  font-size: 12.5px; padding: 5px 13px; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-weight: 500;
  transition: transform var(--t-hover) var(--ease-hover), color .2s ease, background var(--t-hover) var(--ease-hover);
  -webkit-tap-highlight-color: transparent;
}
.seg button:active { transform: scale(.96); }
.seg button.on {
  background: var(--card-solid); color: var(--apple-blue); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 3px 8px rgba(0,0,0,.08);
}
[data-theme="dark"] .seg button.on { background: rgba(120,120,128,.32); }

/* ---------- 3. 控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-2); background: var(--card-solid); color: var(--text);
  padding: 7px 14px; border-radius: 980px; font-size: 13px; cursor: pointer;
  font-family: inherit; font-weight: 500; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), var(--specular);
  transition: transform var(--t-hover) var(--ease-hover), opacity .2s ease,
              background var(--t-hover) var(--ease-hover), border-color var(--t-hover) var(--ease-hover),
              box-shadow var(--t-hover) var(--ease-hover), filter .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--apple-blue); color: var(--apple-blue); filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,113,227,.18); }
.btn:active { transform: scale(.98) translateY(0); filter: brightness(.96); }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary {
  background: linear-gradient(180deg, #0a84ff, #0071e3);
  border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(0,113,227,.30), 0 6px 18px rgba(0,113,227,.28), var(--specular);
}
.btn.primary:hover { background: linear-gradient(180deg, #0071e3, #0064ce); color: #fff; filter: brightness(1.08); box-shadow: 0 2px 6px rgba(0,113,227,.34), 0 10px 26px rgba(0,113,227,.32); }
.btn.ghost { border-color: transparent; background: var(--bg-soft); box-shadow: none; }
.btn.danger:hover { border-color: var(--apple-red); color: var(--apple-red); box-shadow: 0 4px 14px rgba(255,59,48,.18); }
.btn.sm { padding: 4px 11px; font-size: 12px; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--border-2); background: var(--card-solid); border-radius: 50%;
  cursor: pointer; color: var(--text-2); box-shadow: var(--specular);
  transition: transform var(--t-hover) var(--ease-hover), color .2s ease,
              border-color var(--t-hover) var(--ease-hover), background var(--t-hover) var(--ease-hover),
              box-shadow var(--t-hover) var(--ease-hover);
}
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--apple-blue); border-color: var(--apple-blue); transform: translateY(-1px) rotate(12deg); box-shadow: 0 4px 14px rgba(0,113,227,.20); }
.icon-btn:active { transform: scale(.94); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(150deg, #ff9f0a, #bf5af2);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(191,90,242,.28), var(--specular);
  transition: transform var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover);
}
.avatar:hover { transform: scale(1.06); }

/* ---------- 4. 视图容器 ---------- */
.views {
  flex: 1; overflow-y: auto; padding: 24px 26px 40px;
  scroll-behavior: smooth; overscroll-behavior-y: contain;
}
.view { display: none; }
.view.active { display: block; }
.view.reveal > * { opacity: 0; }

/* ---------- 5. 卡片材质 ---------- */
.grid { display: grid; gap: 18px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); }
.grid.g2 { grid-template-columns: 1.5fr 1fr; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g2e { grid-template-columns: 1fr 1fr; }
@media (max-width: 1180px) { .grid.g2, .grid.g2e, .grid.g3 { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), var(--specular);
  border-radius: var(--radius); padding: 18px 20px;
  transition: transform var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover),
              border-color var(--t-hover) var(--ease-hover);
}
.card.pad0 { padding: 0; overflow: hidden; }
.card:hover { box-shadow: var(--shadow-hover), var(--specular); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.card-head .hint { font-size: 12px; color: var(--muted); }
.mb16 { margin-bottom: 18px; }

.kpi-card {
  position: relative; overflow: hidden;
  background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), var(--specular);
  border-radius: var(--radius); padding: 16px 18px;
  transition: transform var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover);
}
.kpi-card::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, var(--brand));
  border-radius: 3px 0 0 3px;
}
.kpi-card::before {
  content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
  border-radius: 50%; background: var(--accent, var(--brand)); opacity: .07;
  transition: transform var(--t-float) var(--ease-out), opacity var(--t-hover) ease;
}
.kpi-card:hover::before { transform: scale(1.35); opacity: .12; }
.kpi-card .label { position: relative; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.kpi-card .value {
  position: relative; font-size: 28px; font-weight: 600; letter-spacing: -1px;
  margin: 7px 0 3px; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--text) 0%, rgba(29,29,31,.62) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .kpi-card .value { background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kpi-card .meta { position: relative; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi-card .spark { position: absolute; right: 12px; top: 14px; opacity: .45; transition: opacity var(--t-hover) ease, transform var(--t-hover) var(--ease-hover); }
.kpi-card:hover .spark { opacity: .85; transform: scale(1.05); }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); }

/* ---------- 6. 工具栏 / 表格 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 7px; background: var(--bg-soft);
  border: 1px solid transparent; border-radius: 980px; padding: 7px 14px; min-width: 230px;
  transition: transform var(--t-hover) var(--ease-hover), background var(--t-hover) var(--ease-hover),
              border-color var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover);
}
.search svg { width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 1.8; }
.search input { border: 0; background: transparent; outline: none; color: var(--text); font-size: 13px; font-family: inherit; width: 100%; }
.search:focus-within {
  border-color: var(--apple-blue); background: var(--card-solid);
  box-shadow: 0 0 0 4px rgba(0,113,227,.12); transform: translateY(-1px);
}

.chip {
  font-size: 12px; padding: 5px 13px; border-radius: 980px; border: 1px solid var(--border);
  background: var(--card-solid); color: var(--text-2); cursor: pointer; user-select: none;
  font-weight: 500;
  transition: transform var(--t-hover) var(--ease-hover), opacity .2s ease,
              background var(--t-hover) var(--ease-hover), color var(--t-hover) var(--ease-hover),
              border-color var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover);
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--apple-blue); color: var(--apple-blue); transform: translateY(-1px); }
.chip:active { transform: scale(.97); }
.chip.on {
  background: linear-gradient(180deg, #0a84ff, #0071e3); border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(0,113,227,.28), var(--specular);
}
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--card-2);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  position: sticky; top: 0; z-index: 2;
}
table.data th.sortable { cursor: pointer; user-select: none; transition: color .2s ease; }
table.data th.sortable:hover { color: var(--apple-blue); }
table.data th .arrow { opacity: .5; font-size: 10px; margin-left: 3px; }
table.data td {
  padding: 11px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle;
  transition: background .2s ease;
}
table.data tbody tr { transition: background .2s ease; }
table.data tbody tr:hover { background: var(--bg-soft); }
table.data tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.cell-sub { display: block; font-size: 11.5px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; opacity: 0; transition: opacity .2s ease; }
tr:hover .row-actions { opacity: 1; }
.empty { padding: 44px; text-align: center; color: var(--muted); font-size: 13px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  padding: 3px 10px; border-radius: 980px; font-weight: 600; white-space: nowrap;
  transition: transform var(--t-hover) var(--ease-hover), filter .2s ease;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2.5px rgba(255,255,255,.14); }
.pill.green { background: rgba(52,199,89,.16); color: #1a7f37; }
.pill.amber { background: rgba(255,159,10,.18); color: #a1650b; }
.pill.blue  { background: rgba(0,113,227,.14); color: #0062cc; }
.pill.gray  { background: rgba(120,120,128,.16); color: var(--muted); }
.pill.red   { background: rgba(255,59,48,.14); color: var(--up); }
.pill.purple{ background: rgba(191,90,242,.16); color: #9b34d8; }
[data-theme="dark"] .pill.green { color: #4ade6a; }
[data-theme="dark"] .pill.amber { color: #ffcf4a; }
[data-theme="dark"] .pill.blue  { color: #5aa9ff; }
[data-theme="dark"] .pill.purple{ color: #d68cff; }

.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-track { width: 62px; height: 6px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.06); }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #0a84ff, #5e5ce6); transform-origin: left; }
.bar-fill.warn { background: linear-gradient(90deg, #ff9f0a, #ff3b30); }
.bar-fill.ok { background: linear-gradient(90deg, #34c759, #248a3d); }

/* ---------- 7. 看板 ---------- */
.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; }
.kcol {
  flex: 0 0 272px; background: var(--bg-soft); border-radius: var(--radius); padding: 12px;
  border: 1px solid var(--hairline); box-shadow: var(--specular);
}
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-size: 13px; font-weight: 600; }
.kcol-head .cnt { font-size: 11.5px; color: var(--muted); background: var(--card-solid); padding: 1px 8px; border-radius: 980px; }
.kcard {
  background: var(--card-solid); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover),
              border-color var(--t-hover) var(--ease-hover);
}
.kcard:hover { border-color: var(--apple-blue); transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow-hover); }
.kcard:active { transform: scale(.98); }
.kcard .t { font-weight: 600; font-size: 13px; margin-bottom: 7px; line-height: 1.45; }
.kcard .kv { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 2px 0; }
.kcard .kv b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.kcard .foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border); }

/* ---------- 8. 图表 ---------- */
.chart-svg { display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--hairline); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-svg .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart-svg .lbl { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart-svg .val { fill: var(--text-2); font-size: 11px; font-family: inherit; font-weight: 600; }
.chart-svg path, .chart-svg rect, .chart-svg circle { transition: opacity .2s ease; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; box-shadow: var(--specular); }

/* ---------- 9. 列表 ---------- */
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px dashed var(--hairline);
  transition: background .2s ease, transform var(--t-hover) var(--ease-hover);
}
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-sub { font-size: 11.5px; color: var(--muted); }
.list-item .li-right { text-align: right; font-variant-numeric: tabular-nums; }
.date-box {
  width: 46px; flex: 0 0 46px; height: 48px; border-radius: var(--radius-sm);
  background: var(--bg-soft); display: grid; place-items: center; text-align: center; line-height: 1.15;
  box-shadow: var(--specular);
  transition: transform var(--t-hover) var(--ease-hover), background var(--t-hover) var(--ease-hover);
}
.list-item:hover .date-box { transform: scale(1.05); background: var(--brand-weak); }
.date-box b { display: block; font-size: 15px; font-weight: 600; }
.date-box span { display: block; font-size: 10.5px; color: var(--muted); }

/* ---------- 10. 模态：流体减速 + 强毛玻璃 ---------- */
.mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .30);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  display: none; align-items: center; justify-content: center;
  z-index: 60; padding: 24px;
  opacity: 0; transition: opacity .28s var(--ease-in-out);
}
.mask.show { display: flex; opacity: 1; }
.modal {
  background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur-deep);
  backdrop-filter: var(--glass-blur-deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px; max-height: 88vh; display: flex; flex-direction: column;
  transform: scale(.92) translateY(16px); opacity: 0;
}
.mask.show .modal { animation: modal-spring var(--t-scale) var(--ease-out) forwards; }
@keyframes modal-spring {
  0%   { transform: scale(.92) translateY(16px); opacity: 0; }
  60%  { transform: scale(1.008) translateY(0); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--hairline); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.3px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--hairline); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  border: 1px solid var(--border-2); background: var(--card-solid); color: var(--text);
  border-radius: 11px; padding: 9px 12px; font-size: 13px; font-family: inherit; outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.03);
  transition: border-color var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover),
              transform var(--t-hover) var(--ease-hover);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 4px rgba(0,113,227,.14), inset 0 1px 2px rgba(0,0,0,.03);
  transform: translateY(-1px);
}

.toast {
  position: fixed; bottom: 28px; left: 50%;
  background: rgba(28,28,30,.82);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: #fff; padding: 11px 22px; border-radius: 980px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 320; pointer-events: none;
  opacity: 0; transform: translateX(-50%) translateY(24px) scale(.94);
  transition: opacity .3s var(--ease-out), transform .48s var(--ease-out);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* ---------- 11. 设置页 ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px dashed var(--hairline); gap: 16px; }
.set-row:last-child { border-bottom: 0; }
.set-row .sr-title { font-size: 13.5px; font-weight: 600; }
.set-row .sr-desc { font-size: 12px; color: var(--muted); }
.switch {
  width: 51px; height: 31px; border-radius: 980px; background: rgba(120,120,128,.24);
  position: relative; cursor: pointer; flex: 0 0 51px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.10);
  transition: background .3s var(--ease-out);
}
.switch.on { background: #34c759; }
.switch i {
  position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 3px 8px rgba(0,0,0,.14);
  transition: transform .34s var(--ease-out), left .34s var(--ease-out);
}
.switch.on i { left: 22px; }

.note {
  font-size: 12px; color: var(--muted); background: var(--bg-soft);
  border-radius: var(--radius-sm); padding: 11px 13px; line-height: 1.6;
  border: 1px solid var(--hairline);
}

/* ---------- 12. 渠道线与编制 ---------- */
.org-line {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow), var(--specular);
  margin-bottom: 16px; overflow: hidden;
  transition: transform var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover);
}
.org-line:hover { box-shadow: var(--shadow-hover), var(--specular); }
.org-line > .ol-head {
  display: flex; align-items: flex-start; gap: 16px; padding: 15px 18px;
  border-left: 4px solid var(--lc, var(--brand)); background: var(--card-2);
  border-bottom: 1px solid var(--hairline); flex-wrap: wrap;
}
.ol-idx {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; background: var(--lc, var(--brand)); flex: 0 0 30px; margin-top: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.14), var(--specular);
}
.ol-title { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.ol-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.55; max-width: 760px; }
.ol-lead { display: flex; align-items: center; gap: 7px; margin-left: auto; flex-wrap: wrap; }
.ol-figs { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.ol-fig { text-align: right; }
.ol-fig b { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ol-fig span { font-size: 11px; color: var(--muted); }
.ol-kpi { padding: 10px 18px; font-size: 12px; color: var(--text-2); background: var(--bg-soft); border-bottom: 1px solid var(--hairline); }
.ol-kpi b { color: var(--text); font-weight: 600; }

.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 14px; padding: 16px 18px; }
.branch {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 14px;
  background: var(--card-2); box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: transform var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover),
              border-color var(--t-hover) var(--ease-hover);
}
.branch:hover { border-color: var(--lc, var(--brand)); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.b-top { display: flex; align-items: center; gap: 8px; }
.b-name { font-size: 14px; font-weight: 600; }
.b-duty { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin: 6px 0 9px; min-height: 34px; }
.b-people { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 9px; border-top: 1px dashed var(--hairline); }
.b-stat { display: flex; gap: 14px; padding-top: 9px; margin-top: 9px; border-top: 1px dashed var(--hairline); flex-wrap: wrap; }
.b-stat div { font-size: 11px; color: var(--muted); }
.b-stat div b { display: block; font-size: 13px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.avt {
  width: 23px; height: 23px; border-radius: 50%; background: var(--brand-weak); color: var(--brand);
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 23px;
  box-shadow: var(--specular);
  transition: transform var(--t-hover) var(--ease-hover);
}
.branch:hover .avt.l { transform: scale(1.08); }
.avt.l { background: var(--lc, var(--brand)); color: #fff; }
.avt.n { background: var(--bg-soft); color: var(--text-2); }
.pname { font-size: 12px; color: var(--text-2); }

.load-wrap { display: flex; align-items: center; gap: 8px; }
.load-track { width: 74px; height: 6px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.06); }
.load-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #0a84ff, #5e5ce6); transform-origin: left; }
.load-fill.hot { background: linear-gradient(90deg, #ff9f0a, #ff3b30); }
.load-fill.low { background: linear-gradient(90deg, #34c759, #248a3d); }

/* ---------- 13. 登录 / 公开首页 ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 26px; overflow: auto;
}
.login-bg { position: absolute; inset: 0; background: var(--bg); }
.login-bg::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(1100px 620px at 10% -6%,  rgba(0,113,227,.20), transparent 62%),
    radial-gradient(1000px 580px at 92% 2%,   rgba(94,92,230,.18), transparent 62%),
    radial-gradient(1200px 700px at 60% 110%, rgba(191,90,242,.14), transparent 62%);
  animation: aurora 24s var(--ease-in-out) infinite alternate;
}
@keyframes aurora {
  0%   { transform: scale(1) translate3d(0,0,0); opacity: .92; }
  100% { transform: scale(1.12) translate3d(-2%, 2%, 0); opacity: 1; }
}
.login-wrap {
  position: relative; width: 100%; max-width: 1080px;
  display: flex; flex-direction: column; gap: 26px;
  animation: rise .7s var(--ease-out) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-mark {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  background: linear-gradient(150deg, #0a84ff, #5e5ce6 55%, #bf5af2);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 19px; letter-spacing: .5px;
  box-shadow: 0 8px 24px rgba(10,132,255,.32), var(--specular);
  transition: transform var(--t-float) var(--ease-out);
}
.login-brand:hover .login-mark { transform: scale(1.08) rotate(-4deg); }
.login-brand h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.8px; }
.login-brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.login-body { display: grid; grid-template-columns: 1.25fr .85fr; gap: 22px; align-items: stretch; }
.login-intro, .login-card {
  position: relative;
  background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur-deep);
  backdrop-filter: var(--glass-blur-deep);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg), var(--specular);
  border-radius: var(--radius-lg); padding: 28px 30px;
}
.login-intro h2 { margin: 0 0 10px; font-size: 24px; font-weight: 600; letter-spacing: -.6px; }
.login-intro .lead { margin: 0 0 18px; color: var(--text-2); font-size: 14px; }
.login-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.login-features li { position: relative; padding-left: 22px; font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.login-features li::before {
  content: ''; position: absolute; left: 6px; top: 9px;
  width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(140deg, #0a84ff, #5e5ce6);
  box-shadow: 0 0 0 3px rgba(0,113,227,.12);
}
.login-features b { color: var(--text); font-weight: 600; }
.login-note { margin-top: 20px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--muted); font-size: 12px; border: 1px solid var(--hairline); }
.login-card { display: flex; flex-direction: column; justify-content: center; }
.login-card h3 { margin: 0 0 20px; font-size: 19px; font-weight: 600; letter-spacing: -.4px; }
.login-card .field { margin-bottom: 14px; }
.login-card .field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.login-card .field input {
  width: 100%; padding: 12px 14px; font-size: 14px;
  border: 1px solid var(--border-2); border-radius: 13px;
  background: var(--card-solid); color: var(--text); outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.03);
  transition: border-color var(--t-hover) var(--ease-hover), box-shadow var(--t-hover) var(--ease-hover),
              transform var(--t-hover) var(--ease-hover);
}
.login-card .field input:focus { border-color: var(--apple-blue); box-shadow: 0 0 0 4px rgba(0,113,227,.14); transform: translateY(-1px); }
.login-err { min-height: 20px; color: var(--danger); font-size: 12.5px; margin-bottom: 6px; }
.login-tip { margin-top: 16px; text-align: center; color: var(--muted); font-size: 12px; }
.btn.block { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; }
.login-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; padding: 0 6px; }

@media (max-width: 880px) {
  .login-body { grid-template-columns: 1fr; }
  .login-features { display: none; }
}

/* ---------- 14. 用户菜单 ---------- */
.user-menu { position: relative; margin-left: 4px; }
.user-menu .avatar { cursor: pointer; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  min-width: 236px; padding: 12px;
  background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur-deep);
  backdrop-filter: var(--glass-blur-deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: none; transform-origin: top right;
}
.user-menu.open .user-pop { display: block; animation: pop-in .32s var(--ease-out) both; }
@keyframes pop-in { from { opacity: 0; transform: scale(.9) translateY(-8px); } to { opacity: 1; transform: none; } }
.up-head { padding: 2px 6px 10px; border-bottom: 1px solid var(--hairline); margin-bottom: 8px; }
.up-head b { display: block; font-size: 14px; font-weight: 600; }
.up-head span { font-size: 12px; }
.up-item { padding: 4px 6px 10px; font-size: 12px; color: var(--muted); line-height: 1.65; }
.up-btn {
  display: block; width: 100%; text-align: left; margin-top: 4px;
  padding: 8px 11px; font-size: 13px; font-family: inherit; cursor: pointer;
  background: transparent; color: var(--text);
  border: 1px solid transparent; border-radius: 9px;
  transition: transform var(--t-hover) var(--ease-hover), background .2s ease, color .2s ease;
}
.up-btn:hover { background: var(--bg-soft); transform: translateX(2px); }
.up-btn.danger { color: var(--danger); }
.up-btn.danger:hover { background: rgba(255,59,48,.10); color: var(--danger); }

/* ---------- 15. 渠道线多选 ---------- */
.chk-wrap {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 12px; max-height: 220px; overflow: auto;
  padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card-solid); box-shadow: inset 0 1px 2px rgba(0,0,0,.03);
}
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 4px 0; transition: transform var(--t-hover) var(--ease-hover); }
.chk:hover { transform: translateX(2px); }
.chk input { width: 15px; height: 15px; accent-color: var(--apple-blue); cursor: pointer; }
.chk span { color: var(--text-2); }

/* ---------- 16. 磁吸卡片（3D 倾斜） ---------- */
.tilt { transform-style: preserve-3d; will-change: transform; }
.tilt-inner { transform: translateZ(30px); }

/* 滚动入场初始态（由 motion.js 驱动） */
.reveal-init { opacity: 0; transform: translateY(18px) scale(.985); }
.reveal-in { opacity: 1; transform: none; }

/* ---------- 17. 无障碍：降低动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-init { opacity: 1 !important; transform: none !important; }
  .mask.show .modal { animation: none; transform: none; opacity: 1; }
  .tilt { transform: none !important; }
}

/* 动画进行中提示合成器 */
.animating { will-change: transform, opacity; }
