/* 抖音数据监控 — 浅色专业版 */
:root {
    --accent: #fe2c55;
    --accent-dim: rgba(254, 44, 85, 0.08);
    --accent-glow: rgba(254, 44, 85, 0.2);
    --cyan: #14b8a6;
    --success: #10b981;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #eef0f4;
    --bg-elevated: rgba(255, 255, 255, 0.92);
    --card: #ffffff;
    --card-hover: #f9fafb;
    --surface: #f5f6f8;
    --text: #222230;
    --text-secondary: #64646f;
    --text-muted: #9494a0;
    --border: rgba(0, 0, 0, 0.05);
    --border-strong: rgba(0, 0, 0, 0.08);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 4px 14px rgba(15, 23, 42, 0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --font: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    --font-mono: "SF Mono", "Menlo", "Consolas", monospace;
    --font-num: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: linear-gradient(180deg, #f8f9fb 0%, var(--bg) 180px, #e9ecf1 100%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ── 登录 ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-box {
    position: relative;
    z-index: 1;
    background: var(--card);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    padding: 48px 40px;
    border-radius: var(--radius-lg);
    width: 400px;
    max-width: 92vw;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-brand-mark {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-brand-mark svg { width: 20px; height: 20px; fill: #fff; }

.login-brand-text h1 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.login-brand-text p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.login-box label {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.login-box input {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color .15s;
}

.login-box input:focus { border-color: var(--accent); }
.login-box input::placeholder { color: var(--text-secondary); }

.login-box button {
    width: 100%;
    padding: 11px;
    margin-top: 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .15s;
    letter-spacing: 0.02em;
}

.login-box button:hover { opacity: .88; }
.login-error { color: var(--danger); font-size: 12px; margin-top: 14px; }

/* ── 主布局 ── */
.dashboard { display: none; }
.dashboard.active { display: block; min-height: 100vh; }

.header {
    background: var(--bg-elevated);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    padding: 0 28px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-logo svg { width: 16px; height: 16px; fill: #fff; }

.header-left h1 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.header-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.platform-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 4px;
    border-radius: 10px;
    background: #dce0e8;
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.08);
    max-width: 100%;
}

.platform-tab {
    border: none;
    background: transparent;
    color: #7a7f8c;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    padding: 6px 12px;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s var(--ease), background .15s var(--ease), box-shadow .2s var(--ease), transform .1s var(--ease);
}

.platform-tab:hover:not(.active) {
    color: #3d4250;
    background: rgba(255, 255, 255, 0.55);
}

.platform-tab.active {
    color: #fff;
    font-weight: 700;
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18), 0 1px 2px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.platform-tab:active {
    transform: scale(0.97) translateY(0);
}

/* 各平台选中色：实心品牌色底 + 白字，一眼区分当前平台 */
body[data-platform="douyin"] .platform-tab.active {
    background: linear-gradient(180deg, #ff4d6d 0%, #fe2c55 100%);
    box-shadow: 0 3px 12px rgba(254, 44, 85, 0.5), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

body[data-platform="channels"] .platform-tab.active {
    background: linear-gradient(180deg, #1ad975 0%, #07c160 100%);
    box-shadow: 0 3px 12px rgba(7, 193, 96, 0.5), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

body[data-platform="xiaohongshu"] .platform-tab.active {
    background: linear-gradient(180deg, #ff4d6a 0%, #ff2442 100%);
    box-shadow: 0 3px 12px rgba(255, 36, 66, 0.5), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

body[data-platform="kuaishou"] .platform-tab.active {
    background: linear-gradient(180deg, #ff7a1a 0%, #ff6600 100%);
    box-shadow: 0 3px 12px rgba(255, 102, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

body[data-platform="bilibili"] .platform-tab.active {
    background: linear-gradient(180deg, #ff85a8 0%, #fb7299 100%);
    box-shadow: 0 3px 12px rgba(251, 114, 153, 0.5), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

body[data-platform="baijiahao"] .platform-tab.active {
    background: linear-gradient(180deg, #4d8cff 0%, #2932e1 100%);
    box-shadow: 0 3px 12px rgba(41, 50, 225, 0.45), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.header-left .subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
    padding-right: 14px;
    border-right: 1px solid var(--border);
    margin-right: 4px;
}

.header-btn {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12px;
    transition: background .22s var(--ease), border-color .22s var(--ease), color .22s var(--ease), opacity .22s var(--ease);
    letter-spacing: 0.01em;
}

.header-btn:hover {
    border-color: var(--border-strong);
    background: #fff;
    color: var(--text);
}

.header-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.header-btn.primary:hover { opacity: .88; color: #fff; }

.main {
    padding: 28px 28px 32px;
    max-width: 1680px;
    margin: 0 auto;
    position: relative;
}

.main > :not(.dash-load) {
    transition: opacity .42s var(--ease), filter .42s var(--ease);
}

.main.is-loading > :not(.dash-load) {
    opacity: 0.62;
    filter: blur(1.5px);
    pointer-events: none;
    user-select: none;
}

.main.is-ready .dash-section {
    animation: dashSectionIn .55s var(--ease-out) both;
}

.main.is-ready .dash-section:nth-of-type(1) { animation-delay: .04s; }
.main.is-ready .dash-section:nth-of-type(2) { animation-delay: .1s; }
.main.is-ready .dash-section:nth-of-type(3) { animation-delay: .16s; }

.main.is-ready .cold-notice,
.main.is-ready .api-alert {
    animation: dashSectionIn .48s var(--ease-out) both;
    animation-delay: .02s;
}

@keyframes dashSectionIn {
    from { opacity: 0.7; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dash-load {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 96px;
    background: rgba(238, 240, 244, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 1;
    transition: opacity .32s var(--ease);
}

.dash-load.is-leaving {
    opacity: 0;
    pointer-events: none;
}

.dash-load[hidden] {
    display: none !important;
}

.dash-load-inner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text-secondary);
    font-size: 13px;
}

.dash-load-spin {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: dashSpin .65s linear infinite;
    flex-shrink: 0;
}

@keyframes dashSpin {
    to { transform: rotate(360deg); }
}

.header-btn.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

.dash-section {
    margin-bottom: 22px;
}

.dash-section:last-child {
    margin-bottom: 0;
}

.overview-shell {
    padding: 14px 14px 12px;
    margin-bottom: 0;
}

.overview-divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

.overview-shell .stat-card,
.overview-shell .insight-card {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.55);
    border-color: transparent;
}

.overview-shell .stat-card:hover,
.overview-shell .insight-card:hover {
    background: rgba(255, 255, 255, 0.82);
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 28px 28px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.site-footer .footer-sep {
    opacity: 0.5;
}

/* ── API 异常提醒（仅有问题时显示） ── */
.api-alert {
    display: none;
    width: 100%;
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid rgba(254, 44, 85, 0.2);
    border-radius: 8px;
    background: rgba(254, 44, 85, 0.06);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.api-alert:hover {
    background: rgba(254, 44, 85, 0.1);
}

/* ── 断更提示 ── */
.cold-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 14px;
    padding: 8px 14px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .22s var(--ease), border-color .22s var(--ease);
}

.cold-notice:hover {
    border-color: var(--border-strong);
    background: var(--card-hover);
}

.cold-notice[hidden] {
    display: none !important;
}

.cold-notice-label {
    flex-shrink: 0;
    color: var(--text-muted);
    font-weight: 600;
}

.cold-notice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    flex: 1;
    min-width: 0;
}

.cold-notice-item {
    color: var(--text);
}

.cold-notice-item em {
    font-style: normal;
    color: var(--text-muted);
}

/* ── 统计卡片 ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

.top-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 540px);
    gap: 12px;
    align-items: stretch;
    margin-bottom: 0;
}

.top-metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    min-height: 0;
}

.top-side-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 168px;
    gap: 10px;
    min-width: 0;
    min-height: 0;
    align-items: stretch;
}

.quick-tools-card {
    margin-bottom: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px 12px 12px;
    background: var(--card);
}

.quick-tools-title {
    margin-bottom: 10px;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
}

.quick-tools-title .title-with-mark {
    font-size: inherit;
    white-space: nowrap;
}

.quick-tools-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
}

.quick-tool {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    transition: background .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
    font: inherit;
    color: var(--text-secondary);
    text-align: left;
}

.quick-tool:hover {
    background: var(--surface);
    color: var(--text);
    transform: translateX(2px);
}

.quick-tool:active {
    background: rgba(254, 44, 85, 0.06);
}

.quick-tool-svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    opacity: 0.72;
}

.quick-tool:hover .quick-tool-svg {
    opacity: 1;
    color: var(--accent);
}

.quick-tool-label {
    font-size: 12px;
    font-weight: 600;
    color: inherit;
    letter-spacing: 0.01em;
    white-space: nowrap;
    line-height: 1.2;
}

.tool-panel-modal {
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tool-panel-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 16px 0 24px;
    flex-shrink: 0;
}

.tool-panel-modal .modal-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.tool-panel-modal .modal-close:hover {
    color: var(--text);
}

.tool-panel-modal .modal-footer {
    flex-shrink: 0;
}

.tool-panel-body {
    flex: 1;
    min-height: 0;
    max-height: min(60vh, 420px);
    overflow-y: auto;
    padding: 16px 24px 20px;
}

.tool-advice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-advice-item {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.tool-advice-who {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.tool-advice-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text);
    margin: 0;
}

.tool-cold-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-cold-group {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.18);
}

.tool-cold-owner {
    font-size: 13px;
    font-weight: 800;
    color: #b45309;
    margin-bottom: 6px;
}

.tool-cold-acc {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text);
}

.tool-report {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-report-head {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.02em;
    padding-bottom: 4px;
}

.tool-report-section {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.tool-report-section.is-warn {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.22);
}

.tool-report-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tool-report-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.tool-report-metric {
    font-size: 13px;
    color: var(--text-secondary);
}

.tool-report-metric strong {
    font-family: var(--font-num);
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.tool-report-metric.is-up strong {
    color: var(--accent);
}

.tool-report-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 6px;
}

.tool-report-sub {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
}

.tool-report-warn {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    color: #b45309;
}

.tool-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(254, 44, 85, 0.08);
    border: 1px solid rgba(254, 44, 85, 0.16);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}

.tool-tag-count {
    font-size: 10px;
    font-weight: 800;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
}

.owner-board-card {
    margin-bottom: 0;
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px 14px 12px;
}

.owner-board-card .card-title {
    margin-bottom: 10px;
    flex-shrink: 0;
}

.owner-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.owner-table {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.owner-tr {
    display: grid;
    grid-template-columns: minmax(72px, 1.1fr) repeat(5, minmax(36px, 1fr));
    align-items: center;
    gap: 4px 8px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border);
}

.owner-tr:last-child {
    border-bottom: none;
}

.owner-tr.owner-th {
    padding: 0 4px 8px;
    border-bottom: 1px solid var(--border-strong);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.owner-tr.owner-th span:nth-child(n+2) {
    text-align: right;
}

.owner-cell-name {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.owner-cell-name strong {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.owner-cold-mark {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.owner-cell-num {
    font-family: var(--font-num);
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── 右侧悬浮 AI 建议 ── */
.ai-tip-dock {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.ai-tip-tab,
.ai-tip-panel {
    pointer-events: auto;
}

.ai-tip-tab {
    width: 36px;
    height: 72px;
    border: none;
    border-radius: 10px 0 0 10px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.08);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transition: background .15s;
}

.ai-tip-tab:hover {
    background: #e0264c;
}

.ai-tip-panel {
    width: 300px;
    max-width: min(320px, calc(100vw - 48px));
    background: #fff;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 14px 0 0 14px;
    box-shadow: -8px 8px 28px rgba(15, 23, 42, 0.12);
    padding: 12px 14px;
    overflow: hidden;
    transition: width .28s ease, opacity .22s ease, padding .28s ease;
}

.ai-tip-dock:not(.is-open) .ai-tip-panel {
    width: 0;
    opacity: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

.ai-tip-dock.is-open .ai-tip-tab {
    display: none;
}

.ai-tip-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.ai-tip-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.ai-tip-meta {
    font-size: 11px;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-tip-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.ai-tip-bubble {
    background: linear-gradient(135deg, #fff5f7, #f8fafc);
    border: 1px solid rgba(254, 44, 85, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    min-height: 72px;
    animation: aiTipPop .35s ease;
}

.ai-tip-bubble.is-pop {
    animation: aiTipPop .35s ease;
}

@keyframes aiTipPop {
    from { opacity: 0; transform: translateX(12px) scale(0.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.ai-tip-who {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}

.ai-tip-line {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    font-weight: 600;
}

.ai-tip-pager {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .ai-tip-dock {
        top: auto;
        bottom: 16px;
        transform: none;
    }
}

@media (max-width: 1100px) {
    .top-split {
        grid-template-columns: 1fr;
    }

    .top-side-col {
        grid-template-columns: 1fr;
    }
}

.owner-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 3px;
    margin-bottom: 0;
}

.owner-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
}

.owner-tag.cold,
.owner-tag.no_posts { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.owner-tag.low_eng { background: rgba(254, 44, 85, 0.1); color: var(--accent); }
.owner-tag.uneven,
.owner-tag.multi { background: rgba(99, 102, 241, 0.1); color: #4f46e5; }
.owner-tag.stable,
.owner-tag.high_eng { background: rgba(16, 185, 129, 0.1); color: #059669; }

.insights-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

.today-best-card {
    flex: 0 0 auto;
    min-height: 0;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--card);
    border-color: var(--border);
}

.today-best-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
    padding-bottom: 2px;
}

.today-best-head .title-with-mark {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.today-best-body {
    flex: 0 0 auto;
    min-height: 0;
    display: block;
}

.today-best-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px 14px;
    align-items: center;
}

.today-best-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.today-best-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.today-best-title a {
    color: inherit;
    text-decoration: none;
}

.today-best-title a:hover {
    color: var(--accent);
}

.today-best-sub {
    font-size: 10px;
    line-height: 1.4;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today-best-who {
    color: var(--text-secondary);
    font-weight: 500;
}

.today-best-metrics {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    justify-content: flex-end;
}

.today-best-metric {
    text-align: right;
    min-width: 52px;
}

.today-best-metric .lbl {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.today-best-metric .val {
    display: inline-block;
    font-family: var(--font-num);
    font-size: 20px;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.today-best-metric.is-up .val {
    animation: todayBestPop .55s ease;
}

@keyframes todayBestPop {
    0% { transform: translateY(6px); opacity: .35; }
    60% { transform: translateY(-2px); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .today-best-metric.is-up .val,
    .main.is-ready .dash-section,
    .main.is-ready .cold-notice,
    .main.is-ready .api-alert {
        animation: none;
    }

    .main > :not(.dash-load),
    .dash-load,
    .quick-tool,
    .works-rank-row,
    .compare-row,
    .owner-tr,
    .rank-table td,
    .card,
    .header-btn {
        transition: none;
    }

    .quick-tool:hover {
        transform: none;
    }
}

.today-best-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.today-best-actions .btn {
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.learn-modal {
    width: 420px;
}

.learn-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-right: 16px;
}

.learn-modal .modal-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.learn-modal-body {
    padding-top: 12px;
}

.learn-player {
    width: 100%;
    max-height: 70vh;
    border-radius: 10px;
    background: #0f172a;
    display: none;
}

.learn-player.is-ready {
    display: block;
}

.learn-loading {
    font-size: 13px;
    color: var(--text-muted);
    padding: 28px 8px;
    text-align: center;
}

.learn-error {
    margin-top: 10px;
    font-size: 13px;
    color: var(--accent);
}

.learn-open-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--accent);
}

@media (max-width: 900px) {
    .today-best-main {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .today-best-metrics {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .today-best-actions {
        justify-content: flex-start;
    }
}

.insight-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 12px;
    box-shadow: var(--shadow);
}

.insight-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.insight-value {
    font-family: var(--font-num);
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.insight-value.up {
    color: var(--accent);
}

.insight-value.muted {
    color: var(--text-muted);
    font-size: 18px;
}

.insight-sub {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: none;
    border-radius: var(--radius-lg);
    padding: 14px 14px 12px;
    transition: background .25s var(--ease), border-color .25s var(--ease);
}

.stat-card:hover { border-color: var(--border-strong); }

.stat-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

.stat-indicator {
    display: none;
}

.stat-card.plays .stat-indicator { background: #6366f1; }
.stat-card.likes .stat-indicator { background: var(--accent); }
.stat-card.favorites .stat-indicator { background: var(--cyan); }
.stat-card.shares .stat-indicator { background: var(--success); }
.stat-card.comments .stat-indicator { background: var(--warning); }

.stat-value {
    font-family: var(--font-num);
    font-size: 26px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* ── 核心板块：流量王 + 账号对比 ── */
.hero-row {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 12px;
    margin-bottom: 0;
    align-items: start;
}

.hero-row > .card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hero-row > .card > .card-title {
    flex-shrink: 0;
}

.title-with-mark {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 22px;
    padding: 0 8px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-radius: 4px;
}

.title-mark.alt {
    background: #0f172a;
}

.spotlight-card {
    background: var(--card);
    border-color: var(--border);
}

.works-rank-wrap {
    padding-top: 4px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.works-rank-head {
    display: grid;
    grid-template-columns: 36px minmax(110px, 1.5fr) repeat(4, 0.65fr) 48px;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.works-rank-head {
    padding: 0 10px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.works-rank-head span:nth-child(n+3) { text-align: right; }
.works-rank-head span:last-child { text-align: center; }

.works-rank-list {
    flex: 1;
    min-height: 280px;
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.works-rank-list::-webkit-scrollbar {
    width: 4px;
}

.works-rank-list::-webkit-scrollbar-track {
    background: transparent;
}

.works-rank-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.16);
    border-radius: 999px;
}

.works-rank-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.28);
}

.works-rank-row {
    display: grid;
    grid-template-columns: 36px minmax(110px, 1.5fr) repeat(4, 0.65fr) 48px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: background .22s var(--ease), border-color .22s var(--ease);
}

.works-rank-row:hover {
    background: var(--card-hover);
    border-color: var(--border);
}

.works-rank-row.is-top {
    background: rgba(254, 44, 85, 0.04);
    border-color: rgba(254, 44, 85, 0.1);
}

.wr-rank {
    font-family: var(--font-num);
    font-weight: 700;
    font-size: 13px;
    color: var(--text-muted);
}

.wr-rank.top1 { color: var(--accent); }
.wr-rank.top2 { color: var(--cyan); }
.wr-rank.top3 { color: var(--warning); }

.wr-main { min-width: 0; }

.wr-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wr-title .wc-link,
.wr-title a {
    color: inherit;
    text-decoration: none;
}

.wr-title a:hover { color: var(--accent); }

.wr-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wr-num {
    text-align: right;
    font-family: var(--font-num);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.wr-act {
    display: flex;
    justify-content: center;
}

.wr-asr-btn {
    appearance: none;
    border: 1px solid rgba(254, 44, 85, 0.28);
    background: rgba(254, 44, 85, 0.06);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}

.wr-asr-btn:hover {
    background: rgba(254, 44, 85, 0.12);
    border-color: rgba(254, 44, 85, 0.45);
}

.wr-asr-btn.is-off {
    border-color: transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: default;
    font-weight: 500;
}

.wr-eng {
    margin-left: 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    vertical-align: middle;
}

.spotlight-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.spotlight-empty-sub {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.85;
}

.spotlight-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.spotlight-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spotlight-owner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.spotlight-owner strong {
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
}

.spotlight-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spotlight-title a {
    color: inherit;
    text-decoration: none;
}

.spotlight-title a:hover { color: var(--accent); }

.spotlight-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.metric-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 12px;
    text-align: center;
    transition: border-color .15s, transform .15s;
}

.metric-tile:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.metric-tile .num {
    font-family: var(--font-num);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.metric-tile.plays .num { color: var(--accent); }
.metric-tile.likes .num { color: #e11d48; }
.metric-tile.favorites .num { color: var(--cyan); }
.metric-tile.comments .num { color: var(--warning); }

.metric-tile .lbl {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.compare-card {
    overflow: hidden;
}

.compare-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.compare-card .card-title {
    flex-wrap: wrap;
    gap: 8px;
}

.compare-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.compare-list::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.compare-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.16);
    border-radius: 999px;
}

.cmp-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.5fr) repeat(5, minmax(58px, 0.7fr));
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    min-width: 580px;
}

.cmp-row:last-child {
    border-bottom: none;
}

.cmp-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding-top: 8px;
    padding-bottom: 8px;
}

.cmp-row.is-top {
    background: rgba(254, 44, 85, 0.04);
}

.cmp-main {
    min-width: 0;
}

.cmp-account {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cmp-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cmp-avatar-fallback {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    background: linear-gradient(135deg, #fee2e2, #e2e8f0);
}

.cmp-text {
    min-width: 0;
    overflow: hidden;
}

.cmp-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmp-sub {
    margin-top: 1px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmp-bar {
    margin-top: 6px;
    height: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.cmp-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
}

.cmp-num {
    text-align: right;
    font-family: var(--font-num);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.cmp-head .cmp-num {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
}

.cmp-num.is-sort {
    color: var(--accent);
}

.cmp-head .cmp-num.is-sort {
    color: var(--accent);
}

.cmp-num.is-lead {
    color: var(--accent);
}

/* legacy scoreboard leftovers kept harmless */
.compare-duel,
.compare-scoreboard,
.compare-sb-inner,
.compare-chart-wrap,
.compare-note {
    display: none;
}

.compare-sb-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.compare-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.compare-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 0;
    flex: 1 1 140px;
}

.compare-chip.is-lead {
    border-color: rgba(254, 44, 85, 0.12);
    background: rgba(254, 44, 85, 0.04);
}

.compare-chip-rank {
    font-family: var(--font-num);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.compare-chip-rank.top1 { color: var(--accent); }
.compare-chip-rank.top2 { color: var(--cyan); }
.compare-chip-rank.top3 { color: var(--warning); }

.compare-chip-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.compare-chip-hint {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.compare-row {
    display: grid;
    grid-template-columns: 28px minmax(90px, 1.1fr) repeat(3, 1fr);
    gap: 8px;
    align-items: center;
    padding: 12px 12px;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: border-color .22s var(--ease), background .22s var(--ease);
}

.compare-row:hover {
    background: var(--card-hover);
    border-color: var(--border);
}

.compare-row.is-top {
    background: rgba(254, 44, 85, 0.04);
    border-color: rgba(254, 44, 85, 0.1);
}

.compare-rank {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
}

.compare-row.is-top .compare-rank { color: var(--accent); }

.compare-name {
    min-width: 0;
}

.compare-name .name {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-name .hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-cell {
    text-align: right;
}

.compare-cell .num {
    font-family: var(--font-num);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.compare-cell .lbl {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2px;
}

.compare-head {
    display: grid;
    grid-template-columns: 28px minmax(90px, 1.1fr) repeat(3, 1fr);
    gap: 8px;
    padding: 0 12px 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.compare-head span:nth-child(n+3) { text-align: right; }

.video-rank-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 220px;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.video-rank-list::-webkit-scrollbar {
    width: 4px;
}

.video-rank-list::-webkit-scrollbar-track {
    background: transparent;
}

.video-rank-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.16);
    border-radius: 999px;
}

.video-rank-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}

.video-rank-item:last-child { border-bottom: none; }

.video-rank-item .vr-rank {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 14px;
    color: var(--text-muted);
}

.video-rank-item:nth-child(1) .vr-rank { color: var(--accent); }
.video-rank-item:nth-child(2) .vr-rank { color: var(--cyan); }
.video-rank-item:nth-child(3) .vr-rank { color: var(--warning); }

.video-rank-item .vr-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-rank-item .vr-owner {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.video-rank-item .vr-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 72px;
}

.video-rank-item .vr-line {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.video-rank-item .vr-line b {
    font-family: var(--font-num);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.video-rank-item .vr-line span {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.rank-table td {
    font-variant-numeric: tabular-nums;
}

.rank-table td:nth-child(4),
.rank-table td:nth-child(5),
.rank-table td:nth-child(6),
.rank-table td:nth-child(7) {
    font-family: var(--font-num);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.02em;
}

.gauge-metric .val {
    font-family: var(--font-num);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.metric-tag {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    vertical-align: middle;
}

/* ── 卡片通用 ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
    letter-spacing: -0.01em;
}

.card-title .badge {
    font-size: 11px;
    background: var(--surface);
    color: var(--text-muted);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-weight: 500;
}

/* ── 中间区域 ── */
.mid-row {
    display: grid;
    grid-template-columns: 1fr 340px 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.mid-row-2 {
    grid-template-columns: 1.4fr 1fr;
}

/* ── 仪表盘 ── */
.gauge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.gauge-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) 0deg, var(--accent) 0deg, var(--surface) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gauge-inner {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: var(--card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-value {
    font-family: var(--font-num);
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.gauge-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    letter-spacing: 0.04em;
}

.gauge-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 20px;
    width: 100%;
}

.gauge-metric {
    text-align: center;
    padding: 10px 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.gauge-metric .val {
    font-family: var(--font-num);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.gauge-metric .lbl {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
    letter-spacing: 0.03em;
}

.gauge-summary {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    letter-spacing: 0.01em;
}

.gauge-summary strong {
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 500;
}

/* ── 图表 ── */
.chart-wrap { height: 220px; position: relative; }

.trend-hint {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    pointer-events: none;
    background: rgba(255, 255, 255, 0.82);
    padding: 6px 10px;
    border-radius: 6px;
}

/* ── 排行表 ── */
.rank-table { width: 100%; border-collapse: collapse; }

.rank-table th {
    text-align: left;
    padding: 9px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rank-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
    transition: background .22s var(--ease);
}

.rank-table td strong { color: var(--text); font-weight: 500; }

.rank-table tr:hover td { background: var(--card-hover); }

.rank-num {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
}

.rank-num.top1 { background: var(--accent-dim); color: var(--accent); }
.rank-num.top2 { background: rgba(20, 184, 166, 0.12); color: var(--cyan); }
.rank-num.top3 { background: rgba(217, 119, 6, 0.1); color: var(--warning); }
.rank-num.normal { background: var(--surface); color: var(--text-secondary); }

.rank-account {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rank-account .cmp-avatar {
    width: 24px;
    height: 24px;
}

.remark-tag {
    display: inline-block;
    background: var(--surface);
    color: var(--text);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid var(--border);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-btn {
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    transition: color .15s;
}

.link-btn:hover { color: var(--accent); }

/* ── 底部 ── */
.bottom-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.rank-card .card-title {
    flex-wrap: wrap;
    gap: 10px;
}

.sync-time {
    font-family: var(--font-num);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.row-actions {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    font-family: inherit;
    transition: background .18s var(--ease), color .18s var(--ease);
}

.row-action:last-child {
    border-right: none;
}

.row-action:hover:not(.is-disabled) {
    background: #fff;
    color: var(--text);
}

.row-action.is-disabled {
    opacity: 0.38;
    cursor: default;
}

.rank-table td:last-child {
    white-space: nowrap;
}

/* ── 按钮 ── */
.btn {
    padding: 7px 14px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 12px;
    transition: all .15s;
    letter-spacing: 0.01em;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: .88; }

.btn-blue {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.btn-blue:hover { opacity: .88; color: #fff; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-danger { background: rgba(220, 38, 38, 0.08); color: var(--danger); border: 1px solid rgba(220, 38, 38, 0.2); }
.btn-danger:hover { background: rgba(220, 38, 38, 0.14); }

.toolbar {
    display: flex;
    gap: 4px;
    margin: 0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 5px 12px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    transition: all .15s;
    letter-spacing: 0.02em;
}

.tab-btn:hover { color: var(--text-secondary); background: var(--surface); }

.tab-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(254, 44, 85, 0.2);
}

/* ── 弹窗 ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--card);
    border: 1px solid var(--border-strong);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-lg);
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-body { padding: 20px 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border-color .15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); }

.form-group textarea { resize: vertical; min-height: 60px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.preview-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
}
.preview-title {
    font-size: 12px;
    color: #0369a1;
    font-weight: 600;
    margin-bottom: 10px;
}
.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.preview-item {
    text-align: center;
    background: #fff;
    border: 1px solid #e0f2fe;
    border-radius: 6px;
    padding: 10px 8px;
    min-width: 0;
}
.preview-item .val {
    font-family: var(--font-num);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.preview-item.is-text {
    grid-column: 1 / -1;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
}
.preview-item.is-text .val {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
}
.preview-item.is-text .lbl {
    flex-shrink: 0;
    margin-top: 0;
}
.preview-item .lbl {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.preview-item.is-muted .val {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}
.preview-note {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px dashed #bae6fd;
    border-radius: 6px;
    font-size: 12px;
    color: #0369a1;
    line-height: 1.45;
}
.preview-hint {
    grid-column: 1 / -1;
    margin-top: 2px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px dashed #7dd3fc;
    border-radius: 6px;
    font-size: 12px;
    color: #0369a1;
    line-height: 1.45;
}
.preview-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 16px 8px;
    font-size: 13px;
    color: #0369a1;
}

.copy-modal {
    width: 520px;
    max-width: 94vw;
}

.copy-paste-step {
    padding: 4px 0;
}

.copy-paste-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.copy-paste-input:focus {
    border-color: var(--border-strong);
    background: #fff;
}

.copy-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 36px 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.copy-paste-step[hidden],
.copy-loading[hidden],
.copy-result-wrap[hidden] {
    display: none !important;
}

.copy-loading-spin {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: dashSpin .65s linear infinite;
    flex-shrink: 0;
}

.copy-result-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.copy-meta-line {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-muted);
}

.copy-meta-line:empty {
    display: none;
}

.copy-result {
    width: 100%;
    min-height: 200px;
    max-height: min(52vh, 420px);
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.75;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fafbfc;
    color: var(--text);
    resize: none;
    font-family: var(--font);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.copy-result:focus {
    outline: none;
}

@media (max-width: 640px) {
    .preview-grid { grid-template-columns: repeat(2, 1fr); }
}
.metric-na { color: var(--text-muted); }

.tikhub-status {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 12px;
}
.tikhub-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.tikhub-cell {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 8px;
    text-align: center;
}
.tikhub-cell .num {
    font-family: var(--font-num);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.tikhub-cell .num.sm { font-size: 14px; }
.tikhub-cell .num.is-zero { color: var(--danger); }
.tikhub-cell .num.is-ok { color: var(--success); }
.tikhub-cell .lbl {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
.tikhub-status-note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--warning);
    line-height: 1.4;
}

.tikhub-status-note[hidden] {
    display: none !important;
}

.settings-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.settings-test-result {
    font-size: 12px;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 36px;
    color: var(--text-secondary);
    font-size: 13px;
}

@media (max-width: 1200px) {
    .top-split { grid-template-columns: 1fr; }
    .stats-row,
    .insights-row { grid-template-columns: repeat(2, 1fr); }
    .hero-row { grid-template-columns: 1fr; }
    .mid-row, .mid-row-2 { grid-template-columns: 1fr; }
    .bottom-row { grid-template-columns: 1fr; }
    .gauge-metrics { grid-template-columns: repeat(2, 1fr); }
    .spotlight-metrics { grid-template-columns: repeat(2, 1fr); }
    .compare-row, .compare-head {
        grid-template-columns: 24px minmax(70px, 1fr) repeat(3, 0.9fr);
    }
    .works-rank-head,
    .works-rank-row {
        grid-template-columns: 28px minmax(90px, 1.4fr) repeat(4, 0.55fr) 44px;
    }
}

@media (max-width: 640px) {
    .header { padding: 0 16px; }
    .main { padding: 16px; }
    .header-time { display: none; }
    .stats-row,
    .insights-row { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 24px; }
    .insight-value { font-size: 18px; }
    .metric-tile .num { font-size: 18px; }
    .compare-cell .num { font-size: 13px; }
    .works-rank-head { display: none; }
    .works-rank-row {
        grid-template-columns: 28px 1fr 44px;
        grid-template-rows: auto;
    }
    .wr-num { display: none; }
}

/* 同步进度浮层 */
.sync-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(8, 12, 24, 0.55);
    backdrop-filter: blur(4px);
}
.sync-overlay.show {
    display: flex;
}
.sync-panel {
    width: min(420px, 90vw);
    padding: 28px 26px 22px;
    border-radius: 14px;
    background: linear-gradient(160deg, #1a2338 0%, #12182a 100%);
    border: 1px solid rgba(120, 160, 220, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    color: #e8eef8;
}
.sync-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}
.sync-detail {
    font-size: 13px;
    color: rgba(200, 214, 235, 0.85);
    margin-bottom: 16px;
    min-height: 1.4em;
    word-break: break-all;
}
.sync-bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.sync-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, #3d8bfd, #5eead4);
    transition: width 0.25s ease;
}
.sync-meta {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(160, 180, 210, 0.75);
}

/* ── 轻提示 Toast ── */
.ui-toast-stack {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    max-width: min(420px, 92vw);
}

.ui-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    animation: uiToastIn .28s ease;
    max-width: 100%;
}

.ui-toast.is-out {
    animation: uiToastOut .22s ease forwards;
}

.ui-toast-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.ui-toast.is-success .ui-toast-dot { background: #10b981; }
.ui-toast.is-warn .ui-toast-dot { background: #f59e0b; }
.ui-toast.is-error .ui-toast-dot { background: var(--accent); }
.ui-toast.is-info .ui-toast-dot { background: #6366f1; }

.ui-toast-msg {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

@keyframes uiToastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes uiToastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

.ui-confirm-modal {
    width: 380px;
}

.ui-confirm-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
}
