@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --brand: #63e6be;
  --brand-rgb: 99, 230, 190;
  --accent: #ffd166;
  --danger: #ff6b7a;
  --cyan: #72d7f5;
  --violet: #a78bfa;
  --bg: #0b0f0f;
  --bg-deep: #070a0a;
  --panel: rgba(19, 25, 24, .82);
  --panel-solid: #131918;
  --panel-hover: rgba(28, 38, 35, .92);
  --sidebar: rgba(10, 14, 14, .92);
  --text: #eef7f3;
  --text-soft: #d0dcd7;
  --muted: #98aaa3;
  --line: rgba(202, 239, 225, .12);
  --line-strong: rgba(202, 239, 225, .2);
  --radius: 14px;
  --radius-sm: calc(var(--radius) * .62);
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
  --glass-blur: 18px;
  --sidebar-w: 236px;
  --rail-w: 58px;
  --topbar-h: 58px;
  --ease: cubic-bezier(.2, .78, .2, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #edf3f0;
  --bg-deep: #e2ebe7;
  --panel: rgba(255, 255, 255, .78);
  --panel-solid: #ffffff;
  --panel-hover: rgba(244, 250, 247, .98);
  --sidebar: rgba(245, 250, 248, .9);
  --text: #17231f;
  --text-soft: #40564d;
  --muted: #62776e;
  --line: rgba(31, 74, 59, .11);
  --line-strong: rgba(31, 74, 59, .2);
  --shadow: 0 18px 45px rgba(26, 54, 44, .1);
}

[data-shadow="flat"] { --shadow: none; --glass-blur: 0px; }
[data-shadow="deep"] { --shadow: 0 24px 70px rgba(0, 0, 0, .42), 0 1px 0 rgba(255,255,255,.05) inset; --glass-blur: 24px; }

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(var(--brand-rgb), .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--brand-rgb), .025) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
  color: var(--text);
  font-family: "Noto Sans SC", "MiSans", sans-serif;
  transition: background .35s ease, color .25s ease;
}

button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.mono { font-family: "DM Mono", monospace; font-variant-numeric: tabular-nums; }
.ambient { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .08; pointer-events: none; z-index: 0; }
.ambient-a { width: 420px; height: 420px; background: var(--brand); left: 45%; top: -260px; }
.ambient-b { width: 300px; height: 300px; background: var(--cyan); right: -180px; top: 44%; }

.shell { min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: var(--sidebar-w); display: grid; grid-template-columns: var(--rail-w) 1fr;
  background: var(--sidebar); border-right: 1px solid var(--line);
  backdrop-filter: blur(var(--glass-blur)); transition: transform .3s var(--ease), background .3s ease;
}
.rail { border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.brand-mark {
  width: 38px; height: 38px; border: 1px solid rgba(var(--brand-rgb), .32); border-radius: 12px;
  display: grid; place-items: center; background: rgba(var(--brand-rgb), .1); margin-bottom: 12px; position: relative;
}
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; width: 15px; height: 15px; border: 2px solid var(--brand); transform: rotate(45deg); }
.brand-mark::after { width: 6px; height: 6px; background: var(--brand); }
.rail-btn, .icon-btn {
  border: 0; background: transparent; cursor: pointer; display: grid; place-items: center;
  color: var(--muted); transition: .2s ease; position: relative;
}
.rail-btn { width: 38px; height: 38px; border-radius: 11px; }
.rail-btn:hover, .rail-btn.active, .icon-btn:hover { color: var(--text); background: rgba(var(--brand-rgb), .09); }
.rail-btn.active { color: var(--brand); }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.nav-panel { padding: 16px 12px; overflow: hidden; }
.workspace-id { display: flex; align-items: center; gap: 9px; height: 38px; margin: 0 6px 18px; }
.workspace-id strong { font-size: 14px; letter-spacing: .03em; white-space: nowrap; }
.workspace-id small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.nav-label { color: var(--muted); font-size: 10px; letter-spacing: .12em; margin: 18px 10px 8px; }
.nav-item {
  width: 100%; border: 0; background: transparent; color: var(--text-soft); padding: 10px 11px;
  border-radius: var(--radius-sm); display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left;
  transition: .2s ease; margin: 2px 0; font-size: 13px;
}
.nav-item:hover { color: var(--text); background: rgba(var(--brand-rgb), .055); transform: translateX(2px); }
.nav-item.active { color: var(--brand); background: rgba(var(--brand-rgb), .115); box-shadow: inset 3px 0 0 var(--brand); }
.nav-item .count { margin-left: auto; font-size: 10px; background: rgba(var(--brand-rgb), .1); padding: 2px 6px; border-radius: 999px; }

