/* ==========================================================================
   知海深智 GEO · 深空信号观测台 / Signal Observatory
   统一设计语言：精确 · 数据驱动 · 冷静权威 · 深空遥测
   纯前端 CSS 皮肤重做。保留 app.js/index.html 全部 class 选择器。
   ========================================================================== */

/* :::::::::::::::::::::::::::: 1. 设计 Token :::::::::::::::::::::::::::: */
:root {
    /* ---- 主强调色（必须为 hex：app.js 存在 var(--primary)15 的 8 位 hex 拼接） ---- */
    --primary:        #22d3ee;   /* 电光青 主导 */
    --primary-strong: #2dd4bf;   /* 电光青偏绿 主高亮 */
    --primary-soft:   #67e8f9;
    --primary-deep:   #0e7490;
    --primary-bg:     rgba(34, 211, 238, 0.10);
    --signal-green:   #34d399;   /* 数据类信号绿 */
    --violet:         #a78bfa;
    --violet-bg:      rgba(167, 139, 250, 0.11);
    --sky:            #38bdf8;
    --sky-bg:         rgba(56, 189, 248, 0.11);
    --cyan:           #22d3ee;
    --cyan-bg:        rgba(34, 211, 238, 0.10);
    --pink:           #f472b6;

    /* ---- 语义色（低饱和暗底适配） ---- */
    --success:        #34d399;
    --success-dark:   #059669;
    --success-bg:     rgba(52, 211, 153, 0.12);
    --warning:        #fbbf24;
    --warning-bg:     rgba(251, 191, 36, 0.12);
    --danger:         #f87171;
    --danger-bg:      rgba(248, 113, 113, 0.12);
    --info:           #38bdf8;
    --info-bg:        rgba(56, 189, 248, 0.12);
    --none-bg:        rgba(148, 163, 184, 0.12);

    /* ---- 深冷墨蓝黑背景 ---- */
    --bg-canvas:  #070b14;
    --bg:         #0b1424;
    --bg-elev:    #0e1829;

    /* ---- 分层面板表面 ---- */
    --surface-0: #0a1220;
    --surface-1: #0d1729;
    --surface-2: #111d33;
    --surface-3: #16233c;
    --bg-card:        var(--surface-1);
    --bg-secondary:   var(--surface-2);
    --card-bg:        var(--surface-1);

    /* ---- 中性文字 ink（三级，全部蓝底冷调） ---- */
    --ink:        #ccd9ee;
    --ink-strong: #eaf2fd;
    --ink-muted:  #8499bd;
    --ink-weak:   #5b6d8f;
    --text-primary:   #eaf2fd;
    --text-secondary: #a9b9d6;
    --text-muted:     #8499bd;

    /* ---- 描边 / 网格线 ---- */
    --border-color:   #1b2a45;
    --border-strong:  #29405f;
    --border-light:   #16223a;
    --stroke:         rgba(126, 170, 255, 0.10);

    /* ---- 圆角 / 布局 ---- */
    --radius-sm: 8px;
    --radius:    14px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --border-radius:    var(--radius);
    --border-radius-sm: var(--radius-sm);

    /* ---- 阴影（悬浮分层投影） ---- */
    --shadow-sm: 0 1px 2px rgba(3, 8, 20, 0.35);
    --shadow:    0 6px 20px rgba(3, 8, 20, 0.42);
    --shadow-md: 0 12px 32px rgba(3, 8, 20, 0.52);
    --shadow-lg: 0 20px 48px rgba(3, 8, 20, 0.60);
    --shadow-glow-primary: 0 0 26px rgba(34, 211, 238, 0.16);
    --shadow-glow-green:   0 0 22px rgba(52, 211, 153, 0.14);

    /* ---- 渐变 ---- */
    --gradient-primary:  linear-gradient(135deg, #22d3ee 0%, #2dd4bf 100%);
    --gradient-violet:   linear-gradient(135deg, #a78bfa 0%, #7c6cf6 100%);
    --gradient-sky:      linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
    --gradient-cyan:     linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
    --gradient-pink:     linear-gradient(135deg, #f472b6 0%, #fb7185 100%);
    --gradient-success:  linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-warning:  linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-danger:   linear-gradient(135deg, #f43f5e 0%, #f87171 100%);
    --gradient-card:     linear-gradient(180deg, #111c31 0%, #0d1729 100%);
    --gradient-body:     linear-gradient(160deg, #070b14 0%, #0b1424 45%, #0a101f 100%);
    --gradient-brand:    linear-gradient(90deg, #22d3ee 0%, #38bdf8 100%);

    /* ---- 侧栏 / 过渡 ---- */
    --sidebar-width: 252px;
    --topbar-height: 62px;
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
    --speed: 0.28s;

    /* ---- 字体 ---- */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', Roboto, Ubuntu, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas,
                 'Liberation Mono', SFMono-Regular, monospace;
}

/* :::::::::::::::::::::::::::: 2. Reset & 基础 :::::::::::::::::::::::::::: */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--gradient-body);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; }

/* 全局背景：遥测网格 + 星点光晕（径向淡化） */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 520px at 78% -8%, rgba(56, 189, 248, 0.07), transparent 60%),
        radial-gradient(700px 480px at 8% 112%, rgba(45, 212, 191, 0.05), transparent 60%);
}
body::after {
    content: '';
    position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .55;
    background-image:
        linear-gradient(rgba(126, 170, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(126, 170, 255, 0.03) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(120% 120% at 50% 0%, #000 35%, transparent 78%);
            mask-image: radial-gradient(120% 120% at 50% 0%, #000 35%, transparent 78%);
}
#login-page, #app-layout, .login-wrap, .main-content { position: relative; z-index: 1; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1f314f; border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #2c4066; background-clip: padding-box; }
::selection { background: rgba(34, 211, 238, 0.28); color: var(--ink-strong); }

/* 等宽字体族容器（遥测数据感） */
.mono, .font-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
code, pre { font-family: var(--font-mono); }

/* :::::::::::::::::::::::::::: 3. 特效容器 :::::::::::::::::::::::::::: */
.fx-particles {
    position: absolute; inset: 0; z-index: 0;
    width: 100%; height: 100%;
    pointer-events: none; opacity: .85;
}

/* :::::::::::::::::::::::::::: 4. 登录页 :::::::::::::::::::::::::::: */
.login-page {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    overflow: hidden;
    isolation: isolate;
}
.login-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.login-bg-grid {
    position: absolute; inset: -40%;
    background-image:
        linear-gradient(rgba(126, 170, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(126, 170, 255, 0.05) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(80% 80% at 50% 42%, #000 20%, transparent 78%);
            mask-image: radial-gradient(80% 80% at 50% 42%, #000 20%, transparent 78%);
    animation: gridDrift 40s linear infinite;
}
@keyframes gridDrift { to { transform: translate3d(54px, 54px, 0); } }
.login-bg-orb {
    position: absolute; border-radius: 50%; pointer-events: none;
    filter: blur(70px); opacity: .16;
}
.orb-a { width: 520px; height: 520px; left: -120px; top: -120px;
         background: radial-gradient(circle, #22d3ee, transparent 70%); animation: orbFloat 14s ease-in-out infinite; }
.orb-b { width: 460px; height: 460px; right: -140px; bottom: -140px;
         background: radial-gradient(circle, #38bdf8, transparent 70%); animation: orbFloat 18s ease-in-out infinite reverse; }
.orb-c { width: 340px; height: 340px; left: 50%; top: 60%;
         background: radial-gradient(circle, #2dd4bf, transparent 70%); opacity: .10; animation: orbFloat 22s ease-in-out infinite; }
@keyframes orbFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(30px, 26px, 0); }
}

/* ---- 双栏登录外壳 ---- */
.login-shell {
    position: relative; z-index: 2; width: 100%; max-width: 940px;
    display: grid; grid-template-columns: 1fr 1.05fr;
    border-radius: 28px; overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--surface-1);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(3, 8, 20, 0.5);
}
/* 左：品牌区 */
.login-hero {
    position: relative; display: flex; align-items: center; justify-content: center;
    padding: 52px 40px; overflow: hidden;
    background:
        radial-gradient(130% 120% at 12% 0%, rgba(34,211,238,0.16), transparent 55%),
        radial-gradient(120% 120% at 100% 100%, rgba(52,211,153,0.10), transparent 55%),
        linear-gradient(180deg, #0a1424 0%, #0a111f 100%);
}
.login-hero::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background-image:
        linear-gradient(rgba(126,170,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(126,170,255,0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(85% 85% at 50% 42%, #000 15%, transparent 78%);
            mask-image: radial-gradient(85% 85% at 50% 42%, #000 15%, transparent 78%);
}
.login-hero-inner { position: relative; z-index: 2; max-width: 320px; }
.login-brand-badge {
    width: 76px; height: 76px; margin-bottom: 22px;
    display: flex; align-items: center; justify-content: center; padding: 12px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid rgba(34, 211, 238, 0.28);
    box-shadow: var(--shadow-md), 0 0 30px rgba(34, 211, 238, 0.14);
    position: relative; overflow: hidden;
}
.login-brand-badge::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(120% 120% at 20% 0%, rgba(34,211,238,0.16), transparent 50%);
}
.login-brand-badge .logo-login { width: 100%; height: 100%; object-fit: contain; }
.login-monogram {
    font-family: var(--font-mono);
    font-size: 34px; font-weight: 700; line-height: 1;
    background: var(--gradient-brand);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.login-hero h1 {
    font-family: var(--font-mono);
    font-size: 30px; font-weight: 700; letter-spacing: 0.01em;
    color: var(--ink-strong); line-height: 1.2;
}
.brand-en {
    font-family: var(--font-mono);
    background: var(--gradient-brand);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    font-weight: 700; letter-spacing: 0.04em;
}
.login-sub { margin-top: 8px; color: var(--ink-muted); font-size: 14px; letter-spacing: 0.5px; }
.login-feats { list-style: none; margin: 30px 0 0; padding: 0; }
.login-feats li {
    display: flex; gap: 10px; align-items: flex-start; margin: 12px 0;
    color: var(--ink-muted); font-size: 14px; line-height: 1.5;
}
.login-feats li .fmt { color: var(--primary); font-size: 12px; line-height: 22px; }
.login-signal {
    position: absolute; right: -80px; bottom: -80px; width: 240px; height: 240px;
    pointer-events: none;
}
.login-signal i {
    position: absolute; inset: 0; border-radius: 50%;
    border: 1px solid rgba(34, 211, 238, 0.18);
}
.login-signal i:nth-child(2) { inset: 46px; }
.login-signal i:nth-child(3) { inset: 92px; border-color: rgba(52, 211, 153, 0.22); }

/* 右：登录面板 */
.login-panel {
    position: relative; display: flex; flex-direction: column; justify-content: center;
    padding: 52px 46px; background: var(--surface-1);
}
.login-welcome { margin-bottom: 26px; }
.login-eyebrow {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.28em;
    color: var(--primary); text-transform: uppercase;
}
.login-panel-title { font-family: var(--font-mono); font-size: 24px; font-weight: 700; margin: 8px 0 6px; color: var(--ink-strong); }
.login-panel-sub { margin: 0; color: var(--ink-muted); font-size: 14px; }
.login-card {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 26px;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.login-card::before {
    content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34,211,238,0.5), transparent);
}
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-error {
    min-height: 20px; font-size: 13px; color: var(--danger);
    padding: 0 4px; line-height: 1.5;
}
.login-error:empty { display: none; }
.login-aux { margin: 16px 4px 0; font-size: 12px; color: var(--ink-muted); line-height: 1.6; }

/* 窄屏：上下堆叠 */
@media (max-width: 860px) {
    .login-shell { grid-template-columns: 1fr; max-width: 460px; }
    .login-hero { padding: 40px 28px 12px; }
    .login-hero::before { display: none; }
    .login-hero-inner { max-width: none; text-align: center; }
    .login-brand-badge { margin-left: auto; margin-right: auto; }
    .login-feats { display: none; }
    .login-signal { display: none; }
    .login-panel { padding: 28px 24px 38px; }
}

/* :::::::::::::::::::::::::::: 5. 主布局 :::::::::::::::::::::::::::: */
.app-layout { display: flex; min-height: 100vh; background: transparent; }

/* ---- 侧边栏 ---- */
.sidebar {
    width: var(--sidebar-width);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    background: linear-gradient(180deg, #0a1222 0%, #0b1424 100%);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow), inset -1px 0 0 var(--stroke);
    transition: transform var(--transition);
}
.sidebar-header {
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center;
}
.sidebar-logo.brand-logo { display: flex; align-items: center; }
.brand-image.logo-login { width: 100%; max-width: 240px; margin: 0 auto; }
.brand-image.logo-side { width: 100%; max-width: 150px; }

/* 文字品牌锁标 */
.sidebar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-brand-name {
    font-family: var(--font-mono);
    font-size: 19px; font-weight: 700; letter-spacing: 0.01em;
    color: var(--ink-strong); white-space: nowrap;
}
.sidebar-brand-en {
    font-family: var(--font-mono);
    font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em;
    padding: 3px 8px; border-radius: 6px; white-space: nowrap;
    background: rgba(34,211,238,0.12);
    border: 1px solid rgba(34,211,238,0.3);
    color: var(--primary);
}

.sidebar-nav {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 16px 12px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 11px 14px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    color: var(--ink-muted);
    font-size: 14px; font-weight: 500;
    cursor: pointer; user-select: none;
    border: 1px solid transparent;
    transition: var(--transition);
    position: relative;
}
.nav-item svg { flex: 0 0 auto; opacity: .75; }
.nav-item:hover { color: var(--ink); background: rgba(126, 170, 255, 0.05); }
.nav-item.active {
    color: var(--primary-soft);
    background: linear-gradient(90deg, rgba(34,211,238,0.14), rgba(34,211,238,0.05));
    border-color: rgba(34, 211, 238, 0.18);
    box-shadow: inset 2px 0 0 var(--primary);
}
.nav-item.active svg { opacity: 1; color: var(--primary); }

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--border-color);
    background: rgba(10, 18, 32, 0.5);
}
.user-info { display: flex; align-items: center; gap: 11px; padding: 6px 4px; }
.user-avatar {
    width: 38px; height: 38px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(34,211,238,0.22), rgba(45,212,191,0.12));
    border: 1px solid rgba(34,211,238,0.2);
    color: var(--primary-soft);
    font-family: var(--font-mono); font-weight: 700; font-size: 16px;
}
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.user-role { font-size: 12px; color: var(--ink-muted); margin-top: 1px; }
.btn-logout {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; margin-top: 10px; margin-left: auto;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    color: var(--ink-muted); cursor: pointer;
    transition: var(--transition);
}
.btn-logout:hover { color: var(--danger); border-color: rgba(248,113,113,0.4); background: var(--danger-bg); }

/* ---- 主内容 ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex; flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}
.topbar {
    height: var(--topbar-height); flex: 0 0 var(--topbar-height);
    display: flex; align-items: center; gap: 14px;
    padding: 0 24px;
    background: rgba(10, 15, 28, 0.72);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 40;
}
.btn-toggle-sidebar {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex: 0 0 auto;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    color: var(--ink-muted); cursor: pointer;
    transition: var(--transition);
}
.btn-toggle-sidebar:hover { color: var(--primary); border-color: rgba(34,211,238,0.4); }
.page-title {
    font-family: var(--font-mono);
    font-size: 19px; font-weight: 700; letter-spacing: 0.01em;
    color: var(--ink-strong);
    white-space: nowrap;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-date {
    font-family: var(--font-mono);
    font-size: 13px; color: var(--ink-muted);
    padding: 6px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.btn-bell {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    color: var(--ink-muted); cursor: pointer;
    transition: var(--transition);
}
.btn-bell:hover { color: var(--primary); border-color: rgba(34,211,238,0.4); }
.notif-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 18px; height: 18px; padding: 0 5px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    color: #04121a;
    background: var(--gradient-primary);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(34,211,238,0.5);
}
.page-content { padding: 24px; flex: 1; position: relative; }

/* :::::::::::::::::::::::::::: 6. 通用工具类 :::::::::::::::::::::::::::: */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.text-center { text-align: center; }
.text-muted { color: var(--ink-muted); }
.text-sm { font-size: 13px; }
.fw-600 { font-weight: 600; }
.w-100 { width: 100%; }
.mb-8 { margin-bottom: 8px; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flat { border: 0 !important; box-shadow: none !important; background: transparent !important; }

.page-header-bar { padding: 4px 0 18px; }
.page-subtitle { color: var(--ink-muted); font-size: 14px; margin-top: 6px; }
.search-bar { display: flex; gap: 10px; align-items: center; }
.search-input-group {
    display: flex; flex: 1; min-width: 200px; max-width: 380px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 12px; align-items: center; gap: 8px;
    transition: var(--transition);
}
.search-input-group:focus-within { border-color: rgba(34,211,238,0.5); box-shadow: 0 0 0 3px rgba(34,211,238,0.12); }
.search-input-group input { border: 0; background: transparent; color: var(--ink); width: 100%; padding: 10px 0; font-size: 14px; outline: 0; }
.search-input-group input::placeholder { color: var(--ink-weak); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* :::::::::::::::::::::::::::: 7. 按钮 :::::::::::::::::::::::::::: */
.btn {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; min-height: 42px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; line-height: 1;
    white-space: nowrap; cursor: pointer; user-select: none;
    transition: var(--transition);
}
/* 光扫 ::before */
.btn::before {
    content: ''; position: absolute; top: 0; left: -60%; width: 36%; height: 100%;
    transform: skewX(-22deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
    opacity: 0;
}
.btn:hover::before { animation: btnSweep 0.72s var(--ease); }
@keyframes btnSweep { 0% { left: -60%; opacity: 0; } 20% { opacity: 1; } 100% { left: 130%; opacity: 0; } }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none !important; }
.btn:disabled::before, .btn.disabled::before { display: none; }

.btn-primary { background: var(--gradient-primary); color: #04121a; box-shadow: 0 4px 16px rgba(34,211,238,0.24); }
.btn-primary:hover { box-shadow: 0 6px 22px rgba(34,211,238,0.36); transform: translateY(-1px); }
.btn-violet { background: var(--gradient-violet); color: #0b0b1e; box-shadow: 0 4px 16px rgba(167,139,250,0.22); }
.btn-violet:hover { box-shadow: 0 6px 22px rgba(167,139,250,0.34); transform: translateY(-1px); }
.btn-cyan { background: var(--gradient-cyan); color: #04121a; box-shadow: 0 4px 16px rgba(34,211,238,0.24); }
.btn-cyan:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(34,211,238,0.36); }
.btn-success { background: var(--gradient-success); color: #03130d; box-shadow: 0 4px 16px rgba(52,211,153,0.22); }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(52,211,153,0.34); }
.btn-danger { background: var(--gradient-danger); color: #180605; box-shadow: 0 4px 16px rgba(248,113,113,0.24); }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(248,113,113,0.36); }
.btn-secondary {
    background: var(--surface-2); color: var(--ink);
    border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: rgba(34,211,238,0.45); color: var(--ink-strong); transform: translateY(-1px); }
.btn-outline {
    background: transparent; color: var(--primary-soft);
    border-color: rgba(34, 211, 238, 0.4);
}
.btn-outline:hover { background: rgba(34,211,238,0.08); border-color: var(--primary); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }

.btn-danger-text { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger-text:hover { background: var(--danger-bg); }

.btn-sm { padding: 7px 14px; min-height: 34px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 5px 10px; min-height: 28px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 13px 26px; min-height: 48px; font-size: 16px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* :::::::::::::::::::::::::::: 8. 表单 :::::::::::::::::::::::::::: */
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.3px; }
.form-group-inline { flex-direction: column; }
.form-group-captcha { display: flex; gap: 12px; align-items: center; }
.captcha-canvas { border-radius: var(--radius-sm); overflow: hidden; flex: 0 0 auto; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 180px; }

input, select, textarea { font-family: inherit; font-size: 14px; }
input.input, select.input, textarea.input,
input.form-input, select.form-input, textarea.form-input,
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--ink);
    transition: var(--transition);
    outline: none;
}
input.input::placeholder, select.input::placeholder, textarea.input::placeholder,
.form-input::placeholder, .form-group input::placeholder { color: var(--ink-weak); }
input.input:focus, select.input:focus, textarea.input:focus,
.form-input:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.13);
    background: var(--surface-3);
}
select.input, select.form-input { cursor: pointer; }
select.input option, select.form-input option { background: var(--surface-2); color: var(--ink); }
textarea { resize: vertical; min-height: 84px; }

/* 日期筛选输入：与普通输入区分，提高在深色背景上的可见度 */
input[type="date"].input, input[type="date"].form-input,
.form-group input[type="date"] {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--ink-strong);
    color-scheme: dark;
}
input[type="date"].input:hover, input[type="date"].form-input:hover,
.form-group input[type="date"]:hover { border-color: rgba(34, 211, 238, 0.5); }
input[type="date"].input::-webkit-calendar-picker-indicator,
input[type="date"].form-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.6); opacity: 0.85; cursor: pointer;
}
input[type="date"].input:focus, input[type="date"].form-input:focus,
.form-group input[type="date"]:focus { border-color: rgba(34, 211, 238, 0.55); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.13); }

/* :::::::::::::::::::::::::::: 9. 卡片 :::::::::::::::::::::::::::: */
.card {
    position: relative;
    background:
        radial-gradient(620px circle at var(--sx, 50%) var(--sy, 12%), rgba(45, 212, 191, 0.05), transparent 46%),
        var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card::before {
    content: ''; position: absolute; top: 0; left: 22px; right: 22px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.45), transparent);
    pointer-events: none;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.card-title { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--ink-strong); letter-spacing: 0.01em; }
.card-body { padding: 20px; }
.card-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border-color); }

.chart-card { position: relative; background: var(--gradient-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow); overflow: hidden; }
.chart-card::before { content: ''; position: absolute; top: 0; left: 22px; right: 22px; height: 1px; background: linear-gradient(90deg, transparent, rgba(34,211,238,0.4), transparent); }
.chart-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

/* ------- 状态统计卡 ------- */
.stats-grid {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    margin-bottom: 22px;
}
.stat-card {
    position: relative;
    padding: 20px 20px 18px;
    background:
        radial-gradient(520px circle at var(--sx, 50%) var(--sy, 8%), rgba(56, 189, 248, 0.06), transparent 50%),
        var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34,211,238,0.45), transparent);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat-content { display: flex; flex-direction: column; }
.stat-label { font-size: 13px; color: var(--ink-muted); }
.stat-value {
    font-family: var(--font-mono);
    font-size: 30px; font-weight: 700; line-height: 1.2;
    color: var(--ink-strong);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}
.stat-icon {
    position: absolute; top: 18px; right: 18px;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--primary);
    border: 1px solid var(--border-color);
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-trend { font-size: 12px; margin-top: 10px; color: var(--ink-muted); }
.stat-trend.up    { color: var(--success); }
.stat-trend.down  { color: var(--danger); }
.stat-trend svg   { width: 15px; height: 15px; vertical-align: -2px; margin-right: 5px; }
.stat-trend.up   svg { filter: drop-shadow(0 0 5px rgba(52,211,153,0.35)); }
.stat-trend.down svg { filter: drop-shadow(0 0 5px rgba(248,113,113,0.35)); }

/* 统计卡颜色变体 */
.stat-card.purple::before { background: linear-gradient(90deg, transparent, rgba(167,139,250,0.5), transparent); }
.stat-card.purple .stat-icon { color: var(--violet); border-color: rgba(167,139,250,0.3); background: rgba(167,139,250,0.08); }
.stat-card.blue::before { background: linear-gradient(90deg, transparent, rgba(56,189,248,0.5), transparent); }
.stat-card.blue .stat-icon { color: var(--sky); border-color: rgba(56,189,248,0.3); background: rgba(56,189,248,0.08); }
.stat-card.green::before { background: linear-gradient(90deg, transparent, rgba(52,211,153,0.5), transparent); }
.stat-card.green .stat-icon { color: var(--success); border-color: rgba(52,211,153,0.3); background: rgba(52,211,153,0.08); }
.stat-card.orange::before { background: linear-gradient(90deg, transparent, rgba(251,191,36,0.5), transparent); }
.stat-card.orange .stat-icon { color: var(--warning); border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.08); }
.stat-icon.purple { color: var(--violet); background: rgba(167,139,250,0.08); border-color: rgba(167,139,250,0.3); }
.stat-icon.blue   { color: var(--sky); background: rgba(56,189,248,0.08); border-color: rgba(56,189,248,0.3); }
.stat-icon.green  { color: var(--success); background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.3); }
.stat-icon.orange { color: var(--warning); background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.3); }

/* ------- 图表 ------- */
.chart-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: 22px; }
.chart-container { position: relative; height: 300px; width: 100%; }
.chart-wrap { position: relative; }

/* ------- 进度条 ------- */
.progress-bar { height: 8px; width: 100%; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s var(--ease); }
.progress-fill { height: 100%; transition: width 0.6s var(--ease); }

/* ------- 评分环 / 环形图 ------- */
.circle-score { font-family: var(--font-mono); color: var(--primary); font-variant-numeric: tabular-nums; }
.circle-score.score-high { color: var(--success); }
.circle-score.score-mid  { color: var(--warning); }
.circle-score.score-low  { color: var(--danger); }
.ring-bg { stroke: var(--surface-3); }
.ring-fill { fill: none; stroke: var(--primary); transition: stroke-dashoffset 0.8s var(--ease); }
.report-score-ring { width: 84px; height: 84px; position: relative; }
.report-score-ring svg { transform: rotate(-90deg); }
.report-score-ring .ring-fill { stroke: var(--primary); filter: drop-shadow(0 0 6px rgba(34,211,238,0.5)); }
.report-score-ring.score-high .ring-fill { stroke: var(--success); filter: drop-shadow(0 0 6px rgba(52,211,153,0.5)); }
.report-score-ring.score-mid  .ring-fill { stroke: var(--warning); filter: drop-shadow(0 0 6px rgba(251,191,36,0.5)); }
.report-score-ring.score-low  .ring-fill { stroke: var(--danger); filter: drop-shadow(0 0 6px rgba(248,113,113,0.4)); }
.report-score-num {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--ink-strong);
}
.citation-count { font-family: var(--font-mono); font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.trend-pill { display: inline-flex; padding: 3px 9px; font-size: 12px; border-radius: 999px; background: var(--surface-3); color: var(--ink-muted); font-family: var(--font-mono); }

/* :::::::::::::::::::::::::::: 10. 表格 :::::::::::::::::::::::::::: */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: var(--surface-1); }
table.data-table, table.table, table.tb {
    width: 100%; border-collapse: collapse; font-size: 14px; min-width: 540px;
}
.data-table th, .table th, .tb th {
    text-align: left; padding: 12px 16px;
    background: var(--surface-2);
    color: var(--ink-muted);
    font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
    font-family: var(--font-mono);
    text-transform: uppercase;
}
.data-table td, .table td, .tb td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--ink);
    vertical-align: middle;
}
/* 斑马纹 + 悬浮高亮 */
.data-table tbody tr:nth-child(even), .table tbody tr:nth-child(even), .tb tbody tr:nth-child(even) { background: rgba(126, 170, 255, 0.025); }
.data-table tbody tr, .table tbody tr, .tb tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover, .table tbody tr:hover, .tb tbody tr:hover { background: rgba(34, 211, 238, 0.06); }
.data-table tbody tr:last-child td, .table tbody tr:last-child td, .tb tbody tr:last-child td { border-bottom: none; }
.data-table .actions, .table .actions, .tb .actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }

.kw-cell { min-width: 180px; line-height: 1.6; }
.highlighted { background: rgba(34,211,238,0.08); }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px rgba(34,211,238,0.7); }

/* 数据行相关工具类 */
.bg-primary { background: var(--primary-bg); }
.bg-success { background: var(--success-bg); }
.bg-warning { background: var(--warning-bg); }
.success-text { color: var(--success); }
.danger-text { color: var(--danger); }
.warning-text { color: var(--warning); }
.info-text { color: var(--info); }

/* :::::::::::::::::::::::::::: 11. 徽章 / 标签 / 胶囊 :::::::::::::::::::::::::::: */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px;
    font-family: var(--font-mono);
    font-size: 12px; font-weight: 600; line-height: 1.5;
    border-radius: 999px;
    color: var(--ink);
    background: var(--surface-3);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.badge-success { color: var(--success); background: var(--success-bg); border-color: rgba(52,211,153,0.25); }
.badge-warning { color: var(--warning); background: var(--warning-bg); border-color: rgba(251,191,36,0.25); }
.badge-danger  { color: var(--danger);  background: var(--danger-bg);  border-color: rgba(248,113,113,0.25); }
.badge-info    { color: var(--info);    background: var(--info-bg);    border-color: rgba(56,189,248,0.25); }
.badge-purple  { color: var(--violet);  background: var(--violet-bg);  border-color: rgba(167,139,250,0.25); }
.badge-blue    { color: var(--sky);     background: var(--sky-bg);     border-color: rgba(56,189,248,0.25); }
.badge-gray    { color: var(--ink-muted); background: var(--surface-3); border-color: var(--border-color); }

.platform-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px;
    font-size: 12px; font-weight: 600;
    border-radius: 999px;
    color: var(--ink);
    background: var(--surface-3);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}
.platform-tag, .platform-dot { display: inline-flex; align-items: center; }
.platform-tag {
    padding: 2px 9px; font-size: 12px; border-radius: 999px;
    background: var(--surface-3); color: var(--ink-muted); border: 1px solid var(--border-color);
}
.platform-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; flex: 0 0 auto; }

