/* 233.com 云端展示样式 ─ 跟本地软件风格保持一致 */

:root {
    /* ── 品牌色（保留蓝紫渐变两端） ── */
    --brand:        #3B82F6;
    --brand-dark:   #1D4ED8;
    --brand-l:      #DBEAFE;
    --brand-purple: #8B5CF6;

    /* ── 功能色：状态语义化 ── */
    --ok:           #10B981;  --ok-l:   #ECFDF5;
    --warn:         #F59E0B;  --warn-l: #FEF3C7;
    --bad:          #EF4444;  --bad-l:  #FEE2E2;
    --info:         #06B6D4;  --info-l: #ECFEFF;
    --vip:          #8B5CF6;  --vip-l:  #F3E8FF;

    /* ── 中性色：语义化命名 ── */
    --bg-page:      #F8FAFC;
    --bg-panel:     #FFFFFF;
    --bg-subtle:    #F1F5F9;
    --text-title:   #0F172A;
    --text-body:    #1E293B;
    --text-muted:   #64748B;
    --line:         #E2E8F0;
    --line-weak:    #F1F5F9;

    /* ── 字体栈 ── */
    --font-sans: -apple-system, "Segoe UI", "Microsoft YaHei", "苹方", "PingFang SC", sans-serif;
    --font-mono: "SF Mono", Consolas, "Microsoft YaHei", monospace;

    /* ── 字号 scale ── */
    --fs-h1: 24px; --fs-h2: 17px; --fs-h3: 15px; --fs-lg: 16px;
    --fs-base: 14px; --fs-sm: 12.5px; --fs-xs: 11px;
    --fs-kpi: 30px; --fs-num: 22px; --fs-stat: 18px;

    /* ── 间距 scale ── */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

    /* ── 圆角 scale ── */
    --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 999px;

    /* ── 阴影 scale（全站仅 3 档 + 品牌辉光） ── */
    --sh-xs:   0 1px 2px rgba(15, 23, 42, 0.04);
    --sh-sm:   0 2px 8px rgba(15, 23, 42, 0.05);
    --sh-md:   0 10px 28px rgba(15, 23, 42, 0.10);
    --sh-brand: 0 2px 8px rgba(59, 130, 246, 0.28);

    /* ── 旧名别名（页面内联样式依赖，勿删） ── */
    --primary: var(--brand);       --primary-dark: var(--brand-dark);
    --primary-l: var(--brand-l);
    --green: var(--ok);  --green-l: var(--ok-l);
    --orange: var(--warn); --orange-l: var(--warn-l);
    --red: var(--bad);   --red-l: var(--bad-l);
    --cyan: var(--info); --cyan-l: var(--info-l);
    --purple: var(--vip); --purple-l: var(--vip-l);
    --bg: var(--bg-page); --panel: var(--bg-panel);
    --title: var(--text-title); --text: var(--text-body); --muted: var(--text-muted);
    --border: var(--line); --border-l: var(--line-weak);
    --subtle_bg: var(--bg-subtle);   /* 修复原未定义变量 */
    --primary_l: var(--brand-l);     /* 修复原未定义变量 */
}

* { box-sizing: border-box; }

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

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ===== 顶栏 ===== */
.topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 16px; color: var(--title);
}
.brand:hover { text-decoration: none; }
.brand-logo {
    display: inline-block; width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    color: white; border-radius: 8px;
    text-align: center; line-height: 32px; font-size: 18px; font-weight: 800;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}
.topnav { margin-left: auto; display: flex; gap: 8px; }
.topnav a {
    padding: 6px 14px; border-radius: 6px;
    color: var(--muted); font-weight: 600; font-size: 13px;
}
.topnav a:hover { background: var(--border-l); color: var(--title); text-decoration: none; }
.topnav a.active { background: var(--primary-l); color: var(--primary); }

/* ===== 主区 ===== */
body > *:not(.topbar):not(.site-footer) {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    padding: 14px 32px 0 !important;
    font-size: 13px; color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--title); font-weight: 600; }

/* ===== KPI Row ===== */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin: 16px 0 8px;
}
.kpi {
    background: var(--panel);
    border-radius: var(--r-lg);
    padding: 18px 18px 16px;
    border-top: 4px solid var(--primary);
    position: relative;
    transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); }
.kpi-blue   { border-top-color: var(--primary); }
.kpi-green  { border-top-color: var(--green); }
.kpi-purple { border-top-color: var(--purple); }
.kpi-orange { border-top-color: var(--orange); }
.kpi-cyan   { border-top-color: var(--cyan); }
.kpi-num {
    font-size: 30px; font-weight: 800; color: var(--title);
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.kpi-num .mini-pos { color: var(--green); }
.kpi-num .mini-neg { color: var(--red); }
.kpi-num .mini-sep { color: var(--muted); margin: 0 4px; }
.kpi-label {
    margin-top: 8px; font-size: 13px; color: var(--text); font-weight: 600;
}
.kpi-sub { margin-top: 4px; font-size: 11px; color: var(--muted); }

/* ===== Section ===== */
.section {
    background: var(--panel);
    border: 1px solid var(--border-l);
    border-radius: 12px;
    padding: 20px 22px 24px;
    margin: 20px 0;
}
/* 直接 body 子元素的 .section 恢复卡片内边距/间距（覆盖 body > *:not(.topbar):not(.site-footer) 容器规则 (0,2,1)）
   左右内边距用 32px 与全局容器一致，保证与 .kpi-row 等上方区块内容区左/右对齐；margin auto 保持水平居中 */
body > .section { padding: 20px 32px 24px !important; margin: 20px auto !important; }
/* index.php 项目列表：左右边缘与上方 KPI 卡片行对齐。
   KPI 卡片在容器（max-width 1320、padding 32）内缩进 32px；
   用 width:min(100%-64px,1256px)+auto 居中，宽屏窄屏都与卡片边缘一致 */
body > .section.idx-list {
    padding: 20px 22px 24px !important;
    margin: 20px auto !important;
    width: min(calc(100% - 64px), 1256px) !important;
    max-width: none !important;
}
@media (max-width: 720px) {
    body > .section.idx-list { width: calc(100% - 32px) !important; padding: 16px 16px 18px !important; }
}
@media (max-width: 480px) {
    body > .section.idx-list { width: calc(100% - 24px) !important; padding: 14px 14px 18px !important; }
}
.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-l);
}
.section-head-l {
    min-width: 0;
    flex: 1 1 auto;
}
.section-head h2 {
    margin: 0 0 4px 0;
    font-size: 17px; font-weight: 700; color: var(--title);
}
.section-sub {
    display: block;
    font-size: 12px; color: var(--muted);
    line-height: 1.5;
}
.section-head-r {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
    align-items: center;
}
.sub-h {
    margin: 18px 0 10px;
    font-size: 13px; font-weight: 700; color: var(--title);
}

/* ===== 分页控件 ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 18px 0 4px;
    padding: 4px;
}
.pagination .page-btn,
.pagination .page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: all .15s;
}
.pagination .page-btn:hover,
.pagination .page-num:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary_l);
}
.pagination .page-num.is-current {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}
.pagination .page-btn.is-disabled {
    color: var(--muted);
    background: white;
    border-color: var(--border);
    cursor: not-allowed;
    pointer-events: none;
    opacity: .55;
}
.pagination .page-ellipsis {
    color: var(--muted);
    padding: 0 4px;
    font-size: 13px;
}
.pagination .page-tip {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pagination .page-jumper {
    width: 52px;
    height: 28px;
    padding: 0 6px;
    font-size: 13px;
    text-align: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
}
.pagination .page-jumper:focus {
    outline: none;
    border-color: var(--primary);
}
/* ===== 项目卡片 ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));   /* 默认2列 */
    gap: 14px;
}
@media (max-width: 720px) {
    .project-grid { grid-template-columns: 1fr; }       /* 窄屏单列 */
}
.project-card {
    display: block;
    position: relative;              /* 右上角编辑/删除定位基准 */
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    color: var(--text);
    transition: all .15s;
}
.card-corner-actions {
    position: absolute;
    top: 10px; right: 10px;
    display: flex; gap: 6px;
    z-index: 2;
}
.project-card:hover .card-corner-actions .card-btn { text-decoration: none; }
.project-card:hover {
    text-decoration: none;
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}
.project-card-head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
    min-height: 30px;
    padding-right: 132px;   /* 给右上角编辑/删除按钮留位 */
}
.project-id {
    background: var(--primary-l); color: var(--primary);
    font-weight: 700; font-size: 12px;
    padding: 2px 8px; border-radius: 4px;
}
.project-name {
    font-size: 17px; font-weight: 700; color: var(--title);
    flex: 1;
}
.multi-client {
    background: var(--orange-l); color: #92400E;
    font-size: 11px; font-weight: 600;
    padding: 2px 6px; border-radius: 4px;
}
.project-card-meta {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
    min-height: 20px; align-items: center;
}
.meta-chip {
    font-size: 11px; color: var(--muted);
    background: var(--border-l);
    padding: 2px 8px; border-radius: 4px;
}
.project-card-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border-l);
    border-bottom: 1px solid var(--border-l);
    margin: 10px 0;
}
.stat-cell {
    padding: 10px 4px; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
}
.stat-num {
    font-size: 18px; font-weight: 800; color: var(--title);
    font-variant-numeric: tabular-nums;
}
.stat-cap {
    font-size: 11px; color: var(--muted); margin-top: 2px;
}

