/**
 * Design Token — 全站 CSS 变量（深色 / 浅色双主题）
 * 用于：所有前台页面
 */

/* 深色主题（默认） */
:root,
[data-theme="dark"] {
    --color-bg: #141318;
    --color-surface: #1E1D24;
    --color-surface-hover: #2A2933;
    --color-accent: #D4845C;
    --color-accent-dim: rgba(212, 132, 92, 0.15);
    --color-text: #F0EEE6;
    --color-text-muted: #9B98A8;
    /* 涨跌基础色（与配色模式无关，供 cn/intl 映射） */
    --rise-red: #F07178;
    --fall-red: #F07178;
    --rise-green: #6EEBB5;
    --fall-green: #6EEBB5;
    --rise-red-bg: rgba(240, 113, 120, 0.12);
    --fall-red-bg: rgba(240, 113, 120, 0.12);
    --rise-green-bg: rgba(110, 235, 181, 0.12);
    --fall-green-bg: rgba(110, 235, 181, 0.12);
    --flash-rise-red: rgba(240, 113, 120, 0.35);
    --flash-fall-red: rgba(240, 113, 120, 0.35);
    --flash-rise-green: rgba(110, 235, 181, 0.35);
    --flash-fall-green: rgba(110, 235, 181, 0.35);
    --color-border: rgba(240, 238, 230, 0.08);
    --color-input-bg: #2A2933;
    --color-shadow: rgba(0, 0, 0, 0.35);
    --color-nav-bg: rgba(20, 19, 24, 0.92);
    --color-chain-line: rgba(212, 132, 92, 0.45);
}

/* 浅色主题 */
[data-theme="light"] {
    --color-bg: #F5F3EE;
    --color-surface: #FFFFFF;
    --color-surface-hover: #EDEAE3;
    --color-accent: #B86A42;
    --color-accent-dim: rgba(184, 106, 66, 0.12);
    --color-text: #1A1920;
    --color-text-muted: #6B6878;
    --rise-red: #D63B44;
    --fall-red: #D63B44;
    --rise-green: #0D9B6E;
    --fall-green: #0D9B6E;
    --rise-red-bg: rgba(214, 59, 68, 0.1);
    --fall-red-bg: rgba(214, 59, 68, 0.1);
    --rise-green-bg: rgba(13, 155, 110, 0.1);
    --fall-green-bg: rgba(13, 155, 110, 0.1);
    --flash-rise-red: rgba(214, 59, 68, 0.25);
    --flash-fall-red: rgba(214, 59, 68, 0.25);
    --flash-rise-green: rgba(13, 155, 110, 0.25);
    --flash-fall-green: rgba(13, 155, 110, 0.25);
    --color-border: rgba(26, 25, 32, 0.1);
    --color-input-bg: #FFFFFF;
    --color-shadow: rgba(26, 25, 32, 0.08);
    --color-nav-bg: rgba(255, 255, 255, 0.94);
    --color-chain-line: rgba(184, 106, 66, 0.35);
}

/* 涨跌语义色：默认红涨绿跌（cn） */
:root {
    --color-up: var(--rise-red);
    --color-down: var(--fall-green);
    --color-up-bg: var(--rise-red-bg);
    --color-down-bg: var(--fall-green-bg);
    --color-flash-up: var(--flash-rise-red);
    --color-flash-down: var(--flash-fall-green);
}

/* 国际惯例：绿涨红跌 */
[data-color-scheme="intl"] {
    --color-up: var(--rise-green);
    --color-down: var(--fall-red);
    --color-up-bg: var(--rise-green-bg);
    --color-down-bg: var(--fall-red-bg);
    --color-flash-up: var(--flash-rise-green);
    --color-flash-down: var(--flash-fall-red);
}

/* 间距 / 圆角 / 字体（主题无关） */
:root {
    --radius-sm: 6px;
    --radius-md: 10px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --container-max: 1280px;
    --header-h: 56px;
    --font-display: 'Syne', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-mono: 'DM Mono', 'SF Mono', 'Consolas', 'Noto Sans SC', monospace;
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --color-logo-brand: #F7931A;
}