/* :::::::::::::::::::::::::::: 12. Tabs（页内标签） :::::::::::::::::::::::::::: */
.sub-tabs, .report-tabs {
    display: inline-flex; gap: 4px; padding: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    position: relative; overflow: hidden;
}
.sub-tab, .report-tab {
    padding: 8px 18px;
    font-size: 13px; font-weight: 600;
    color: var(--ink-muted);
    background: transparent; border: 0; border-radius: 8px;
    cursor: pointer; white-space: nowrap;
    transition: var(--transition);
}
.sub-tab:hover, .report-tab:hover { color: var(--ink); }
.sub-tab.active, .report-tab.active {
    color: var(--primary-soft);
    background: rgba(34, 211, 238, 0.12);
    box-shadow: inset 0 0 0 1px rgba(34,211,238,0.25);
}

/* :::::::::::::::::::::::::::: 13. 模态框 :::::::::::::::::::::::::::: */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(4, 8, 16, 0.66);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.2s var(--ease);
}
.modal {
    width: 100%; max-width: 620px; max-height: 88vh;
    display: flex; flex-direction: column;
    background: var(--surface-1);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl, var(--shadow-lg)), 0 0 40px rgba(34,211,238,0.08);
    overflow: hidden;
    animation: modalIn 0.26s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(34,211,238,0.05), transparent);
}
.modal-header h3 { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--ink-strong); }
.modal-close {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border-color);
    color: var(--ink-muted); cursor: pointer;
    transition: var(--transition);
}
.modal-close:hover { color: var(--danger); border-color: rgba(248,113,113,0.4); background: var(--danger-bg); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border-color); }

