/* =========================================================
   奥洛数智 · 自媒体数据监测与获客系统
   深色数据驾驶舱主题 / 动效看板
   ========================================================= */
:root {
    --bg: #060a12;
    --bg-soft: #0b1220;
    --panel: rgba(16, 24, 39, 0.66);
    --panel-solid: #101828;
    --line: rgba(148, 163, 184, 0.14);
    --line-strong: rgba(148, 163, 184, 0.26);
    --text: #e8eefb;
    --muted: #8a99b1;
    --dim: #5f6f88;
    --cyan: #22d3ee;
    --blue: #4f7cff;
    --violet: #a78bfa;
    --pink: #f472b6;
    --green: #34d399;
    --amber: #fbbf24;
    --red: #f87171;
    --radius: 16px;
    --shadow: 0 18px 40px -22px rgba(2, 8, 20, 0.9);
    --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- 背景特效 ---------- */
.bg-fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: float 18s ease-in-out infinite;
}
.orb-1 { width: 520px; height: 520px; top: -180px; left: -120px; background: radial-gradient(circle, rgba(34, 211, 238, 0.42), transparent 70%); }
.orb-2 { width: 620px; height: 620px; top: 12%; right: -220px; background: radial-gradient(circle, rgba(124, 92, 255, 0.34), transparent 70%); animation-delay: -6s; }
.orb-3 { width: 480px; height: 480px; bottom: -200px; left: 32%; background: radial-gradient(circle, rgba(244, 114, 182, 0.22), transparent 70%); animation-delay: -12s; }

.grid-layer {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 78%);
}

@keyframes float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(24px, 34px, 0) scale(1.08); }
}

/* ---------- 布局 ---------- */
.app { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.sidebar {
    position: sticky; top: 0;
    width: 232px; flex: 0 0 232px;
    height: 100vh;
    padding: 24px 16px 20px;
    display: flex; flex-direction: column;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.94), rgba(6, 10, 18, 0.78));
    backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 26px; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.18), rgba(167, 139, 250, 0.2));
    border: 1px solid rgba(34, 211, 238, 0.28);
    box-shadow: 0 0 22px -8px rgba(34, 211, 238, 0.7);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; letter-spacing: 0.06em; }
.brand-text span { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; color: var(--dim); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 13.5px;
    transition: color 0.22s, background 0.22s, transform 0.22s;
}
.nav-item svg { width: 19px; height: 19px; flex: 0 0 19px; }
.nav-item:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); transform: translateX(2px); }
.nav-item.is-active {
    color: #fff;
    background: linear-gradient(100deg, rgba(34, 211, 238, 0.16), rgba(79, 124, 255, 0.08) 55%, transparent);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.18);
}
.nav-item.is-active::before {
    content: ""; position: absolute; left: 0; top: 22%; bottom: 22%;
    width: 3px; border-radius: 4px;
    background: linear-gradient(180deg, var(--cyan), var(--violet));
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
}

.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.collect-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); animation: pulse 2.2s infinite; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
    70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.version { margin-top: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--dim); }

.logout-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; margin-top: 10px; padding: 7px 11px;
    border: 1px solid var(--line); border-radius: 9px;
    background: rgba(148, 163, 184, 0.08); color: var(--muted);
    font-size: 12px; transition: all 0.22s;
}
.logout-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(148, 163, 184, 0.14); }
.logout-btn[hidden] { display: none; }
.logout-btn span { color: var(--cyan); font-family: var(--mono); font-size: 11px; }

.main { flex: 1; min-width: 0; padding: 22px 30px 70px; }