.rank-bar {
    height: 6px; background: var(--border-l); border-radius: 3px;
    display: flex; overflow: hidden; margin-top: 10px;
}
.rank-bar-rk  { background: var(--green); }
.rank-bar-urk { background: var(--red); }
.rank-bar-legend {
    display: flex; gap: 12px; align-items: center;
    font-size: 11px; color: var(--muted); margin-top: 6px;
    min-height: 18px;
}
.rank-bar-legend .rank-avg { margin-left: auto; font-weight: 700; color: var(--title); white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot-g { background: var(--green); }
.dot-r { background: var(--red); }

.project-card-foot {
    margin-top: 10px;
    display: flex; flex-direction: column; gap: 6px;
    font-size: 11px; color: var(--muted);
}

/* 工作台式卡片：彩色统计块 */
.stat-cell { border-top: 3px solid transparent; }
.stat-1 { border-top-color: var(--primary); }
.stat-2 { border-top-color: var(--green); }
.stat-3 { border-top-color: var(--purple); }
.stat-4 { border-top-color: var(--orange); }
.stat-cell .stat-num { font-size: 19px; }
.stat-1 .stat-num { color: var(--primary); }
.stat-2 .stat-num { color: var(--green); }
.stat-3 .stat-num { color: var(--purple); }
.stat-4 .stat-num { color: var(--orange); }

/* ===== Empty ===== */
.empty {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    border-radius: 8px;
    border: 1px dashed var(--border);
}

/* ===== Chip ===== */
.chip {
    display: inline-block;
    padding: 3px 10px; border-radius: 14px;
    font-size: 11px; font-weight: 700;
    background: var(--bg-subtle); color: var(--muted);
    border: 1px solid transparent;
    white-space: nowrap;
}
.chip-pos { background: var(--green-l);  color: #047857; }
.chip-neg { background: var(--red-l);    color: #B91C1C; }
.chip-neu { background: var(--border-l); color: var(--muted); }
.chip-pri { background: var(--primary-l); color: var(--primary-dark); }

/* ===== Tables ===== */
.data-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
    background: var(--bg); color: var(--muted);
    font-weight: 600; font-size: 11px;
    padding: 8px 10px; text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-l);
    vertical-align: middle;
    line-height: 1.5;
}
.data-table tr:hover td { background: var(--bg); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.data-table .ts  { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.data-table .prompt-cell { max-width: 280px; color: var(--text); }

.row-link {
    background: var(--primary-l); color: var(--primary-dark);
    padding: 3px 10px; border-radius: 4px;
    font-size: 12px; font-weight: 600;
}
.row-link:hover { background: var(--primary); color: white; text-decoration: none; }

/* 引用域名 host cell */
.host-cell {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.host-name { font-weight: 600; color: var(--title); }
.host-site { color: var(--muted); font-size: 12px; }
.host-bar {
    height: 4px; background: var(--border-l); border-radius: 2px;
    margin-top: 4px; overflow: hidden;
}
.host-bar-fill {
    height: 100%; background: var(--primary); border-radius: 2px;
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 14px;
}
.filter-bar select {
    padding: 6px 12px; border: 1px solid var(--border);
    border-radius: var(--r-sm); background: white;
    font-size: 13px; color: var(--text);
    cursor: pointer;
}
.filter-bar select:hover { border-color: var(--primary); }
.filter-bar select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.reset-btn {
    background: var(--border-l); color: var(--muted);
    padding: 6px 12px; border-radius: 6px; font-size: 12px;
    font-weight: 600;
}
.reset-btn:hover { background: var(--red-l); color: var(--red); text-decoration: none; }

/* ===== Pager ===== */
.pager {
    margin-top: 16px;
    display: flex; gap: 4px; flex-wrap: wrap;
    justify-content: center;
}
.pager-cell {
    display: inline-block;
    min-width: 32px; height: 32px; line-height: 30px;
    text-align: center;
    background: white; border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 13px; font-weight: 600;
    color: var(--text);
}
.pager-cell:hover {
    border-color: var(--primary); color: var(--primary);
    background: var(--primary-l);
    text-decoration: none;
}
.pager-cell.active {
    background: var(--primary); color: white; border-color: var(--primary);
}

/* ===== Run Meta ===== */
.run-meta {
    background: var(--panel);
    border: 1px solid var(--border-l);
    border-radius: 12px;
    padding: 16px 22px;
    margin: 20px 0;
}
.run-meta-row {
    display: flex; flex-wrap: wrap; gap: 18px;
    padding: 4px 0;
}
.chips-row { gap: 6px; margin-top: 8px; }
.meta-cell { min-width: 90px; }
.meta-key {
    font-size: 11px; color: var(--muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.meta-val {
    font-size: 14px; color: var(--title); font-weight: 700;
    margin-top: 2px;
}
.meta-val.cid {
    font-family: var(--font-mono);
    font-size: 12px; color: var(--primary); font-weight: 600;
}

/* ===== QA Block ===== */
.qa-block { margin: 12px 0; }
.qa-label {
    font-size: 12px; font-weight: 700;
    color: var(--muted); text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 6px;
}
.qa-label.err-label { color: var(--red); }
.qa-text {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}
.prompt-text {
    background: var(--primary-l);
    color: var(--primary-dark);
    border-left: 3px solid var(--primary);
}
.answer-text {
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
}
.err-text {
    background: var(--red-l);
    color: #7F1D1D;
    border-left: 3px solid var(--red);
    font-family: var(--font-mono);
    font-size: 12px;
}

.comp-chip {
    display: inline-block;
    margin: 4px 6px 0 0;
    padding: 4px 12px;
    background: var(--orange-l); color: #92400E;
    border-radius: 14px;
    font-size: 12px; font-weight: 600;
}

/* ===== 提及品牌 chips + 正文高亮（run.php） ===== */
.mention-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.mention-chips .comp-chip, .mention-chips .self-chip {
    display: inline-flex; align-items: center; gap: 4px;
    margin: 0;
}
.mention-chips i { font-style: normal; opacity: .6; }
.self-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px;
    background: var(--primary-l); color: var(--primary-dark);
    border-radius: 14px;
    font-size: 12px; font-weight: 600;
}
.hl-self {
    background: var(--primary-l); color: var(--primary-dark);
    font-weight: 700; border-radius: 3px; padding: 0 2px;
}
.hl-comp {
    background: var(--orange-l); color: #92400E;
    font-weight: 700; border-radius: 3px; padding: 0 2px;
}

/* ===== Refs ===== */
.ref-list {
    display: grid; grid-template-columns: 1fr;
    gap: 10px;
}
.ref-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    transition: all .15s;
}
.ref-card:hover { border-color: var(--primary); }
.ref-card.own {
    border-color: var(--primary);
    background: linear-gradient(90deg, var(--primary-l) 0%, white 30%);
}
.ref-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 6px;
}
.ref-num {
    background: var(--primary-l); color: var(--primary-dark);
    font-weight: 800; font-size: 12px;
    padding: 2px 8px; border-radius: 4px;
}
.ref-site {
    color: var(--title); font-weight: 600; font-size: 13px;
}
.ref-host {
    margin-left: auto;
    color: var(--muted); font-size: 12px;
    font-family: var(--font-mono);
}
.ref-host:hover { color: var(--primary); }
.ext-icon { font-size: 10px; }
.ref-title {
    display: block; font-size: 14px; font-weight: 600;
    color: var(--title); margin-top: 4px;
}
.ref-title:hover { color: var(--primary); }
.ref-snippet {
    margin-top: 6px; font-size: 13px; color: var(--muted);
    line-height: 1.6;
    padding-left: 8px; border-left: 2px solid var(--border-l);
}

/* ===== Brand ===== */
.brand-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.brand-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}
.brand-card.has-alias { border-left: 3px solid var(--primary); }
.brand-name { font-weight: 700; color: var(--title); font-size: 14px; }
.brand-aliases, .brand-domains {
    font-size: 12px; color: var(--muted);
    margin-top: 4px;
}

/* ===== Meta Grid ===== */
.meta-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 12px;
}
.meta-item {
    background: var(--bg);
    border-radius: 8px;
    padding: 10px 14px;
}

/* ===== API Box ===== */
.api-box .api-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.api-box .api-table th, .api-box .api-table td {
    padding: 8px 12px; border-bottom: 1px solid var(--border-l);
    text-align: left;
}
.api-box .api-table th {
    background: var(--bg); color: var(--muted); font-size: 11px;
}
.api-box .api-table td:first-child { color: var(--primary); font-weight: 700; width: 60px; }
.api-box .api-table td:nth-child(2) {
    font-family: var(--font-mono); font-size: 12px;
    color: var(--text);
}
.api-note {
    margin-top: 12px; font-size: 12px; color: var(--muted);
    padding: 10px 14px;
    background: var(--orange-l); border-radius: 6px;
    border-left: 3px solid var(--orange);
}
.api-note code {
    background: white; padding: 1px 6px; border-radius: 3px;
    border: 1px solid var(--border);
    font-size: 11px;
}

/* ===== Client ===== */
.cid {
    font-family: var(--font-mono);
    font-size: 11px; color: var(--primary);
}
.cid-pill {
    display: inline-block;
    background: var(--primary-l); color: var(--primary-dark);
    padding: 3px 10px; border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 700;
}
td.num.pos { color: var(--green); font-weight: 700; }
td.num.neg { color: var(--red); font-weight: 700; }

/* ===== Footer ===== */
.site-footer {
    max-width: none !important;
    margin-top: 40px;
    padding: 20px 32px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    background: white;
    border-top: 1px solid var(--border-l);
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .kpi-row { grid-template-columns: repeat(3, 1fr); }
    .meta-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .meta-grid { grid-template-columns: 1fr; }
    body > *:not(.topbar):not(.site-footer) { padding: 0 16px; }
    .topbar-inner { padding: 12px 16px; }
}

/* ============================================================
   信源分析页（复刻 Python「信源分析」）
   ============================================================ */

/* 项目卡片：主体可点链接 + 底部按钮 */
.project-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.project-card-link:hover { text-decoration: none; color: inherit; }
/* 功能按钮区：网格均分，换行整齐、按钮等宽（消除 flex 换行的错位与孤立按钮） */
.card-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 6px;
    width: 100%;
}
.card-actions .card-btn {
    text-align: center;
    padding: 5px 6px;
}
.card-btn {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px; font-weight: 700;
    white-space: nowrap; line-height: 1.4;
    background: var(--primary-l); color: var(--primary-dark);
    border: 1px solid transparent;
}
.card-btn:hover { background: var(--primary); color: white; text-decoration: none; }
.card-btn-src { background: var(--orange-l); color: #92400E; }
.card-btn-src:hover { background: var(--orange); color: white; }

/* 4 列 KPI */
.kpi-row-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-status { margin-top: 6px; font-size: 12px; font-weight: 800; }
.st-ok   { color: var(--green); }
.st-warn { color: var(--orange); }
.st-bad  { color: var(--red); }

/* 标题 + 筛选条 */
.src-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 18px; flex-wrap: wrap;
    margin: 30px 0 6px;
}
.src-title h1 { margin: 0; font-size: 24px; font-weight: 800; color: var(--title); }
.src-desc { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); max-width: 640px; }
.src-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-cap { font-size: 12px; color: var(--muted); font-weight: 600; }
.seg {
    display: inline-flex; background: var(--border-l);
    border-radius: 8px; padding: 3px; gap: 2px;
}
.seg-btn {
    padding: 5px 14px; border-radius: 6px;
    font-size: 12.5px; font-weight: 700; color: var(--text);
    background: transparent; text-decoration: none;
    transition: all .12s;
}
.seg-btn:hover { color: var(--primary); text-decoration: none; }
.seg-btn.on { background: var(--primary); color: white; box-shadow: 0 1px 4px rgba(59,130,246,.35); }