/* :::::::::::::::::::::::::::: 14. Toast :::::::::::::::::::::::::::: */
.toast-container {
    position: fixed; top: 18px; right: 18px; z-index: 300;
    display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px;
    background: var(--surface-1);
    border: 1px solid var(--border-strong);
    border-left-width: 3px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    color: var(--ink);
    font-size: 13.5px; line-height: 1.5;
    animation: toastIn 0.28s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.toast svg { flex: 0 0 auto; margin-top: 2px; }
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }
.toast-message { flex: 1; }

/* :::::::::::::::::::::::::::: 15. 空状态 :::::::::::::::::::::::::::: */
.empty-state, .diag-empty-state {
    padding: 48px 24px; text-align: center;
    color: var(--ink-muted); font-size: 14px;
}
.empty-state::before, .diag-empty-state::before {
    content: ''; display: block;
    width: 46px; height: 46px; margin: 0 auto 14px;
    border-radius: 14px;
    background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%235b6d8f' stroke-width='1.6'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Cpath d='M3 12h18M12 3v18'/%3E%3C/svg%3E") center/22px no-repeat;
    border: 1px solid var(--border-color);
}
.diag-empty-icon { color: var(--ink-weak); }

/* :::::::::::::::::::::::::::: 16. 首页 · AI 答案 :::::::::::::::::::::::::::: */
.ai-answer-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ai-answer-item {
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.ai-answer-item:hover { border-color: rgba(34,211,238,0.35); box-shadow: var(--shadow-sm); }
.ai-answer-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-answer-kw { font-size: 14px; font-weight: 600; color: var(--ink-strong); margin-top: 8px; }
.ai-answer-kw-sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.ai-answer-link { color: var(--primary-soft); font-size: 13px; }
.ai-answer-link:hover { color: var(--primary); text-decoration: underline; }
.answer-view { cursor: pointer; }

/* :::::::::::::::::::::::::::: 17. 信源追踪 / 追踪详情 :::::::::::::::::::::::::::: */
.source-result-card { padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); margin-bottom: 12px; }
.source-result-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.source-result-body { margin-top: 12px; }
.source-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.source-table th { text-align: left; padding: 8px 12px; color: var(--ink-muted); font-family: var(--font-mono); font-size: 12px; border-bottom: 1px solid var(--border-strong); }
.source-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); color: var(--ink); }
.source-url { font-family: var(--font-mono); font-size: 12.5px; color: var(--primary-soft); word-break: break-all; }
.source-platform-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; font-size: 12px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-color); }

