@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; }
.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: hidden;
  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;
}

/* Club list headers: center field labels independently from the sort controls. */
#detail-table-head th {
  min-width: 210px;
  height: 100px;
  padding: 18px 20px;
  vertical-align: middle;
  text-align: center;
}
#detail-table-head th:first-child { min-width: 140px; }
#detail-table-head th:nth-child(2) { min-width: 190px; }
#detail-table-head .sortable-head {
  display: contents;
}
#detail-table-head .sortable-head > span:first-child {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: calc(100% - 80px);
  color: var(--text);
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
  transform: translate(-50%, -50%);
  word-break: normal;
}
#detail-table-head .sort-stack {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
}
.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;
}

/* 集卡活动 v20：与现有活动模块共用 App Shell，仅补充业务可视化和全字段移动端表现。 */
.filter-bar.hidden { display: none; }
.money-card-grid {
  min-height: 245px;
  padding: 22px 20px 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 10px;
  align-items: end;
}
.money-card {
  position: relative;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  overflow: hidden;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(var(--brand-rgb), .035);
}
.money-card i {
  position: absolute;
  inset: auto 6px 6px;
  z-index: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(var(--brand-rgb), .56), rgba(var(--brand-rgb), .12));
  transition: height .35s var(--ease);
}
.money-card span, .money-card b { position: relative; z-index: 1; }
.money-card span { font-size: 22px; font-weight: 800; color: var(--text); }
.money-card b { font: 700 13px/1 var(--mono); color: var(--brand); }
.channel-card { margin-bottom: 12px; }
.channel-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}
.channel-item {
  position: relative;
  min-height: 84px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(var(--brand-rgb), .025);
}
.channel-item small { display: block; color: var(--muted); margin-bottom: 5px; }
.channel-item b { font-size: 20px; color: var(--text); }
.channel-index { color: var(--brand); font: 700 12px/1 var(--mono); }
.channel-item i { position: absolute; left: 0; bottom: 0; width: var(--channel-width); height: 2px; background: var(--brand); }
.card-daily-table { min-width: 2860px; }
.card-user-table { min-width: 2340px; }
.vip-distribution { display: grid; grid-template-columns: repeat(10, minmax(52px, 1fr)); gap: 7px; }
.vip-distribution > div { padding: 10px 6px; text-align: center; border: 1px solid var(--line); border-radius: 9px; background: rgba(var(--brand-rgb), .035); }
.vip-distribution span { display: block; margin-bottom: 5px; color: var(--muted); font: 600 11px/1 var(--mono); }
.vip-distribution b { color: var(--brand); font: 700 16px/1 var(--mono); }

@media (max-width: 1100px) {
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vip-distribution { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .money-card-grid { min-height: auto; grid-template-columns: repeat(5, minmax(48px, 1fr)); padding: 14px; overflow-x: auto; }
  .money-card { min-height: 138px; }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .card-daily-table { min-width: 0; }
  .card-daily-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .card-daily-table tbody, .card-daily-table tr, .card-daily-table td { display: block; width: 100%; }
  .card-daily-table tbody { display: grid; gap: 12px; padding: 12px; }
  .card-daily-table tr { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(var(--brand-rgb), .025); }
  .card-daily-table td { min-height: 38px; display: grid; grid-template-columns: minmax(112px, .9fr) minmax(0, 1.2fr); align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); text-align: right; white-space: normal; }
  .card-daily-table td:last-child { border-bottom: 0; }
  .card-daily-table td::before { content: attr(data-label); color: var(--muted); font-family: var(--font); text-align: left; }
  .card-daily-table .drill-trigger { margin-left: auto; }
  #detail-drawer { width: 100vw; max-width: 100vw; }
  #detail-drawer .detail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .channel-grid { grid-template-columns: 1fr; }
  .channel-item { min-height: 68px; }
  .money-card-grid { gap: 6px; padding-inline: 10px; }
  .money-card { min-height: 122px; padding-inline: 4px; }
  .money-card span { font-size: 18px; }
  .vip-distribution { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 521px) and (max-width: 820px) {
  .card-daily-table { min-width: 2860px; }
  .card-daily-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .card-daily-table tbody { display: table-row-group; padding: 0; }
  .card-daily-table tr { display: table-row; width: auto; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .card-daily-table td { display: table-cell; width: auto; min-height: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
  .card-daily-table td::before { content: none; }
}

/* 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; }
}