/* 时间窗行 */
.src-meta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 24px 0 14px;
}
.meta-cap { font-size: 13px; font-weight: 800; color: var(--title); }
.brand-pill {
    font-size: 11px; font-weight: 800; color: var(--muted);
    background: var(--border-l); padding: 3px 12px; border-radius: 999px;
}
.brand-pill.brand-primary { background: var(--primary-l); color: var(--primary-dark); }
.brand-pill.brand-warn { background: var(--orange-l); color: #92400E; }
.meta-info { font-size: 11.5px; color: var(--muted); margin-left: auto; }

/* 双栏 */
.src-dual {
    display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px;
    align-items: stretch;
}
.src-dual > .section { margin: 20px 0; }
.src-card-accent-blue  { border-top: 3px solid var(--primary); }
.src-card-accent-cyan  { border-top: 3px solid var(--cyan); }
.src-card-accent-orange{ border-top: 3px solid var(--orange); }

/* 徽章 */
.badge {
    display: inline-block; vertical-align: middle;
    font-size: 11px; font-weight: 800;
    padding: 3px 10px; border-radius: 999px; margin-left: 6px;
}
.badge-blue   { background: var(--primary-l); color: var(--primary-dark); }
.badge-cyan   { background: var(--cyan-l); color: #0E7490; }
.badge-orange { background: var(--orange-l); color: #92400E; }

/* 信源榜表格 */
.src-rank-table td { padding: 8px 10px; }
.rk-cell { font-weight: 800; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rk-top.rk-1 { color: var(--primary); }
.rk-top.rk-2 { color: var(--cyan); }
.rk-top.rk-3 { color: var(--green); }
.site-cell { font-weight: 600; color: var(--title); }
.host-cell-mono {
    font-family: var(--font-mono);
    font-size: 11.5px; color: var(--muted);
    max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pct-cell { color: var(--primary); font-weight: 700; }
.cat-chip {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 10.5px; font-weight: 800; white-space: nowrap;
}
.src-foot { margin-top: 10px; font-size: 11px; color: var(--muted); }

/* 品类分布（SVG 环形图 + 图例） */
.pie-wrap { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.pie-svg { flex: 0 0 auto; padding-top: 4px; }
.pie-legend { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 2px; }
.legend-row {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px; border-radius: 6px; font-size: 12px;
}
.legend-row:hover { background: var(--bg); }
.legend-strong { font-weight: 800; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.legend-name { color: var(--title); font-weight: 700; min-width: 52px; }
.legend-n { color: var(--muted); font-size: 11px; margin-left: auto; }
.legend-pct { font-weight: 800; min-width: 46px; text-align: right; }

/* 标杆文章榜 */
.article-list { display: flex; flex-direction: column; gap: 8px; }
.article-row {
    display: flex; align-items: center; gap: 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px; padding: 10px 14px;
    color: inherit; text-decoration: none;
    transition: all .12s;
}
.article-row:hover {
    background: var(--primary-l); border-color: var(--primary);
    text-decoration: none; transform: translateY(-1px);
}
.article-rk {
    flex: 0 0 52px; text-align: center;
    font-size: 12.5px; font-weight: 800; color: var(--muted); white-space: nowrap;
}
.article-rk.rk-1 { color: var(--primary); }
.article-rk.rk-2 { color: var(--cyan); }
.article-rk.rk-3 { color: var(--green); }
.article-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.article-title-row { display: flex; align-items: center; gap: 8px; }
.article-title {
    flex: 1; min-width: 0;
    font-size: 13px; font-weight: 700; color: var(--title);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.article-sub-row { display: flex; align-items: center; gap: 10px; }
.article-sub {
    font-size: 11px; color: var(--muted); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 46%;
}
.article-bar { flex: 1; height: 4px; background: var(--border-l); border-radius: 2px; overflow: hidden; }
.article-bar i { display: block; height: 100%; border-radius: 2px; }
.article-n { flex: 0 0 52px; text-align: right; font-size: 13px; font-weight: 800; color: var(--orange); }
.article-open {
    flex: 0 0 auto;
    font-size: 11px; font-weight: 700; color: var(--primary);
    border: 1px solid var(--primary); border-radius: 5px; padding: 3px 9px;
    background: white; white-space: nowrap;
}
.article-row:hover .article-open { background: var(--primary); color: white; }

/* 文章分页 */
.article-pager {
    display: flex; align-items: center; gap: 12px;
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid var(--border-l);
}
.pager-info { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-right: auto; }
.pager-btn {
    padding: 6px 16px; border-radius: 6px;
    font-size: 12.5px; font-weight: 700;
    background: white; color: var(--primary);
    border: 1px solid var(--primary);
}
.pager-btn:hover { background: var(--primary-l); text-decoration: none; }
.pager-btn.is-disabled {
    color: var(--muted); border-color: var(--border);
    background: var(--bg); pointer-events: none; opacity: .6;
}

/* 信源分析响应式 */
@media (max-width: 1100px) {
    .kpi-row-4 { grid-template-columns: repeat(2, 1fr); }
    .src-dual { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .src-head { flex-direction: column; }
    .meta-info { margin-left: 0; width: 100%; }
    .article-sub { max-width: 40%; }
    .card-actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   信源明细页（复刻 Python「信源明细」）
   ============================================================ */
.card-btn-cit { background: var(--green-l); color: #065F46; }
.card-btn-cit:hover { background: var(--green); color: white; }

/* 筛选表单 */
.cit-filter {
    border: 1px solid var(--border-l); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 12px;
    display: flex; flex-direction: column; gap: 10px;
}
.cit-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cit-flabel {
    flex: 0 0 auto; font-size: 12px; font-weight: 800; color: var(--title);
    background: var(--primary-l); padding: 4px 10px; border-radius: 999px;
}
.cit-select {
    flex: 1; min-width: 220px; height: 32px;
    border: 1px solid var(--border); border-radius: 6px;
    background: white; padding: 0 8px; font-size: 12.5px; color: var(--text);
}
.cit-input {
    flex: 1; min-width: 220px; height: 32px;
    border: 1px solid var(--border); border-radius: 6px;
    background: white; padding: 0 10px; font-size: 12.5px; color: var(--text);
}
.cit-input:focus, .cit-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.cit-actions { display: inline-flex; gap: 8px; margin-left: auto; }
.cit-btn-reset {
    padding: 6px 16px; border-radius: 6px; font-size: 12.5px; font-weight: 700;
    background: white; color: var(--muted); border: 1px solid var(--border);
}
.cit-btn-reset:hover { color: var(--title); border-color: var(--muted); text-decoration: none; }
.cit-btn-go {
    padding: 6px 18px; border-radius: 6px; font-size: 12.5px; font-weight: 800;
    background: var(--primary); color: white; border: none; cursor: pointer;
}
.cit-btn-go:hover { background: var(--primary-dark); color: white; }
.cit-count { font-size: 12px; color: var(--muted); margin-bottom: 10px; font-variant-numeric: tabular-nums; }

/* 双栏引用卡片 */
.cit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cit-card {
    border: 1px solid var(--border-l);
    border-radius: 10px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 8px;
    transition: all .12s;
}
.cit-card:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(59,130,246,.10); }
.cit-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cit-ts { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.cit-brand { font-size: 12.5px; font-weight: 800; color: var(--title); }
.cit-model { font-size: 11px; color: var(--muted); }
.cit-rank { font-size: 10px; color: var(--muted); margin-left: auto; }
.cit-rank.own { color: var(--orange); }
.cit-site {
    font-size: 11.5px; font-weight: 700; color: var(--text);
    background: white; border: 1px solid var(--border-l);
    padding: 2px 9px; border-radius: 5px;
    max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cit-num { font-size: 12px; font-weight: 800; color: var(--primary); }
.cit-title {
    font-size: 13.5px; font-weight: 700; color: var(--primary);
    text-decoration: none; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cit-title:hover { color: var(--primary-dark); text-decoration: underline; }
.cit-prompt { display: flex; align-items: flex-start; gap: 8px; }
.cit-prompt-tag {
    flex: 0 0 auto; font-size: 10.5px; font-weight: 800; color: var(--muted);
    background: var(--border-l); padding: 2px 8px; border-radius: 5px;
}
.cit-prompt-text { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.cit-card-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.cit-btn-view {
    padding: 5px 12px; border-radius: 6px; font-size: 11.5px; font-weight: 700;
    background: white; color: var(--text); border: 1px solid var(--border);
}
.cit-btn-view:hover { border-color: var(--muted); text-decoration: none; }
.cit-btn-open {
    padding: 5px 14px; border-radius: 6px; font-size: 11.5px; font-weight: 800;
    background: var(--primary); color: white;
}
.cit-btn-open:hover { background: var(--primary-dark); color: white; text-decoration: none; }

@media (max-width: 900px) {
    .cit-grid { grid-template-columns: 1fr; }
    .cit-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
}

/* ============================================================
   Run 详情页：PC 双栏 + 右侧粘性侧边栏（引用明细导航）
   ============================================================ */
html { scroll-behavior: smooth; }
.run-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}
.run-main { min-width: 0; }
.run-side { position: sticky; top: 16px; }
.run-side-inner { display: flex; flex-direction: column; gap: 14px; }
.side-card {
    background: var(--panel);
    border: 1px solid var(--border-l);
    border-radius: 12px;
    padding: 14px 16px;
}
.side-title {
    font-size: 13.5px; font-weight: 800; color: var(--title);
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.side-count {
    font-size: 11px; font-weight: 800; color: var(--primary);
    background: var(--primary-l); padding: 1px 9px; border-radius: 999px;
}
.side-btn {
    display: block;
    padding: 8px 12px; border-radius: 8px;
    font-size: 12.5px; font-weight: 700;
    background: var(--primary-l); color: var(--primary-dark);
    margin-bottom: 8px; text-decoration: none;
    border: 1px solid transparent;
}
.side-btn:last-child { margin-bottom: 0; }
.side-btn:hover { background: var(--primary); color: white; text-decoration: none; }
.side-btn-src { background: var(--orange-l); color: #92400E; }
.side-btn-src:hover { background: var(--orange); color: white; }
.side-btn-cit { background: var(--green-l); color: #065F46; }
.side-btn-cit:hover { background: var(--green); color: white; }

.side-empty { font-size: 12px; color: var(--muted); padding: 6px 0; }

/* 引用导航列表 */
.side-refs {
    display: flex; flex-direction: column; gap: 4px;
    max-height: 480px; overflow-y: auto;
    margin: 0 -6px; padding: 0 6px;
}
.side-ref {
    display: flex; gap: 8px; align-items: flex-start;
    padding: 7px 8px; border-radius: 8px;
    text-decoration: none; color: inherit;
    border: 1px solid transparent;
}
.side-ref:hover { background: var(--bg); border-color: var(--border-l); text-decoration: none; }
.side-ref.own { background: var(--primary-l); }
.side-ref.own:hover { border-color: var(--primary); }
.side-ref-num {
    flex: 0 0 26px; font-size: 11px; font-weight: 800; color: var(--primary);
    font-family: var(--font-mono); padding-top: 1px;
}
.side-ref-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.side-ref-title {
    font-size: 12px; font-weight: 700; color: var(--title); line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-ref-host {
    font-size: 10.5px; color: var(--muted);
    font-family: var(--font-mono);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-hosts {
    display: flex; flex-wrap: wrap; gap: 5px;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed var(--border);
}

/* 锚点跳转留白 + 高亮 */
.ref-card { scroll-margin-top: 70px; }
.ref-card:target {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-l);
}

@media (max-width: 1100px) {
    .run-layout { grid-template-columns: 1fr; }
    .run-side { position: static; }
    .run-side-inner { flex-direction: row; flex-wrap: wrap; }
    .side-card { flex: 1; min-width: 260px; }
    .side-refs { max-height: 300px; }
}

/* ===== 登录页 ===== */
.login-wrap {
    min-height: calc(100vh - 140px);
    display: flex; align-items: center; justify-content: center;
    padding: 40px 16px;
}
.login-card {
    width: 100%; max-width: 380px;
    background: var(--panel);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    padding: 36px 32px 28px;
    display: flex; flex-direction: column; align-items: center;
}
.login-logo {
    width: 56px; height: 56px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-size: 28px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.login-title { font-size: 20px; font-weight: 800; color: var(--title); margin: 0 0 4px; }
.login-sub { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.login-err {
    width: 100%; background: var(--red-l); color: #B91C1C;
    border: 1px solid #FCA5A5; border-radius: 10px;
    padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
.login-field {
    width: 100%; display: flex; flex-direction: column; gap: 5px;
    margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--text);
}
.login-field input {
    border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; font-size: 14px; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.login-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.login-btn {
    width: 100%; margin-top: 6px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border: none; border-radius: 10px;
    padding: 11px 0; font-size: 15px; font-weight: 700;
    cursor: pointer; letter-spacing: 4px;
    transition: filter .15s, transform .05s;
}
.login-btn:hover { filter: brightness(1.06); }
.login-btn:active { transform: translateY(1px); }
.login-tip { font-size: 12px; color: var(--muted); margin: 16px 0 0; text-align: center; line-height: 1.6; }
.login-tip code { background: var(--border-l); padding: 1px 5px; border-radius: 5px; font-size: 11.5px; }

/* ── 登录页：左广告右登录（桌面） / 仅登录（移动） ── */
.login-shell {
    width: 100%; max-width: 980px;
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px;
    align-items: stretch;
}
.login-shell .login-card { justify-content: center; }
.login-hero {
    display: flex; flex-direction: column;
    background: linear-gradient(150deg, #1E1B4B 0%, #312E81 55%, #3730A3 100%);
    border-radius: 18px; padding: 30px 28px 22px;
    color: #E0E7FF;
    box-shadow: 0 18px 40px rgba(49, 46, 129, .25);
}
.hero-kicker {
    display: inline-block; align-self: flex-start;
    font-size: 12px; font-weight: 700; letter-spacing: .5px;
    background: rgba(255, 255, 255, .12); color: #FDE68A;
    padding: 4px 12px; border-radius: 999px;
}
.login-hero h2 {
    font-size: 25px; font-weight: 800; line-height: 1.35;
    color: #fff; margin: 14px 0 10px;
}
.hero-sub { font-size: 13.5px; color: #C7D2FE; line-height: 1.8; margin: 0 0 20px; }
.hero-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.hero-item { display: flex; gap: 12px; font-size: 13px; line-height: 1.65; }
.hero-ico {
    flex: none; width: 34px; height: 34px; border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.hero-item b { color: #fff; display: block; font-size: 13.5px; margin-bottom: 2px; }
.hero-item span { color: #C7D2FE; }
.hero-foot {
    margin-top: auto; padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: 12px; color: #A5B4FC;
}
@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; max-width: 380px; }
    .login-hero { display: none; }
    .login-shell .login-card { justify-content: flex-start; }
}

/* ===== 顶栏用户区 ===== */
.topuser {
    margin-left: auto; display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--text);
}
.topuser-name { font-weight: 700; }
.topuser-out {
    color: var(--muted); font-size: 12.5px;
    border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px;
}
.topuser-out:hover { color: var(--red); border-color: var(--red); background: var(--red-l); text-decoration: none; }

/* 角色徽章 */
.role-badge, .admin-role-badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    border-radius: 999px; padding: 2px 9px; line-height: 1.6;
    white-space: nowrap;
}
.role-super { background: var(--purple-l); color: #6D28D9; }
.role-agent { background: var(--orange-l); color: #92400E; }
.role-user  { background: var(--primary-l); color: var(--primary-dark); }

/* 会员等级徽章 */
.plan-badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    border-radius: 999px; padding: 2px 9px; line-height: 1.6; white-space: nowrap;
}
.plan-trial      { background: #F1F5F9; color: #475569; }
.plan-standard   { background: var(--cyan-l); color: #0E7490; }
.plan-enterprise { background: var(--purple-l); color: #7C3AED; }
.plan-pro        { background: var(--warn-l); color: #92400E; }
.plan-none       { background: var(--red-l); color: var(--red); }
.plan-exp { font-size: 11px; color: var(--muted); margin-left: 6px; }
.plan-sel { font-size: 12px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; }
.exp-in   { font-size: 12px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; }

/* ===== 会员升级卡片（user.php） ===== */
.plan-current {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    font-size: 13.5px; color: var(--text); margin-bottom: 16px;
    padding: 12px 14px; background: var(--bg-subtle);
    border-radius: var(--r-md); border: 1px solid var(--line-weak);
}
.plan-cur-lab { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.plan-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.plan-card {
    display: flex; flex-direction: column;
    padding: 16px 16px 14px;
    background: var(--panel);
    border: 1px solid var(--border-l);
    border-radius: var(--r-lg);
    transition: transform .15s ease, box-shadow .15s ease;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.plan-card.current {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-l);
}
.plan-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    margin-bottom: 12px;
}
.plan-tag-cur {
    font-size: 11px; font-weight: 700; color: var(--primary-dark);
    background: var(--primary-l); border-radius: 999px; padding: 1px 8px;
}
.plan-feats {
    list-style: none; margin: 0 0 14px; padding: 0;
    display: flex; flex-direction: column; gap: 7px; flex: 1;
}
.plan-feats li {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12.5px; color: var(--text); padding-bottom: 7px;
    border-bottom: 1px dashed var(--border-l);
}
.plan-feats li:last-child { border-bottom: none; }
.plan-feats li > span { color: var(--muted); }
.plan-feats b { font-weight: 700; color: var(--title); }
.plan-feats li.plan-on  { color: var(--green); }
.plan-feats li.plan-on b { color: var(--green); }
.plan-feats li.plan-off { color: var(--muted); }
.plan-price {
    text-align: center; font-size: 22px; font-weight: 700; color: var(--primary);
    margin: 0;
}
.plan-price small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.plan-price.free { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.plan-discount {
    text-align: center; font-size: 12px; color: var(--green);
    margin: 2px 0 14px;
}
.plan-bill { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.plan-up.alt {
    background: var(--bg-subtle); color: var(--text-body);
    border: 1px solid var(--border-l);
}
.plan-up.alt:hover { background: var(--border-l); color: var(--text-body); }
.plan-card-foot { display: flex; justify-content: center; margin-top: 2px; }
.plan-cur {
    font-size: 12.5px; font-weight: 700; color: var(--muted);
    padding: 6px 16px; background: var(--bg-subtle);
    border-radius: 8px; width: 100%; text-align: center;
}
.plan-dim { color: var(--muted); font-size: 12px; padding: 6px 0; }
.plan-up, .plan-goto {
    display: inline-block; width: 100%; text-align: center;
    background: var(--primary); color: #fff; font-weight: 700;
    border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px;
    cursor: pointer; text-decoration: none;
}
.plan-up:hover, .plan-goto:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.plan-goto { background: var(--bg-subtle); color: var(--text-body); border: 1px solid var(--border-l); }
.plan-goto:hover { background: var(--border-l); color: var(--text-body); }
@media (max-width: 980px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .plan-grid { grid-template-columns: 1fr; } }

/* ===== 代理工作台横幅 ===== */
.agent-home {
    max-width: 1320px; margin: 28px auto; padding: 0 32px;
}
.agent-home .section, .agent-home-card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 16px; padding: 36px 40px;
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
.agent-home-icon { font-size: 40px; line-height: 1; }
.agent-home h1 { font-size: 22px; font-weight: 800; color: var(--title); margin: 0; }
.agent-home p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.7; }
.agent-home-btn {
    margin-top: 10px; display: inline-block;
    background: var(--orange); color: #fff; font-weight: 700;
    border-radius: 10px; padding: 10px 22px; font-size: 14px;
}
.agent-home-btn:hover { background: #D97706; color: #fff; text-decoration: none; }

/* ===== 用户管理页 ===== */
.admin-head {
    display: flex; align-items: center; gap: 12px;
    margin: 22px 0 6px;
}
.admin-head h1 { font-size: 22px; font-weight: 800; color: var(--title); margin: 0; }
.admin-flash {
    border-radius: var(--r-sm); padding: 10px 14px; font-size: 13px;
    margin: 10px 0; line-height: 1.6; word-break: break-all;
    border-left: 4px solid;   /* 每处只留一件：去整圈框，留左边条 */
}
.admin-flash.ok { background: var(--green-l); color: #065F46; border-left-color: var(--green); }
.admin-flash.err { background: var(--red-l); color: #B91C1C; border-left-color: var(--red); }
.admin-card { margin-top: 14px; }
.admin-form { display: flex; flex-direction: column; gap: 14px; }
.admin-form-row { display: flex; flex-wrap: wrap; gap: 14px; }
.admin-form label {
    display: flex; flex-direction: column; gap: 5px;
    font-size: 12.5px; font-weight: 600; color: var(--text);
    min-width: 160px; flex: 1;
}
.admin-form input, .admin-form select {
    border: 1px solid var(--border); border-radius: 9px;
    padding: 8px 10px; font-size: 13.5px; outline: none; background: #fff;
}
.admin-form input:focus, .admin-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.admin-submit {
    align-self: flex-start;
    background: var(--primary); color: #fff; border: none;
    border-radius: 9px; padding: 9px 26px; font-size: 14px; font-weight: 700;
    cursor: pointer;
}
.admin-submit:hover { background: var(--primary-dark); }
.admin-table code {
    font-family: var(--font-mono); font-size: 11px;
    background: var(--border-l); padding: 2px 6px; border-radius: 6px;
    word-break: break-all;
}
.admin-token { max-width: 260px; }
.admin-user { font-weight: 700; }
.me-tag {
    display: inline-block; font-size: 10.5px; font-weight: 700;
    background: var(--green-l); color: #065F46;
    border-radius: 999px; padding: 1px 7px; margin-left: 4px;
}
.st-on { color: var(--green); font-weight: 700; }
.st-off { color: var(--red); font-weight: 700; }
.row-off td { opacity: .55; }
.admin-ops { white-space: nowrap; }
.admin-ops form.inline { display: inline-flex; gap: 4px; align-items: center; margin-right: 6px; }
.pw-in {
    width: 92px; border: 1px solid var(--border); border-radius: 7px;
    padding: 4px 7px; font-size: 12px; outline: none;
}
.pw-in:focus { border-color: var(--primary); }
.op-btn {
    border: 1px solid var(--border); background: #fff; color: var(--text);
    border-radius: 7px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.op-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.op-btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-l); }
.op-btn:disabled { opacity: .5; cursor: not-allowed; }
.op-btn:disabled:hover { border-color: var(--border); color: var(--text); background: #fff; }
.op-none { color: var(--muted); }

/* ===== 用户中心页（user.php） ===== */
/* body>*:not(.topbar):not(.site-footer) 会给直接 body 子元素盖 padding/margin 0 32px，
   本节用同优先级（0,2,1）且靠后声明的选择器恢复管理页卡片应有的内边距与间距 */
body > .breadcrumb + .admin-head { margin-top: 0; padding-top: 12px; }
body > .section.admin-card { padding: 20px 22px 24px; margin: 20px 0; }
body > .admin-flash { padding: 10px 14px; margin: 10px 0; }
.uc-keyline { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.uc-kchip { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.uc-ok   { color: #047857; background: #ECFDF5; }
.uc-miss { color: #B45309; background: #FEF3C7; }
.uc-ktip { color: var(--muted); font-size: 12px; }
.uc-import {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #FFFBEB; border-left: 4px solid #F59E0B;  /* 每处只留一件：去整圈框，留左边条 */
    border-radius: var(--r-sm); padding: 10px 14px; margin: 0 0 14px;
    font-size: 12.5px; color: #92400E;
}
.admin-form-row .admin-submit { align-self: flex-end; }   /* 「保存 Key」与输入框同行 */
.uc-keylab { flex: 1; min-width: 260px; }
.uc-stats { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; }
.uc-stats b { color: var(--text-title); font-variant-numeric: tabular-nums; }
.uc-ckbox { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.uc-ckbox input { width: 15px; height: 15px; accent-color: var(--primary); }
/* ── 按项目清理采集数据 ── */
.uc-toolbar { display: flex; align-items: center; gap: 14px; margin: 0 0 10px; }
.uc-toolbar .uc-ckbox { margin: 0; }
.uc-count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.uc-proj-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 12px; }
.uc-proj { display: flex; flex-direction: column; gap: 7px; padding: 9px 11px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; cursor: pointer; }
.uc-proj:hover { border-color: var(--primary); }
.uc-proj:has(input:checked) { border-color: var(--primary); background: var(--primary-l); }
.uc-proj-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.uc-proj-top input { width: 15px; height: 15px; accent-color: var(--primary); flex: none; }
.uc-proj-name { font-weight: 600; color: var(--text-title); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-proj-stats { display: flex; flex-wrap: wrap; gap: 5px; }
.uc-stat { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-size: 11px; color: var(--text); white-space: nowrap; }
.uc-stat b { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text-title); }
.uc-stat-blue   { background: #DBEAFE; color: #1D4ED8; }   .uc-stat-blue b { color: #1D4ED8; }
.uc-stat-purple { background: #F3E8FF; color: #7E22A2; }   .uc-stat-purple b { color: #7E22A2; }
.uc-stat-orange { background: #FEF3C7; color: #92400E; }   .uc-stat-orange b { color: #92400E; }
.uc-stat-green  { background: #D1FAE5; color: #047857; }   .uc-stat-green b { color: #047857; }
.uc-proj-none { color: #B45309; font-size: 11px; }
.uc-options { display: flex; align-items: center; gap: 18px; margin: 0 0 12px; flex-wrap: wrap; }
.uc-options .uc-ckbox { margin: 0; }

/* ===== GEO 总览页（overview.php） ===== */
.card-btn-ov { background: var(--purple-l); color: #6D28D9; }
.card-btn-ov:hover { background: var(--purple); color: white; }
.card-btn-tr { background: #DBEAFE; color: #1D4ED8; }
.card-btn-tr:hover { background: var(--primary); color: white; }
.card-btn-rp { background: var(--cyan-l); color: #0E7490; }
.card-btn-rp:hover { background: var(--cyan); color: white; }
.card-btn-pm { background: #F3E8FF; color: #7E22A2; }
.card-btn-pm:hover { background: #A855F7; color: white; }
.card-btn-mn { background: #E0E7FF; color: #4338CA; }
.card-btn-mn:hover { background: #6366F1; color: white; }
.card-btn-br { background: #FEF3C7; color: #92400E; }
.card-btn-br:hover { background: #D97706; color: white; }
.card-btn-edit { background: #DBEAFE; color: #1D4ED8; }
.card-btn-edit:hover { background: #2563EB; color: white; }
.card-btn-del { color: #DC2626; }
.card-btn-del:hover { background: #FEF2F2; border-color: #FCA5A5; color: #B91C1C; }

/* ===== 云端 GEO 四工具（advisor/topic_factory/competitor_radar/decision_dashboard） ===== */
.card-btn-ga { background: #E0E7FF; color: #4338CA; }  /* 顾问=靛蓝 */
.card-btn-ga:hover { background: #6366F1; color: white; }
.card-btn-tf { background: #D1FAE5; color: #047857; }  /* 选题=绿 */
.card-btn-tf:hover { background: #10B981; color: white; }
.card-btn-cr { background: #FEE2E2; color: #B91C1C; }  /* 雷达=红 */
.card-btn-cr:hover { background: #EF4444; color: white; }
.card-btn-dd { background: #CFFAFE; color: #0E7490; }  /* 仪表盘=青 */
.card-btn-dd:hover { background: #06B6D4; color: white; }

/* GEO 生成页表单（4 页共用） */
.geo-key-warn {
    background: #FFFBEB; border-left: 4px solid #F59E0B;
    border-radius: 10px; padding: 12px 16px; margin: 14px 0; max-width: 860px;
    color: #78350F; font-size: 13px; line-height: 1.8;
}
.geo-form {
    background: var(--panel, #fff); border: 1px solid var(--border-l, #e2e8f0);
    border-radius: 12px; padding: 20px 22px; margin-top: 14px; max-width: 860px;
}
.geo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 640px; }
.geo-grid-2 { margin-top: 14px; align-items: start; }
.geo-grid label { font-size: 13px; color: #475569; font-weight: 600; }
.geo-grid select, .geo-grid input[type="number"] {
    padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 13px; width: 100%; margin-top: 5px; box-sizing: border-box;
}
.geo-note {
    font-size: 12px; color: #94A3B8; line-height: 1.8; padding-top: 18px;
}
.geo-gen-foot { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
@media (max-width: 720px) { .geo-grid { grid-template-columns: 1fr; } }

/* ── 生成按钮（原 index.php 内联样式全局化 + 点击按压缩放反馈） ── */
.np-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 20px; border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff; color: var(--text);
    font-weight: 600; font-size: 13px; line-height: 1.4;
    cursor: pointer; text-decoration: none;
    transition: transform .12s ease, box-shadow .18s ease,
                background-color .18s ease, border-color .18s ease, color .18s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.np-btn:hover { border-color: var(--primary); color: var(--primary); }
.np-btn:active { transform: scale(.96); }
.np-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.np-btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.np-btn-pri {
    background: linear-gradient(135deg, var(--primary), #2563EB);
    border: none; color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}
.np-btn-pri:hover { background: linear-gradient(135deg, #1D4ED8, #1E40AF); color: #fff; }
.np-btn-pri:active { box-shadow: 0 1px 3px rgba(59, 130, 246, 0.35); }

.np-btn-head {
    display: inline-block; text-decoration: none; line-height: 1.2;
    padding: 7px 16px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #2563EB);
    color: #fff; font-size: 13px; font-weight: 600;
    transition: transform .12s ease, background-color .18s ease;
}
.np-btn-head:hover { background: #1D4ED8; color: #fff; }
.np-btn-head:active { transform: scale(.96); }
.np-btn-mine { background: linear-gradient(135deg, #F59E0B, #D97706); }
.np-btn-mine:hover { background: #B45309; }
.np-btn-brand-all { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.np-btn-brand-all:hover { background: #5B21B6; }

.rp-hint { font-size: 11.5px; color: #94A3B8; max-width: 520px; line-height: 1.5; }

/* ── 错误状态卡片（项目不存在 / 无权访问等页面守卫提示） ──
   body > .err-card 覆盖全局容器规则 body > *:not(.topbar):not(.site-footer)（同 .section 处理） */
body > .err-card {
    max-width: 520px !important;
    margin: 72px auto !important;
    padding: 44px 36px !important;
    background: #fff;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 14px;
    text-align: center;
    box-shadow: var(--sh-sm, 0 2px 8px rgba(15, 23, 42, 0.05));
}
.err-ic { font-size: 42px; line-height: 1; }
.err-title { margin: 14px 0 6px; font-size: 17px; font-weight: 700; color: var(--text-title, #0f172a); }
.err-sub { margin: 0 0 24px; font-size: 13px; color: var(--text-muted, #64748b); line-height: 1.6; }
.err-ops { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── 生成中加载遮罩（仅 GEO 表单提交时触发） ── */
.geo-gen-loading {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.geo-gen-card {
    background: #fff; border-radius: 14px; padding: 28px 34px;
    text-align: center; max-width: 340px; box-shadow: var(--sh-md);
}
.geo-gen-spinner {
    width: 38px; height: 38px; margin: 0 auto 14px;
    border: 3px solid var(--primary-l); border-top-color: var(--primary);
    border-radius: 50%;
    animation: geo-spin .8s linear infinite;
}
@keyframes geo-spin { to { transform: rotate(360deg); } }
.geo-gen-card b { display: block; font-size: 14px; color: var(--title); }
.geo-gen-card p { margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ── 报告在线查看 shell（report_view.php 包壳） ── */
body.rpt-body > .rpt-shell { max-width: 960px; margin: 0 auto; padding: 0 20px 48px; }
.rpt-toolbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; padding: 10px 16px; margin: 18px 0 16px;
    box-shadow: var(--sh-xs);
}
.rpt-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 8px;
    background: var(--primary-l); color: var(--primary-dark);
    font-size: 13px; font-weight: 700; text-decoration: none;
}
.rpt-back:hover { background: var(--primary); color: #fff; }
.rpt-title { flex: 1; min-width: 180px; font-size: 14.5px; font-weight: 800; color: var(--title); }
.rpt-dl {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 8px;
    border: 1px solid var(--border); color: var(--text);
    font-size: 13px; font-weight: 600; text-decoration: none;
}
.rpt-dl:hover { border-color: var(--primary); color: var(--primary); }
.rpt-article {
    background: #fff; border: 1px solid var(--border-l);
    border-radius: 14px; padding: 30px 34px 40px;
    box-shadow: var(--sh-xs);
    font-size: 14px; line-height: 1.75; color: var(--text-body);
}
/* 覆盖 GEO 报告内联样式（!important） */
.rpt-article h1 { font-size: 24px !important; line-height: 1.4 !important; }
.rpt-article h2 { font-size: 17.5px !important; margin-top: 26px !important; }
.rpt-article h3 { font-size: 15px !important; margin-top: 20px !important; }
.rpt-article p { line-height: 1.8 !important; margin: 8px 0 !important; }
.rpt-article strong { color: var(--text-title); }
.rpt-article table { width: 100% !important; font-size: 12.5px; border: none !important; }
.rpt-article td, .rpt-article th { border: none !important; padding: 8px 11px !important; }
.rpt-article th {
    background: var(--bg-subtle) !important; text-align: left !important;
    color: var(--text-title); font-weight: 700;
    border-bottom: 2px solid var(--line) !important;
    white-space: nowrap;
}
.rpt-article td { vertical-align: top; line-height: 1.6; }
.rpt-article td { border-bottom: 1px solid var(--line-weak) !important; }
.rpt-article tr:last-child td { border-bottom: none !important; }
.rpt-article tr:nth-child(even) td { background: #FAFBFD; }
.rpt-article tr:not(:first-child):hover td { background: #EEF2FF; }
/* 序号列（表头为「#/序号」的表格，report_view.php 注入 t-num） */
.rpt-article table.t-num th:first-child,
.rpt-article table.t-num td:first-child {
    text-align: center !important;
    width: 36px;
    color: var(--muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.rpt-article a { color: var(--primary) !important; text-decoration: none !important; }
.rpt-article a:hover { text-decoration: underline !important; }
.rpt-article blockquote {
    background: #F5F9FF !important; border-left: 3px solid var(--primary) !important;
    color: #334155 !important; padding: 9px 14px !important;
    margin: 10px 0 !important; border-radius: 0 8px 8px 0;
}
.rpt-article pre { background: var(--bg-subtle) !important; }
.rpt-article input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--primary); }
@media (max-width: 720px) {
    .rpt-article { padding: 18px 16px 24px; }
    .rpt-article table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* 报告与方案列表 */
.rp-kind {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 800;
}
.rp-report { background: var(--purple-l); color: #6D28D9; }
.rp-plan   { background: var(--cyan-l); color: #0E7490; }
.rp-view { background: var(--primary-l); color: var(--primary-dark); }
.rp-view:hover { background: var(--primary); color: white; }
.rp-nohtml { font-size: 12px; color: var(--muted); }

.st-muted { color: var(--muted); }

/* 解读条 */
.ov-tipbar {
    background: #FFFBEB; border-left: 4px solid #F59E0B;
    border-radius: 10px; padding: 12px 16px; margin: 14px 0;
    color: #78350F; font-size: 12.5px; line-height: 1.9;
}
.ov-tip-title { font-weight: 800; margin-bottom: 4px; font-size: 13px; }
.ov-tip-line { text-indent: 0; }
.tip-no { color: #B45309; font-weight: 800; }

/* 来源对比 */
.ov-src-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ov-src-card {
    background: var(--panel); border: 1px solid var(--border-l);
    border-radius: 12px; overflow: hidden;
}
.ov-src-card > .ov-src-head { padding-top: 14px; }
.ov-accent-green { border-top: 3px solid var(--green); }
.ov-accent-blue  { border-top: 3px solid var(--primary); }
.ov-src-head {
    display: flex; align-items: baseline; gap: 10px; padding: 0 18px;
}
.ov-src-name { font-size: 16px; font-weight: 800; }
.ov-accent-green .ov-src-name { color: var(--green); }
.ov-accent-blue  .ov-src-name { color: var(--primary); }
.ov-src-sub { font-size: 11px; color: var(--muted); }
.ov-src-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px 16px;
}
.ov-mini {
    background: var(--bg); border-radius: 10px; padding: 10px 14px;
}
.ov-mini-cap { font-size: 11px; color: var(--muted); font-weight: 700; }
.ov-mini-val { font-size: 22px; font-weight: 800; color: var(--title); line-height: 1.3; }
.ov-mini-st { font-size: 10px; font-weight: 700; }

/* 品牌提及率双栏 */
.ov-brand-dual { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; margin-top: 14px; }
.ov-brand-card {
    background: var(--panel); border: 1px solid var(--border-l);
    border-radius: 12px; overflow: hidden; padding-bottom: 18px;
}
.ov-accent-orange { border-top: 3px solid var(--orange); }
.ov-brand-head {
    display: flex; align-items: baseline; gap: 10px; padding: 16px 20px 6px;
    border-bottom: 1px solid var(--border-l); margin-bottom: 6px;
}
.ov-brand-head h2 { margin: 0; font-size: 16px; color: var(--title); }
.ov-accent-green .ov-brand-head h2 { color: var(--green); }
.ov-accent-orange .ov-brand-head h2 { color: #B45309; }
.ov-comp-count {
    margin-left: auto; font-size: 12px; font-weight: 800; color: #B45309;
    background: var(--orange-l); border-radius: 999px; padding: 2px 10px;
}
/* 左卡：我方大数字 */
.ov-mine-body { display: flex; flex-direction: column; align-items: center; padding: 14px 24px 0; }
.ov-mine-cap { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.ov-no-chip {
    background: var(--green-l); color: #047857; font-weight: 800; font-size: 11px;
    border-radius: 6px; padding: 2px 8px;
}
.ov-mine-num { font-size: 44px; font-weight: 800; color: var(--orange); line-height: 1.25; }
.ov-mine-brand { font-size: 16px; font-weight: 800; color: var(--title); margin-bottom: 12px; }
.ov-mine-track { width: 70%; height: 8px; margin-bottom: 10px; }
.ov-mine-note { font-size: 11.5px; color: var(--muted); }

/* 右卡：竞品条榜 */
.ov-comp-list { padding: 6px 20px 0; }
.ov-comp-row {
    display: grid; grid-template-columns: 34px 150px 1fr 56px;
    align-items: center; gap: 10px; padding: 7px 0; font-size: 13px;
    border-bottom: 1px dashed var(--border-l);
}
.ov-comp-row:last-child { border-bottom: none; }
.ov-comp-pos { color: var(--muted); font-weight: 700; font-size: 12px; text-align: center; }
.ov-medal { font-style: normal; font-size: 16px; }
.ov-comp-name { color: var(--title); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-bar-track { background: var(--bg); border-radius: 6px; height: 8px; overflow: hidden; }
.ov-bar-fill { height: 100%; border-radius: 6px; min-width: 3px; }
.ov-bar-fill.mine { background: var(--orange); }
.ov-bar-fill.comp { background: #94A3B8; }
.ov-comp-val { color: var(--title); font-weight: 800; text-align: right; }
.ov-comp-val.zero { color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
    .ov-src-compare { grid-template-columns: 1fr; }
    .ov-brand-dual { grid-template-columns: 1fr; }
    .ov-comp-row { grid-template-columns: 30px 110px 1fr 50px; }
}

/* ── 品牌趋势页（trends.php） ── */
.seg-scroll { flex-wrap: wrap; }
.tr-filters {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 14px; padding: 6px 18px; margin: 0 0 18px;
}
.tr-frow {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.tr-frow:last-child { border-bottom: none; }
.tr-flabel {
    flex: 0 0 64px; color: var(--muted); font-size: 12px; font-weight: 700;
}
.tr-fmeta { margin-left: auto; color: var(--muted); font-size: 11px; }
.tr-brand-chip {
    color: var(--primary); font-size: 12px; font-weight: 800;
    background: #EFF6FF; padding: 3px 12px; border-radius: 12px;
}
.tr-sample-chip {
    color: var(--muted); font-size: 12px; font-weight: 700;
    background: var(--bg); border: 1px solid var(--border);
    padding: 3px 12px; border-radius: 12px;
}
.tr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tr-card {
    background: #fff; border-radius: 14px; overflow: hidden;
    border: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.tr-bar { height: 3px; flex: 0 0 auto; }
.tr-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; }
.tr-title { font-size: 14px; font-weight: 800; letter-spacing: -.3px; }
.tr-sub { font-size: 11px; color: var(--muted); font-weight: 500; }
.tr-cur {
    margin-left: auto; font-size: 11px; font-weight: 800;
    background: #fff; padding: 3px 10px; border-radius: 10px;
}
.tr-body { flex: 1; padding: 10px 14px 2px; }
.tr-svg { width: 100%; height: auto; display: block; background: #fff; }
.tr-foot { padding: 6px 18px 14px; font-size: 10px; color: var(--muted); }
.tr-empty { padding: 40px 0; text-align: center; color: var(--muted); font-size: 12px; font-style: italic; }
@media (max-width: 900px) {
    .tr-grid { grid-template-columns: 1fr; }
    .tr-flabel { flex-basis: 100%; }
}

/* ===== 平板适配 768px ===== */
@media (max-width: 768px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .meta-grid { grid-template-columns: repeat(2, 1fr); }
    .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
    .topnav { flex-wrap: wrap; }
    .filter-bar select { flex: 1 1 170px; }
    .cit-select, .cit-input { min-width: 0; }
    .src-head { flex-direction: column; align-items: stretch; }
    .ov-comp-row { grid-template-columns: 28px 96px 1fr 46px; }
    /* 采集记录表：第一级隐藏（延迟 / 客户端） */
    .runs-table .col-hide-md { display: none; }
    /* 用户中心项目清理卡片：4 列 → 2 列 */
    .uc-proj-list { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 手机适配 480px ===== */
@media (max-width: 480px) {
    .kpi-row { grid-template-columns: 1fr; }
    .kpi { padding: 14px 16px; }
    .kpi-num { font-size: 26px; }

    .topbar-inner { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
    .topnav { order: 3; width: 100%; justify-content: flex-start; gap: 4px; }
    .topnav a { padding: 5px 10px; font-size: 12.5px; }
    .topuser { margin-left: auto; }

    body > *:not(.topbar):not(.site-footer) { padding: 0 12px; }
    .section { padding: 14px 14px 18px; }
    .breadcrumb { padding: 12px 12px 0 !important; font-size: 12px; }

    .project-card-head { padding-right: 96px; }
    .project-card-stats { grid-template-columns: repeat(2, 1fr); }
    .src-title h1 { font-size: 20px; }

    .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table th, .data-table td { white-space: nowrap; }
    /* 手机端：第三级隐藏（品牌） */
    .runs-table .col-hide-xs { display: none; }
    /* 用户中心项目清理卡片：2 列 → 1 列 */
    .uc-proj-list { grid-template-columns: 1fr; }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar select, .filter-bar .reset-btn { width: 100%; }
    .cit-filter-row { flex-direction: column; align-items: stretch; }
    .cit-select, .cit-input { width: 100%; }
    .cit-actions { margin-left: 0; justify-content: flex-end; }
    .cit-flabel { flex-basis: auto; }
    .geo-gen-foot { flex-direction: column; align-items: stretch; }
    .geo-gen-foot button { width: 100%; }

    .pagination .page-tip { margin-left: 0; width: 100%; justify-content: center; }
    .tr-filters { padding: 6px 12px; }
    .login-card { padding: 28px 20px; }
    .agent-home { padding: 0 12px; }

    /* 用户中心 / 用户管理：表单竖排 */
    .admin-head h1 { font-size: 19px; }
    .admin-form-row { flex-direction: column; }
    .admin-form-row .admin-submit { align-self: stretch; }
    .uc-keylab { min-width: 100%; }
    .uc-import { padding: 10px 12px; }
    body > .section.admin-card { padding: 14px 14px 18px; margin: 14px 0; }
}

/* ── GEO 新客户教程页（guide.php） ── */
.tut-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tut-list li {
    display: flex; align-items: baseline; gap: 8px;
    font-size: 13px; line-height: 1.8; color: var(--text);
}
.tut-list li::before {
    content: "·"; flex: none; width: 16px; height: 16px; border-radius: 50%;
    background: var(--primary-l); color: var(--primary);
    font-weight: 800; font-size: 13px; line-height: 16px; text-align: center;
}
.tut-list b { color: var(--text-title); font-weight: 700; }
.tut-list code {
    background: var(--bg); border: 1px solid var(--border-l);
    padding: 1px 6px; border-radius: 5px; font-size: 12px;
    font-family: var(--font-mono, monospace); color: var(--primary-dark);
}

/* ═════════ 项目工作台 hub.php ═════════ */
.hub-head-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hub-head-main h1 { font-size: 22px; margin: 0; }
.hub-back { font-size: 13px; color: var(--muted); text-decoration: none; }
.hub-back:hover { color: var(--primary); text-decoration: none; }
.hub-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hub-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 16px; }
.hub-stats .kpi { padding: 14px 14px 12px; border-top-width: 3px; }
.hub-stats .kpi-num { font-size: 24px; }
.hub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.hub-entry {
    display: flex; flex-direction: column; gap: 3px;
    padding: 14px 14px 12px;
    background: var(--panel);
    border: 1px solid var(--border-l);
    border-radius: var(--r-md);
    text-decoration: none; color: var(--text);
    transition: transform .15s, box-shadow .15s;
}
.hub-entry:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); text-decoration: none; }
.hub-entry-icon { font-size: 20px; }
.hub-entry-name { font-size: 14px; font-weight: 700; color: var(--title); }
.hub-entry-desc { font-size: 11px; color: var(--muted); line-height: 1.45; }

/* 工作台入口分组：小标题 + 分组间距 */
.hub-group { margin-top: 20px; }
.hub-group-title {
    display: flex; align-items: center;
    font-size: 13px; font-weight: 800; color: var(--text-body);
    margin: 0 0 10px; padding-left: 10px;
    border-left: 3px solid var(--primary);
}
.hub-group:first-of-type { margin-top: 0; }

/* 首页卡片「进入工作台」按钮 */
.card-btn-hub {
    background: var(--primary); color: #fff; padding: 7px 16px;
    font-size: 12.5px; border-radius: 8px; box-shadow: var(--sh-brand);
    flex: none;
}
.card-btn-hub:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); }

/* 首页卡片快捷入口按钮（品牌管理 / 提示词 / 定制提示词 + 数据洞察 / 报告生成 / 智能工具） */
.card-quick-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-quick-row .card-btn-hub { margin-left: auto; }
.card-btn-quick {
    padding: 5px 11px; font-size: 11.5px;
    background: var(--bg-subtle); color: var(--text-body);
    border: 1px solid var(--line-weak);
}
.card-btn-quick:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 子页面同级引导（数据洞察 / 智能工具 组入口）——卡片式 */
.tool-group {
    margin: 20px 0; padding: 18px;
    background: var(--bg-panel); border: 1px solid var(--line);
    border-radius: 14px; box-shadow: var(--sh-xs);
}
.tool-group-head {
    font-size: 13px; font-weight: 800; color: var(--title);
    padding-bottom: 14px; margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.tool-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 18px 10px 16px; border-radius: 12px;
    background: var(--bg-subtle); border: 1px solid transparent;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.tool-card:hover { background: var(--primary-l); transform: translateY(-2px); box-shadow: var(--sh-sm); text-decoration: none; }
.tool-icon { font-size: 26px; line-height: 1; }
.tool-name { font-size: 13px; font-weight: 700; color: var(--text-body); }
.tool-desc { font-size: 11px; color: var(--muted); line-height: 1.4; text-align: center; }
.tool-card.on { background: var(--primary); box-shadow: var(--sh-brand); }
.tool-card.on .tool-name { color: #fff; }
.tool-card.on .tool-desc { color: rgba(255, 255, 255, .85); }
/* 引导卡片下方的间距统一由 .tool-group 自身下边距提供（消除 src-head / section 的额外 top 边距） */
.tool-group + .src-head { margin-top: 0; }
.tool-group + .section  { margin-top: 0; }
@media (max-width: 640px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }

/* 响应式：工作台入口网格 */
@media (max-width: 980px) {
    .hub-stats { grid-template-columns: repeat(3, 1fr); }
    .hub-grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .hub-stats { grid-template-columns: repeat(2, 1fr); }
    .hub-grid  { grid-template-columns: 1fr; }
    /* 采集记录表：第二级隐藏（轮次 / 类型 / 引用） */
    .runs-table .col-hide-sm { display: none; }
}