/* :::::::::::::::::::::::::::: 18. 通知 :::::::::::::::::::::::::::: */
.notification-list { display: flex; flex-direction: column; gap: 10px; }
.notification-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.notification-item:hover { border-color: rgba(34,211,238,0.35); }
.notification-icon {
    width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-bg); color: var(--primary);
}
.notification-icon svg { width: 20px; height: 20px; }
.notification-content { flex: 1; font-size: 14px; color: var(--ink); }

/* :::::::::::::::::::::::::::: 19. 关键词排名 :::::::::::::::::::::::::::: */
.keyword-rank-list { display: flex; flex-direction: column; gap: 10px; }
.keyword-rank-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.keyword-rank-num {
    width: 36px; height: 36px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-weight: 700; font-size: 15px;
    border-radius: 10px;
    background: var(--surface-3); color: var(--ink-muted);
}
.keyword-rank-info { flex: 1; min-width: 0; }
.keyword-rank-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.keyword-rank-meta { font-size: 12px; color: var(--ink-muted); margin-top: 2px; font-family: var(--font-mono); }
.keyword-rank-score { font-family: var(--font-mono); font-weight: 700; font-size: 15px; }

/* 关键词管理 */
.kw-add-bar { display: flex; gap: 10px; align-items: center; }
.kw-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; margin: 3px;
    background: var(--surface-3); border: 1px solid var(--border-color);
    border-radius: 999px; font-size: 13px; color: var(--ink); font-family: var(--font-mono);
}
.kw-edit { cursor: pointer; color: var(--ink-muted); }
.kw-edit:hover { color: var(--primary); }
.kw-recommend { display: flex; flex-wrap: wrap; gap: 8px; }
.rec-label { font-size: 12px; color: var(--ink-muted); }