/* ---------- 顶栏 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-heading h1 { font-size: 22px; font-weight: 600; letter-spacing: 0.01em; }
.page-heading p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.icon-btn {
    width: 38px; height: 38px; display: none; place-items: center;
    border-radius: 10px; border: 1px solid var(--line);
    background: rgba(148, 163, 184, 0.08); color: var(--text);
}
.icon-btn svg { width: 20px; height: 20px; }

.range-switch {
    display: flex; padding: 3px; gap: 2px;
    border: 1px solid var(--line); border-radius: 11px;
    background: rgba(11, 18, 32, 0.7);
}
.range-switch button {
    padding: 6px 13px; border: 0; border-radius: 8px;
    background: transparent; color: var(--muted); font-size: 12.5px;
    transition: all 0.22s;
}
.range-switch button:hover { color: var(--text); }
.range-switch button.is-active {
    color: #04121a;
    background: linear-gradient(120deg, #22d3ee, #67e8f9);
    font-weight: 600;
    box-shadow: 0 4px 16px -6px rgba(34, 211, 238, 0.9);
}

.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 15px; border-radius: 10px;
    font-size: 13px; border: 1px solid transparent;
    transition: all 0.22s;
}
.btn svg { width: 16px; height: 16px; }
.btn-ghost { background: rgba(148, 163, 184, 0.08); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: rgba(34, 211, 238, 0.42); color: var(--cyan); background: rgba(34, 211, 238, 0.08); }
.btn-primary {
    background: linear-gradient(120deg, #22d3ee, #4f7cff);
    color: #03121c; font-weight: 600;
    box-shadow: 0 10px 26px -14px rgba(34, 211, 238, 0.9);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(34, 211, 238, 0.95); }
.btn.is-busy { opacity: 0.6; pointer-events: none; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

/* ---------- 页面容器 ---------- */
.view { display: flex; flex-direction: column; gap: 16px; animation: viewIn 0.45s cubic-bezier(0.22, 0.85, 0.3, 1); }
@keyframes viewIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.demo-banner {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: 12px;
    border: 1px dashed rgba(251, 191, 36, 0.4);
    background: linear-gradient(100deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.02));
    color: #fcd34d; font-size: 12.5px;
}
.demo-banner b { color: #fde68a; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.kpi-card {
    position: relative; overflow: hidden;
    padding: 16px 18px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(160deg, rgba(20, 30, 48, 0.86), rgba(10, 16, 28, 0.72));
    box-shadow: var(--shadow);
    animation: cardIn 0.6s cubic-bezier(0.22, 0.85, 0.3, 1) backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
    transition: transform 0.25s, border-color 0.25s;
}
.kpi-card::after {
    content: ""; position: absolute; inset: -40% 55% 55% -40%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 70%);
    opacity: 0; transition: opacity 0.35s;
    pointer-events: none;
}
.kpi-card:hover { transform: translateY(-3px); border-color: rgba(34, 211, 238, 0.34); }
.kpi-card:hover::after { opacity: 1; }
@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.kpi-head { position: relative; display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12.5px; color: var(--muted); letter-spacing: 0.02em; }
.kpi-delta { font-family: var(--mono); font-size: 11.5px; padding: 2px 7px; border-radius: 6px; }
.kpi-delta.up { color: var(--green); background: rgba(52, 211, 153, 0.1); }
.kpi-delta.down { color: var(--red); background: rgba(248, 113, 113, 0.1); }
.kpi-value {
    position: relative;
    margin: 10px 0 2px;
    font-family: var(--mono);
    font-size: 30px; font-weight: 600; letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(120deg, #ffffff, #9feaf6 70%, #a9c2ff);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kpi-foot { position: relative; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--dim); }
.kpi-unit { padding: 1px 6px; border-radius: 5px; background: rgba(148, 163, 184, 0.1); color: var(--muted); }
.kpi-spark { position: absolute; right: 12px; bottom: 8px; width: 96px; height: 34px; opacity: 0.9; }

/* ---------- 面板 ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }

.panel {
    position: relative;
    padding: 16px 18px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    animation: cardIn 0.6s cubic-bezier(0.22, 0.85, 0.3, 1) backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
    transition: border-color 0.25s;
    min-width: 0;
}
.panel:hover { border-color: var(--line-strong); }

.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-head h3::before {
    content: ""; width: 3px; height: 14px; border-radius: 3px;
    background: linear-gradient(180deg, var(--cyan), var(--blue));
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.7);
}
.panel-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.panel-tag {
    font-family: var(--mono); font-size: 10.5px; color: var(--muted);
    padding: 2px 8px; border-radius: 20px;
    border: 1px solid var(--line); background: rgba(148, 163, 184, 0.06);
    white-space: nowrap;
}

/* ---------- 图表通用 ---------- */
.chart { position: relative; min-height: 120px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis-text { fill: var(--dim); font-size: 10.5px; font-family: var(--mono); }
.grid-line { stroke: rgba(148, 163, 184, 0.1); stroke-width: 1; }
.guide-line { stroke: rgba(34, 211, 238, 0.45); stroke-dasharray: 4 4; stroke-width: 1; opacity: 0; }
.chart-hit { fill: transparent; }
.chart-dot { opacity: 0; transition: opacity 0.2s; }

.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }

.chart-tip {
    position: absolute; z-index: 5; pointer-events: none;
    min-width: 128px; padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    background: rgba(8, 14, 24, 0.94);
    box-shadow: 0 14px 30px -14px #000;
    font-size: 11.5px; color: var(--text);
    opacity: 0; transform: translate(-50%, -108%);
    transition: opacity 0.16s;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip .tip-date { font-family: var(--mono); color: var(--muted); font-size: 10.5px; margin-bottom: 5px; }
.chart-tip .tip-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.chart-tip .tip-row span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.chart-tip .tip-row b { font-family: var(--mono); font-weight: 600; }

/* ---------- 柱状对比 ---------- */
.bars-body { display: flex; align-items: flex-end; gap: 10px; height: 214px; padding-top: 20px; }
.bars-group { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 8px; position: relative; }
.bars-group .bar-label {
    position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
    font-size: 11.5px; color: var(--muted); white-space: nowrap;
}
.bars-wrap { position: relative; padding-bottom: 26px; }
.bar-col { position: relative; width: 26px; height: 100%; display: flex; align-items: flex-end; }
.bar-fill {
    display: block; width: 100%; height: var(--h, 0%);
    border-radius: 7px 7px 3px 3px;
    background: linear-gradient(180deg, var(--c1), var(--c2));
    box-shadow: 0 0 18px -6px var(--c1);
    transition: height 1s cubic-bezier(0.22, 0.9, 0.3, 1);
    position: relative;
}
.bar-fill::after {
    content: ""; position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 45%);
}
.bar-val {
    position: absolute; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--h, 0%) + 6px);
    font-family: var(--mono); font-size: 10.5px; color: var(--muted);
    white-space: nowrap;
    transition: bottom 1s cubic-bezier(0.22, 0.9, 0.3, 1);
}