.topbar {
  position: fixed; z-index: 20; left: var(--sidebar-w); top: 0; right: 0; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(20px);
}
.mobile-menu { display: none; }
.mobile-sidebar-close, .mobile-bottom-nav { display: none; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.breadcrumb b { color: var(--text); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-trigger {
  width: min(280px, 24vw); height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--muted); border-radius: 10px; cursor: pointer;
}
.search-trigger kbd { margin-left: auto; border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; font-family: "DM Mono"; font-size: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; }
.icon-btn:hover { border-color: var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #2d8d72); color: #062019; display: grid; place-items: center; font-weight: 800; font-size: 12px; border: 2px solid var(--panel-solid); box-shadow: 0 0 0 1px var(--line-strong); }

.main { margin-left: var(--sidebar-w); padding-top: var(--topbar-h); min-height: 100vh; }
.tabs-wrap { position: sticky; top: var(--topbar-h); z-index: 15; padding: 8px 18px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); }
.tabs { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tab { border: 1px solid var(--line); border-bottom: 0; background: rgba(255,255,255,.015); color: var(--muted); padding: 8px 13px; cursor: pointer; display: flex; align-items: center; gap: 7px; font-size: 12px; margin-right: -1px; min-width: max-content; }
.tab:first-child { border-top-left-radius: var(--radius-sm); }
.tab:last-child { border-top-right-radius: var(--radius-sm); }
.tab.active { color: var(--brand); background: var(--panel); position: relative; z-index: 1; }
.tab.active::after { content: ""; position: absolute; height: 2px; background: var(--brand); inset: auto 12px -1px; }
.tab-x { opacity: .45; }

.content { padding: 22px 24px 60px; max-width: 1760px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 4px 0 18px; }
.eyebrow { display: flex; gap: 8px; align-items: center; font-size: 10px; letter-spacing: .14em; color: var(--brand); text-transform: uppercase; margin-bottom: 7px; }
.status-dot { width: 6px; height: 6px; background: var(--brand); border-radius: 50%; box-shadow: 0 0 0 5px rgba(var(--brand-rgb),.1); }
h1 { margin: 0; font-size: clamp(24px, 3vw, 38px); letter-spacing: -.04em; line-height: 1.1; font-weight: 800; }
.page-head p { color: var(--text-soft); margin: 8px 0 0; font-size: 12px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn { border: 1px solid var(--line); border-radius: var(--radius-sm); height: 36px; padding: 0 13px; background: var(--panel); color: var(--text-soft); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: .2s ease; font-size: 12px; }
.btn:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.btn.primary { background: var(--brand); color: #062019; border-color: var(--brand); font-weight: 700; }

.filter-bar { display: grid; grid-template-columns: 1.1fr .8fr .8fr auto; gap: 10px; padding: 12px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); backdrop-filter: blur(var(--glass-blur)); box-shadow: var(--shadow); }
.filter-bar[hidden] { display: none !important; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 10px; color: var(--muted); }
.field-control { height: 36px; width: 100%; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--text); }
.field-control option { background: var(--panel-solid); }
.filter-actions { display: flex; gap: 8px; align-items: flex-end; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.card { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); backdrop-filter: blur(var(--glass-blur)); box-shadow: var(--shadow); overflow: hidden; transition: border-color .25s, transform .25s var(--ease), background .25s; }
.card:hover { border-color: var(--line-strong); }
.kpi { min-height: 132px; padding: 16px; position: relative; animation: rise .55s var(--ease) both; }
.kpi:nth-child(2) { animation-delay: .04s; } .kpi:nth-child(3) { animation-delay: .08s; } .kpi:nth-child(4) { animation-delay: .12s; } .kpi:nth-child(5) { animation-delay: .16s; }
.kpi::after { content: ""; position: absolute; width: 70px; height: 70px; right: -24px; top: -24px; border-radius: 50%; background: var(--kpi-color, var(--brand)); opacity: .09; filter: blur(1px); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-soft); font-size: 11px; }
.kpi-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--kpi-color, var(--brand)); background: color-mix(in srgb, var(--kpi-color, var(--brand)) 12%, transparent); }
.kpi-value { font-family: "DM Mono", monospace; font-size: clamp(23px, 2.2vw, 31px); letter-spacing: -.06em; font-weight: 500; margin: 14px 0 8px; white-space: nowrap; }
.delta { display: flex; align-items: center; gap: 5px; color: var(--brand); font-size: 10px; }
.delta.down { color: var(--danger); }
.delta span { color: var(--muted); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 12px; margin-bottom: 12px; }
.card-head { padding: 14px 16px; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.card-title { font-weight: 650; font-size: 13px; }
.card-sub { color: var(--muted); font-size: 10px; margin-top: 3px; }
.segmented { display: flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg-btn { border: 0; color: var(--muted); background: transparent; border-radius: 6px; padding: 5px 8px; cursor: pointer; font-size: 10px; }
.seg-btn.active { color: var(--text); background: rgba(var(--brand-rgb), .12); }
.chart-body { height: 320px; padding: 10px 14px 14px; }
.chart-body svg { display: block; width: 100%; height: 100%; overflow: visible; }
.grid-line { stroke: var(--line); stroke-dasharray: 4 5; }
.axis-label { fill: var(--muted); font: 9px "DM Mono"; }
.area-fill { fill: url(#areaGradient); }
.trend-line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-motion-area {
  opacity: 1;
  clip-path: inset(0 0 0 0);
  animation: vip-area-reveal 680ms cubic-bezier(.16, 1, .3, 1) 70ms both;
}
.chart-motion-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: vip-trend-draw 760ms cubic-bezier(.16, 1, .3, 1) 80ms both;
}
.chart-motion-point {
  opacity: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: vip-point-reveal 220ms cubic-bezier(.16, 1, .3, 1) calc(180ms + var(--point-index) * 45ms) both;
}
.trend-line.secondary { stroke: var(--cyan); opacity: .75; }
.chart-dot { fill: var(--panel-solid); stroke: var(--brand); stroke-width: 2; }
.chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: 10px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 16px; height: 2px; background: var(--brand); }
.legend-swatch.cyan { background: var(--cyan); }

.funnel { padding: 18px 16px; display: grid; gap: 10px; }
.funnel-step { position: relative; }
.funnel-label { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 5px; }
.funnel-label span:first-child { color: var(--text-soft); }
.funnel-track { height: 25px; background: rgba(255,255,255,.028); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.funnel-fill { height: 100%; width: var(--w); background: linear-gradient(90deg, rgba(var(--brand-rgb),.25), var(--brand)); border-radius: 6px; animation: grow .7s var(--ease) both; transform-origin: left; }
.funnel-step:nth-child(2) .funnel-fill { filter: saturate(.86); }
.funnel-step:nth-child(3) .funnel-fill { background: linear-gradient(90deg, rgba(114,215,245,.24), var(--cyan)); }
.funnel-step:nth-child(4) .funnel-fill { background: linear-gradient(90deg, rgba(255,209,102,.24), var(--accent)); }
.funnel-note { margin: 4px 16px 16px; padding: 10px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 10px; border-radius: 9px; }

.table-card { margin-bottom: 12px; }
.table-tools { display: flex; gap: 8px; align-items: center; }
.table-search { border: 1px solid var(--line); background: rgba(255,255,255,.02); border-radius: 8px; height: 30px; color: var(--text); padding: 0 9px; width: 160px; font-size: 11px; }
.table-wrap { overflow: auto; max-height: 420px; }
table { width: 100%; border-collapse: collapse; min-width: 1120px; font-size: 11px; }
th { position: sticky; top: 0; z-index: 2; text-align: right; color: var(--muted); background: color-mix(in srgb, var(--panel-solid) 95%, transparent); font-weight: 500; padding: 11px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, th:nth-child(2), td:first-child, td:nth-child(2) { text-align: left; }
td { text-align: right; padding: 12px 13px; border-bottom: 1px solid var(--line); color: var(--text-soft); white-space: nowrap; }
tbody tr { cursor: pointer; transition: .18s ease; }
tbody tr:hover { background: rgba(var(--brand-rgb), .045); }
tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--brand); }
.pill { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); padding: 3px 7px; border-radius: 999px; color: var(--text); }
.pill::before { content: ""; width: 5px; height: 5px; background: var(--pill, var(--brand)); border-radius: 50%; }
.pos { color: var(--brand); } .neg { color: var(--danger); }
.table-foot { padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; border-top: 1px solid var(--line); }
.pagination { display: flex; gap: 4px; }
.page-btn { width: 26px; height: 26px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 7px; cursor: pointer; }
.page-btn.active { background: rgba(var(--brand-rgb), .14); color: var(--brand); border-color: rgba(var(--brand-rgb), .3); }

.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.insight-list { padding: 5px 16px 14px; }
.insight { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.insight:last-child { border-bottom: 0; }
.insight-num { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: rgba(var(--brand-rgb),.1); color: var(--brand); font: 10px "DM Mono"; }
.insight b { font-size: 11px; display: block; margin-bottom: 2px; }
.insight small { color: var(--muted); font-size: 9px; }
.severity { font-size: 9px; padding: 3px 6px; border-radius: 5px; background: rgba(255,209,102,.1); color: var(--accent); }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; background: rgba(3, 7, 6, .54); z-index: 90; opacity: 0; pointer-events: none; transition: .25s ease; backdrop-filter: blur(2px); }
.drawer-backdrop.open, .modal-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 100; right: 0; top: 0; bottom: 0; width: min(420px, 92vw); background: var(--panel-solid); border-left: 1px solid var(--line-strong); box-shadow: -30px 0 70px rgba(0,0,0,.25); transform: translateX(102%); transition: .34s var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { padding: 17px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer-head h2 { margin: 0; font-size: 15px; }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }
.drawer-section { margin-bottom: 22px; }
.drawer-section h3 { font-size: 10px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; margin: 0 0 10px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.choice { border: 1px solid var(--line); background: transparent; color: var(--text-soft); padding: 10px 6px; border-radius: var(--radius-sm); cursor: pointer; font-size: 11px; }
.choice.active { border-color: rgba(var(--brand-rgb),.45); color: var(--brand); background: rgba(var(--brand-rgb),.08); }
.palette-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.palette { border: 1px solid var(--line); background: transparent; border-radius: 10px; padding: 8px; cursor: pointer; }
.palette.active { border-color: var(--text); }
.palette-swatches { display: flex; gap: 3px; justify-content: center; }
.palette-swatches i { display: block; width: 12px; height: 12px; border-radius: 50%; }
.range-row { display: grid; grid-template-columns: 1fr 44px; gap: 10px; align-items: center; }
input[type="range"] { accent-color: var(--brand); width: 100%; }
.range-value { font: 10px "DM Mono"; text-align: right; color: var(--brand); }
.drawer-foot { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; gap: 8px; }

.search-modal { position: fixed; z-index: 110; top: 12vh; left: 50%; transform: translate(-50%, -12px); width: min(660px, 92vw); background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 36px 90px rgba(0,0,0,.42); opacity: 0; pointer-events: none; transition: .25s var(--ease); overflow: hidden; }
.search-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.search-input-wrap { display: flex; gap: 10px; align-items: center; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.search-input-wrap input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.search-results { padding: 8px; max-height: 360px; overflow: auto; }
.result { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 9px; color: var(--text-soft); cursor: pointer; }
.result:hover { background: rgba(var(--brand-rgb), .08); color: var(--text); }
.result-icon { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--brand); }
.result small { display: block; color: var(--muted); margin-top: 2px; }

.ai-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; height: 46px; border: 1px solid rgba(var(--brand-rgb),.36); background: var(--panel-solid); color: var(--brand); padding: 0 15px 0 11px; border-radius: 999px; display: flex; align-items: center; gap: 9px; cursor: pointer; box-shadow: var(--shadow); }
.ai-orb { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff, var(--brand) 25%, #1c7059 70%); box-shadow: 0 0 16px rgba(var(--brand-rgb),.35); }
.ai-panel { position: fixed; right: 20px; bottom: 76px; width: min(370px, calc(100vw - 28px)); height: min(570px, calc(100vh - 100px)); z-index: 49; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0,0,0,.35); transform: translateY(15px) scale(.97); opacity: 0; pointer-events: none; transition: .25s var(--ease); display: flex; flex-direction: column; overflow: hidden; }
.ai-panel.open { opacity: 1; pointer-events: auto; transform: none; }
.ai-head { padding: 13px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.ai-head b { font-size: 12px; } .ai-head small { color: var(--muted); font-size: 9px; display: block; }
.ai-close { margin-left: auto; }
.ai-chat { flex: 1; padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 88%; padding: 10px 11px; border-radius: 11px; background: rgba(var(--brand-rgb), .075); color: var(--text-soft); font-size: 11px; line-height: 1.7; border: 1px solid rgba(var(--brand-rgb), .12); }
.bubble.user { align-self: flex-end; background: var(--brand); color: #062019; border-color: var(--brand); }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestion { border: 1px solid var(--line); color: var(--muted); background: transparent; padding: 5px 8px; border-radius: 999px; font-size: 9px; cursor: pointer; }
.suggestion:hover { color: var(--brand); border-color: rgba(var(--brand-rgb),.3); }
.ai-input { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 7px; }
.ai-input input { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--text); padding: 0 10px; border-radius: 9px; }

.detail-list { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.detail-item { padding: 12px; border-bottom: 1px solid var(--line); }
.detail-item:nth-child(odd) { border-right: 1px solid var(--line); }
.detail-item small { color: var(--muted); display: block; font-size: 9px; margin-bottom: 5px; }
.detail-item b { font: 12px "DM Mono"; }
.form-grid { display: grid; gap: 12px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 10px); z-index: 140; background: var(--panel-solid); border: 1px solid var(--line-strong); color: var(--text); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transition: .25s; font-size: 11px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* High-legibility data mode: detail table and drill-through content */
.table-card table {
  min-width: 2240px;
  font-size: 22px;
}
.table-card th {
  padding: 18px 22px;
  font-size: 22px;
  color: var(--text);
  font-weight: 700;
  background: color-mix(in srgb, var(--panel-solid) 98%, var(--brand) 2%);
}
.table-card td {
  padding: 20px 22px;
  font-size: 22px;
}
.table-card .pill {
  gap: 10px;
  padding: 6px 14px;
  font-size: 22px;
}
.table-card .pill::before {
  width: 10px;
  height: 10px;
}
.table-card .drill-trigger {
  min-width: 150px;
  min-height: 48px;
  justify-content: flex-start;
  border-color: color-mix(in srgb, var(--pill) 48%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--pill) 24%, transparent), color-mix(in srgb, var(--pill) 11%, transparent));
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 3px 0 0 var(--pill), 0 5px 18px color-mix(in srgb, var(--pill) 8%, transparent);
  transition: transform .2s var(--ease), background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.table-card .drill-trigger span {
  font-weight: 700;
}
.table-card .drill-trigger em {
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--pill);
  background: color-mix(in srgb, var(--pill) 12%, transparent);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .05em;
}
.table-card .drill-trigger svg {
  flex: 0 0 auto;
  color: var(--pill);
  transition: transform .2s var(--ease);
}
.table-card .drill-trigger:hover,
tbody tr:hover .drill-trigger {
  transform: translateX(3px);
  border-color: color-mix(in srgb, var(--pill) 75%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--pill) 34%, transparent), color-mix(in srgb, var(--pill) 16%, transparent));
  box-shadow: inset 4px 0 0 var(--pill), 0 8px 24px color-mix(in srgb, var(--pill) 14%, transparent);
}
.table-card .drill-trigger:hover svg,
tbody tr:hover .drill-trigger svg {
  transform: translateX(2px);
}
.table-card .drill-trigger:active {
  transform: translateX(3px) scale(.98);
}
.table-card .table-wrap {
  max-height: 620px;
}
.table-card .table-foot {
  min-height: 58px;
  padding: 12px 18px;
  font-size: 20px;
}
.table-card .page-btn {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

#detail-drawer {
  width: 65vw;
  max-width: 65vw;
}
#detail-drawer .drawer-body {
  padding: 22px;
}
#detail-drawer .detail-list {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
#detail-drawer .detail-item {
  border-right: 1px solid var(--line);
  border-bottom: 0;
}
#detail-drawer .detail-item:last-child {
  border-right: 0;
}
#detail-drawer .drawer-head h2 {
  font-size: 30px;
}
#detail-drawer .drawer-head .card-sub {
  font-size: 20px;
}
#detail-drawer .drawer-section h3 {
  margin-bottom: 16px;
  font-size: 20px;
}
#detail-drawer .detail-item {
  padding: 18px;
}
#detail-drawer .detail-item small {
  margin-bottom: 8px;
  font-size: 18px;
}
#detail-drawer .detail-item b {
  font-size: 24px;
}
#detail-drawer .field label {
  font-size: 20px;
}
#detail-drawer .field-control {
  height: 52px;
  padding-inline: 14px;
  font-size: 22px;
}
#detail-drawer .btn {
  min-height: 48px;
  font-size: 20px;
}
#detail-drawer .insight {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px 0;
}
#detail-drawer .insight-num {
  width: 40px;
  height: 40px;
  font-size: 20px;
}
#detail-drawer .insight b {
  margin-bottom: 5px;
  font-size: 22px;
}
#detail-drawer .insight small {
  font-size: 18px;
  line-height: 1.6;
}
#detail-drawer .insight > span:last-child {
  font-size: 18px;
}
#detail-drawer .drawer-foot {
  padding-block: 16px;
}
.vip-data-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.vip-data-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .018);
}
.vip-data-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--brand-rgb), .06);
}
.vip-data-card header b {
  color: var(--brand);
  font: 20px "DM Mono", monospace;
}
.vip-data-card header span {
  color: var(--muted);
  font-size: 12px;
}
.vip-data-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.vip-data-card > div:last-child { border-bottom: 0; }
.vip-data-card small {
  color: var(--muted);
  font-size: 12px;
}
.vip-data-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vip-data-card strong.pos { color: var(--brand); }
.vip-data-card strong.neg { color: var(--danger); }
#user-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.user-profile-card {
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .018);
  transition: border-color .2s ease, transform .2s var(--ease);
}
.user-profile-card:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--brand-rgb), .3);
}
.user-profile-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--brand-rgb), .035);
}
.vip-badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--brand);
  background: rgba(var(--brand-rgb), .12);
  font: 18px "DM Mono", monospace;
  font-weight: 600;
}
.user-profile-head b {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-profile-head small {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 13px;
}
.user-status {
  padding: 5px 8px;
  border: 1px solid rgba(var(--brand-rgb), .24);
  border-radius: 999px;
  color: var(--brand);
  background: rgba(var(--brand-rgb), .07);
  font-size: 12px;
}
.user-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .1);
}
.user-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.user-metrics > div {
  min-width: 0;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.user-metrics > div:nth-child(4n) {
  border-right: 0;
}
.user-metrics small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
.user-metrics b {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-metrics b.pos { color: var(--brand); }
.user-metrics b.neg { color: var(--danger); }
.user-empty {
  padding: 30px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.data-basis {
  margin-bottom: 16px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 12px;
}
.vip-distribution {
  height: 150px;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .014);
}
.vip-dist-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 20px 1fr 20px;
  gap: 5px;
  text-align: center;
}
.vip-dist-item > span {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vip-dist-track {
  width: min(34px, 55%);
  height: 78px;
  display: flex;
  align-items: flex-end;
  justify-self: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px 7px 4px 4px;
  background: rgba(255, 255, 255, .025);
}
.vip-dist-track i {
  width: 100%;
  height: var(--h);
  display: block;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--brand), rgba(var(--brand-rgb), .38));
  box-shadow: 0 -8px 18px rgba(var(--brand-rgb), .16);
}
.vip-dist-item b {
  color: var(--brand);
  font: 14px "DM Mono", monospace;
}
.drill-table-wrap {
  max-height: 520px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .012);
}
.drill-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 14px;
}
.drill-table th {
  padding: 14px 8px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel-solid) 95%, var(--brand) 5%);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: .01em;
  text-align: right;
}
.drill-table td {
  overflow: hidden;
  padding: 14px 8px;
  color: var(--text);
  font-size: 14px;
  text-align: right;
  text-overflow: ellipsis;
}
.drill-table tbody tr { cursor: default; }
.drill-table th:nth-child(-n+3),
.drill-table td:nth-child(-n+3) { text-align: left; }
.drill-table th:first-child,
.drill-table td:first-child {
  min-width: 0;
  position: static;
  background: var(--panel-solid);
}
.drill-table th:nth-child(2),
.drill-table td:nth-child(2) {
  min-width: 0;
  position: static;
  background: var(--panel-solid);
  box-shadow: none;
}
.drill-table thead th:first-child,
.drill-table thead th:nth-child(2) {
  position: sticky;
  top: 0;
  z-index: 6;
}
.drill-table th:nth-child(1) { width: 8%; }
.drill-table th:nth-child(2) { width: 6%; }
.drill-table th:nth-child(3) { width: 11%; }
.drill-table th:nth-child(4),
.drill-table th:nth-child(5) { width: 10%; }
.drill-table th:nth-child(6) { width: 6%; }
.drill-table th:nth-child(7) { width: 13%; }
.drill-table th:nth-child(8),
.drill-table th:nth-child(9),
.drill-table th:nth-child(10),
.drill-table th:nth-child(11) { width: 9%; }
.sortable-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  line-height: 1.25;
  white-space: normal;
}
.drill-table th:nth-child(-n+3) .sortable-head { justify-content: flex-start; }
.sort-stack {
  display: inline-flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 1px;
}
.sort-arrow {
  width: 17px;
  height: 13px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 9px;
  line-height: 12px;
  transition: color .16s ease, transform .16s ease;
}
.sort-arrow:hover {
  color: var(--text);
  transform: scale(1.14);
}
.sort-arrow.active {
  color: var(--brand);
  text-shadow: 0 0 10px rgba(var(--brand-rgb), .42);
}
.vip-table-badge {
  display: inline-grid;
  min-width: 38px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: rgba(var(--brand-rgb), .1);
  font: 14px "DM Mono", monospace;
}
.reward-type {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid rgba(var(--brand-rgb), .32);
  border-radius: 6px;
  color: var(--brand);
  background: rgba(var(--brand-rgb), .055);
  white-space: nowrap;
}
.boolean-tag {
  display: inline-grid;
  min-width: 34px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(114, 215, 245, .4);
  border-radius: 6px;
  color: var(--cyan);
}
.boolean-tag.yes {
  color: var(--brand);
  border-color: rgba(var(--brand-rgb), .4);
  background: rgba(var(--brand-rgb), .06);
}

