/* ============================================================
   全站主题令牌（单一数据源）
   index.html / settings.html 共用，统一切换 <html data-theme="cN">
   c1 为默认主题（不设置 data-theme 属性时生效）
   ============================================================ */

:root {
    /* 1. 默认：深邃暗蓝 (Dark Cyber) */
    --bg-base: #060910;
    --bg-card: #0b1120;
    --bg-nav: #090e17;
    --bg-inner: #040711;
    --border-color: #1e293b;
    --border-bright: #334155;
    --accent-color: #0284c7;
    --accent-hover: #38bdf8;
    --accent-glow: rgba(2, 132, 199, 0.35);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

/* 2. 彭博黑金 (纯黑底色 + 琥珀橙光) */
[data-theme="c2"] {
    --bg-base: #000000;
    --bg-card: #0c0b0a;
    --bg-nav: #12100e;
    --bg-inner: #050403;
    --border-color: #2b2319;
    --border-bright: #443725;
    --accent-color: #d97706;
    --accent-hover: #f59e0b;
    --accent-glow: rgba(217, 119, 6, 0.35);
    --text-main: #ffffff;
    --text-muted: #a89f91;
}

/* 3. 松石墨翡 (幽深青绿底 + 翠绿荧光) */
[data-theme="c3"] {
    --bg-base: #020f0d;
    --bg-card: #051e1a;
    --bg-nav: #031713;
    --bg-inner: #010a08;
    --border-color: #0d3830;
    --border-bright: #145347;
    --accent-color: #059669;
    --accent-hover: #10b981;
    --accent-glow: rgba(5, 150, 105, 0.35);
    --text-main: #f0fdf4;
    --text-muted: #6ee7b7;
}

/* 4. 赛博暗紫 (深夜紫晶底 + 霓虹紫芒) */
[data-theme="c4"] {
    --bg-base: #090514;
    --bg-card: #140d28;
    --bg-nav: #0f0920;
    --bg-inner: #06030e;
    --border-color: #2f1a52;
    --border-bright: #48277d;
    --accent-color: #7c3aed;
    --accent-hover: #a855f7;
    --accent-glow: rgba(124, 58, 237, 0.35);
    --text-main: #faf5ff;
    --text-muted: #c084fc;
}

/* 5. 暗夜熔岩 (炭黑底 + 炽烈赤红) */
[data-theme="c5"] {
    --bg-base: #0f0404;
    --bg-card: #1c0808;
    --bg-nav: #140505;
    --bg-inner: #080202;
    --border-color: #3b1212;
    --border-bright: #5c1c1c;
    --accent-color: #dc2626;
    --accent-hover: #ef4444;
    --accent-glow: rgba(220, 38, 38, 0.4);
    --text-main: #fff5f5;
    --text-muted: #fca5a5;
}

/* 6. 北欧灰青 (雾霾青冷灰) */
[data-theme="c6"] {
    --bg-base: #061015;
    --bg-card: #0b1d24;
    --bg-nav: #08171d;
    --bg-inner: #030a0d;
    --border-color: #153542;
    --border-bright: #204e60;
    --accent-color: #0891b2;
    --accent-hover: #06b6d4;
    --accent-glow: rgba(8, 145, 178, 0.35);
    --text-main: #ecfeff;
    --text-muted: #67e8f9;
}

/* 7. 暖木摩卡 (深炭棕卡其) */
[data-theme="c7"] {
    --bg-base: #0c0906;
    --bg-card: #18130d;
    --bg-nav: #130f0a;
    --bg-inner: #070503;
    --border-color: #33261a;
    --border-bright: #4d3a27;
    --accent-color: #b45309;
    --accent-hover: #d97706;
    --accent-glow: rgba(180, 83, 9, 0.35);
    --text-main: #fefce8;
    --text-muted: #fde047;
}

/* 8. 暗钛冷灰 (极简冷钢工业底) */
[data-theme="c8"] {
    --bg-base: #0a0d11;
    --bg-card: #121820;
    --bg-nav: #0e131a;
    --bg-inner: #06080b;
    --border-color: #243040;
    --border-bright: #364860;
    --accent-color: #475569;
    --accent-hover: #cbd5e1;
    --accent-glow: rgba(203, 213, 225, 0.3);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

/* ============================================================
   统一页面标签栏（浏览器标签页样式）
   由 templates/_tabs.html 渲染，全站各页面共用
   .page-tabs-bar 为外层容器：左侧标签可横向滚动，右侧承载页面级操作按钮
   （如行情分析页的「视图 / 刷新所有」），避免这些按钮只出现在顶栏而产生割裂感
   ============================================================ */
.page-tabs-bar {
    display: flex;
    flex: 0 0 auto; /* index.html 的 body 为纵向 flex，需禁止标签栏被压缩，否则顶部被裁切 */
    align-items: stretch;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-color);
}
.page-tabs {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: flex-end;
    gap: 4px;
    padding: 6px 16px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.page-tabs::-webkit-scrollbar { display: none; }
/* 页面级操作区（仅行情分析页渲染），与标签同一行、右对齐 */
.page-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 0 12px;
}
.page-actions .scan-status-text {
    font-size: 0.74rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.page-actions .btn-tool {
    padding: 7px 14px;
    font-size: 0.82rem;
}
.page-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.page-tab:hover {
    color: var(--text-main);
    background: var(--bg-inner);
}
.page-tab.active {
    color: var(--text-main);
    background: var(--bg-card);
    border-color: var(--border-color);
    border-top: 2px solid var(--accent-color);
    margin-bottom: -1px;
    padding-top: 6px;
    font-weight: 600;
}

/* ============================================================
   内容页滚动容器（实时跟踪 / 持仓管理 / 交易复盘 / 策略图解 / 管理后台 / 个人中心）
   这 6 个页面原本整页滚动，顶栏与页面标签栏会被卷走。
   这里改为与「行情分析」一致的模型：body 固定视口高度且不滚动，
   由 <main class="container"> 内部滚动，从而顶栏与 7 个页面标签始终可见。
   注：行情分析页的滚动容器是 .workspace-scroll-box（非 .container），不受影响；
       登录/注册页无 .page-tabs-bar，同样不受影响。
   ============================================================ */
body:has(.page-tabs-bar) {
    height: 100vh;
    overflow: hidden;
}
body:has(.page-tabs-bar) > main.container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* 主题色块选择器（index.html 与 settings.html 共用） */
.theme-picker-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.45);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-picker-circle:hover {
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.55);
}
.theme-picker-circle.active {
    border-color: #ffffff !important;
    transform: scale(1.06);
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.22), 0 0 0 2px rgba(255, 255, 255, 0.9) !important;
}
.theme-picker-circle.active::after {
    content: "✓";
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}