/* :::::::::::::::::::::::::::: 20. 设置中心 :::::::::::::::::::::::::::: */
.settings-grid { display: grid; gap: 18px; }
.setting-info-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--border-light); }
.info-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.info-item { padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.info-label { font-size: 12px; color: var(--ink-muted); }
.info-value { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 3px; font-family: var(--font-mono); }

/* API 配置卡 */
.api-config-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.api-config-card { padding: 18px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.api-config-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.api-platform-icon { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--primary-bg); color: var(--primary); }
.api-platform-name { font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.api-platform-status { margin-left: auto; }
.api-config-body { color: var(--ink-muted); font-size: 13px; }
.api-config-footer { margin-top: 12px; display: flex; justify-content: flex-end; }

/* :::::::::::::::::::::::::::: 21. 优化建议 / 优化卡 :::::::::::::::::::::::::::: */
.optimization-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.optimization-card { padding: 18px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); transition: var(--transition); }
.optimization-card:hover { border-color: rgba(34,211,238,0.35); transform: translateY(-2px); }
.optimization-card-header { display: flex; align-items: center; gap: 10px; }
.optimization-card-title { font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.optimization-desc { font-size: 13px; color: var(--ink-muted); margin-top: 8px; line-height: 1.6; }
.optimization-value { font-family: var(--font-mono); font-weight: 700; color: var(--primary); }
.industry-name, .industry-price, .platform-fee { font-family: var(--font-mono); }

/* :::::::::::::::::::::::::::: 22. 报告（报表） :::::::::::::::::::::::::::: */
.report-brand { display: flex; align-items: center; gap: 10px; }
.report-platforms { display: flex; flex-wrap: wrap; gap: 8px; }
.report-platform-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.report-item-left { display: flex; align-items: center; gap: 12px; }
.report-meta { font-size: 12px; color: var(--ink-muted); font-family: var(--font-mono); }

/* 报价配置 */
.price-platform { display: flex; align-items: center; gap: 10px; }
.price-platform-label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-color); background: var(--surface-2); border-radius: 10px; color: var(--ink); }
.price-platform-label:hover { border-color: rgba(34,211,238,0.4); }