/* Homepage reading mode: allow vertical growth instead of compressing insight copy */
.bottom-grid {
  gap: 16px;
}
.bottom-grid .card-head {
  min-height: 74px;
  padding: 17px 20px;
}
.bottom-grid .card-title {
  font-size: 20px;
}
.bottom-grid .card-sub {
  margin-top: 5px;
  font-size: 14px;
}
.bottom-grid .btn {
  min-height: 42px;
  padding-inline: 14px;
  font-size: 14px;
}
.bottom-grid .pill {
  padding: 6px 10px;
  font-size: 15px;
}
.bottom-grid .insight-list {
  padding: 8px 20px 20px;
}
.bottom-grid .insight {
  min-height: 88px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 17px 0;
}
.bottom-grid .insight-num {
  width: 34px;
  height: 34px;
  font-size: 13px;
}
.bottom-grid .insight b {
  margin-bottom: 5px;
  font-size: 18px;
  line-height: 1.45;
}
.bottom-grid .insight small {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
}
.bottom-grid .severity {
  padding: 6px 9px;
  font-size: 13px;
}
.bottom-grid .insight > .pos,
.bottom-grid .insight > .neg {
  font-size: 18px;
  font-weight: 600;
}

/* Readability pass: strengthen secondary information without flattening hierarchy */
.workspace-id small {
  color: var(--text-soft);
  font-size: 12px;
}
.nav-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.nav-item,
.tab,
.breadcrumb {
  font-size: 13px;
}
.page-head p {
  font-size: 14px;
  line-height: 1.7;
}
.field label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}
.field-control::placeholder,
.table-search::placeholder,
.ai-input input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.kpi-top {
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: .01em;
}
.kpi-top > span:first-child {
  max-width: calc(100% - 42px);
  text-wrap: balance;
}
.delta {
  font-size: 13px;
  font-weight: 600;
}
.delta span {
  color: var(--text-soft);
  font-weight: 500;
}
.card-title {
  font-size: 15px;
}
.card-sub {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
}
.chart-legend {
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.chart-legend .legend-item {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
}
.chart-legend .legend-swatch {
  width: 22px;
  height: 3px;
  border-radius: 999px;
}
.axis-label {
  fill: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
}
.funnel-label {
  font-size: 14px;
}
.funnel-label span:first-child {
  color: var(--text-soft);
  font-weight: 600;
}
.funnel-label b {
  font-size: 13px;
}
.funnel-note {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.65;
}
.seg-btn {
  min-width: 54px;
  min-height: 36px;
  padding: 8px 12px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
}
.segmented {
  padding: 3px;
  border-color: var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, .018);
}
.seg-btn.active {
  color: var(--text);
  background: rgba(var(--brand-rgb), .18);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), .2);
}
.seg-btn:hover {
  color: var(--text);
  background: rgba(var(--brand-rgb), .1);
}
.insight b {
  font-size: 13px;
}
.insight small {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
}
.severity {
  font-size: 11px;
}
.table-search {
  width: 190px;
  font-size: 12px;
}

/* AI workspace: comfortable reading scale and clearer conversational hierarchy */
#ai-report {
  min-height: 42px;
  padding-inline: 16px;
  font-size: 14px;
  font-weight: 600;
}
.ai-fab {
  right: 24px;
  bottom: 24px;
  height: 56px;
  padding: 0 20px 0 11px;
  gap: 12px;
  font-size: 15px;
  border-color: rgba(var(--brand-rgb), .5);
}
.ai-fab .ai-orb {
  width: 36px;
  height: 36px;
}
.ai-panel {
  right: 24px;
  bottom: 92px;
  width: min(520px, calc(100vw - 40px));
  height: min(720px, calc(100vh - 120px));
  border-color: rgba(var(--brand-rgb), .28);
  border-radius: calc(var(--radius) + 2px);
  background:
    linear-gradient(180deg, rgba(var(--brand-rgb), .035), transparent 24%),
    var(--panel-solid);
  box-shadow: 0 36px 100px rgba(0, 0, 0, .46), 0 0 0 1px rgba(var(--brand-rgb), .05) inset;
}
.ai-head {
  min-height: 78px;
  padding: 16px 18px;
  gap: 13px;
  background: rgba(var(--brand-rgb), .035);
}
.ai-head .ai-orb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}
.ai-head b {
  font-size: 18px;
  letter-spacing: -.01em;
}
.ai-head small {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
}
.ai-head .ai-close {
  width: 42px;
  height: 42px;
}
.ai-chat {
  padding: 20px;
  gap: 15px;
}
.bubble {
  max-width: 90%;
  padding: 14px 16px;
  border-radius: 15px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  border-color: rgba(var(--brand-rgb), .22);
  background: rgba(var(--brand-rgb), .09);
}
.bubble.user {
  padding-inline: 17px;
  color: #062019;
  font-weight: 600;
}
.suggestions {
  gap: 8px;
}
.suggestion {
  padding: 8px 12px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.3;
  background: rgba(255, 255, 255, .018);
}
.ai-input {
  min-height: 76px;
  padding: 13px 14px;
  gap: 10px;
  background: rgba(var(--brand-rgb), .025);
}
.ai-input input {
  height: 48px;
  padding: 0 14px;
  border-color: var(--line-strong);
  font-size: 15px;
}
.ai-input .btn {
  height: 48px;
  padding-inline: 18px;
  font-size: 14px;
}