/* ---------- 漏斗 ---------- */
.funnel { display: flex; flex-direction: column; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: 62px 1fr 66px; align-items: center; gap: 10px; }
.funnel-name { font-size: 12px; color: var(--muted); }
.funnel-lines { display: flex; flex-direction: column; gap: 5px; }
.funnel-line { display: flex; align-items: center; gap: 8px; }
.funnel-fill {
    height: 9px; width: 0; min-width: 4px;
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.22, 0.9, 0.3, 1);
    position: relative;
}
.funnel-fill.organic { background: linear-gradient(90deg, rgba(167, 139, 250, 0.95), rgba(167, 139, 250, 0.4)); box-shadow: 0 0 14px -4px rgba(167, 139, 250, 0.8); }
.funnel-fill.paid { background: linear-gradient(90deg, rgba(34, 211, 238, 0.95), rgba(79, 124, 255, 0.45)); box-shadow: 0 0 14px -4px rgba(34, 211, 238, 0.8); }
.funnel-val { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.funnel-rate { font-family: var(--mono); font-size: 11px; color: var(--text); text-align: right; }
.funnel-rate small { display: block; font-size: 10px; color: var(--dim); }

/* ---------- 雷达 ---------- */
.radar-wrap { display: flex; justify-content: center; }
.radar-svg { width: 100%; max-width: 360px; height: auto; overflow: visible; }
.radar-grid { fill: none; stroke: rgba(148, 163, 184, 0.14); stroke-width: 1; }
.radar-axis { stroke: rgba(148, 163, 184, 0.12); stroke-width: 1; }
.radar-label { fill: var(--muted); font-size: 10.5px; }
.radar-shape {
    stroke-width: 2; stroke-linejoin: round;
    transform-origin: 170px 150px;
    transform: scale(0.25); opacity: 0;
    transition: transform 0.9s cubic-bezier(0.22, 0.9, 0.3, 1), opacity 0.6s;
}
.radar-shape.is-in { transform: scale(1); opacity: 1; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.data-table th {
    text-align: left; font-size: 11.5px; font-weight: 500; color: var(--dim);
    padding: 9px 12px; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid rgba(148, 163, 184, 0.07); font-size: 13px; vertical-align: middle; }
.data-table tbody tr { transition: background 0.2s; }
.data-table tbody tr:hover { background: rgba(34, 211, 238, 0.05); }
.data-table tbody tr:last-child td { border-bottom: 0; }

.account-cell { display: flex; align-items: center; gap: 10px; min-width: 168px; }
.avatar-dot {
    width: 32px; height: 32px; border-radius: 10px; flex: 0 0 32px;
    display: grid; place-items: center;
    font-size: 12.5px; font-weight: 600; color: #04121a;
    background: linear-gradient(140deg, #67e8f9, #818cf8);
}
.account-name { display: flex; flex-direction: column; line-height: 1.35; }
.account-name b { font-weight: 500; font-size: 13px; }
.account-name span { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num.up { color: var(--green); }
.num.down { color: var(--red); }

.platform-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 20px;
    font-size: 11px; border: 1px solid;
    white-space: nowrap;
}
.platform-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
[data-platform="douyin"] { color: #f472b6; border-color: rgba(244, 114, 182, 0.35); background: rgba(244, 114, 182, 0.08); }
[data-platform="xiaohongshu"] { color: #fb7185; border-color: rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.08); }
[data-platform="kuaishou"] { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
[data-platform="shipinhao"] { color: #34d399; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
[data-platform="bilibili"] { color: #60a5fa; border-color: rgba(96, 165, 250, 0.35); background: rgba(96, 165, 250, 0.08); }
[data-platform="weibo"] { color: #f87171; border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }

.role-tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.role-self { color: var(--cyan); background: rgba(34, 211, 238, 0.1); }
.role-peer { color: var(--violet); background: rgba(167, 139, 250, 0.1); }

.spark-cell svg { width: 86px; height: 26px; display: block; }

/* ---------- 搜索 / 热点 ---------- */
.search-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.search-input {
    display: flex; align-items: center; gap: 8px;
    flex: 1; min-width: 260px; max-width: 520px;
    padding: 7px 7px 7px 14px;
    border-radius: 12px; border: 1px solid var(--line);
    background: rgba(11, 18, 32, 0.78);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus-within { border-color: rgba(34, 211, 238, 0.5); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08); }
.search-input svg { width: 17px; height: 17px; color: var(--dim); flex: 0 0 17px; }
.search-input input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    color: var(--text); font-size: 13px;
}
.search-input input::placeholder { color: var(--dim); }
.search-input button {
    border: 0; padding: 7px 16px; border-radius: 9px;
    background: linear-gradient(120deg, #22d3ee, #4f7cff);
    color: #04121a; font-weight: 600; font-size: 12.5px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 5px 13px; border-radius: 20px; font-size: 12px;
    color: var(--muted); border: 1px solid var(--line);
    background: rgba(148, 163, 184, 0.05);
    transition: all 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active { color: #04121a; background: linear-gradient(120deg, #67e8f9, #a5b4fc); border-color: transparent; font-weight: 600; }

.hot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.hot-card {
    position: relative; overflow: hidden;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(160deg, rgba(18, 27, 44, 0.9), rgba(9, 14, 24, 0.8));
    display: flex; flex-direction: column; gap: 10px;
    animation: cardIn 0.5s cubic-bezier(0.22, 0.85, 0.3, 1) backwards;
    animation-delay: calc(var(--i, 0) * 45ms);
    transition: transform 0.25s, border-color 0.25s;
}
.hot-card:hover { transform: translateY(-3px); border-color: rgba(34, 211, 238, 0.35); }
.hot-head { display: flex; align-items: center; justify-content: space-between; }
.hot-score {
    font-family: var(--mono); font-size: 12px; font-weight: 600;
    color: var(--amber);
    padding: 2px 8px; border-radius: 6px;
    background: rgba(251, 191, 36, 0.1);
}
.hot-title { font-size: 13.5px; font-weight: 500; line-height: 1.5; min-height: 41px; }
.hot-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--dim); }
.hot-stats { display: flex; gap: 14px; padding-top: 10px; border-top: 1px solid rgba(148, 163, 184, 0.08); }
.hot-stats div { display: flex; flex-direction: column; line-height: 1.3; }
.hot-stats b { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.hot-stats span { font-size: 10px; color: var(--dim); }
.hot-bar { height: 3px; border-radius: 3px; background: rgba(148, 163, 184, 0.1); overflow: hidden; }
.hot-bar i {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, #22d3ee, #a78bfa);
    transition: width 1s cubic-bezier(0.22, 0.9, 0.3, 1);
}

/* ---------- 线索 ---------- */
.lead-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card {
    padding: 14px 16px; border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
}
.stat-card .stat-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat-card .stat-value { margin-top: 6px; font-family: var(--mono); font-size: 24px; font-weight: 600; }
.stat-card .stat-value small { font-size: 11px; color: var(--dim); margin-left: 4px; font-family: var(--font); }

.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 9px; border-radius: 20px; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-new { color: var(--cyan); background: rgba(34, 211, 238, 0.1); }
.status-following { color: var(--amber); background: rgba(251, 191, 36, 0.1); }
.status-converted { color: var(--green); background: rgba(52, 211, 153, 0.1); }
.status-lost { color: var(--dim); background: rgba(148, 163, 184, 0.1); }

.intent { font-size: 11.5px; font-family: var(--mono); }
.intent-3 { color: var(--pink); }
.intent-2 { color: var(--amber); }
.intent-1 { color: var(--muted); }

select.select-mini {
    appearance: none;
    padding: 4px 26px 4px 10px;
    border-radius: 8px; border: 1px solid var(--line);
    background: rgba(11, 18, 32, 0.8) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238a99b1' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 8px center;
    color: var(--text); font-size: 12px; outline: 0;
}

/* ---------- 洞察列表 ---------- */
.insight-list { display: flex; flex-direction: column; gap: 10px; }
.insight-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 11px 13px; border-radius: 11px;
    background: rgba(148, 163, 184, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.08);
}
.insight-index {
    flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px;
    display: grid; place-items: center;
    font-family: var(--mono); font-size: 11px; font-weight: 600;
    color: var(--cyan); background: rgba(34, 211, 238, 0.1);
}
.insight-item p { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.insight-item p b { color: var(--text); font-weight: 600; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label { font-size: 12px; color: var(--muted); }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: 9px 12px;
    border-radius: 10px; border: 1px solid var(--line);
    background: rgba(8, 13, 23, 0.8);
    color: var(--text); font-size: 13px; font-family: inherit;
    outline: 0; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus, .form-row select:focus { border-color: rgba(34, 211, 238, 0.5); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08); }
.form-hint { font-size: 11px; color: var(--dim); }
.platform-status { display: flex; flex-direction: column; gap: 8px; }
.platform-status-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 10px; background: rgba(148, 163, 184, 0.04); font-size: 12.5px; }
.ok-dot { color: var(--green); font-size: 11.5px; display: inline-flex; align-items: center; gap: 6px; }
.ok-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

/* ---------- 弹窗 / Toast ---------- */
.modal-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.modal-mask {
    position: absolute; inset: 0;
    display: grid; place-items: center; padding: 20px;
    background: rgba(3, 7, 14, 0.68);
    backdrop-filter: blur(6px);
    opacity: 0; transition: opacity 0.25s;
    pointer-events: auto;
    overflow-y: auto;
}
.modal-mask.is-on { opacity: 1; }
.modal {
    width: 100%; max-width: 440px;
    border-radius: 18px; border: 1px solid var(--line-strong);
    background: linear-gradient(165deg, #121c2f, #0a111d);
    box-shadow: 0 40px 80px -30px #000;
    padding: 22px 22px 18px;
    transform: translateY(14px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.modal-mask.is-on .modal { transform: translateY(0) scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 16px; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
    display: flex; align-items: center; gap: 9px;
    padding: 11px 16px; border-radius: 11px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    background: rgba(10, 17, 28, 0.96);
    color: var(--text); font-size: 12.5px;
    box-shadow: 0 20px 40px -20px #000;
    animation: toastIn 0.35s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.toast.is-out { animation: toastOut 0.3s forwards; }
.toast svg { width: 16px; height: 16px; color: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- 骨架 / 空态 ---------- */
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.skeleton {
    height: 106px; border-radius: var(--radius);
    background: linear-gradient(100deg, rgba(148, 163, 184, 0.06) 20%, rgba(148, 163, 184, 0.14) 40%, rgba(148, 163, 184, 0.06) 60%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
}
.skeleton.tall { height: 260px; grid-column: span 2; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -80% 0; } }

.empty { padding: 42px 20px; text-align: center; color: var(--dim); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chart-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
        box-shadow: 30px 0 60px -30px #000;
    }
    .sidebar.is-open { transform: translateX(0); }
    .icon-btn { display: grid; }
    .main { padding: 18px 16px 60px; }
    .topbar { flex-wrap: wrap; }
    .page-heading h1 { font-size: 19px; }
    .lead-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-value { font-size: 25px; }
    .skeleton-grid { grid-template-columns: repeat(2, 1fr); }
    .skeleton.tall { grid-column: span 2; }
}

@media (max-width: 560px) {
    .kpi-grid, .lead-stats { grid-template-columns: 1fr; }
    .topbar-right { width: 100%; justify-content: space-between; }
    .range-switch button { padding: 6px 10px; }
    .hot-grid { grid-template-columns: 1fr; }
    .chart-grid { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 抖音授权绑定 ---------- */
.dy-bind-list { display: grid; gap: 10px; margin-top: 4px; }
.dy-bind-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 13px;
    border: 1px solid var(--line); border-radius: 11px;
    background: rgba(148, 163, 184, 0.05);
}

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
    display: flex; align-items: center; gap: 9px;
    width: 100%; margin-top: 8px; padding: 7px 11px;
    border: 1px solid var(--line); border-radius: 9px;
    background: rgba(148, 163, 184, 0.08); color: var(--muted);
    font-size: 12px; font-family: inherit; cursor: pointer;
    transition: all 0.22s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); background: rgba(148, 163, 184, 0.14); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .theme-ico.moon { display: none; }
html[data-theme="light"] .theme-toggle .theme-ico.sun { display: none; }
html[data-theme="light"] .theme-toggle .theme-ico.moon { display: block; }

/* =========================================================
   亮色（白天）主题
   ========================================================= */
html[data-theme="light"] {
    --bg: #f2f6fb;
    --bg-soft: #e8eef7;
    --panel: rgba(255, 255, 255, 0.84);
    --panel-solid: #ffffff;
    --line: rgba(15, 23, 42, 0.10);
    --line-strong: rgba(15, 23, 42, 0.18);
    --text: #0f172a;
    --muted: #475569;
    --dim: #64748b;
    --cyan: #0891b2;
    --blue: #3b6cf0;
    --violet: #7c3aed;
    --pink: #db2777;
    --green: #059669;
    --amber: #d97706;
    --red: #dc2626;
    --shadow: 0 22px 50px -34px rgba(15, 23, 42, 0.35);
}

html[data-theme="light"] .grid-layer { opacity: 0.55; }
html[data-theme="light"] .orb { opacity: 0.2; }

html[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(238, 244, 252, 0.88));
}
html[data-theme="light"] .nav-item.is-active {
    color: #0e7490;
    box-shadow: inset 0 0 0 1px rgba(8, 145, 178, 0.22);
}
html[data-theme="light"] .nav-item.is-active::before { box-shadow: 0 0 10px rgba(8, 145, 178, 0.35); }

html[data-theme="light"] .kpi-card { background: linear-gradient(160deg, #ffffff, #f1f6fc); }
html[data-theme="light"] .kpi-value {
    background: linear-gradient(120deg, #0f172a, #0e7490 62%, #3b6cf0);
    -webkit-background-clip: text; background-clip: text;
}
html[data-theme="light"] .hot-card { background: linear-gradient(160deg, #ffffff, #f2f7fd); }

html[data-theme="light"] .chart-tip {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(8, 145, 178, 0.25);
    box-shadow: 0 16px 36px -18px rgba(15, 23, 42, 0.35);
}
html[data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(8, 145, 178, 0.25);
    box-shadow: 0 20px 40px -22px rgba(15, 23, 42, 0.35);
}
html[data-theme="light"] .modal {
    background: linear-gradient(165deg, #ffffff, #f4f8fd);
    box-shadow: 0 40px 80px -40px rgba(15, 23, 42, 0.45);
}
html[data-theme="light"] .modal-mask { background: rgba(15, 23, 42, 0.35); }

html[data-theme="light"] .form-row input,
html[data-theme="light"] .form-row select,
html[data-theme="light"] .form-row textarea,
html[data-theme="light"] .search-input,
html[data-theme="light"] .range-switch,
html[data-theme="light"] select.select-mini {
    background-color: #ffffff;
}

html[data-theme="light"] .demo-banner {
    border-color: rgba(217, 119, 6, 0.35);
    background: linear-gradient(100deg, rgba(251, 191, 36, 0.16), rgba(251, 191, 36, 0.04));
}
html[data-theme="light"] .demo-banner b { color: #b45309; }

html[data-theme="light"] .grid-line { stroke: rgba(15, 23, 42, 0.08); }
html[data-theme="light"] .guide-line { stroke: rgba(8, 145, 178, 0.5); }
html[data-theme="light"] .radar-grid { stroke: rgba(15, 23, 42, 0.12); }
html[data-theme="light"] .radar-axis { stroke: rgba(15, 23, 42, 0.1); }
html[data-theme="light"] .legend-dot { box-shadow: none; }
html[data-theme="light"] .nav-item:hover { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .panel-tag { background: rgba(15, 23, 42, 0.04); }
html[data-theme="light"] .data-table td { border-bottom-color: rgba(15, 23, 42, 0.07); }
html[data-theme="light"] .data-table tbody tr:hover { background: rgba(8, 145, 178, 0.06); }
html[data-theme="light"] .dy-bind-item { background: rgba(15, 23, 42, 0.03); }
html[data-theme="light"] .brand-mark { box-shadow: 0 0 18px -10px rgba(8, 145, 178, 0.6); }
html[data-theme="light"] .btn-ghost { background: rgba(15, 23, 42, 0.04); }
html[data-theme="light"] .icon-btn { background: rgba(15, 23, 42, 0.04); }
html[data-theme="light"] .logout-btn,
html[data-theme="light"] .theme-toggle { background: rgba(15, 23, 42, 0.04); }
html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .logout-btn:hover { background: rgba(15, 23, 42, 0.08); }

.dy-bind-main { display: grid; gap: 2px; min-width: 0; }
.dy-bind-main b { font-size: 13px; font-weight: 600; }
.dy-bind-main span {
    font-family: var(--mono); font-size: 10.5px; color: var(--dim);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dy-bind-meta { display: grid; gap: 2px; text-align: right; flex-shrink: 0; font-size: 11px; color: var(--muted); }
#douyinAuth { margin-top: 14px; }

/* ---------- 抖音授权状态 ---------- */
.dy-status-grid { display: grid; gap: 8px; margin: 12px 0 4px; }
.dy-status-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(148, 163, 184, 0.05);
    font-size: 12px;
}
.dy-status-row > span { flex: 0 0 60px; color: var(--muted); }
.dy-status-row code {
    flex: 1; min-width: 0;
    font-family: var(--mono); font-size: 11px; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dy-status-row b { margin-left: auto; font-weight: 600; }
.dy-status-row b.is-ok { color: var(--green); }
.dy-status-row b.is-bad { color: var(--amber); }
.dy-status-row .btn { flex: 0 0 auto; }
.dy-unbind { flex: 0 0 auto; }
.dy-warn {
    margin: 10px 0 0; padding: 9px 11px; border-radius: 9px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.1);
    color: var(--amber); font-size: 12px; line-height: 1.7;
}
html[data-theme="light"] .dy-status-row { background: rgba(15, 23, 42, 0.03); }