/* 平台复选 */
.platform-checkboxes { display: flex; flex-wrap: wrap; gap: 10px; }
.platform-checkboxes-lg { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.platform-checkbox { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); }
.platform-checkbox:hover { border-color: rgba(34,211,238,0.4); }
.platform-checkbox-lg { padding: 12px 14px; }
.platform-name { font-size: 13px; font-weight: 600; }

/* 代理查看商户 · 权限分配等滚动盒 */
.agent-merchant-box, .perm-assign-box { max-height: 62vh; overflow: auto; }

/* :::::::::::::::::::::::::::: 23. 诊断报告模块 :::::::::::::::::::::::::::: */
.diagnosis-form-wrap { max-width: 760px; margin: 0 auto; }
.diagnosis-form-card-lg { padding: 26px; }
.diag-form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.diag-form-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.diag-form-icon { width: 42px; height: 42px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--primary-bg); color: var(--primary); }

.diag-notice { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--info-bg); border: 1px solid rgba(56,189,248,0.25); color: var(--info); font-size: 13px; margin-bottom: 16px; }
.diag-notice-success { background: var(--success-bg); border-color: rgba(52,211,153,0.25); color: var(--success); }

.diag-progress-card { text-align: center; padding: 40px 20px; }
.diag-progress-overlay { display: inline-flex; align-items: center; justify-content: center; position: relative; width: 96px; height: 96px; margin: 0 auto 18px; }
.diag-spinner-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--primary); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.diag-progress-icon { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary-bg); color: var(--primary); }
.diag-spinner-text { color: var(--ink-muted); font-size: 14px; }