/* Club statistics module: source boundary, shared detail modes and club structure */
.source-notice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: -2px 0 14px; padding: 12px 14px; border: 1px solid rgba(255, 209, 102, .26); border-radius: var(--radius-sm); background: rgba(255, 209, 102, .055); color: var(--text-soft); font-size: 13px; line-height: 1.55; }
.source-notice b { color: var(--accent); white-space: nowrap; }
.source-notice a { color: var(--brand); font-weight: 700; text-decoration: none; white-space: nowrap; }
.source-notice a:hover { text-decoration: underline; }
.detail-mode-switch { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.detail-mode-switch::-webkit-scrollbar { display: none; }
.detail-mode-btn { min-width: max-content; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .018); color: var(--text-soft); cursor: pointer; font-size: 14px; font-weight: 650; transition: .2s ease; }
.detail-mode-btn:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.detail-mode-btn.active { color: var(--brand); border-color: rgba(var(--brand-rgb), .38); background: rgba(var(--brand-rgb), .1); box-shadow: inset 0 -2px 0 var(--brand); }
.club-level { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid currentColor; border-radius: 999px; font-size: .78em; font-weight: 750; }
.club-level::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.club-level.diamond { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 8%, transparent); }
.club-level.gold { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.club-structure { padding: 20px 18px 18px; }
.structure-ratio { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 24px; }
.structure-ratio strong { color: var(--text); font-size: clamp(30px, 3vw, 46px); letter-spacing: -.06em; }
.structure-ratio span { margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.structure-bars { display: grid; gap: 18px; }
.structure-bars > div > span { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--text-soft); font-size: 13px; }
.structure-bars em { color: var(--text); font-style: normal; }
.structure-bars i { display: block; height: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.025); }
.structure-bars i b { display: block; width: var(--w); height: 100%; border-radius: 5px; background: linear-gradient(90deg, rgba(114,215,245,.32), var(--cyan)); }
.structure-bars i b.gold { background: linear-gradient(90deg, rgba(255,209,102,.3), var(--accent)); }
.club-structure p { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; }
#trend-section .chart-legend { min-height: 38px; align-items: center; padding: 10px 16px 0; font-size: 14px; }
#trend-section .chart-dot.secondary { stroke: var(--cyan); }
.club-drill-table th:nth-child(1), .club-drill-table th:nth-child(2) { width: 10%; }
.club-drill-table th:nth-child(3), .club-drill-table th:nth-child(4) { width: 8%; }
.club-drill-table th:nth-child(5), .club-drill-table th:nth-child(6), .club-drill-table th:nth-child(7), .club-drill-table th:nth-child(8) { width: 9%; }
.club-drill-table th:nth-child(9), .club-drill-table th:nth-child(10) { width: 14%; }
.search-results .result { width: 100%; border: 0; color: inherit; text-align: left; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 1180px) {
  :root { --sidebar-w: 58px; }
  .sidebar { width: var(--rail-w); grid-template-columns: var(--rail-w); }
  .nav-panel { display: none; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(4), .kpi:nth-child(5) { grid-column: span 1; }
  .vip-data-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #user-cards { grid-template-columns: 1fr; }
  #detail-drawer .detail-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); width: 236px; grid-template-columns: var(--rail-w) 1fr; }
  .sidebar.mobile-open { transform: none; }
  .sidebar.mobile-open .nav-panel { display: block; }
  .mobile-menu { display: grid; }
  .topbar { padding-inline: 10px; }
  .breadcrumb { display: none; }
  .search-trigger { width: auto; flex: 1; max-width: 260px; }
  .search-trigger span { display: none; }
  .content { padding: 18px 14px 70px; }
  .tabs-wrap { padding-inline: 12px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .head-actions { justify-content: flex-start; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-actions { grid-column: 1 / -1; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi:last-child { grid-column: 1 / -1; }
  .dashboard-grid, .bottom-grid { grid-template-columns: 1fr; }
  #detail-drawer { width: 96vw; max-width: 96vw; }
  #detail-drawer .detail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vip-data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-metrics > div:nth-child(2n) { border-right: 0; }
}
@media (max-width: 520px) {
  :root { --topbar-h: 60px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .ambient-a { width: 260px; height: 260px; left: 22%; top: -180px; }
  .ambient-b { opacity: .045; }
  .topbar { padding: 0 14px; gap: 10px; }
  .mobile-menu { color: var(--brand); border-color: var(--line); }
  .top-actions { gap: 5px; width: 100%; }
  .top-actions .icon-btn:not(.theme-open), .top-actions .avatar { display: none; }
  .search-trigger { order: -1; max-width: none; min-width: 0; height: 38px; }
  .search-trigger::after { content: "搜索指标或用户"; font-size: 12px; }
  .search-trigger kbd { display: none; }
  .tabs-wrap { display: none; }
  .content { padding: 18px 14px 30px; }
  .page-head { gap: 16px; margin: 2px 0 16px; }
  .eyebrow { font-size: 9px; margin-bottom: 9px; }
  .page-head h1 { font-size: 28px; line-height: 1.16; letter-spacing: -.045em; }
  .page-head p { max-width: 330px; font-size: 13px; line-height: 1.65; }
  .head-actions { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .head-actions .btn { justify-content: center; padding-inline: 8px; height: 42px; font-size: 12px; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar:not([hidden]) { display: grid; animation: rise .24s var(--ease) both; }
  .filter-actions { grid-column: auto; }
  .filter-actions .btn { flex: 1; justify-content: center; height: 42px; }
  .field label { font-size: 12px; }
  .field-control { height: 44px; font-size: 14px; }
  .source-notice { grid-template-columns: 1fr auto; gap: 5px 10px; font-size: 12px; }
  .source-notice b { grid-column: 1; }
  .source-notice span { grid-column: 1 / -1; grid-row: 2; }
  .source-notice a { grid-column: 2; grid-row: 1; }
  .detail-mode-switch { margin-inline: -1px; padding: 10px 0 14px; border-bottom: 0; }
  .detail-mode-btn { min-height: 42px; font-size: 13px; }

  .kpi-grid {
    display: flex;
    gap: 10px;
    margin: 0 -14px 14px;
    padding: 0 14px 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .kpi-grid::-webkit-scrollbar { display: none; }
  .kpi {
    flex: 0 0 min(76vw, 292px);
    min-height: 146px;
    padding: 18px;
    scroll-snap-align: start;
  }
  .kpi:first-child { flex-basis: calc(100vw - 28px); border-color: rgba(var(--brand-rgb), .3); background: color-mix(in srgb, var(--panel) 84%, rgba(var(--brand-rgb), .12)); }
  .kpi:last-child { grid-column: auto; }
  .kpi-top { font-size: 13px; }
  .kpi-value { font-size: 32px; margin-block: 16px 10px; }
  .delta { font-size: 12px; }

  .dashboard-grid { gap: 14px; }
  .card-head { padding: 15px; align-items: flex-start; }
  .card-title { font-size: 16px; }
  .card-sub { font-size: 12px; line-height: 1.5; }
  .chart-legend { gap: 9px; padding-top: 3px; }
  .chart-body { height: 250px; padding: 10px 12px 14px; overflow: hidden; }
  .chart-body svg { width: 690px; max-width: none; transform: translateX(-12px); }
  .funnel { padding: 18px 15px; gap: 14px; }
  .funnel-label { font-size: 13px; }
  .funnel-track { height: 30px; }
  .funnel-note { font-size: 12px; line-height: 1.6; }

  .table-card { overflow: visible; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; }
  .table-card > .card-head { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 10px; flex-direction: column; }
  .table-tools { width: 100%; }
  .table-search { flex: 1; width: auto; height: 40px; font-size: 13px; }
  .table-wrap { overflow: visible; max-height: none; }
  .table-wrap table { display: block; min-width: 0; font-size: 12px; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: grid; gap: 10px; }
  .table-wrap tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
  }
  .table-wrap tr:active { border-color: rgba(var(--brand-rgb), .45); transform: scale(.995); }
  .table-wrap td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    text-align: right;
    white-space: normal;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }
  .table-wrap td::before { content: attr(data-label); color: var(--muted); font-family: "Noto Sans SC", "MiSans", sans-serif; font-size: 11px; }
  .table-wrap td:first-child, .table-wrap td:nth-child(2) { grid-column: 1 / -1; text-align: right; }
  .table-wrap td:first-child { color: var(--muted); padding-top: 0; }
  .table-wrap td:nth-child(2) { padding: 11px 0 13px; border-bottom-color: var(--line-strong); }
  .table-wrap td:nth-last-child(-n+2) { border-bottom: 0; }
  .drill-trigger { min-width: 108px; justify-content: center; padding: 7px 10px; }
  .table-foot { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }

  .bottom-grid { gap: 14px; }
  .bottom-grid .insight { grid-template-columns: 30px 1fr; padding-block: 14px; }
  .bottom-grid .insight > :last-child { grid-column: 2; justify-self: start; margin-top: 4px; }
  .bottom-grid .insight b { font-size: 14px; line-height: 1.45; }
  .bottom-grid .insight small { font-size: 12px; line-height: 1.55; }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 45;
    left: 8px;
    right: 8px;
    bottom: 8px;
    min-height: 62px;
    padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
    border: 1px solid var(--line-strong);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: 0 18px 45px rgba(0,0,0,.38);
    backdrop-filter: blur(22px);
  }
  .mobile-nav-item { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: var(--radius-sm); font-size: 10px; }
  .mobile-nav-item svg { width: 18px; height: 18px; }
  .mobile-nav-item.active { color: var(--brand); background: rgba(var(--brand-rgb), .1); }

  .sidebar { width: min(86vw, 320px); grid-template-columns: var(--rail-w) 1fr; box-shadow: 30px 0 80px rgba(0,0,0,.55); }
  .mobile-sidebar-close { display: grid; position: absolute; top: 12px; right: 12px; z-index: 2; border-color: var(--line); }
  .workspace-id { padding-right: 38px; }
  #detail-drawer, #theme-drawer { width: 100vw; max-width: 100vw; }
  #detail-drawer .drawer-head h2 { font-size: 25px; }
  #detail-drawer .drawer-body { padding-inline: 14px; }
  #detail-drawer .drawer-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  #detail-drawer .drill-table-wrap { overflow-x: auto; }
  #detail-drawer .club-drill-table { min-width: 1060px; table-layout: fixed; }
  .choice-grid { grid-template-columns: 1fr; }
  .ai-fab { right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); width: 44px; padding: 0; justify-content: center; }
  .ai-fab b { display: none; }
  .ai-panel {
    right: 10px;
    bottom: calc(138px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
    height: min(68vh, 680px);
  }
  .bubble { max-width: 94%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* v26 · 用户穿透密度优化：按穿透字段数分配列宽，减少大屏空档。 */
#detail-drawer {
  width: min(78vw, 1180px);
  max-width: min(78vw, 1180px);
}

#detail-drawer .drawer-head { padding: 14px 18px; }
#detail-drawer .drawer-head h2 { font-size: 22px; }
#detail-drawer .drawer-head .card-sub { font-size: 13px; }
#detail-drawer .drawer-body { padding: 16px 18px; }
#detail-drawer .drawer-section { margin-bottom: 16px; }
#detail-drawer .drawer-section h3 {
  margin-bottom: 10px;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: none;
}
#detail-drawer .source-notice.compact { margin-bottom: 14px; }
#detail-drawer .detail-item { padding: 12px 14px; }
#detail-drawer .detail-item small { margin-bottom: 5px; font-size: 12px; }
#detail-drawer .detail-item b { font-size: 17px; white-space: nowrap; }
#detail-drawer .field-control { height: 44px; font-size: 15px; }
#detail-drawer .btn { min-height: 40px; font-size: 14px; }

#detail-drawer .vip-distribution {
  height: 132px;
  padding-block: 10px 8px;
}
#detail-drawer .vip-dist-track { height: 64px; }

#detail-drawer .drill-table th {
  padding: 10px 12px;
  font-size: 12px;
  white-space: nowrap;
}
#detail-drawer .drill-table td {
  padding: 10px 12px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#detail-drawer .drill-table th:nth-child(3),
#detail-drawer .drill-table td:nth-child(3) { text-align: right; }
#detail-drawer .drill-table th:nth-child(3) .sortable-head { justify-content: flex-end; }

#detail-drawer .drill-table[data-columns="6"] th:nth-child(1) { width: 18%; }
#detail-drawer .drill-table[data-columns="6"] th:nth-child(2) { width: 9%; }
#detail-drawer .drill-table[data-columns="6"] th:nth-child(3) { width: 18%; }
#detail-drawer .drill-table[data-columns="6"] th:nth-child(4) { width: 20%; }
#detail-drawer .drill-table[data-columns="6"] th:nth-child(5) { width: 16%; }
#detail-drawer .drill-table[data-columns="6"] th:nth-child(6) { width: 19%; }

#detail-drawer .drill-table[data-columns="8"] th:nth-child(1) { width: 15%; }
#detail-drawer .drill-table[data-columns="8"] th:nth-child(2) { width: 7%; }
#detail-drawer .drill-table[data-columns="8"] th:nth-child(3) { width: 13%; }
#detail-drawer .drill-table[data-columns="8"] th:nth-child(4) { width: 17%; }
#detail-drawer .drill-table[data-columns="8"] th:nth-child(5) { width: 13%; }
#detail-drawer .drill-table[data-columns="8"] th:nth-child(6) { width: 11%; }
#detail-drawer .drill-table[data-columns="8"] th:nth-child(7) { width: 12%; }
#detail-drawer .drill-table[data-columns="8"] th:nth-child(8) { width: 12%; }

#detail-drawer .drill-table[data-columns="9"] th:nth-child(1) { width: 15%; }
#detail-drawer .drill-table[data-columns="9"] th:nth-child(2) { width: 7%; }
#detail-drawer .drill-table[data-columns="9"] th:nth-child(3) { width: 11%; }
#detail-drawer .drill-table[data-columns="9"] th:nth-child(4) { width: 11%; }
#detail-drawer .drill-table[data-columns="9"] th:nth-child(5) { width: 13%; }
#detail-drawer .drill-table[data-columns="9"] th:nth-child(6) { width: 10%; }
#detail-drawer .drill-table[data-columns="9"] th:nth-child(7) { width: 11%; }
#detail-drawer .drill-table[data-columns="9"] th:nth-child(8) { width: 11%; }
#detail-drawer .drill-table[data-columns="9"] th:nth-child(9) { width: 11%; }

@media (max-width: 1600px) and (min-width: 821px) {
  #detail-drawer .detail-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #detail-drawer .detail-item { border-bottom: 1px solid var(--line); }
  #detail-drawer .detail-item:nth-last-child(-n + 3) { border-bottom: 0; }
}

@media (max-width: 820px) {
  #detail-drawer { width: 96vw; max-width: 96vw; }
}

@media (max-width: 520px) {
  #detail-drawer { width: 100vw; max-width: 100vw; }
}

/* VIP activity module: reuses the shared shell and adds only activity-specific components. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.vip-kpi-grid { grid-template-columns: minmax(0, .82fr) repeat(2, minmax(0, 1.09fr)); }
.vip-kpi-grid .kpi {
  min-width: 0;
  min-height: 156px;
  padding: 18px 20px;
  box-shadow: inset 0 2px 0 color-mix(in srgb, var(--kpi-color) 72%, transparent), var(--shadow);
}
.vip-kpi-grid .kpi::after { display: none; }
.vip-kpi-grid .kpi-top {
  min-height: 32px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
}
.vip-kpi-grid .kpi-label {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.vip-kpi-grid .kpi-label::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--kpi-color, var(--brand));
  content: "";
}
.vip-kpi-grid .kpi-icon {
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--kpi-color) 18%, transparent);
  background: color-mix(in srgb, var(--kpi-color) 7%, transparent);
  opacity: .72;
}
.vip-kpi-grid .kpi-value {
  margin: 16px 0 9px;
  color: var(--text);
  font-size: clamp(32px, 2.25vw, 34px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
  letter-spacing: -.025em;
}
.vip-kpi-grid .kpi-pair .kpi-value { font-size: 32px; }
.vip-kpi-grid .delta { min-height: 26px; }
.kpi-drill {
  margin-left: auto;
  padding: 4px 7px;
  border: 1px solid rgba(var(--brand-rgb), .28);
  border-radius: 7px;
  background: rgba(var(--brand-rgb), .08);
  color: var(--brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
}
.kpi-drill:hover { background: rgba(var(--brand-rgb), .16); transform: translateX(2px); }
.metric-drill {
  min-width: 92px;
  min-height: 38px;
  padding: 5px 9px;
  border: 1px solid rgba(var(--brand-rgb), .32);
  border-radius: 8px;
  background: rgba(var(--brand-rgb), .075);
  color: var(--brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font: inherit;
}
.metric-drill:hover { border-color: var(--brand); background: rgba(var(--brand-rgb), .15); transform: translateX(2px); }
.metric-drill svg { flex: 0 0 auto; }
.vip-level-table table { min-width: 5400px; }
.vip-level-table th,
.vip-level-table td { min-width: 176px; }
.vip-level-table th:first-child,
.vip-level-table td:first-child { min-width: 170px; }
.vip-level-table th:nth-child(2),
.vip-level-table td:nth-child(2) { min-width: 140px; }
.vip-level-table th:nth-child(12),
.vip-level-table td:nth-child(12),
.vip-level-table th:nth-child(13),
.vip-level-table td:nth-child(13),
.vip-level-table th:nth-child(14),
.vip-level-table td:nth-child(14),
.vip-level-table th:nth-child(18),
.vip-level-table td:nth-child(18),
.vip-level-table th:nth-child(25),
.vip-level-table td:nth-child(25),
.vip-level-table th:nth-child(26),
.vip-level-table td:nth-child(26) { min-width: 260px; }
.vip-level-table thead th {
  height: 88px;
  vertical-align: middle;
}
.vip-level-table .sortable-head {
  display: grid;
  grid-template-columns: max-content 18px;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-height: 44px;
}
.vip-level-table .sortable-head > span:first-child {
  white-space: nowrap;
  line-height: 1.25;
  text-align: right;
}
.vip-level-table th:nth-child(2) .sortable-head {
  justify-content: start;
}
.vip-level-table th:nth-child(2) .sortable-head > span:first-child {
  text-align: left;
}
.vip-level-table .data-basis { margin: 0; }
.source-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.source-tag.sheet { color: var(--brand); background: rgba(var(--brand-rgb), .08); }
.source-tag.demo { color: var(--accent); background: rgba(255, 209, 102, .08); }
.reward-mix { padding: 18px 16px 20px; display: grid; gap: 17px; }
.reward-row > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.reward-row span { color: var(--text-soft); font-size: 14px; font-weight: 600; }
.reward-row b { color: var(--text); font-size: 13px; }
.reward-track { height: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.025); }
.reward-track i { display: block; width: var(--w); height: 100%; border-radius: 6px; background: linear-gradient(90deg, rgba(var(--brand-rgb),.22), var(--brand)); }
.reward-fill-motion {
  transform: scaleX(1);
  transform-origin: left center;
  animation: vip-reward-grow 620ms cubic-bezier(.16, 1, .3, 1) calc(100ms + var(--bar-index) * 65ms) both;
}
.chart-value { fill: var(--text); font: 11px "DM Mono", monospace; font-weight: 600; }

@keyframes vip-area-reveal {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes vip-trend-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes vip-point-reveal {
  from { opacity: 0; transform: translateY(4px) scale(.82); }
  to { opacity: 1; transform: none; }
}
@keyframes vip-reward-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .chart-motion-line {
    animation: none !important;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
  .chart-motion-area {
    animation: none !important;
    clip-path: none;
    opacity: 1;
  }
  .chart-motion-point,
  .reward-fill-motion {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
.source-notice.compact { margin: 0 0 20px; }
#detail-drawer .drill-table { min-width: 0; table-layout: fixed; }
#detail-drawer .drill-table th,
#detail-drawer .drill-table td { min-width: 0; }
#detail-drawer .drill-table td:first-child { color: var(--text); }

@media (max-width: 1180px) {
  .vip-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vip-kpi-grid .kpi { padding-inline: 18px; }
  .vip-kpi-grid .kpi-value { font-size: clamp(28px, 2.65vw, 32px); }
  .vip-kpi-grid .kpi-pair .kpi-value { font-size: 27px; }
}
@media (max-width: 820px) {
  .vip-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vip-kpi-grid .kpi:last-child { grid-column: auto; }
  .vip-kpi-grid .kpi-top { font-size: 18px; }
  .vip-kpi-grid .kpi-value {
    font-size: clamp(27px, 4vw, 32px);
    white-space: normal;
  }
  .vip-kpi-grid .kpi-pair .kpi-value { font-size: 27px; }
  .source-notice { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .vip-kpi-grid { display: flex; }
  .vip-kpi-grid .kpi {
    min-height: 156px;
    flex: 0 0 calc(100vw - 28px);
    padding: 18px;
  }
  .vip-kpi-grid .kpi-top { font-size: 17px; }
  .vip-kpi-grid .kpi-label { gap: 8px; }
  .vip-kpi-grid .kpi-label::before { width: 7px; height: 7px; }
  .vip-kpi-grid .kpi-value {
    margin-block: 16px 11px;
    font-size: 30px;
    letter-spacing: -.02em;
    white-space: normal;
  }
  .vip-kpi-grid .kpi-pair .kpi-value { font-size: 27px; }
  .vip-level-table table { min-width: 0; }
  .vip-level-table th,
  .vip-level-table td { min-width: 0; }
  .vip-level-table th:nth-child(n),
  .vip-level-table td:nth-child(n) { min-width: 0; }
  .metric-drill { min-width: 112px; min-height: 40px; }
  .source-notice { margin-bottom: 12px; padding: 12px; }
  #detail-drawer .drill-table-wrap { overflow-x: auto; overflow-y: visible; max-height: none; border: 0; }
  #detail-drawer .drill-table,
  #detail-drawer .drill-table tbody,
  #detail-drawer .drill-table tr { display: block; width: 100%; }
  #detail-drawer .drill-table thead { display: none; }
  #detail-drawer .drill-table tr { margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.018); }
  #detail-drawer .drill-table td { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 0; border-bottom: 1px solid var(--line); text-align: right; }
  #detail-drawer .drill-table td:last-child { border-bottom: 0; }
  #detail-drawer .drill-table td::before { content: attr(data-label); color: var(--muted); font-family: "Noto Sans SC", sans-serif; font-size: 12px; }
}

/* ========================================================================== 
   v23 · 抖音系深色商业后台视觉覆盖
   保留原有结构与数据逻辑，仅重设设计令牌、层级、状态与交互反馈。
   ========================================================================== */

:root {
  --brand: #fe2c55;
  --brand-rgb: 254, 44, 85;
  --cyan: #25f4ee;
  --success: #00c896;
  --accent: #ff9f0a;
  --danger: #ff4058;
  --violet: #9b7bff;
  --bg: #07080d;
  --bg-deep: #05060a;
  --panel: #151822;
  --panel-solid: #151822;
  --panel-hover: #1a1e2b;
  --sidebar: #0b0c12;
  --text: #f5f5f7;
  --text-soft: #b9c0d2;
  --muted: #737d96;
  --line: rgba(145, 157, 190, .14);
  --line-strong: rgba(164, 176, 207, .24);
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 16px 42px rgba(0, 0, 0, .2);
  --glass-blur: 0px;
  --sidebar-w: 264px;
  --rail-w: 62px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.2, .78, .2, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6fa;
  --bg-deep: #eceef4;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --panel-hover: #fafafe;
  --sidebar: #ffffff;
  --text: #171821;
  --text-soft: #43495d;
  --muted: #747c91;
  --line: rgba(45, 51, 72, .11);
  --line-strong: rgba(45, 51, 72, .2);
  --shadow: 0 14px 36px rgba(29, 32, 47, .08);
}

html {
  background: var(--bg);
  scrollbar-color: rgba(var(--brand-rgb), .5) var(--bg-deep);
}

body {
  background: var(--bg);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: .005em;
}

.ambient { display: none; }

::selection {
  color: #fff;
  background: rgba(var(--brand-rgb), .7);
}

button,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.sidebar {
  background: var(--sidebar);
  border-right-color: var(--line);
  backdrop-filter: none;
  box-shadow: 18px 0 45px rgba(0, 0, 0, .12);
}

.rail {
  padding: 14px 10px;
  border-right-color: var(--line);
  background: var(--bg-deep);
}

.brand-mark {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border: 1px solid rgba(var(--brand-rgb), .72);
  border-radius: 10px;
  background: var(--brand);
  box-shadow: 0 8px 26px rgba(var(--brand-rgb), .26);
}

.brand-mark::before,
.brand-mark::after {
  border-color: #fff;
}

.brand-mark::after { background: #fff; }

.rail-btn {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}

.rail-btn:hover,
.rail-btn.active,
.icon-btn:hover {
  color: var(--text);
  background: rgba(var(--brand-rgb), .11);
}

.rail-btn.active {
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), .18);
}

.nav-panel { padding: 18px 12px; }

.workspace-id {
  height: 42px;
  margin-bottom: 22px;
}

.workspace-id .avatar,
.top-actions > .avatar {
  color: #fff;
  background: var(--brand);
  border-color: var(--sidebar);
  box-shadow: 0 0 0 1px rgba(var(--brand-rgb), .5);
}

.workspace-id strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.workspace-id small { color: var(--muted); }

.nav-label {
  margin: 20px 12px 8px;
  color: #5f6880;
  font-weight: 700;
  letter-spacing: .16em;
}

.nav-item {
  min-height: 42px;
  margin: 3px 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-soft);
  font-weight: 500;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .035);
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--brand);
  background: rgba(var(--brand-rgb), .13);
  box-shadow: inset 3px 0 0 var(--brand);
}

