/*
 * lg-theme.css — 全站日/夜间模式设计令牌（唯一源）
 *
 * 约定：
 * 1. 主题令牌（CSS 变量）只在本文件定义，其他文件（含 scss/_theme.scss、
 *    各 JSP 内联 <style>）只消费 var(--xxx)，不得重复定义，避免两处失同步。
 * 2. 作用域用 html[data-theme]，因为 FOUC 防闪脚本在 <head> 里即可给
 *    <html> 设属性，首帧生效；<body> 同时带 data-theme 供图表 bundle
 *    （读 document.body.dataset.theme）判断暗色。
 * 3. 值对齐自 frontpage-dashboard-chart.jsp（重构前内联令牌块），
 *    改动这里时请同步检查 dashboard 布局遗留的页面级覆盖规则。
 */
html[data-theme="light"] {
    --bg-topnav:        #ffffff;
    --bg-topnav-hover:  #f3f4f6;
    --bg-body:          #f0f2f5;
    --bg-sidebar:       #f0f2f5;
    --bg-sidebar-hover: #e4e6ea;
    --bg-sidebar-active:#dbe4f0;
    --bg-main:          #f5f6f8;
    --bg-card:          #ffffff;
    --bg-search:        #e4e6ea;
    --bg-search-focus:  #ffffff;
    --bg-footer-bg:     #e4e6ea;
    --text-primary:     #1a1d29;
    --text-secondary:   #6b7280;
    --text-muted:       #9ca3af;
    --text-sidebar-item:#374151;
    --border-color:     #e5e7eb;
    --border-active:    #2563eb;
    --accent-color:     #2563eb;
    --accent-bg:        #eff6ff;
    --badge-bg:         #e5e7eb;
    --badge-text:       #6b7280;
    --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-card:      0 2px 8px rgba(0, 0, 0, 0.04);
    --empty-color:      #d1d5db;
    --spinner-track:    #e5e7eb;
    --spinner-accent:   #9ca3af;
    --skeleton-highlight: #ffffff;
    --topnav-border:    #e5e7eb;
    /* 产业链页左侧导航（industry-chain-list.jsp） */
    --chain-link-bg:          #f5f6fa;
    --chain-link-hover-bg:    #eef1ff;
    --chain-sidebar-input-bg: #f9f9fb;
    --chain-title-hover-bg:   #f8f9ff;
}

html[data-theme="dark"] {
    --bg-topnav:        #1a1d2b;
    --bg-topnav-hover:  #252a3d;
    --bg-body:          #161821;
    --bg-sidebar:       #12141b;
    --bg-sidebar-hover: #1e2231;
    --bg-sidebar-active:#1a2240;
    --bg-main:          #1a1d2b;
    --bg-card:          #242840;
    --bg-search:        #1e2231;
    --bg-search-focus:  #252a3d;
    --bg-footer-bg:     #1e2231;
    --text-primary:     #e5e7eb;
    --text-secondary:   #9ca3af;
    --text-muted:       #6b7280;
    --text-sidebar-item:#d1d5db;
    --border-color:     #454c5d;
    --border-active:    #60a5fa;
    --accent-color:     #60a5fa;
    --accent-bg:        #1e3a5f;
    --badge-bg:         #303543;
    --badge-text:       #9ca3af;
    --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-card:      0 2px 8px rgba(0, 0, 0, 0.2);
    --empty-color:      #374151;
    --spinner-track:    #454c5d;
    --spinner-accent:   #6b7280;
    --skeleton-highlight: #3d4254;
    --topnav-border:    #3f4656;
    /* 产业链页左侧导航（industry-chain-list.jsp） */
    --chain-link-bg:          #1e2231;
    --chain-link-hover-bg:    #1a2240;
    --chain-sidebar-input-bg: #1e2231;
    --chain-title-hover-bg:   #1e2231;
    /* 港股通页（hk 前缀的 _style.jsp、hk-page-nav.jsp、hk-family-nav.jsp）的浅底/悬停/选中底：
       这三个名字只在暗色侧定义——亮色的默认值写在各调用点的 var(--x, 兜底) 里
       （胶囊 #f4f5f7 / 面板 #fafbfc），所以亮色渲染不受影响；
       暗色不给值的话会掉进亮色兜底，胶囊和白底面板会直接在白夜里亮起来。 */
    --bg-subtle:        #252a3d;
    --bg-hover:         #252a3d;
    --bg-active:        #1a2240;
}

/* 基础暗色兜底：即使不引 all.min.css 的布局（如 dashboard）也保证最小可用 */
html[data-theme="dark"] body {
    background-color: #161821;
    color: #d1d5db;
}
html[data-theme="dark"] a {
    color: #60a5fa;
}
html[data-theme="dark"] a:hover {
    color: #93c5fd;
}