.diag-stats-bar { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.diag-stat-card { padding: 18px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); text-align: center; position: relative; overflow: hidden; transition: var(--transition); }
.diag-stat-card::before { content: ''; position: absolute; top: 0; left: 20px; right: 20px; height: 1px; background: linear-gradient(90deg, transparent, rgba(34,211,238,0.4), transparent); }
.diag-stat-icon { width: 40px; height: 40px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; border-radius: 11px; background: var(--surface-3); color: var(--primary); }
.diag-stat-label { font-size: 12px; color: var(--ink-muted); }
.diag-stat-value { font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--ink-strong); margin-top: 4px; font-variant-numeric: tabular-nums; }

.diag-steps { display: flex; flex-wrap: wrap; gap: 14px; }
.diag-step { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 180px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.diag-step-num { width: 30px; height: 30px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 9px; font-family: var(--font-mono); font-weight: 700; background: var(--surface-3); color: var(--ink-muted); }
.diag-step-status { font-family: var(--font-mono); font-size: 16px; margin-left: auto; }
.diag-step-status.done { color: var(--success); }
.diag-step-status.running { color: var(--info); }
.diag-step-status.wait { color: var(--ink-weak); }
.diag-step-text { font-size: 13px; color: var(--ink); }

.diag-tips-card { padding: 16px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--ink-muted); font-size: 13.5px; line-height: 1.8; }