.nav-item .count {
  color: #fff;
  background: rgba(var(--brand-rgb), .78);
}

.topbar {
  padding: 0 24px;
  background: rgba(9, 10, 15, .98);
  border-bottom-color: var(--line);
  backdrop-filter: none;
}

[data-theme="light"] .topbar { background: rgba(255, 255, 255, .98); }

.breadcrumb { font-size: 13px; }
.breadcrumb b:last-child { color: var(--brand); }

.search-trigger {
  height: 40px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.search-trigger:hover {
  color: var(--text-soft);
  border-color: rgba(var(--brand-rgb), .42);
  background: var(--panel-hover);
}

.search-trigger kbd {
  color: var(--muted);
  background: rgba(255,255,255,.025);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.tabs-wrap {
  padding: 10px 24px 0;
  background: rgba(7, 8, 13, .98);
  backdrop-filter: none;
}

[data-theme="light"] .tabs-wrap { background: rgba(245, 246, 250, .98); }

.tabs { gap: 8px; padding-bottom: 10px; }

.tab {
  min-height: 38px;
  padding: 8px 14px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.tab:hover {
  color: var(--text);
  background: var(--panel);
  border-color: var(--line);
  transform: translateY(-1px);
}

.tab.active {
  color: var(--brand);
  background: rgba(var(--brand-rgb), .11);
  border-color: rgba(var(--brand-rgb), .16);
}

.tab.active::after { display: none; }

.content {
  max-width: 1660px;
  padding: 30px 32px 72px;
}

.page-head {
  align-items: center;
  margin: 4px 0 22px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--brand);
  font-weight: 800;
  letter-spacing: .16em;
}

.status-dot {
  background: var(--brand);
  box-shadow: 0 0 0 5px rgba(var(--brand-rgb), .11);
}

h1 {
  color: var(--text);
  font-size: clamp(30px, 3.1vw, 42px);
  font-weight: 900;
  letter-spacing: -.045em;
}

.page-head p {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 13px;
}

.head-actions { gap: 10px; }

.btn {
  height: 40px;
  padding: 0 15px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text-soft);
  font-weight: 600;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s var(--ease), box-shadow .18s ease;
}

.btn:hover {
  color: var(--text);
  border-color: rgba(var(--brand-rgb), .34);
  background: var(--panel-hover);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0) scale(.985); }

.btn.primary {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 9px 26px rgba(var(--brand-rgb), .2);
}

.btn.primary:hover {
  color: #fff;
  border-color: #ff4a6d;
  background: #ff365f;
  box-shadow: 0 12px 32px rgba(var(--brand-rgb), .3);
}

.btn.is-active {
  color: var(--brand);
  border-color: rgba(var(--brand-rgb), .5);
  background: rgba(var(--brand-rgb), .1);
}

.btn.is-loading,
.btn:disabled {
  cursor: progress;
  opacity: .68;
  transform: none;
}

.source-notice {
  margin-bottom: 16px;
  padding: 13px 15px;
  border-color: rgba(255, 159, 10, .3);
  border-radius: 8px;
  background: rgba(255, 159, 10, .07);
}

.source-notice b { color: var(--accent); }

.filter-bar {
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border-color: var(--line);
  border-radius: 10px;
  background: var(--panel);
  backdrop-filter: none;
  box-shadow: none;
}

.field { gap: 7px; }
.field label { color: var(--muted); font-weight: 700; }

.field-control {
  height: 40px;
  padding-inline: 12px;
  border-color: var(--line);
  border-radius: 8px;
  background: #10131c;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

[data-theme="light"] .field-control { background: #f7f8fb; }

.field-control:hover { border-color: var(--line-strong); }
.field-control:focus {
  border-color: rgba(var(--brand-rgb), .55);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .08);
}

.card {
  border-color: var(--line);
  border-radius: 10px;
  background: var(--panel);
  backdrop-filter: none;
  box-shadow: none;
}

.card:hover {
  border-color: rgba(var(--brand-rgb), .25);
  background: var(--panel-hover);
}

.vip-kpi-grid { gap: 14px; margin-bottom: 14px; }

.vip-kpi-grid .kpi {
  min-height: 154px;
  padding: 20px;
  border-top: 2px solid var(--kpi-color, var(--brand));
  background: var(--panel);
}

.vip-kpi-grid .kpi:hover {
  border-color: var(--kpi-color, var(--brand));
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .2);
}

.vip-kpi-grid .kpi-top {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.vip-kpi-grid .kpi-label::before {
  background: var(--kpi-color, var(--brand));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--kpi-color, var(--brand)) 10%, transparent);
}

.vip-kpi-grid .kpi-icon {
  border-color: color-mix(in srgb, var(--kpi-color, var(--brand)) 30%, transparent);
  color: var(--kpi-color, var(--brand));
  background: color-mix(in srgb, var(--kpi-color, var(--brand)) 10%, transparent);
}

.vip-kpi-grid .kpi-value {
  color: var(--kpi-color, var(--text));
  font-weight: 700;
  letter-spacing: -.045em;
}

.vip-kpi-grid .delta span { color: var(--text-soft); }

.kpi-drill,
.metric-drill {
  color: var(--brand);
  border-color: rgba(var(--brand-rgb), .38);
  background: rgba(var(--brand-rgb), .08);
}

.kpi-drill:hover,
.metric-drill:hover {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 8px 22px rgba(var(--brand-rgb), .18);
}

.dashboard-grid,
.bottom-grid { gap: 14px; margin-bottom: 14px; }

.card-head {
  min-height: 60px;
  padding: 16px 18px;
  border-bottom-color: var(--line);
}

.card-title { color: var(--text); font-size: 15px; font-weight: 800; }
.card-sub { margin-top: 4px; color: var(--muted); font-size: 11px; }

.segmented {
  padding: 3px;
  border-color: var(--line);
  border-radius: 999px;
  background: #10131c;
}

[data-theme="light"] .segmented { background: #f3f4f8; }

.seg-btn {
  min-width: 52px;
  padding: 6px 11px;
  border-radius: 999px;
  font-weight: 700;
}

.seg-btn.active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 18px rgba(var(--brand-rgb), .18);
}

.chart-body { height: 330px; padding: 12px 18px 18px; }
.grid-line { stroke: rgba(145, 157, 190, .14); }
.trend-line { stroke: var(--cyan); stroke-width: 2.6; }
.chart-dot { fill: var(--panel-solid); stroke: var(--cyan); }
.chart-value { fill: var(--text); }

.reward-mix { padding: 20px 18px 22px; }
.reward-track { height: 22px; border-color: var(--line); background: #0e1118; }
[data-theme="light"] .reward-track { background: #f1f3f7; }
.reward-track i { background: var(--cyan); }

.pill {
  border-color: rgba(37, 244, 238, .28);
  color: var(--cyan);
  background: rgba(37, 244, 238, .06);
}

.pill::before { background: var(--cyan); }

.table-card { margin-bottom: 14px; }
.table-wrap { max-height: 460px; }

table { font-size: 12px; }

th {
  padding: 13px 14px;
  color: #8490aa;
  background: #1d2130;
  border-bottom-color: var(--line-strong);
  font-weight: 700;
}

[data-theme="light"] th { background: #f0f2f7; color: #626b80; }

td {
  padding: 13px 14px;
  color: var(--text-soft);
  border-bottom-color: var(--line);
}

tbody tr:hover,
tbody tr.is-selected {
  background: rgba(var(--brand-rgb), .07);
}

tbody tr.is-selected td:first-child,
tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

.sort-arrow { color: #566077; }
.sort-arrow:hover,
.sort-arrow.active { color: var(--brand); }
.auto-sort-control { margin-left: 7px; padding: 2px 5px; border: 1px solid var(--line-strong); border-radius: 5px; background: transparent; color: var(--muted); font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; vertical-align: middle; }
.auto-sort-control:hover, th[aria-sort] .auto-sort-control { color: var(--brand); border-color: rgba(var(--brand-rgb), .5); background: rgba(var(--brand-rgb), .08); }

.rain-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rain-overview { grid-template-columns: minmax(340px, 1.05fr) minmax(300px, .95fr); }
.rain-participation { min-height: 220px; display: flex; align-items: center; justify-content: center; gap: 34px; padding: 12px 8px; }
.rain-round-ring { --ring: calc(var(--p) * 1%); width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) var(--ring), rgba(var(--brand-rgb), .11) 0); box-shadow: inset 0 0 0 12px var(--panel-solid), 0 0 34px rgba(var(--brand-rgb), .18); }
.rain-round-ring > div { width: 124px; height: 124px; border-radius: 50%; background: var(--panel-solid); display: grid; place-content: center; text-align: center; gap: 4px; }
.rain-round-ring small, .rain-round-ring span { color: var(--muted); font-size: 11px; font-weight: 700; }
.rain-round-ring b { font-size: 24px; letter-spacing: -.04em; }
.rain-round-metrics { display: grid; gap: 10px; min-width: 180px; }
.rain-round-metrics > div, .rain-status { padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(var(--brand-rgb), .035); }
.rain-round-metrics small, .rain-status span, .rain-status small { color: var(--muted); font-size: 12px; }
.rain-round-metrics b { display: block; margin-top: 3px; font-size: 18px; }
.rain-status-list { display: grid; gap: 10px; padding: 10px 0; }
.rain-status { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; }
.rain-status b { color: var(--text); }
.rain-status small { padding: 3px 6px; border-radius: 999px; background: rgba(var(--accent-rgb, 255, 159, 10), .1); color: var(--accent); }
.rain-detail-table .table-wrap { overflow-x: auto; }
.rain-detail-table table { width: max-content; min-width: 0; table-layout: auto; }
.rain-detail-table th, .rain-detail-table td { width: max-content; min-width: 0; padding-inline: 12px; }
.rain-detail-table th:first-child, .rain-detail-table td:first-child { min-width: 104px; }

/* V44: 打码返水分档明细按内容收紧列宽，保留横向查看。 */
.rebate-detail-table .table-wrap { overflow-x: auto; }
.rebate-detail-table table { width: max-content; min-width: 0; table-layout: auto; }
.rebate-detail-table th, .rebate-detail-table td { width: max-content; min-width: 0; padding-inline: 12px; }
.rebate-detail-table th:first-child, .rebate-detail-table td:first-child { min-width: 80px; }
.rebate-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rebate-kpi-grid .kpi {
  min-width: 0;
  min-height: 148px;
  padding: 16px;
}
.rebate-kpi-grid .kpi-top {
  font-size: clamp(12px, .78vw, 15px);
}
.rebate-kpi-grid .kpi-label {
  line-height: 1.3;
}
.rebate-kpi-grid .kpi-value {
  color: var(--kpi-color, var(--text));
  font-size: clamp(20px, 1.35vw, 28px);
}
.rebate-kpi-grid .delta {
  font-size: 11px;
}
.turnover-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.turnover-kpi-grid .kpi-value { color: var(--kpi-color, var(--text)); }
.turnover-kpi-grid .kpi { min-width: 0; }
.turnover-kpi-grid .kpi-label { line-height: 1.3; }
.virtual-data-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 3px 8px;
  border: 1px solid rgba(37, 217, 222, .3);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(37, 217, 222, .08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.virtual-data-tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.rebate-overview { grid-template-columns: minmax(380px, 1.05fr) minmax(300px, .95fr); }
.rebate-bucket-list { display: grid; gap: 13px; padding: 8px 2px; }
.rebate-bucket-row { display: grid; grid-template-columns: 145px minmax(130px, 1fr) 100px; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.rebate-bucket-row b { color: var(--text); text-align: right; }
.rebate-status-list { display: grid; gap: 10px; padding-top: 8px; }
.rebate-status { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(var(--brand-rgb), .035); }
.rebate-status span, .rebate-status small { color: var(--muted); font-size: 12px; }
.rebate-status small { padding: 3px 7px; border-radius: 999px; background: rgba(var(--brand-rgb), .08); }
@media (max-width: 1180px) { .rebate-kpi-grid, .turnover-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .rebate-kpi-grid, .turnover-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rebate-overview { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .rebate-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rebate-kpi-grid .kpi { min-height: 138px; padding: 14px; } .rebate-kpi-grid .kpi-value { font-size: clamp(20px, 6vw, 26px); } .rebate-bucket-row { grid-template-columns: 86px minmax(80px, 1fr) 72px; gap: 8px; font-size: 11px; } .rebate-status { grid-template-columns: 1fr auto; } .rebate-status small { grid-column: 1 / -1; justify-self: start; } }
@media (max-width: 1050px) { .rain-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rain-overview { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .rain-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rain-kpi-grid .kpi:last-child { grid-column: 1 / -1; } .rain-participation { flex-direction: column; align-items: stretch; } .rain-round-ring { margin-inline: auto; } }

.source-tag.sheet {
  color: var(--cyan);
  border-color: rgba(37, 244, 238, .28);
  background: rgba(37, 244, 238, .07);
}

.source-tag.demo {
  color: var(--accent);
  border-color: rgba(255, 159, 10, .28);
  background: rgba(255, 159, 10, .07);
}

.table-foot {
  padding: 12px 16px;
  border-top-color: var(--line);
  background: rgba(255,255,255,.012);
}

.insight-list { padding: 6px 18px 16px; }
.insight { padding: 13px 0; }

.insight-num {
  color: var(--brand);
  background: rgba(var(--brand-rgb), .11);
}

.severity {
  color: var(--accent);
  background: rgba(255, 159, 10, .1);
}

.drawer-backdrop,
.modal-backdrop {
  background: rgba(2, 3, 7, .72);
  backdrop-filter: blur(5px);
}

.drawer {
  border-left-color: var(--line-strong);
  background: #10121a;
  box-shadow: -30px 0 80px rgba(0,0,0,.45);
}

[data-theme="light"] .drawer { background: #fff; }

.drawer-head,
.drawer-foot { border-color: var(--line); }

.choice,
.palette {
  border-color: var(--line);
  background: var(--panel);
}

.choice:hover,
.choice.active,
.palette:hover,
.palette.active {
  color: var(--brand);
  border-color: rgba(var(--brand-rgb), .52);
  background: rgba(var(--brand-rgb), .08);
}

.palette-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.search-modal {
  top: 10vh;
  border-color: var(--line-strong);
  border-radius: 12px;
  background: #11131c;
  box-shadow: 0 34px 90px rgba(0,0,0,.5);
}

[data-theme="light"] .search-modal { background: #fff; }

.search-input-wrap { border-bottom-color: var(--line); }
.search-input-wrap:focus-within { box-shadow: inset 3px 0 0 var(--brand); }

.result {
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
}

.result:hover {
  border-color: rgba(var(--brand-rgb), .2);
  background: rgba(var(--brand-rgb), .07);
}

.result-icon {
  color: var(--brand);
  background: rgba(var(--brand-rgb), .11);
}

.ai-fab {
  height: 52px;
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 14px 36px rgba(var(--brand-rgb), .28);
}

.ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(var(--brand-rgb), .36);
}

.ai-orb {
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(37, 244, 238, .13);
}

.ai-panel {
  border-color: var(--line-strong);
  border-radius: 12px;
  background: #11131c;
  box-shadow: 0 28px 80px rgba(0,0,0,.48);
}

[data-theme="light"] .ai-panel { background: #fff; }

.bubble {
  border-color: var(--line);
  background: var(--panel);
}

.bubble.user {
  color: #fff;
  border-color: rgba(var(--brand-rgb), .45);
  background: rgba(var(--brand-rgb), .17);
}

.suggestion {
  color: var(--brand);
  border-color: rgba(var(--brand-rgb), .3);
  background: rgba(var(--brand-rgb), .06);
}

.suggestion:hover { background: rgba(var(--brand-rgb), .13); }

.toast {
  min-width: 220px;
  padding: 12px 16px;
  border-color: rgba(var(--brand-rgb), .38);
  border-radius: 8px;
  background: #171a24;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
  text-align: center;
  font-weight: 600;
}

.mobile-bottom-nav {
  border-top-color: var(--line);
  background: rgba(9, 10, 15, .98);
  backdrop-filter: none;
}

.mobile-nav-item.active { color: var(--brand); }

@media (max-width: 1180px) {
  :root { --sidebar-w: 238px; --rail-w: 58px; }
  .content { padding-inline: 24px; }
  .vip-kpi-grid .kpi { min-height: 148px; }
}

@media (max-width: 820px) {
  :root { --sidebar-w: 0px; --topbar-h: 58px; }
  .content { padding: 22px 16px 84px; }
  .tabs-wrap { padding-inline: 14px; }
  .page-head { align-items: flex-start; }
  h1 { font-size: clamp(28px, 5.2vw, 38px); }
  .filter-bar { padding: 12px; }
  .vip-kpi-grid .kpi { min-height: 148px; }
}

@media (max-width: 520px) {
  :root { --radius: 9px; --radius-sm: 7px; }
  html,
  body { overflow-x: hidden; }
  .topbar { padding-inline: 12px; }
  .tabs { gap: 6px; }
  .tab { min-height: 36px; padding: 7px 11px; }
  .content { padding: 18px 10px 104px; }
  .page-head { margin-bottom: 16px; }
  h1 { font-size: 28px; line-height: 1.18; }
  .page-head p { font-size: 12px; line-height: 1.65; }
  .head-actions { width: 100%; justify-content: stretch; }
  .head-actions .btn { flex: 1; justify-content: center; }
  .source-notice { border-radius: 8px; }
  .vip-kpi-grid {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    gap: 10px;
    padding: 0 0 4px;
  }
  .vip-kpi-grid .kpi {
    min-height: 158px;
    flex-basis: calc(100vw - 20px);
    padding: 18px;
  }
  .dashboard-grid,
  .bottom-grid { gap: 10px; }
  .card-head { padding: 14px; }
  .ai-fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
  }
  .search-modal { width: calc(100vw - 20px); }
  .palette-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .btn,
  .tab,
  .nav-item,
  .ai-fab {
    transition: none !important;
    transform: none !important;
  }
}

/* ========================================================================== 
   v27 · 抖音系明亮商业后台视觉覆盖
   独立皮肤：保留业务结构与交互，只重设白底层级、色彩语义与反馈。
   ========================================================================== */

:root[data-skin="douyin-light"][data-theme="light"] {
  color-scheme: light;
  --brand: #fe2c55;
  --brand-rgb: 254, 44, 85;
  --cyan: #25d9de;
  --cyan-ink: #008f98;
  --success: #009f75;
  --accent: #c77800;
  --danger: #d9365a;
  --violet: #6474a5;
  --bg: #f6f7fa;
  --bg-deep: #f1f3f7;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --panel-hover: #fafbfd;
  --sidebar: #ffffff;
  --text: #17181c;
  --text-soft: #5f6675;
  --muted: #8b93a4;
  --line: #e4e7ee;
  --line-strong: #d5dae5;
  --shadow: 0 6px 20px rgba(24, 30, 45, .06);
  --glass-blur: 0px;
}

[data-skin="douyin-light"][data-theme="light"] body {
  background:
    radial-gradient(circle at 72% -18%, rgba(254, 44, 85, .045), transparent 36%),
    var(--bg);
}

[data-skin="douyin-light"][data-theme="light"] button:focus-visible,
[data-skin="douyin-light"][data-theme="light"] input:focus-visible,
[data-skin="douyin-light"][data-theme="light"] select:focus-visible {
  outline-color: rgba(var(--brand-rgb), .9);
}

[data-skin="douyin-light"][data-theme="light"] .sidebar {
  background: #fff;
  border-right-color: var(--line);
  box-shadow: 8px 0 24px rgba(24, 30, 45, .035);
}

[data-skin="douyin-light"][data-theme="light"] .rail {
  background: #f8f9fc;
  border-right-color: var(--line);
}

[data-skin="douyin-light"][data-theme="light"] .nav-label { color: var(--muted); }

[data-skin="douyin-light"][data-theme="light"] .nav-item:hover,
[data-skin="douyin-light"][data-theme="light"] .rail-btn:hover,
[data-skin="douyin-light"][data-theme="light"] .icon-btn:hover {
  color: var(--text);
  background: #fafbfd;
}

[data-skin="douyin-light"][data-theme="light"] .nav-item.active,
[data-skin="douyin-light"][data-theme="light"] .rail-btn.active {
  color: var(--brand);
  background: #fff0f3;
}

[data-skin="douyin-light"][data-theme="light"] .topbar {
  background: rgba(255, 255, 255, .98);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(24, 30, 45, .02);
}

[data-skin="douyin-light"][data-theme="light"] .tabs-wrap {
  background: rgba(246, 247, 250, .98);
}

[data-skin="douyin-light"][data-theme="light"] .search-trigger,
[data-skin="douyin-light"][data-theme="light"] .field-control,
[data-skin="douyin-light"][data-theme="light"] .btn,
[data-skin="douyin-light"][data-theme="light"] .choice,
[data-skin="douyin-light"][data-theme="light"] .palette {
  background: #fff;
}

[data-skin="douyin-light"][data-theme="light"] .btn.primary {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 8px 22px rgba(var(--brand-rgb), .18);
}

[data-skin="douyin-light"][data-theme="light"] .btn.primary:hover {
  color: #fff;
  border-color: #ff4a6d;
  background: #ff365f;
  box-shadow: 0 10px 28px rgba(var(--brand-rgb), .24);
}

[data-skin="douyin-light"][data-theme="light"] .btn.primary:active {
  color: #fff;
  background: #e9244b;
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), .16);
}

[data-skin="douyin-light"][data-theme="light"] .search-trigger kbd {
  color: var(--text-soft);
  background: var(--bg-deep);
}

[data-skin="douyin-light"][data-theme="light"] .tab.active,
[data-skin="douyin-light"][data-theme="light"] .btn.is-active,
[data-skin="douyin-light"][data-theme="light"] .choice.active,
[data-skin="douyin-light"][data-theme="light"] .palette.active {
  color: var(--brand);
  border-color: #ffd0da;
  background: #fff0f3;
}

[data-skin="douyin-light"][data-theme="light"] .source-notice {
  color: #765215;
  border-color: #f0d5a4;
  background: #fff9ef;
}

[data-skin="douyin-light"][data-theme="light"] .source-notice b,
[data-skin="douyin-light"][data-theme="light"] .source-tag.demo,
[data-skin="douyin-light"][data-theme="light"] .severity { color: var(--accent); }

[data-skin="douyin-light"][data-theme="light"] .filter-bar,
[data-skin="douyin-light"][data-theme="light"] .card {
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

[data-skin="douyin-light"][data-theme="light"] .card {
  transition: transform .18s var(--ease), border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

[data-skin="douyin-light"][data-theme="light"] .card:hover {
  border-color: #d8dde8;
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(24, 30, 45, .09);
}

[data-skin="douyin-light"][data-theme="light"] .table-card:hover {
  transform: none;
  box-shadow: var(--shadow);
}

[data-skin="douyin-light"][data-theme="light"] .vip-kpi-grid .kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(24, 30, 45, .09);
}

[data-skin="douyin-light"][data-theme="light"] .segmented,
[data-skin="douyin-light"][data-theme="light"] .reward-track {
  background: var(--bg-deep);
}

[data-skin="douyin-light"][data-theme="light"] .trend-line { stroke: var(--brand); }
[data-skin="douyin-light"][data-theme="light"] .chart-dot { stroke: var(--brand); }

[data-skin="douyin-light"][data-theme="light"] .pill,
[data-skin="douyin-light"][data-theme="light"] .source-tag.sheet {
  color: var(--cyan-ink);
  border-color: rgba(37, 217, 222, .34);
  background: #eafafb;
}

[data-skin="douyin-light"][data-theme="light"] .pill::before { background: var(--cyan-ink); }

[data-skin="douyin-light"][data-theme="light"] th {
  color: var(--text-soft);
  background: #f4f5f8;
  border-bottom-color: var(--line-strong);
}

[data-skin="douyin-light"][data-theme="light"] td {
  color: var(--text-soft);
  background: #fff;
  border-bottom-color: var(--line);
}

[data-skin="douyin-light"][data-theme="light"] tbody tr:hover { background: #fafbfd; }
[data-skin="douyin-light"][data-theme="light"] tbody tr:hover td { background: #fafbfd; }

[data-skin="douyin-light"][data-theme="light"] tbody tr.is-selected,
[data-skin="douyin-light"][data-theme="light"] tbody tr.is-selected td { background: #fff0f3; }

[data-skin="douyin-light"][data-theme="light"] .table-foot { background: #fafbfd; }

[data-skin="douyin-light"][data-theme="light"] .drawer-backdrop,
[data-skin="douyin-light"][data-theme="light"] .modal-backdrop {
  background: rgba(23, 24, 28, .28);
  backdrop-filter: none;
}

[data-skin="douyin-light"][data-theme="light"] .drawer,
[data-skin="douyin-light"][data-theme="light"] .search-modal,
[data-skin="douyin-light"][data-theme="light"] .ai-panel {
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: 0 20px 60px rgba(24, 30, 45, .16);
}

[data-skin="douyin-light"][data-theme="light"] .bubble { background: #f6f7fa; }

[data-skin="douyin-light"][data-theme="light"] .bubble.user {
  color: var(--brand);
  border-color: #ffd0da;
  background: #fff0f3;
}

[data-skin="douyin-light"][data-theme="light"] .toast {
  color: var(--text);
  border-color: #ffd0da;
  background: #fff;
  box-shadow: 0 14px 38px rgba(24, 30, 45, .14);
}

[data-skin="douyin-light"][data-theme="light"] .mobile-bottom-nav {
  background: rgba(255, 255, 255, .98);
  border-top-color: var(--line);
  box-shadow: 0 -8px 24px rgba(24, 30, 45, .06);
}

@media (max-width: 520px) {
  [data-skin="douyin-light"][data-theme="light"] #detail-drawer .drill-table tr {
    background: #fff;
    box-shadow: var(--shadow);
  }
}

/* v28 · 双风格融合：界面设置中的明亮 / 深色手动切换器。 */
.theme-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.theme-style-card {
  position: relative;
  min-width: 0;
  padding: 9px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s var(--ease);
}

.theme-style-card:hover {
  color: var(--text);
  border-color: rgba(var(--brand-rgb), .34);
  transform: translateY(-1px);
}

.theme-style-card.active {
  color: var(--text);
  border-color: rgba(var(--brand-rgb), .72);
  background: rgba(var(--brand-rgb), .055);
  box-shadow: 0 0 0 2px rgba(var(--brand-rgb), .09), 0 9px 24px rgba(var(--brand-rgb), .08);
}

.theme-style-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.theme-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 62px;
  margin-bottom: 9px;
  overflow: hidden;
  border: 1px solid rgba(105, 115, 138, .22);
  border-radius: 7px;
}

.theme-preview i {
  position: absolute;
  display: block;
}

.theme-preview-light { background: #f6f7fa; }
.theme-preview-dark { background: #07080d; }

.theme-preview .preview-rail {
  inset: 0 auto 0 0;
  width: 16px;
  border-right: 1px solid rgba(105, 115, 138, .16);
}

.theme-preview-light .preview-rail { background: #fff; }
.theme-preview-dark .preview-rail { background: #0b0c12; }

.theme-preview .preview-head {
  left: 22px;
  right: 6px;
  top: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--brand);
  opacity: .92;
}

.theme-preview .preview-card {
  top: 21px;
  bottom: 7px;
  border-radius: 4px;
}

.theme-preview .preview-card-a { left: 22px; width: calc(46% - 14px); }
.theme-preview .preview-card-b { right: 6px; width: calc(54% - 14px); }
.theme-preview-light .preview-card { background: #fff; border: 1px solid #e4e7ee; box-shadow: 0 3px 8px rgba(24,30,45,.05); }
.theme-preview-dark .preview-card { background: #151822; border: 1px solid rgba(164,176,207,.2); }
.theme-preview-dark .preview-card-b::after,
.theme-preview-light .preview-card-b::after {
  content: '';
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  height: 3px;
  border-radius: 999px;
  background: var(--cyan);
}

.theme-style-copy { display: block; padding-right: 20px; }
.theme-style-copy b { display: block; color: var(--text); font-size: 13px; font-weight: 800; }
.theme-style-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.theme-style-check {
  position: absolute;
  right: 10px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  color: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}

.theme-style-card.active .theme-style-check {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

html.theme-switching body,
html.theme-switching .sidebar,
html.theme-switching .rail,
html.theme-switching .topbar,
html.theme-switching .tabs-wrap,
html.theme-switching .card,
html.theme-switching .filter-bar,
html.theme-switching .drawer,
html.theme-switching .theme-style-card,
html.theme-switching .field-control,
html.theme-switching .btn {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

@media (max-width: 380px) {
  .theme-style-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-style-card,
  html.theme-switching body,
  html.theme-switching .sidebar,
  html.theme-switching .card { transition: none !important; }
}

/* Daily Surprise activity: shared VIP shell with source-only comparison views. */
.tab { text-decoration: none; }
.daily-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.daily-comparison {
  min-height: 292px;
  padding: 26px 20px;
  display: grid;
  align-content: center;
  gap: 24px;
}
.daily-compare-row { display: grid; gap: 9px; }
.daily-compare-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.daily-compare-row b { color: var(--text); font-size: 15px; }
.daily-compare-row span { color: var(--cyan-ink); font-size: 14px; font-weight: 700; }
.daily-compare-fill {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: 6px;
  background: var(--cyan);
  transform-origin: left center;
  animation: vip-reward-grow 620ms cubic-bezier(.16, 1, .3, 1) calc(100ms + var(--bar-index) * 65ms) both;
}
.daily-detail-table table { min-width: 2380px; }
.daily-detail-table th,
.daily-detail-table td { min-width: 176px; }
.daily-detail-table th:first-child,
.daily-detail-table td:first-child { min-width: 156px; }
.daily-detail-table th:nth-child(2),
.daily-detail-table td:nth-child(2) { min-width: 126px; }
#detail-drawer .daily-drill-table { min-width: 1280px; table-layout: fixed; }
#detail-drawer .daily-drill-table th,
#detail-drawer .daily-drill-table td { min-width: 112px; }
#detail-drawer .daily-drill-table th:first-child,
#detail-drawer .daily-drill-table td:first-child { min-width: 168px; }

/* V31 club page */
.club-detail-head { align-items: center; flex-wrap: wrap; gap: 12px; }
.club-detail-switcher { margin-left: auto; }
.club-inviter-link { white-space: nowrap; }
.club-summary-table .table-wrap,
.daily-detail-table .table-wrap { scrollbar-color: rgba(var(--brand-rgb), .55) transparent; }

@media (max-width: 760px) {
  .club-detail-head { align-items: stretch; }
  .club-detail-switcher { width: 100%; margin-left: 0; overflow-x: auto; }
  .club-detail-switcher .seg-btn { flex: 1 0 auto; }
}

/* V43 shared activity pages */
.collection-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.collection-kpi-grid .kpi-value { color: var(--kpi-color, var(--text)); }
@media (max-width: 1320px) {
  .mystery-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .mystery-kpi-grid .kpi-value { font-size: 24px; }
  .mystery-kpi-grid .kpi:nth-child(3) .kpi-value { font-size: 18px; }
}

/* Phone binding follows the collection page's compact six-card scan rhythm. */
.phone-binding-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.phone-binding-kpi-grid .kpi {
  min-width: 0;
  min-height: 148px;
  overflow: hidden;
}
.phone-binding-kpi-grid .kpi-value {
  color: var(--kpi-color, var(--text));
}
.phone-binding-kpi-grid .kpi[data-provenance="virtual"] {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--kpi-color) 9%, transparent), transparent 58%),
    var(--panel);
  border-style: dashed;
}
.phone-binding-kpi-grid .delta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.virtual-tag,
.cell-virtual,
.virtual-pill {
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-radius: 999px;
  font-style: normal;
  font-size: 10px;
  line-height: 1;
  padding: 4px 7px;
  white-space: nowrap;
}
.cell-virtual {
  display: inline-flex;
  margin-left: 7px;
  vertical-align: middle;
}

@media (max-width: 1180px) {
  .phone-binding-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .phone-binding-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .phone-binding-kpi-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .phone-binding-kpi-grid .kpi {
    flex: 0 0 calc(100vw - 42px);
    scroll-snap-align: start;
  }
}
.tournament-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tournament-kpi-grid .kpi {
  min-width: 0;
  min-height: 154px;
  padding: 16px;
}
.tournament-kpi-grid .kpi-label { line-height: 1.3; }
.tournament-kpi-grid .kpi-value { font-size: clamp(20px, 1.35vw, 28px); }
.tournament-kpi-grid .delta {
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tournament-kpi-grid .delta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tournament-kpi-grid .virtual-data-tag { flex: 0 0 auto; padding-inline: 6px; font-size: 9px; }
.collection-channel-chart { display: grid; gap: 11px; padding: 6px 0; }
.collection-channel-row { display: grid; grid-template-columns: 90px minmax(120px, 1fr) 42px; gap: 12px; align-items: center; }
.collection-channel-row > span { color: var(--muted); font-size: 12px; }
.collection-channel-row > b { text-align: right; font-size: 13px; }
.collection-card-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; min-height: 220px; align-items: end; }
.collection-card { position: relative; display: grid; place-items: center; min-height: 210px; padding: 16px 8px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(var(--brand-rgb), .035); }
.collection-card > span { align-self: start; color: var(--muted); font-size: 12px; font-weight: 800; }
.collection-card > b { position: relative; z-index: 1; color: var(--text); font-size: 24px; }
.collection-card > i { position: absolute; inset: auto 12px 12px; height: var(--h); max-height: 118px; border-radius: calc(var(--radius) - 3px); background: linear-gradient(180deg, rgba(var(--brand-rgb), .78), rgba(var(--brand-rgb), .18)); opacity: .74; transform-origin: bottom; animation: grow-bar .7s var(--ease) both; animation-delay: calc(var(--card-index) * 70ms); }
#detail-drawer .collection-drill-table { min-width: max-content; width: max-content; table-layout: auto; }
#detail-drawer .collection-drill-table th,
#detail-drawer .collection-drill-table td { width: max-content; min-width: max-content; white-space: nowrap; }
#detail-drawer .collection-drill-table th:first-child,
#detail-drawer .collection-drill-table td:first-child { min-width: max-content; }
#detail-drawer .collection-drill-table thead th > span { display: block; color: var(--text); font-weight: 800; }
#detail-drawer .collection-drill-table thead th > small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; }
#detail-drawer .collection-drill-table thead th[data-format="money"] > small,
#detail-drawer .collection-drill-table thead th[data-format="signed"] > small { color: var(--brand); }
#detail-drawer .drill-table-wrap { scrollbar-color: rgba(var(--brand-rgb), .72) var(--surface); scrollbar-width: thin; }
#detail-drawer .drill-table-wrap::-webkit-scrollbar { height: 10px; }
#detail-drawer .drill-table-wrap::-webkit-scrollbar-thumb { border: 2px solid var(--surface); border-radius: 999px; background: rgba(var(--brand-rgb), .72); }
.field-scroll-hint { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* V39 fortune tree page */
.fortune-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fortune-grid { grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); }
.fortune-level-chart { display: grid; gap: 13px; padding: 8px 0; }
.fortune-level-row { display: grid; grid-template-columns: 44px minmax(160px, 1fr) 52px 56px; gap: 10px; align-items: center; color: var(--muted); opacity: .48; transition: .2s ease; }
.fortune-level-row.active { color: var(--text); opacity: 1; }
.fortune-level-row b { color: var(--brand); font: 700 12px "DM Mono", monospace; }
.fortune-level-row span,.fortune-level-row small { text-align: right; font: 12px "DM Mono", monospace; }
.fortune-level-row .reward-track { height: 11px; overflow: hidden; border-radius: 999px; background: rgba(var(--brand-rgb),.08); }
.fortune-level-row .reward-track i { display: block; width: var(--w); height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand),var(--cyan)); }
.fortune-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); align-items: end; min-height: 190px; gap: 10px; padding: 16px 4px 4px; }
.fortune-action { position: relative; display: grid; align-content: end; min-height: 160px; overflow: hidden; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(var(--brand-rgb),.035); }
.fortune-action span,.fortune-action b { position: relative; z-index: 1; }
.fortune-action span { color: var(--muted); font-size: 11px; }
.fortune-action b { margin-top: 6px; font: 700 17px "DM Mono", monospace; }
.fortune-action > i { position: absolute; inset: auto 8px 8px; height: var(--h); border-radius: 7px; background: linear-gradient(180deg,rgba(var(--brand-rgb),.78),rgba(var(--brand-rgb),.16)); opacity: .72; }
.fortune-detail-table .table-wrap,.fortune-coupon-table .table-wrap { overflow-x: auto; }
.fortune-detail-table table { min-width: 3250px; }
.fortune-coupon-table table { min-width: 1150px; }
.fortune-detail-table th,.fortune-detail-table td,.fortune-coupon-table th,.fortune-coupon-table td { white-space: nowrap; }
.fortune-sort { border:0; background:transparent; color:inherit; cursor:pointer; font-weight:800; white-space:nowrap; }
.fortune-drill-table { min-width: 2800px; }

#detail-drawer .empty-state {
  padding: 26px !important;
  color: var(--muted) !important;
  text-align: center !important;
}
@media (max-width: 1180px) { .collection-kpi-grid, .tournament-kpi-grid, .fortune-kpis { grid-template-columns: repeat(3,minmax(0,1fr)); } .fortune-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .collection-kpi-grid, .tournament-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .collection-kpi-grid .kpi:last-child { grid-column: auto; } }
@media (max-width: 520px) { .collection-kpi-grid, .fortune-kpis { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); } .fortune-level-row { grid-template-columns: 36px minmax(90px,1fr) 45px 52px; gap:7px; } .fortune-action-grid { gap:6px; } .fortune-action { padding:8px 5px; } .fortune-action b { font-size:13px; } .fortune-detail-table table,.fortune-coupon-table table,.fortune-drill-table { min-width:0; } }

/* V58 · 破产亏损参考集卡页面的统一卡片与穿透体验 */
.bankruptcy-shell { --bankruptcy-accent: #ef4764; }
.bankruptcy-shell .eyebrow,
.bankruptcy-shell .kpi.is-virtual .kpi-value,
.bankruptcy-shell .virtual-cell { color: var(--bankruptcy-accent); }
.bankruptcy-shell .status-dot { background: var(--bankruptcy-accent); box-shadow: 0 0 0 6px rgba(239,71,100,.12); }
.bankruptcy-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bankruptcy-kpi-grid .kpi {
  min-width: 0;
  min-height: 150px;
  overflow: hidden;
  border-color: var(--line);
}
.bankruptcy-kpi-grid .kpi.is-virtual::before {
  display: none;
}
.bankruptcy-kpi-grid .kpi:hover { border-color: var(--line-strong); }
.bankruptcy-kpi-grid .kpi-value { font-size: clamp(20px, 1.45vw, 28px); }
.bankruptcy-kpi-grid .delta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.virtual-dot {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--bankruptcy-accent);
  background: rgba(239,71,100,.1);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}
.bankruptcy-overview { grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); }
.bankruptcy-status-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 14px; }
.bankruptcy-status {
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(239,71,100,.16);
  border-radius: calc(var(--radius) - 2px);
  background: linear-gradient(145deg, rgba(239,71,100,.08), rgba(239,71,100,.015));
}
.bankruptcy-status span,
.bankruptcy-status small { display: block; color: var(--muted); font-size: 12px; }
.bankruptcy-status b { display: block; margin: 12px 0 8px; color: var(--text); font-family: var(--mono); font-size: clamp(18px,1.5vw,25px); }
.bankruptcy-status small { color: var(--bankruptcy-accent); font-weight: 800; }
.table-virtual-mark {
  display: inline-flex;
  margin-inline-start: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--bankruptcy-accent);
  background: rgba(239,71,100,.1);
  font-size: 9px;
  font-weight: 800;
  vertical-align: middle;
}
.bankruptcy-detail-table .metric-drill { color: var(--cyan); }
.bankruptcy-drill-table { min-width: 1180px; }
.filter-bar.is-collapsed { display: none; }
@media (max-width: 1180px) {
  .bankruptcy-kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .bankruptcy-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bankruptcy-overview { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .bankruptcy-kpi-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bankruptcy-kpi-grid .kpi { min-height: 138px; padding: 14px; }
  .bankruptcy-status-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .collection-channel-row { grid-template-columns: 78px minmax(80px, 1fr) 36px; gap: 8px; }
  .collection-card-grid { min-height: 160px; gap: 6px; }
  .collection-card { min-height: 154px; padding: 12px 4px; }
  .collection-card > b { font-size: 18px; }
  .collection-card > i { inset-inline: 6px; bottom: 6px; max-height: 86px; }
}

@media (max-width: 520px) {
  #detail-drawer .collection-drill-table { min-width: 0; }
}

/* VIP keeps the six-card collection composition with a tighter type scale. */
.vip-compact-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.vip-compact-kpi-grid .kpi {
  min-height: 154px;
  padding: 16px;
}
.vip-compact-kpi-grid .kpi-top {
  font-size: clamp(13px, .82vw, 16px);
}
.vip-compact-kpi-grid .kpi-value {
  margin-block: 14px 9px;
  font-size: clamp(20px, 1.25vw, 26px);
  line-height: 1.18;
}
.vip-compact-kpi-grid .kpi-pair .kpi-value {
  white-space: normal;
}
.vip-compact-kpi-grid .delta {
  align-items: flex-end;
  gap: 6px;
  font-size: 11px;
  line-height: 1.45;
}
.vip-compact-kpi-grid .delta span {
  min-width: 0;
}
.vip-compact-kpi-grid .kpi-drill {
  flex: 0 0 auto;
  padding: 4px 6px;
  font-size: 10px;
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .vip-compact-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .vip-compact-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Channel conversion follows the collection page's compact six-card summary. */
.channel-conversion-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.channel-conversion-kpi-grid .kpi {
  min-width: 0;
  min-height: 154px;
  padding: 16px;
}
.channel-conversion-kpi-grid .kpi-label {
  line-height: 1.3;
}
.channel-conversion-kpi-grid .kpi-value {
  color: var(--kpi-color, var(--text));
  font-size: clamp(20px, 1.35vw, 28px);
}
.channel-conversion-kpi-grid .delta {
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.channel-conversion-kpi-grid .delta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-conversion-kpi-grid .virtual-data-tag {
  flex: 0 0 auto;
  padding-inline: 6px;
  font-size: 9px;
}
.virtual-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.virtual-inline small {
  padding: 2px 6px;
  border: 1px solid rgba(37, 217, 222, .28);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(37, 217, 222, .08);
  font-size: 9px;
  font-weight: 800;
}
@media (max-width: 1180px) {
  .channel-conversion-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .channel-conversion-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .daily-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .daily-kpi-grid { display: flex; }
  .daily-kpi-grid .kpi { flex: 0 0 calc(100vw - 42px); }
  .daily-comparison { min-height: 0; padding: 20px 16px; gap: 20px; }
  .daily-detail-table table,
  .daily-detail-table th:nth-child(n),
  .daily-detail-table td:nth-child(n) { min-width: 0; }
  #detail-drawer .daily-drill-table { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .daily-compare-fill { animation: none; transform: scaleX(1); }
}

/* V57: desktop tables size every column by its actual header and cell content. */
@media (min-width: 761px) {
  .table-card .table-wrap {
    overflow-x: auto;
  }

  .table-card .table-wrap > table {
    width: max-content;
    min-width: 0 !important;
    table-layout: auto;
  }

  .table-card .table-wrap > table th,
  .table-card .table-wrap > table td {
    width: max-content !important;
    min-width: 0 !important;
  }

  #detail-drawer .drill-table-wrap {
    overflow-x: auto;
  }

  #detail-drawer .drill-table {
    width: max-content;
    min-width: 0 !important;
    table-layout: auto;
  }

  #detail-drawer .drill-table th,
  #detail-drawer .drill-table td {
    width: max-content !important;
    min-width: 0 !important;
    overflow: visible;
    text-overflow: clip;
  }

  .table-card .table-wrap .sortable-head,
  #detail-drawer .drill-table .sortable-head {
    white-space: nowrap;
  }
}

/* V58: shared activity directory. */
.directory-page-head { padding-bottom: 18px; }
.directory-summary {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 22px 24px;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}
.directory-summary::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -62px;
  top: -72px;
  border: 1px solid rgba(var(--brand-rgb), .2);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(var(--brand-rgb), .035), 0 0 0 46px rgba(var(--brand-rgb), .022);
  pointer-events: none;
}
.directory-summary > div { position: relative; z-index: 1; }
.directory-summary span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.directory-summary b { display: block; margin-top: 4px; color: var(--brand); font-size: 46px; line-height: 1; letter-spacing: -.06em; }
.directory-summary p { position: relative; z-index: 1; max-width: 660px; margin: 0; color: var(--text-soft); font-size: 15px; line-height: 1.7; }
.directory-card { overflow: hidden; }
.directory-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.directory-list > li + li { border-top: 1px solid var(--line); }
.directory-link {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 14px 24px;
  color: inherit;
  text-decoration: none;
  transition: background .2s ease, padding .2s ease;
}
.directory-link:hover { padding-inline: 28px 20px; background: rgba(var(--brand-rgb), .07); }
.directory-link:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
.directory-index { color: var(--brand); font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.directory-copy { min-width: 0; }
.directory-copy b, .directory-copy small { display: block; }
.directory-copy b { color: var(--text); font-size: 16px; line-height: 1.35; }
.directory-copy small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.directory-open { display: inline-flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 13px; font-weight: 700; white-space: nowrap; }
.directory-open i { color: var(--brand); font-size: 18px; font-style: normal; transition: transform .2s ease; }
.directory-link:hover .directory-open { color: var(--brand); }
.directory-link:hover .directory-open i { transform: translateX(3px); }
@media (max-width: 760px) {
  .directory-summary { grid-template-columns: 1fr; gap: 12px; padding: 20px; }
  .directory-summary b { font-size: 40px; }
  .directory-summary p { font-size: 13px; }
  .directory-link { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; min-height: 72px; padding: 13px 16px; }
  .directory-link:hover { padding-inline: 16px; }
  .directory-open { grid-column: 2; justify-self: start; margin-top: -4px; font-size: 12px; }
}