.diagnosis-report-list { display: flex; flex-direction: column; gap: 12px; }
.diagnosis-report-item { padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); transition: var(--transition); }
.diagnosis-report-item:hover { border-color: rgba(34,211,238,0.35); }

/* :::::::::::::::::::::::::::: 24. 企业知识库 KB :::::::::::::::::::::::::::: */
.kb-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.kb-field label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.kb-field-foot { font-size: 12px; color: var(--ink-muted); }
.kb-hint { font-size: 12px; color: var(--ink-muted); }
.kb-lock-banner { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--warning-bg); border: 1px solid rgba(251,191,36,0.25); color: var(--warning); font-size: 13px; }
.kb-pic-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--primary-soft); font-size: 13px; cursor: pointer; }
.kb-pic-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); }
.kb-preview { display: flex; align-items: center; gap: 12px; }
.kb-sum-imgs { display: flex; flex-wrap: wrap; gap: 10px; }
.kb-sum-img { position: relative; width: 84px; height: 84px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3); border: 1px solid var(--border-color); }
.kb-sum-img img { width: 100%; height: 100%; object-fit: cover; }
.kb-thumb { width: 100%; height: 100%; object-fit: cover; }
.kb-thumb-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: rgba(4,8,16,0.7); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
.kb-thumb-del:hover { background: var(--danger); }
.kb-sum-item { padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.kb-edit-modal { max-width: 680px; }
.emp-check, .perm-check { display: inline-flex; gap: 8px; align-items: center; margin-right: 14px; }

/* 建议 */
.brand-suggestions { display: flex; flex-direction: column; gap: 10px; }
.suggestion-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.suggestion-name { font-size: 14px; color: var(--ink); flex: 1; }
.suggestion-tag { font-size: 12px; color: var(--ink-muted); font-family: var(--font-mono); }
.merchant-link { color: var(--primary-soft); cursor: pointer; }
.merchant-link:hover { color: var(--primary); text-decoration: underline; }

/* :::::::::::::::::::::::::::: 25. 入场 & 动效 :::::::::::::::::::::::::::: */
.fx-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
    will-change: opacity, transform;
}
.fx-in.fx-revealed:not(:hover) { opacity: 1; transform: none; }
.fx-in.fx-revealed { opacity: 1; }
.fx-counted { }

/* 卡片 hover 轻抬（补充） */
.stat-card, .card, .diag-stat-card, .kb-card, .chart-card {
    will-change: transform;
}

/* 光晕辅助（spotlight 由 effects.js 写 --sx/--sy） */
.kb-card, .toolbar { position: relative; }

/* :::::::::::::::::::::::::::: 26. 响应式 :::::::::::::::::::::::::::: */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; }
    .page-title { font-size: 16px; }
    .topbar-date { display: none; }
}
@media (max-width: 520px) {
    .login-page { padding: 28px 16px; }
    .login-brand h1 { font-size: 26px; }
    .login-brand-badge .logo-login { width: 100%; }
    .login-card { padding: 26px 20px; }
    .page-content { padding: 16px; }
    .card-header, .card-body { padding-left: 16px; padding-right: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .chart-grid { grid-template-columns: 1fr; }
}

/* :::::::::::::::::::::::::::: 26b. 移动端细致适配 :::::::::::::::::::::::::::: */
/* 侧栏抽屉背后的点击蒙层（移动端出现，点空白可收起） */
.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(4, 8, 16, 0.55);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease);
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

@media (min-width: 901px) {
    .btn-toggle-sidebar { display: none; }
    .sidebar-backdrop { display: none; }
}

@media (max-width: 900px) {
    .sidebar { z-index: 110; }
    /* 宽表格在卡片内横向滚动，避免撑破布局 */
    .card-body, .table-wrapper, .perm-assign-box {
        -webkit-overflow-scrolling: touch;
    }
    .card-body { overflow-x: auto; }
    .btn-row { flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .topbar { padding: 0 12px; gap: 10px; }
    .page-title { font-size: 15px; }
    .topbar-right { gap: 6px; }
    .btn { min-height: 40px; }
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal { max-width: 100%; width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
    .modal-header { padding: 14px 16px; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
    .form-row { flex-direction: column; gap: 10px; }
    .form-row .form-group { width: 100%; }
}

@media (max-width: 520px) {
    .page-content { padding: 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .login-card { border-radius: 16px; }
}

/* :::::::::::::::::::::::::::: 27. 动态 DOM 用到的辅助（防御性） :::::::::::::::::::::::::::: */
.option-plat-multi { display: flex; flex-wrap: wrap; gap: 8px; }
.metric-label { font-size: 12px; color: var(--ink-muted); letter-spacing: 0.4px; }
.bar-cell { height: 100%; min-height: 6px; border-radius: 999px; background: var(--surface-3); }

/* :::::::::::::::::::::::::::: 28. 动效克制 / 无障碍 :::::::::::::::::::::::::::: */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .fx-particles { display: none !important; }
    .fx-in { opacity: 1 !important; transform: none !important; }
}
html.fx-no-motion .fx-particles { display: none !important; }
html.fx-no-motion * { animation: none !important; transition: none !important; }
html.fx-no-motion .fx-in { opacity: 1 !important; transform: none !important; }