/*! ABYSS FX bundled asset. Generated by tools/build-web.mjs. Do not edit. */
/* css/tokens.css */
/* ==========================================================================
   深渊汇率 ABYSS FX — 设计令牌
   旧账本 × 深海交易终端
   - :root 为白天主题（暖米纸 / 墨色 / 氧化黄铜）
   - html[data-theme="night"] 覆盖为夜间主题（深海蓝黑 / 磷光绿松石 / 铜线）
   - html[data-updown="global"] 只交换涨跌语义，不动风险色
   字体全部使用系统字体栈，不加载任何外部字体。
   ========================================================================== */

:root {
  /* 页面自己管理明暗主题，声明 color-scheme 避免浏览器/系统强制反色 */
  color-scheme: light;

  /* ---------- 字体 ---------- */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC",
    "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", STSong, "Noto Serif CJK SC",
    "Source Han Serif SC", "SimSun", "PingFang SC", serif;
  --font-mono: "SF Mono", "Cascadia Code", "Roboto Mono",
    "JetBrains Mono", "IBM Plex Mono", "Noto Sans Mono", ui-monospace, monospace;

  /* ---------- 字号层级 ---------- */
  --fs-2xs: 10px;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --fs-3xl: 34px;
  --fs-4xl: 44px;
  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-body: 1.6;

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

  /* ---------- 圆角：克制，12–16px 为主 ---------- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 12px;
  --r-2xl: 14px;
  --r-3xl: 16px;
  --r-pill: 999px;

  /* ---------- 布局 ---------- */
  --topbar-h: 52px;
  --account-h: 84px;
  --rail-left: 240px;
  --rail-right: 340px;
  --gap: 16px;
  --content-max: 1680px;
  --page-pad: 20px;

  /* ---------- 动效 ---------- */
  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 280ms;
  --dur-4: 520ms;
  --ease-std: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  /* ---------- 层级 ---------- */
  --z-topbar: 40;
  --z-account: 35;
  --z-float: 60;
  --z-modal: 70;
  --z-toast: 80;
}

/* ==========================================================================
   白天主题
   ========================================================================== */
:root,
html[data-theme="day"] {
  color-scheme: light;

  /* 底与面板 */
  --bg: #F1EBDD;
  --bg-grain: rgba(20, 56, 60, .028);
  --surface: #FBF8F0;
  --surface-raised: #FFFDF8;
  --surface-sunken: #E9E1D1;
  --surface-hover: #F5EEDF;
  --surface-active: #EDE4D2;

  /* 文字 */
  --ink: #19262B;
  --ink-2: #31454A;
  /* 为正文级对比度（≥4.5:1）从规范原值略作加深 */
  --text-muted: #4E5956;
  --text-faint: #5F675D;

  /* 边框 */
  --border: #D6CDBB;
  --border-strong: #B7AC97;
  --border-soft: #E8E0D1;

  /* 品牌与操作 */
  --brand: #14383C;
  --brand-2: #2B5D5C;
  --brand-contrast: #F7F1E3;
  --brass: #9C6827;
  --brass-strong: #6E440F;
  --brass-soft: #F1E1C3;
  --action: #14383C;
  --action-hover: #1E4D50;
  --action-contrast: #F7F1E3;
  --accent: #8E5C1E;
  --accent-hover: #764A15;
  --accent-contrast: #FFF9EE;
  --link: #6E440F;
  --focus: #B57F35;
  --focus-ring: rgba(181, 127, 53, .34);

  /* 涨跌基础色 */
  --red-500: #B83A2D;
  --red-600: #932A20;
  --red-soft: #F6E2DD;
  --on-red: #FFF8F5;
  --green-500: #177760;
  --green-600: #0F5C49;
  --green-soft: #DFEDE7;
  --on-green: #F4FBF8;

  /* 买卖报价：刻意不用红绿，避免与盈亏混淆 */
  --bid: #2E6680;
  --ask: #8A5A1A;
  --spread: #6F5A3C;
  --spread-soft: #EFE7D6;
  --spread-wide: var(--risk-watch);

  /* 风险与保证金：不随涨跌配色切换 */
  --risk-safe: #2C6A61;
  --risk-safe-soft: #DFECE8;
  --risk-watch: #7C4F0D;
  --risk-watch-soft: #F7E9C8;
  --risk-danger: #A32F23;
  --risk-danger-soft: #F6DFDA;
  --risk-liq: #6E1A14;
  --risk-liq-soft: #F1D6D1;
  --gauge-track: #E7DFCF;

  /* 非行情状态 */
  --loan: #6A4B78;
  --loan-soft: #EDE4F0;
  --info: #24596F;
  --info-soft: #DFEBF0;
  --warn: #7C4F0D;
  --warn-soft: #F7E7C6;
  --danger: #A62C21;
  --danger-soft: #F5DDD8;
  --on-danger: #FFF8F5;
  --success: #2F6B53;
  --success-soft: #E2EEE8;

  /* 图表：白天也保持深色仪表盘 */
  --chart-bg: #0F1B20;
  --chart-bg-elev: #15262B;
  --chart-border: rgba(235, 228, 211, .12);
  --chart-grid: rgba(235, 228, 211, .07);
  --chart-grid-strong: rgba(235, 228, 211, .14);
  --chart-axis: #91A59F;
  --chart-text: #DDE6E1;
  --chart-red: #FF7468;
  --chart-red-soft: rgba(255, 116, 104, .16);
  --chart-green: #43C9AA;
  --chart-green-soft: rgba(67, 201, 170, .15);
  --chart-ma-1: #E6C177;
  --chart-ma-2: #83A9D6;
  --chart-ma-3: #B692C4;
  --chart-crosshair: #C8D4CF;
  --chart-volume: rgba(200, 212, 207, .34);
  --chart-current: #D7A65A;
  --chart-entry: #D7A65A;
  --chart-sl: #FF7A6E;
  --chart-tp: #6FC7E2;
  --chart-liq: #FF4D42;
  --chart-liq-fill: rgba(255, 77, 66, .08);
  --chart-order: #C9B47C;
  --chart-tip-bg: rgba(9, 18, 22, .92);
  --chart-tip-border: rgba(215, 166, 90, .34);
  --chart-equity: #D2A35A;
  --chart-equity-fill: rgba(210, 163, 90, .20);
  --chart-equity-drawdown: rgba(255, 116, 104, .16);

  /* 阴影与浮层 */
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, .55),
              0 1px 2px rgba(25, 38, 43, .06),
              0 8px 24px rgba(25, 38, 43, .045);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, .55),
              0 12px 36px rgba(25, 38, 43, .10);
  --shadow-float: 0 24px 80px rgba(14, 30, 34, .26);
  --overlay: rgba(10, 20, 23, .56);
  --scrollbar: #CFC5B3;
  --selection: #E8D4AF;
}

/* ==========================================================================
   夜间主题（默认，index.html 已设置 data-theme="night"）
   ========================================================================== */
html[data-theme="night"] {
  color-scheme: dark;

  --bg: #0A1114;
  --bg-grain: rgba(216, 166, 92, .028);
  --surface: #101B1F;
  --surface-raised: #152429;
  --surface-sunken: #070F12;
  --surface-hover: #192C31;
  --surface-active: #20363B;

  --ink: #EDE5D4;
  --ink-2: #C9C2B4;
  /* 次级文字在 surface-raised / hover 上也保持 ≥4.5:1 */
  --text-muted: #A3AFAB;
  --text-faint: #8A9894;

  --border: #27393D;
  --border-strong: #3B5155;
  --border-soft: #1B2C30;

  --brand: #D8A65C;
  --brand-2: #E9C27F;
  --brand-contrast: #111A1D;
  --brass: #D8A65C;
  --brass-strong: #F0C47C;
  --brass-soft: #332817;
  --action: #D8A65C;
  --action-hover: #E9BA70;
  --action-contrast: #17140D;
  --accent: #D8A65C;
  --accent-hover: #E9BA70;
  --accent-contrast: #17140D;
  --link: #F0C47C;
  --focus: #E9BA70;
  --focus-ring: rgba(233, 186, 112, .32);

  --red-500: #FF776A;
  --red-600: #FF9C92;
  --red-soft: #3A1F1C;
  --on-red: #2A100E;
  --green-500: #46D3B2;
  --green-600: #79E6CC;
  --green-soft: #12352C;
  --on-green: #06251E;

  --bid: #7FB6CE;
  --ask: #E0B168;
  --spread: #B8A27F;
  --spread-soft: #2A2419;
  --spread-wide: var(--risk-watch);

  --risk-safe: #6FC9B8;
  --risk-safe-soft: #13362F;
  --risk-watch: #E4B660;
  --risk-watch-soft: #392F18;
  --risk-danger: #FF8B7D;
  --risk-danger-soft: #3D1E1A;
  --risk-liq: #FF5B50;
  --risk-liq-soft: #421713;
  --gauge-track: #1B2C30;

  --loan: #C9A6D8;
  --loan-soft: #2D2035;
  --info: #8BC8E3;
  --info-soft: #19303A;
  --warn: #E4B660;
  --warn-soft: #392F18;
  --danger: #FF8B7D;
  --danger-soft: #3D1E1A;
  --on-danger: #2A100E;
  --success: #6FD3B5;
  --success-soft: #13362F;

  --chart-bg: #070E11;
  --chart-bg-elev: #0C171B;
  --chart-border: rgba(235, 229, 212, .10);
  --chart-grid: rgba(235, 229, 212, .055);
  --chart-grid-strong: rgba(235, 229, 212, .12);
  --chart-axis: #7F928F;
  --chart-text: #DCE5E0;
  --chart-red: #FF8276;
  --chart-red-soft: rgba(255, 130, 118, .16);
  --chart-green: #4BD9B7;
  --chart-green-soft: rgba(75, 217, 183, .14);
  --chart-ma-1: #F2CD86;
  --chart-ma-2: #8CB9E8;
  --chart-ma-3: #C79ED6;
  --chart-crosshair: #AABBB6;
  --chart-volume: rgba(190, 205, 199, .30);
  --chart-current: #E1B772;
  --chart-entry: #E1B772;
  --chart-sl: #FF8B7D;
  --chart-tp: #84D3EA;
  --chart-liq: #FF5B50;
  --chart-liq-fill: rgba(255, 91, 80, .10);
  --chart-order: #D8C08C;
  --chart-tip-bg: rgba(5, 12, 15, .94);
  --chart-tip-border: rgba(235, 196, 124, .32);
  --chart-equity: #E1B772;
  --chart-equity-fill: rgba(225, 183, 114, .18);
  --chart-equity-drawdown: rgba(255, 130, 118, .15);

  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, .03),
              0 1px 2px rgba(0, 0, 0, .32),
              0 10px 28px rgba(0, 0, 0, .22);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, .04),
              0 18px 48px rgba(0, 0, 0, .36);
  --shadow-float: 0 28px 90px rgba(0, 0, 0, .62);
  --overlay: rgba(2, 7, 9, .74);
  --scrollbar: #30464A;
  --selection: #4A3420;
}

/* ==========================================================================
   涨跌语义（默认中式：红涨绿跌）
   只交换颜色语义，符号与文字不变；风险色不参与切换。
   ========================================================================== */
:root {
  --mkt-up: var(--red-500);
  --mkt-up-strong: var(--red-600);
  --mkt-up-soft: var(--red-soft);
  --mkt-up-on: var(--on-red);
  --mkt-down: var(--green-500);
  --mkt-down-strong: var(--green-600);
  --mkt-down-soft: var(--green-soft);
  --mkt-down-on: var(--on-green);
  --chart-up: var(--chart-red);
  --chart-up-soft: var(--chart-red-soft);
  --chart-down: var(--chart-green);
  --chart-down-soft: var(--chart-green-soft);
}

/* 国际模式：绿涨红跌 */
html[data-updown="global"] {
  --mkt-up: var(--green-500);
  --mkt-up-strong: var(--green-600);
  --mkt-up-soft: var(--green-soft);
  --mkt-up-on: var(--on-green);
  --mkt-down: var(--red-500);
  --mkt-down-strong: var(--red-600);
  --mkt-down-soft: var(--red-soft);
  --mkt-down-on: var(--on-red);
  --chart-up: var(--chart-green);
  --chart-up-soft: var(--chart-green-soft);
  --chart-down: var(--chart-red);
  --chart-down-soft: var(--chart-red-soft);
}

/* ==========================================================================
   Claude 风格覆盖：暖纸、陶土橙、克制边框与柔和圆角
   仅覆盖颜色/字体/圆角/阴影令牌，布局令牌保持不变。
   ========================================================================== */
:root,
html[data-theme="day"] {
  --font-ui: "Styrene B", "Söhne", "Inter", -apple-system, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-display: "Tiempos Headline", "Source Serif 4", "Source Serif Pro",
    "Songti SC", STSong, "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --font-mono: "SFMono-Regular", "SF Mono", "Cascadia Code", "Roboto Mono",
    "JetBrains Mono", "IBM Plex Mono", "Noto Sans Mono", ui-monospace, monospace;

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 14px;
  --r-2xl: 16px;
  --r-3xl: 20px;

  color-scheme: light;

  --bg: #F5F4EE;
  --bg-grain: transparent;
  --surface: #FBFAF7;
  --surface-raised: #FFFFFF;
  --surface-sunken: #EFECE4;
  --surface-hover: #F5F2EA;
  --surface-active: #ECE8DF;

  --ink: #262624;
  --ink-2: #3F3D38;
  --text-muted: #6B6860;
  --text-faint: #746F65;

  --border: #E3DED3;
  --border-strong: #CFC8BA;
  --border-soft: #ECE8DF;

  --brand: #C96442;
  --brand-2: #B4532F;
  --brand-contrast: #FFF8F4;
  --brass: #C96A46;
  --brass-strong: #A94B2C;
  --brass-soft: #F4E4DB;
  --action: #B4532F;
  --action-hover: #9E4528;
  --action-contrast: #FFF9F5;
  --accent: #B4532F;
  --accent-hover: #9E4528;
  --accent-contrast: #FFF9F5;
  --link: #A94B2C;
  --focus: #D97757;
  --focus-ring: rgba(217, 119, 87, .30);

  --red-500: #C0503B;
  --red-600: #A33E2C;
  --red-soft: #F8E5DF;
  --on-red: #FFF8F5;
  --green-500: #4F7D66;
  --green-600: #3C6652;
  --green-soft: #E4EDE7;
  --on-green: #F5FAF7;

  --bid: #4F6E7A;
  --ask: #965F2E;
  --spread: #7A6A55;
  --spread-soft: #F0EADF;
  --spread-wide: var(--risk-watch);

  --risk-safe: #4F7D66;
  --risk-safe-soft: #E4EDE7;
  --risk-watch: #946529;
  --risk-watch-soft: #F7EBD7;
  --risk-danger: #B04332;
  --risk-danger-soft: #F7E2DD;
  --risk-liq: #8E2F22;
  --risk-liq-soft: #F2DAD5;
  --gauge-track: #E7E1D5;

  --loan: #7A5C82;
  --loan-soft: #EFE8F1;
  --info: #4F6E7A;
  --info-soft: #E6EDF0;
  --warn: #946529;
  --warn-soft: #F7EBD7;
  --danger: #B04332;
  --danger-soft: #F7E2DD;
  --on-danger: #FFF8F5;
  --success: #4F7D66;
  --success-soft: #E4EDE7;

  /* 图表：浅色纸面，陶土橙 / 鼠尾草绿 */
  --chart-bg: #FBFAF7;
  --chart-bg-elev: #F3F0E8;
  --chart-border: rgba(38, 38, 36, .13);
  --chart-grid: rgba(38, 38, 36, .06);
  --chart-grid-strong: rgba(38, 38, 36, .13);
  --chart-axis: #7C776D;
  --chart-text: #3F3D38;
  --chart-red: #C0503B;
  --chart-red-soft: rgba(192, 80, 59, .14);
  --chart-green: #4F7D66;
  --chart-green-soft: rgba(79, 125, 102, .14);
  --chart-ma-1: #C08A4E;
  --chart-ma-2: #5F7F91;
  --chart-ma-3: #9A7FA8;
  --chart-crosshair: #5F5B53;
  --chart-volume: rgba(60, 58, 53, .24);
  --chart-current: #C96442;
  --chart-entry: #C96442;
  --chart-sl: #C0503B;
  --chart-tp: #5F7F91;
  --chart-liq: #A33E2C;
  --chart-liq-fill: rgba(163, 62, 44, .08);
  --chart-order: #B08A54;
  --chart-tip-bg: rgba(251, 250, 247, .97);
  --chart-tip-border: rgba(201, 100, 66, .32);
  --chart-equity: #C15F3C;
  --chart-equity-fill: rgba(193, 95, 60, .15);
  --chart-equity-drawdown: rgba(192, 80, 59, .14);

  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, .75),
              0 1px 2px rgba(38, 38, 36, .04),
              0 8px 24px rgba(38, 38, 36, .035);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, .75),
              0 14px 38px rgba(38, 38, 36, .09);
  --shadow-float: 0 26px 80px rgba(38, 38, 36, .18);
  --overlay: rgba(38, 38, 36, .34);
  --scrollbar: #D8D2C6;
  --selection: #F3DDD3;
}

html[data-theme="night"] {
  color-scheme: dark;

  --bg: #1F1E1D;
  --bg-grain: transparent;
  --surface: #262624;
  --surface-raised: #2B2A27;
  --surface-sunken: #191817;
  --surface-hover: #302E2A;
  --surface-active: #37342F;

  --ink: #F5F3EC;
  --ink-2: #DAD5C9;
  --text-muted: #B0AA9E;
  --text-faint: #948E83;

  --border: #3B3833;
  --border-strong: #514C44;
  --border-soft: #322F2B;

  --brand: #E08A6E;
  --brand-2: #EDA48B;
  --brand-contrast: #1F1E1D;
  --brass: #E08A6E;
  --brass-strong: #F0A88F;
  --brass-soft: #3A2A24;
  --action: #D97757;
  --action-hover: #E48B6D;
  --action-contrast: #1F1E1D;
  --accent: #E08A6E;
  --accent-hover: #EDA48B;
  --accent-contrast: #1F1E1D;
  --link: #EDA48B;
  --focus: #E08A6E;
  --focus-ring: rgba(224, 138, 110, .30);

  --red-500: #E27964;
  --red-600: #F09A87;
  --red-soft: #3B2620;
  --on-red: #1F1E1D;
  --green-500: #86B49E;
  --green-600: #A5CCB9;
  --green-soft: #24332C;
  --on-green: #16221C;

  --bid: #8FAFBC;
  --ask: #D9A15F;
  --spread: #B7AC98;
  --spread-soft: #2C2822;
  --spread-wide: var(--risk-watch);

  --risk-safe: #86B49E;
  --risk-safe-soft: #24332C;
  --risk-watch: #D9A15F;
  --risk-watch-soft: #342B1E;
  --risk-danger: #E27964;
  --risk-danger-soft: #3B2620;
  --risk-liq: #EE8B7A;
  --risk-liq-soft: #40241F;
  --gauge-track: #35322D;

  --loan: #C6A6CE;
  --loan-soft: #302637;
  --info: #8FAFBC;
  --info-soft: #24303A;
  --warn: #D9A15F;
  --warn-soft: #342B1E;
  --danger: #E27964;
  --danger-soft: #3B2620;
  --on-danger: #1F1E1D;
  --success: #86B49E;
  --success-soft: #24332C;

  --chart-bg: #1B1A18;
  --chart-bg-elev: #24221F;
  --chart-border: rgba(245, 243, 236, .10);
  --chart-grid: rgba(245, 243, 236, .06);
  --chart-grid-strong: rgba(245, 243, 236, .12);
  --chart-axis: #9A9489;
  --chart-text: #E8E3D9;
  --chart-red: #E27964;
  --chart-red-soft: rgba(226, 121, 100, .16);
  --chart-green: #86B49E;
  --chart-green-soft: rgba(134, 180, 158, .15);
  --chart-ma-1: #D9A15F;
  --chart-ma-2: #8FAFBC;
  --chart-ma-3: #C6A6CE;
  --chart-crosshair: #B8B2A6;
  --chart-volume: rgba(200, 195, 185, .28);
  --chart-current: #E08A6E;
  --chart-entry: #E08A6E;
  --chart-sl: #E27964;
  --chart-tp: #8FAFBC;
  --chart-liq: #EE8B7A;
  --chart-liq-fill: rgba(238, 139, 122, .10);
  --chart-order: #D9B57C;
  --chart-tip-bg: rgba(20, 19, 18, .95);
  --chart-tip-border: rgba(224, 138, 110, .35);
  --chart-equity: #E08A6E;
  --chart-equity-fill: rgba(224, 138, 110, .18);
  --chart-equity-drawdown: rgba(226, 121, 100, .16);

  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, .03),
              0 1px 2px rgba(0, 0, 0, .24),
              0 10px 28px rgba(0, 0, 0, .16);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, .04),
              0 18px 48px rgba(0, 0, 0, .30);
  --shadow-float: 0 28px 90px rgba(0, 0, 0, .60);
  --overlay: rgba(10, 9, 8, .70);
  --scrollbar: #4A453E;
  --selection: #4A2E25;
}

/* css/app.css */
/* ==========================================================================
   深渊汇率 ABYSS FX — 界面样式
   结构顺序：基础 → 通用 → 顶栏 → 账户条 → 工作区 → 市场 → 图表 → 交易台
             → 下单票 → 浮层 → 弹窗 → 各业务面板 → 动效 → 响应式
   所有颜色只从 tokens.css 的变量取值。
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. 基础重置
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(
    0deg,
    var(--bg-grain) 0 1px,
    transparent 1px 4px
  );
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

img,
svg,
canvas {
  max-width: 100%;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}

/* --------------------------------------------------------------------------
   1. 通用工具类
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -.01em;
  white-space: nowrap;
}

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

.dim {
  opacity: .55;
}

.up {
  color: var(--mkt-up);
}

.down {
  color: var(--mkt-down);
}

.ico {
  width: 16px;
  height: 16px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
  fill: none;
}

.ico use {
  pointer-events: none;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--action);
  color: var(--action-contrast);
  border-radius: var(--r-md);
  font-size: 13px;
  transition: top var(--dur-2) var(--ease-out);
}

.skip-link:focus-visible {
  top: 10px;
  outline-offset: 3px;
}

.empty-state {
  position: relative;
  padding: 26px 16px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-sunken);
  color: var(--text-muted);
}

.empty-state::before {
  content: "◈";
  display: block;
  margin-bottom: 6px;
  font-size: 20px;
  line-height: 1;
  color: var(--brass);
  opacity: .55;
}

.empty-state strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.empty-state span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   2. 按钮
   -------------------------------------------------------------------------- */
.primary-button,
.outline-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-std),
              border-color var(--dur-1) var(--ease-std),
              color var(--dur-1) var(--ease-std),
              transform var(--dur-1) var(--ease-std);
}

.primary-button {
  background: var(--action);
  color: var(--action-contrast);
  border-color: var(--action);
}

.primary-button:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
}

.primary-button:disabled {
  opacity: .45;
}

.outline-button {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--border-strong);
}

.outline-button:hover {
  background: var(--surface-hover);
  border-color: var(--brass);
  color: var(--ink);
}

.danger-button {
  background: var(--danger);
  color: var(--on-danger);
  border-color: var(--danger);
}

.danger-button:hover {
  filter: brightness(1.08);
}

.primary-button:active,
.outline-button:active,
.danger-button:active {
  transform: scale(.985);
}

/* 统一的按压反馈（不改变布局） */
.mode-tab:active,
.seg button:active,
.desk-tab:active,
.pair-row:active,
.pos-btn:active,
.quick-lots button:active,
.battle-card:active,
.text-button:active {
  transform: scale(.97);
}

.mode-tab,
.seg button,
.desk-tab,
.pair-row,
.pos-btn,
.quick-lots button,
.battle-card,
.text-button {
  transform-origin: center;
}

.outline-button.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: var(--r-sm);
  gap: 5px;
}

.outline-button.small .ico {
  width: 14px;
  height: 14px;
}

.text-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-std),
              color var(--dur-1) var(--ease-std);
}

.text-button:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.text-button .ico {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.text-button:hover .ico {
  color: var(--brass-strong);
}

.text-button.danger-text {
  color: var(--danger);
}

.text-button.danger-text .ico {
  color: var(--danger);
}

.text-button.danger-text:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  flex: none;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
  color: var(--ink-2);
  transition: background-color var(--dur-1) var(--ease-std),
              border-color var(--dur-1) var(--ease-std),
              color var(--dur-1) var(--ease-std);
}

.icon-button:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--ink);
}

.icon-button.active {
  background: var(--brass-soft);
  border-color: var(--brass);
  color: var(--brass-strong);
}

.icon-button:disabled {
  opacity: .4;
}

.icon-button .ico {
  width: 15px;
  height: 15px;
}

/* 小控件的触摸热区补充 */
.text-button::after,
.icon-button::after,
.mode-tab::after,
.seg button::after,
.desk-tab::after,
.pos-btn::after,
.modal-x::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
}

/* --------------------------------------------------------------------------
   3. 分段控件 / 输入
   -------------------------------------------------------------------------- */
.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}

.seg button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-std),
              color var(--dur-1) var(--ease-std);
}

.seg button:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.seg button.active {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14);
}

.seg button:disabled {
  opacity: .4;
}

.seg.full {
  display: flex;
  width: 100%;
}

.seg.full button {
  flex: 1 1 0;
  min-height: 34px;
  font-size: 12px;
}

.seg.mini {
  padding: 1px;
  border-radius: var(--r-sm);
  flex: none;
}

.seg.mini button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 10.5px;
  border-radius: var(--r-xs);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--brass-soft);
  color: var(--brass-strong);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1;
}

.desk-tab.active .count-pill {
  background: var(--brass-soft);
  border-color: transparent;
  color: var(--brass-strong);
}

/* 输入与下拉 */
.input-shell,
.select-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 9px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--dur-1) var(--ease-std),
              box-shadow var(--dur-1) var(--ease-std);
}

.input-shell:focus-within,
.select-shell:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-shell input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.input-shell input:focus {
  outline: none;
}

.input-shell input::placeholder {
  color: var(--text-faint);
}

.input-shell .unit {
  flex: none;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: .04em;
}

.input-shell button {
  flex: none;
  min-height: 28px;
  padding: 0 5px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--brass-strong);
  font-size: 10px;
  font-weight: 600;
}

.input-shell button:hover {
  background: var(--brass-soft);
}

.select-shell {
  display: block;
  padding: 0;
}

.select-shell::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.select-shell select {
  width: 100%;
  min-height: 40px;
  padding: 0 30px 0 10px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.select-shell select:focus {
  outline: none;
}

.hint {
  font-weight: 400;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0;
}

/* --------------------------------------------------------------------------
   4. 顶栏
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 max(var(--page-pad), calc((100vw - var(--content-max)) / 2 + var(--page-pad)));
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .18));
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
}

.brand-text small {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--brass-strong);
}

.mode-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline: auto;
  padding: 3px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-pill);
}

.mode-tab {
  position: relative;
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-std),
              color var(--dur-1) var(--ease-std);
}

.mode-tab:hover {
  color: var(--ink);
}

.mode-tab.active {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: none;
}

.clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  margin-right: 2px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}

.clock-pill .ico {
  width: 13px;
  height: 13px;
  color: var(--brass);
}

/* --------------------------------------------------------------------------
   5. 账户条
   -------------------------------------------------------------------------- */
.account-bar {
  position: sticky;
  top: var(--topbar-h);
  z-index: var(--z-account);
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) repeat(5, minmax(90px, 1fr));
  align-items: center;
  height: var(--account-h);
  padding: 0 max(var(--page-pad), calc((100vw - var(--content-max)) / 2 + var(--page-pad)));
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}

.account-lead {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  padding-left: 13px;
  border-left: 2px solid var(--brass);
  min-width: 0;
}

.mode-badge {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--brass-soft);
  color: var(--brass-strong);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

.lead-label {
  grid-column: 2;
  grid-row: 1;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--text-muted);
  white-space: nowrap;
}

.equity {
  grid-column: 1;
  grid-row: 2;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--ink);
}

.equity-delta {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.account-metric {
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--border-soft);
}

.account-metric > span {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: nowrap;
}

.account-metric > strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-level {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.metric-level > strong {
  margin-top: 1px;
}

/* 保证金条：轨道 + 填充 + 刻度 */
.margin-gauge {
  position: relative;
  width: 100%;
  max-width: 96px;
  height: 5px;
  margin-top: 3px;
  border-radius: var(--r-pill);
  background: var(--gauge-track);
  overflow: hidden;
}

.margin-gauge i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--risk-safe);
  transition: width var(--dur-3) var(--ease-out),
              background-color var(--dur-2) var(--ease-std);
}

.margin-gauge::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      transparent 0 49.5%,
      var(--border-strong) 49.5% 50.5%,
      transparent 50.5% 74.5%,
      var(--border-strong) 74.5% 75.5%,
      transparent 75.5% 89.5%,
      var(--border-strong) 89.5% 90.5%,
      transparent 90.5%);
  opacity: .5;
  pointer-events: none;
}

.margin-gauge.is-safe i,
.margin-gauge.is-ok i {
  background: var(--risk-safe);
}

.margin-gauge.is-watch i {
  background: var(--risk-watch);
}

.margin-gauge.is-danger i {
  background: var(--risk-danger);
}

.margin-gauge.is-liq i {
  background-color: var(--risk-liq);
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 4px,
    rgba(255, 255, 255, .38) 4px 6px
  );
}

.margin-gauge.is-liq {
  box-shadow: 0 0 0 1px var(--risk-liq);
}

/* 状态标签：颜色 + 文字，风险色不随涨跌配色切换 */
.state-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 15px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  letter-spacing: .04em;
  white-space: nowrap;
}

.state-tag.is-safe,
.state-tag.is-ok {
  background: var(--risk-safe-soft);
  color: var(--risk-safe);
}

.state-tag.is-watch {
  background: var(--risk-watch-soft);
  color: var(--risk-watch);
}

.state-tag.is-danger {
  background: var(--risk-danger-soft);
  color: var(--risk-danger);
}

.state-tag.is-liq {
  background: var(--risk-liq-soft);
  color: var(--risk-liq);
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 5px,
    rgba(255, 255, 255, .34) 5px 7px
  );
}

/* --------------------------------------------------------------------------
   6. 工作区与面板
   -------------------------------------------------------------------------- */
.workspace {
  display: grid;
  grid-template-columns: var(--rail-left) minmax(0, 1fr) var(--rail-right);
  gap: var(--gap);
  align-items: start;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--gap) var(--page-pad) 48px;
  min-width: 0;
}

.center-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
}

.right-column {
  /* 右栏整体吸顶并在内部滚动：下单票和风险席不再互相遮挡 */
  position: sticky;
  top: calc(var(--topbar-h) + var(--account-h) + var(--gap));
  align-self: start;
  max-height: calc(100dvh - var(--topbar-h) - var(--account-h) - var(--gap) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-1);
  animation: panel-in var(--dur-4) var(--ease-out) both;
}

.market-panel {
  animation-delay: 80ms;
}

.center-column > .panel:nth-child(1) {
  animation-delay: 120ms;
}

.center-column > .panel:nth-child(2) {
  animation-delay: 160ms;
}

.right-column > .panel:nth-child(1) {
  animation-delay: 160ms;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
}

.panel-heading h2 {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .01em;
  color: var(--ink);
}

.panel-heading.compact {
  padding: 12px 14px 8px;
}

.panel-heading.compact h2 {
  font-size: 16px;
}

.heading-glyph {
  font-size: 18px;
  line-height: 1;
  color: var(--brass);
  opacity: .5;
}

.corner-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--brass);
  border-right: 1px solid var(--brass);
  opacity: .55;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   7. 左栏：市场列表
   -------------------------------------------------------------------------- */
.market-panel {
  position: sticky;
  top: calc(var(--topbar-h) + var(--account-h) + var(--gap));
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--topbar-h) - var(--account-h) - var(--gap) - 16px);
  overflow: hidden;
}

.market-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 12px 6px;
  padding: 0 9px;
  height: 36px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  transition: border-color var(--dur-1) var(--ease-std),
              box-shadow var(--dur-1) var(--ease-std);
}

.market-filter:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.market-filter .ico {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
}

.market-filter input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.market-filter input:focus {
  outline: none;
}

.market-filter input::placeholder {
  color: var(--text-faint);
}

.pair-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 6px 6px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.pair-group-label {
  padding: 8px 8px 3px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.pair-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 1px;
  width: 100%;
  min-height: 52px;
  padding: 6px 8px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background-color var(--dur-1) var(--ease-std),
              border-color var(--dur-1) var(--ease-std);
}

.pair-row:hover {
  background: var(--surface-hover);
}

.pair-row.selected {
  background: var(--surface-sunken);
  border-left-color: var(--brass);
}

.pair-row.disabled {
  opacity: .42;
}

.pair-id {
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pair-cn {
  grid-column: 1;
  grid-row: 2;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pair-price {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-2);
}

.pair-chg {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
}

.pair-spread {
  grid-column: 1 / -1;
  grid-row: 3;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  color: var(--text-faint);
}

.pair-row.selected .pair-spread {
  color: var(--spread);
}

.market-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.dot-live {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
  animation: live-pulse 2.4s var(--ease-in-out) infinite;
}

.spread-note {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-faint);
}

.spread-note.warn {
  color: var(--risk-watch);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   8. 中栏：图表
   -------------------------------------------------------------------------- */
.chart-panel {
  padding: 14px 16px 10px;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 10px;
}

.pair-block {
  min-width: 0;
}

.pair-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.pair-title h1 {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ink);
}

.pair-title .pair-cn {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.quote-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.price {
  display: inline-block;
  min-width: 7.6ch;
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
  border-radius: var(--r-xs);
}

.change {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.sess-chip {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--brass-soft);
  color: var(--brass-strong);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
}

.bidask {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex: none;
  padding-top: 4px;
}

.bidask > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bidask span {
  font-size: 9.5px;
  line-height: 1.2;
  color: var(--text-muted);
  white-space: nowrap;
}

.bidask strong {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-2);
}

.bidask .bid {
  color: var(--bid);
}

.bidask .ask {
  color: var(--ask);
}

/* 工具栏 */
.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px dashed var(--border-soft);
  border-bottom: 1px dashed var(--border-soft);
}

.playback {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 0;
  padding: 0 2px;
}

.playback-date {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.playback .icon-button {
  width: 32px;
  height: 32px;
}

.day-progress {
  flex: 1 1 auto;
  min-width: 56px;
  height: 4px;
  margin: 0 2px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  accent-color: var(--accent);
}

.day-progress::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-active);
}

.day-progress::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid var(--surface-raised);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  appearance: none;
  -webkit-appearance: none;
}

.day-progress::-moz-range-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-active);
}

.day-progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--surface-raised);
  border-radius: 50%;
  background: var(--accent);
}

.chart-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.speed-seg {
  margin-right: 2px;
}

/* 图表画布：两种主题下都是深色仪表盘 */
#chartWrap,
.chart-wrap {
  position: relative;
  height: 380px;
  height: clamp(320px, 40vh, 460px);
  margin: 10px 0 0;
  border: 1px solid var(--chart-border);
  border-radius: var(--r-xl);
  background: var(--chart-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .04),
    0 8px 24px rgba(0, 0, 0, .22);
  overflow: hidden;
}

.chart-wrap canvas,
#chart {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  background: var(--chart-bg);
  color: var(--chart-text);
  font-size: 12px;
  pointer-events: none;
}

.chart-empty span {
  padding: 10px 16px;
  border: 1px dashed var(--chart-grid-strong);
  border-radius: var(--r-md);
  background: var(--chart-bg-elev);
  color: var(--chart-axis);
}

.chart-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  height: 20px;
  padding: 0 8px;
  border: 1px solid var(--chart-tip-border);
  border-radius: var(--r-pill);
  background: var(--chart-tip-bg);
  color: var(--chart-current);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: .12em;
  pointer-events: none;
}

/* 新闻条 */
.news-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin-top: 8px;
  padding-right: 6px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.ticker-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 44px;
  align-self: stretch;
  padding: 0 8px;
  border-radius: calc(var(--r-lg) - 1px) 0 0 calc(var(--r-lg) - 1px);
  background: var(--info-soft);
  color: var(--info);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.ticker-tag.info {
  background: var(--info-soft);
  color: var(--info);
}

.ticker-tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.ticker-tag.brass {
  background: var(--brass-soft);
  color: var(--brass-strong);
}

.ticker-tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.ticker-body {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.ticker-track {
  display: inline-block;
  padding-left: 100%;
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
  animation: ticker-run 26s linear infinite;
}

.ticker-body:hover .ticker-track,
.news-ticker:focus-within .ticker-track {
  animation-play-state: paused;
}

.news-ticker .text-button {
  flex: none;
  height: 30px;
  font-size: 10.5px;
  color: var(--brass-strong);
}

.chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 1px 0;
  font-size: 10px;
  color: var(--text-muted);
}

.chart-foot > span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.legend-line {
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-right: 6px;
  border-radius: 1px;
  background: var(--brass);
  flex: none;
}

/* --------------------------------------------------------------------------
   9. 交易台：持仓 / 挂单 / 成交
   -------------------------------------------------------------------------- */
.desk-panel {
  padding: 0;
  overflow: hidden;
}

.desk-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.desk-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-std),
              color var(--dur-1) var(--ease-std);
}

.desk-tab:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.desk-tab.active {
  background: var(--surface-sunken);
  color: var(--ink);
}

.desk-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.risk-hint {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-body {
  padding: 10px 12px 12px;
}

.desk-pane {
  display: none;
}

.desk-pane.active {
  display: block;
}

.positions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* 尽量多显示持仓；极端数量下仍保留内部滚动 */
  max-height: 70vh;
  padding-right: 2px;
  overflow-y: auto;
}

.positions-list > .empty-state {
  grid-column: 1 / -1;
  margin: 2px 0;
}

/* 持仓 / 挂单在宽屏下双列排布，同屏能看到更多卡片 */
#positionsList,
#ordersList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(315px, 100%), 1fr));
  align-content: start;
}

/* 持仓 / 挂单 / 成交卡片共用骨架 */
.position-card,
.order-card,
.history-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 8px 11px;
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  transition: background-color var(--dur-2) var(--ease-std),
              border-color var(--dur-2) var(--ease-std);
}

.position-card.long {
  border-left-color: var(--mkt-up);
}

.position-card.short {
  border-left-color: var(--mkt-down);
}

.position-card.danger {
  border-color: var(--risk-danger);
  border-top-style: dashed;
  background: var(--risk-danger-soft);
}

.position-card.liq,
.position-card.liq.danger {
  border-color: var(--risk-liq);
  background-color: var(--risk-liq-soft);
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 9px,
    color-mix(in srgb, var(--risk-liq) 9%, transparent) 9px 11px
  );
}

.order-card {
  border-left-color: var(--chart-order);
}

.history-row {
  border-left-color: var(--border-strong);
  background: var(--surface-sunken);
}

.history-row.win {
  border-left-color: var(--mkt-up);
}

.history-row.loss {
  border-left-color: var(--mkt-down);
}

.pos-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.pos-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.pos-pair {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
}

.pos-side {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border-radius: var(--r-xs);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.pos-side.up {
  background: var(--mkt-up-soft);
  color: var(--mkt-up-strong);
}

.pos-side.down {
  background: var(--mkt-down-soft);
  color: var(--mkt-down-strong);
}

.pos-lots {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.pos-tag {
  display: inline-flex;
  align-items: center;
  height: 15px;
  padding: 0 5px;
  border-radius: var(--r-xs);
  background: var(--surface-sunken);
  color: var(--text-faint);
  font-size: 8.5px;
  line-height: 1;
  white-space: nowrap;
}

.pos-pnl {
  flex: none;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.history-row .pos-pnl {
  font-size: 12.5px;
}

.pos-sub {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-muted);
}

.pos-sub b {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink-2);
}

.pos-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 9px;
  line-height: 1.4;
  color: var(--text-faint);
}

.pos-meta b {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-muted);
}

.pos-risk-text {
  margin-left: auto;
  color: var(--text-faint);
}

.position-card.danger .pos-risk-text,
.position-card.liq .pos-risk-text {
  color: var(--risk-danger);
  font-weight: 600;
}

.pos-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
}

.pos-btn {
  position: relative;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-std),
              border-color var(--dur-1) var(--ease-std),
              color var(--dur-1) var(--ease-std);
}

.pos-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--ink);
}

.pos-btn.primary {
  background: var(--action);
  border-color: var(--action);
  color: var(--action-contrast);
}

.pos-btn.primary:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
}

.reason-tag {
  display: inline-flex;
  align-items: center;
  height: 15px;
  padding: 0 5px;
  border-radius: var(--r-xs);
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 8.5px;
  line-height: 1;
  white-space: nowrap;
}

/* 预留：单仓风险条 / 迷你条 */
.pos-risk {
  height: 4px;
  margin-top: 4px;
  border-radius: var(--r-pill);
  background: var(--gauge-track);
  overflow: hidden;
}

.pos-risk i,
.pos-risk > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--risk-safe);
  transition: width var(--dur-3) var(--ease-out);
}

.pos-risk.is-watch i,
.pos-risk.is-watch > span {
  background: var(--risk-watch);
}

.pos-risk.is-danger i,
.pos-risk.is-danger > span {
  background: var(--risk-danger);
}

.pos-risk.is-liq i,
.pos-risk.is-liq > span {
  background: var(--risk-liq);
}

.mini-bar {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--gauge-track);
  overflow: hidden;
}

.mini-bar i,
.mini-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--risk-safe);
}

/* --------------------------------------------------------------------------
   10. 右栏：下单票
   -------------------------------------------------------------------------- */
.order-ticket {
  padding: 12px 14px 14px;
}

.order-ticket .panel-heading {
  padding: 0 0 10px;
}

.order-ticket .panel-heading h2 {
  font-size: 16px;
}

.order-pair {
  align-self: center;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--brass-soft);
  color: var(--brass-strong);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.order-ticket > .seg.full {
  margin-bottom: 10px;
}

.trigger-row,
.field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 9px;
  min-width: 0;
}

.trigger-row label,
.field-row > label {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-2);
}

.quick-lots {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.quick-lots button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 30px;
  padding: 0 4px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  transition: background-color var(--dur-1) var(--ease-std),
              border-color var(--dur-1) var(--ease-std),
              color var(--dur-1) var(--ease-std);
}

.quick-lots button:hover {
  background: var(--surface-hover);
  border-color: var(--brass);
  color: var(--brass-strong);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-grid .field-row {
  margin-bottom: 0;
}

.trailing-row {
  margin-top: 9px;
}

.order-preview {
  display: grid;
  gap: 3px;
  margin: 8px 0 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}

.order-preview > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.order-preview span {
  font-size: 10.5px;
  color: var(--text-muted);
}

.order-preview strong {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.trade-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.trade-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 52px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  transition: background-color var(--dur-1) var(--ease-std),
              border-color var(--dur-1) var(--ease-std),
              color var(--dur-1) var(--ease-std),
              transform var(--dur-1) var(--ease-std),
              box-shadow var(--dur-2) var(--ease-std);
}

.trade-button .ico {
  width: 17px;
  height: 17px;
}

.trade-button em {
  font-size: 10px;
  font-weight: 500;
  font-style: normal;
  opacity: .78;
  margin-left: 1px;
}

.trade-button.long {
  background: var(--mkt-up-soft);
  border-color: var(--mkt-up);
  color: var(--mkt-up-strong);
}

.trade-button.long:hover {
  background: var(--mkt-up);
  border-color: var(--mkt-up);
  color: var(--mkt-up-on);
}

.trade-button.short {
  background: var(--mkt-down-soft);
  border-color: var(--mkt-down);
  color: var(--mkt-down-strong);
}

.trade-button.short:hover {
  background: var(--mkt-down);
  border-color: var(--mkt-down);
  color: var(--mkt-down-on);
}

.trade-button:active:not(:disabled) {
  transform: translateY(1px) scale(.99);
}

.trade-button:disabled {
  opacity: .42;
}

.order-note {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.55;
  color: var(--text-muted);
}

.risk-panel {
  padding: 12px 14px 14px;
}

.risk-panel .panel-heading {
  padding: 0 0 8px;
}

.risk-panel .panel-heading h2 {
  font-size: 16px;
}

.risk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  overflow: hidden;
}

.risk-grid > div {
  padding: 7px 9px;
  background: var(--surface-sunken);
  min-width: 0;
}

.risk-grid span {
  display: block;
  font-size: 9.5px;
  line-height: 1.3;
  color: var(--text-muted);
}

.risk-grid strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-note {
  margin-top: 8px;
  padding: 7px 9px;
  border-left: 2px solid var(--brass);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface-sunken);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.disclaimer {
  padding: 0 4px;
  font-size: 10px;
  line-height: 1.65;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   11. 新闻浮卡 / Toast
   -------------------------------------------------------------------------- */
.news-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--z-float);
  width: 336px;
  max-width: calc(100vw - 32px);
  padding: 13px 15px 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-right: 3px solid var(--info);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
  animation: toast-in var(--dur-2) var(--ease-out) both;
}

.news-float:has(.nf-tag.warn) {
  border-right-color: var(--warn);
}

.news-float:has(.nf-tag.brass) {
  border-right-color: var(--brass);
}

.news-float:has(.nf-tag.danger) {
  border-right-color: var(--danger);
}

.nf-tag {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--info-soft);
  color: var(--info);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
}

.nf-tag.info {
  background: var(--info-soft);
  color: var(--info);
}

.nf-tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.nf-tag.brass {
  background: var(--brass-soft);
  color: var(--brass-strong);
}

.nf-tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.news-float h4 {
  margin: 6px 0 3px;
  padding-right: 26px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.news-float p {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.nf-date {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-faint);
}

/* 浮卡整体不拦截交易，但关闭按钮必须可点 */
.news-float .modal-x {
  pointer-events: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: min(92vw, 460px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast-item {
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-2);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  animation: toast-in var(--dur-2) var(--ease-out) both;
  word-break: break-word;
}

.toast-item.ok {
  border-left-color: var(--success);
}

.toast-item.warn {
  border-left-color: var(--warn);
}

.toast-item.bad {
  border-left-color: var(--danger);
}

.toast-item.info {
  border-left-color: var(--info);
}

.toast-item.out {
  animation: toast-out var(--dur-2) var(--ease-std) both;
}

/* --------------------------------------------------------------------------
   12. 弹窗
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  padding: 20px;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  animation: fade-in var(--dur-2) var(--ease-out) both;
}

.modal {
  position: relative;
  width: min(480px, 100%);
  max-height: 92dvh;
  padding: 24px;
  overflow-y: auto;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-3xl);
  box-shadow: var(--shadow-float);
  animation: modal-in var(--dur-2) var(--ease-out) both;
}

.modal.wide {
  width: min(680px, 100%);
}

.modal.story-card {
  width: min(560px, 100%);
}

.modal.share-card-modal {
  width: min(560px, 100%);
}

.modal-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  transition: background-color var(--dur-1) var(--ease-std),
              color var(--dur-1) var(--ease-std);
}

.modal-x:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.modal-x .ico {
  width: 16px;
  height: 16px;
}

.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  border-radius: var(--r-lg);
  background: var(--brass-soft);
  color: var(--brass-strong);
}

.modal-icon .ico {
  width: 20px;
  height: 20px;
}

.modal h2 {
  margin: 0 0 8px;
  padding-right: 28px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .01em;
  color: var(--ink);
}

.modal-body {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
}

.modal-body p {
  margin: 0 0 10px;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body strong {
  font-weight: 600;
  color: var(--ink);
}

.modal-sub {
  margin: 0 0 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.modal h2 + .modal-sub {
  margin-top: -2px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.modal-actions .primary-button,
.modal-actions .outline-button,
.modal-actions .danger-button {
  min-width: 96px;
}

/* --------------------------------------------------------------------------
   13. 教程
   -------------------------------------------------------------------------- */
.tutorial-card {
  width: min(520px, 100%);
}

.tut-step {
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  color: var(--text-faint);
}

.tut-demo {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-2);
}

.tut-demo:empty {
  display: none;
}

.tut-demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.tut-demo-row span {
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   14. 成就
   -------------------------------------------------------------------------- */
.ach-progress-line {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ach-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 96px;
  padding: 10px;
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-xl);
  background: var(--surface-sunken);
}

.ach-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text-faint);
}

.ach-icon .ico {
  width: 18px;
  height: 18px;
}

.ach-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ach-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-2);
}

.ach-desc {
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-faint);
}

.ach-foot {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.35;
  color: var(--text-faint);
}

/* 兼容旧字段 */
.ach-hint {
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-faint);
}

.ach-date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--brass-strong);
}

.ach-xp {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--brass-strong);
}

.ach-item.locked .ach-icon {
  opacity: .45;
}

.ach-item.locked .ach-name {
  color: var(--text-muted);
}

.ach-item.unlocked {
  border-style: solid;
  border-color: var(--border-strong);
  background: var(--surface);
}

.ach-item.unlocked::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--brand-2), var(--brass));
  box-shadow: 0 0 0 2px var(--brass-soft);
}

.ach-item.unlocked .ach-icon {
  background: var(--brass-soft);
  border-color: transparent;
  color: var(--brass-strong);
}

.ach-item.unlocked .ach-name {
  color: var(--ink);
}

/* 解锁扫光：铜色从左到右一次 */
.ach-item.unlocked::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 42%;
  background: linear-gradient(
    100deg,
    transparent,
    color-mix(in srgb, var(--brass) 32%, transparent),
    transparent
  );
  transform: skewX(-18deg);
  animation: ach-sweep 640ms var(--ease-out) 120ms 1;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   15. 战役 / 剧情
   -------------------------------------------------------------------------- */
.battle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.battle-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 112px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface-sunken);
  color: var(--ink);
  text-align: left;
  font-family: inherit;
  transition: transform var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-std),
              background-color var(--dur-2) var(--ease-std);
}

.battle-card:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--brass);
  background: var(--surface-hover);
}

.battle-card.locked {
  opacity: .65;
}

.battle-card.cleared {
  border-color: var(--brass);
  background: var(--surface);
}

.battle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.battle-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.battle-pair {
  flex: none;
  padding: 1px 6px;
  border-radius: var(--r-xs);
  background: var(--brass-soft);
  color: var(--brass-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
}

.battle-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--text-faint);
}

.battle-goal {
  display: -webkit-box;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.battle-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

.battle-stars {
  display: inline-flex;
  gap: 2px;
}

.battle-stars .star {
  font-size: 11px;
  line-height: 1;
}

.battle-diff {
  font-size: 8.5px;
  letter-spacing: 1px;
  color: var(--brass);
  opacity: .8;
}

.battle-lock {
  font-size: 9px;
  font-weight: 600;
  color: var(--risk-watch);
}

.star {
  color: var(--border-strong);
  transition: color var(--dur-2) var(--ease-std),
              transform var(--dur-2) var(--ease-out);
}

.star.on {
  color: var(--brass);
  text-shadow: 0 0 6px color-mix(in srgb, var(--brass) 40%, transparent);
}

.stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 10px;
}

.stars:empty {
  display: none;
}

.stars .star {
  font-size: 28px;
  line-height: 1;
}

.stars .star.on {
  animation: star-pop var(--dur-3) var(--ease-out) both;
}

/* 剧情 */
.story-card .kicker {
  margin-bottom: 4px;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0 10px;
}

.story-meta span {
  padding: 2px 7px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  color: var(--text-muted);
}

.story-body {
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 4px;
}

.story-body p {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.story-body p:last-child {
  margin-bottom: 0;
}

.story-goal {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 10px 0 0;
  padding: 9px 11px;
  border-left: 2px solid var(--brass);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface-sunken);
}

.story-goal strong {
  font-size: 11px;
  font-weight: 600;
  color: var(--brass-strong);
}

.story-goal span {
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   16. 每日挑战 / 排行榜
   -------------------------------------------------------------------------- */
.challenge-card {
  position: relative;
  margin: 6px 0 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--brass);
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 0 50%, var(--surface-raised) 5px, transparent 6px),
    radial-gradient(circle at 100% 50%, var(--surface-raised) 5px, transparent 6px),
    var(--surface-sunken);
}

.ch-date {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--brass-strong);
}

.challenge-card h3 {
  margin: 4px 0 5px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.challenge-card p {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-muted);
}

.ch-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.ch-stats > div {
  padding: 6px 8px;
  border-radius: var(--r-md);
  background: var(--surface-raised);
  min-width: 0;
}

.ch-stats span {
  display: block;
  font-size: 9px;
  line-height: 1.3;
  color: var(--text-muted);
}

.ch-stats strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard {
  max-height: 190px;
  margin-top: 6px;
  padding: 4px 6px;
  overflow-y: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--surface-sunken);
}

.leaderboard .empty-state {
  border: 0;
  background: transparent;
}

.ldr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 7px 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ldr-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
  color: var(--ink-2);
}

.ldr-row + .ldr-row {
  border-top: 1px solid var(--border-soft);
}

.ldr-row.me {
  background: var(--brass-soft);
  color: var(--ink);
  font-weight: 600;
}

.ldr-rank {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-faint);
  text-align: center;
}

.ldr-row.me .ldr-rank {
  color: var(--brass-strong);
}

.ldr-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ldr-score {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  text-align: right;
}

/* --------------------------------------------------------------------------
   17. 结算 / 统计
   -------------------------------------------------------------------------- */
.settle-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-soft);
}

.settle-line span {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.settle-line strong {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-align: right;
}

.settle-line.big {
  margin-top: 4px;
  padding-top: 10px;
  border-bottom: 0;
}

.settle-line.big strong {
  font-size: 22px;
  font-weight: 600;
  color: var(--brass-strong);
}

.settle-warn {
  margin: 8px 0 0;
  padding: 6px 9px;
  border-radius: var(--r-sm);
  background: var(--risk-danger-soft);
  color: var(--risk-danger);
  font-size: 10.5px;
  line-height: 1.5;
}

.history-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--text-muted);
}

.stats-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 8px 0 10px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--border-soft);
}

.stats-hero > div {
  padding: 8px 10px;
  background: var(--surface-sunken);
  min-width: 0;
}

.stats-hero span {
  display: block;
  font-size: 9.5px;
  line-height: 1.3;
  color: var(--text-muted);
}

.stats-hero strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equity-canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 4px 0 10px;
  border: 1px solid var(--chart-border);
  border-radius: var(--r-md);
  background: var(--chart-bg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
}

.stat-cell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
  min-width: 0;
}

.stat-cell span {
  overflow: hidden;
  font-size: 10px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-cell strong {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   18. 设置
   -------------------------------------------------------------------------- */
.settings-list {
  display: flex;
  flex-direction: column;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-soft);
}

.settings-row:first-child {
  padding-top: 2px;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row > div:first-child {
  min-width: 0;
}

.settings-row strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.settings-row small {
  display: block;
  max-width: 290px;
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* 存档导出 / 导入 */
.save-io-buttons {
  display: flex;
  flex: none;
  gap: 8px;
}

.save-io-pick {
  margin: 2px 0 4px;
}

.save-io-text {
  display: block;
  width: 100%;
  min-height: 140px;
  max-height: 42vh;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  resize: vertical;
}

.save-io-text:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px var(--border-soft);
}

.save-io-error {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--danger);
}

/* 开关 */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  width: 40px;
  min-height: 22px;
  /* 扩大触摸热区到 40px，不改变视觉尺寸 */
  padding: 9px 0;
  margin: -9px 0;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.switch span {
  position: relative;
  display: block;
  width: 40px;
  height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface-active);
  transition: background-color var(--dur-2) var(--ease-std),
              border-color var(--dur-2) var(--ease-std);
}

.switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  transition: transform var(--dur-2) var(--ease-out);
}

.switch input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.switch input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.switch input:disabled + span {
  opacity: .45;
}

/* --------------------------------------------------------------------------
   19. 分享
   -------------------------------------------------------------------------- */
.share-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--surface-sunken);
}

.share-preview canvas {
  display: block;
  width: min(100%, 340px);
  height: auto;
  border-radius: var(--r-sm);
  background: var(--chart-bg);
  box-shadow: var(--shadow-2);
}

/* --------------------------------------------------------------------------
   20. 新闻中心 / 财经日历 / 动态表单
   -------------------------------------------------------------------------- */
.news-center-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
}

.news-item {
  padding: 10px 11px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.news-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.news-tag {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--info-soft);
  color: var(--info);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.news-tag.info {
  background: var(--info-soft);
  color: var(--info);
}

.news-tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.news-tag.brass {
  background: var(--brass-soft);
  color: var(--brass-strong);
}

.news-tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.news-time {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-faint);
  white-space: nowrap;
}

.news-title {
  display: block;
  margin: 3px 0 2px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}

.news-body {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-muted);
}

.cal-list {
  display: flex;
  flex-direction: column;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
}

.cal-item {
  display: grid;
  grid-template-columns: 86px 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 8px 3px;
  border-bottom: 1px dashed var(--border-soft);
}

.cal-item.done {
  opacity: .72;
}

.cal-time {
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: nowrap;
}

.cal-ccy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
  padding: 0 5px;
  border-radius: var(--r-xs);
  background: var(--brass-soft);
  color: var(--brass-strong);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.cal-main {
  min-width: 0;
}

.cal-title {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-2);
}

.cal-values {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-faint);
}

.cal-actual {
  font-weight: 600;
  color: var(--ink-2);
}

.cal-imp {
  font-size: 8.5px;
  line-height: 1.8;
  letter-spacing: 1px;
  color: var(--brass);
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

.form-grid.two {
  grid-template-columns: 1fr 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.form-field > span {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.quick-range {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.quick-range button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
}

.quick-range button:hover {
  background: var(--surface-hover);
  border-color: var(--brass);
  color: var(--brass-strong);
}

/* --------------------------------------------------------------------------
   21. 动效
   -------------------------------------------------------------------------- */
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(4px);
  }
}

@keyframes tick-flash {
  0% { background-color: var(--flash-bg, transparent); }
  100% { background-color: transparent; }
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--success-soft); }
  50% { box-shadow: 0 0 0 5px var(--success-soft); }
}

@keyframes ticker-run {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@keyframes ach-sweep {
  from { left: -60%; }
  to { left: 130%; }
}

@keyframes star-pop {
  0% { transform: scale(.9); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes liq-vignette {
  0% { box-shadow: inset 0 0 0 0 rgba(255, 77, 66, 0); }
  35% { box-shadow: inset 0 0 90px 2px rgba(255, 77, 66, .28); }
  100% { box-shadow: inset 0 0 0 0 rgba(255, 77, 66, 0); }
}

/* 价格闪：只闪背景，不改变布局宽度 */
.flash-up,
.flash-down {
  animation: tick-flash 420ms var(--ease-out) 1;
}

.flash-up {
  --flash-bg: var(--mkt-up-soft);
}

.flash-down {
  --flash-bg: var(--mkt-down-soft);
}

/* 数值更新脉冲（util.pulse 使用，语义同价格闪） */
.pulse-up,
.pulse-down {
  animation: tick-flash 520ms var(--ease-out) 1;
}

.pulse-up {
  --flash-bg: var(--mkt-up-soft);
}

.pulse-down {
  --flash-bg: var(--mkt-down-soft);
}

/* 爆仓：屏幕边缘红晕一次，不全屏抖动。
   优先响应 body.is-liquidated；若上层未加该类，
   则由保证金条进入 is-liq 状态触发同样的边缘红晕。 */
body.is-liquidated::after,
body:has(.margin-gauge.is-liq)::after,
body:has(.state-tag.is-liq)::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  animation: liq-vignette 900ms var(--ease-out) 1;
}

/* --------------------------------------------------------------------------
   22. 响应式
   -------------------------------------------------------------------------- */

/* ≥1440：三栏 240 / 1fr / 340（默认） */

@media (max-width: 1439px) {
  :root {
    --rail-left: 220px;
    --rail-right: 312px;
    --gap: 12px;
    --page-pad: 16px;
  }

  .workspace {
    padding: 14px var(--page-pad) 40px;
  }

  .account-bar {
    grid-template-columns: minmax(190px, 1.3fr) repeat(5, minmax(82px, 1fr));
  }

  .equity {
    font-size: 26px;
  }

  .account-metric {
    padding-left: 11px;
  }

  .pair-row {
    min-height: 50px;
  }

  .mode-tab {
    padding: 0 10px;
    font-size: 11.5px;
  }
}

@media (max-width: 1279px) {
  .top-actions {
    gap: 1px;
  }

  .top-actions .text-button {
    width: 32px;
    padding: 0;
    justify-content: center;
  }

  .top-actions .text-button span {
    display: none;
  }

  .brand-text strong {
    font-size: 17px;
  }
}

/* 1080–1199：左栏变顶部横向货币对条；中栏 + 右栏两列 */
@media (max-width: 1199px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) var(--rail-right);
    grid-template-areas:
      "market market"
      "center right";
  }

  .market-panel {
    grid-area: market;
    position: static;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    max-height: none;
    padding: 8px 10px;
    overflow: visible;
  }

  .market-panel .panel-heading,
  .market-panel .market-foot {
    display: none;
  }

  .market-filter {
    margin: 0;
    height: 34px;
  }

  .pair-list {
    display: flex;
    gap: 4px;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .pair-group-label,
  .pair-spread {
    display: none;
  }

  .pair-row {
    flex: 0 0 auto;
    width: auto;
    min-width: 146px;
    min-height: 48px;
    padding: 5px 9px;
    border-left-width: 0;
    border-bottom: 2px solid transparent;
  }

  .pair-row.selected {
    border-left-color: transparent;
    border-bottom-color: var(--brass);
  }

  .center-column {
    grid-area: center;
  }

  .right-column {
    grid-area: right;
  }

  .chart-panel {
    padding: 12px 14px 10px;
  }
}

/* 860–1079：单列；右栏取消 sticky；账户条两行 */
@media (max-width: 1079px) {
  :root {
    --page-pad: 14px;
    --gap: 12px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "market"
      "center"
      "right";
    padding: 12px var(--page-pad) 36px;
  }

  .right-column {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .order-ticket {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .account-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: auto;
    min-height: 78px;
    padding: 9px var(--page-pad);
    row-gap: 6px;
  }

  .account-lead {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    padding-left: 11px;
    border-left-width: 2px;
  }

  .account-lead .equity {
    font-size: 25px;
  }

  .account-lead .equity-delta {
    justify-self: auto;
  }

  .account-metric {
    border-left: 1px solid var(--border-soft);
  }

  .account-metric:nth-child(2) {
    border-left: 0;
    padding-left: 0;
  }

  .market-panel {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .desk-tools .risk-hint {
    display: none;
  }

  .mode-tabs {
    margin-inline: auto;
  }

  .topbar {
    gap: 10px;
  }

  .pair-title h1 {
    font-size: 22px;
  }

  .chart-head {
    gap: 10px;
  }
}

@media (max-width: 899px) {
  .clock-pill {
    display: none;
  }

  .topbar {
    gap: 8px;
    padding-inline: var(--page-pad);
  }

  .top-actions {
    gap: 0;
  }

  .top-actions .text-button {
    width: 30px;
  }

  .mode-tab {
    padding: 0 7px;
    font-size: 11px;
  }

  .brand {
    gap: 7px;
  }

  .bidask {
    gap: 12px;
  }

  .bidask strong {
    font-size: 12.5px;
  }

  .playback {
    flex-basis: 100%;
    order: 3;
  }

  .chart-toolbar-right {
    margin-left: 0;
  }

  .desk-tab {
    padding: 0 8px;
  }
}

/* <720：顶栏紧凑、账户 3 列、图表 280px、下单票正常流 */
@media (max-width: 719px) {
  :root {
    --topbar-h: 52px;
    --page-pad: 12px;
  }

  .topbar {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 7px var(--page-pad);
  }

  .brand {
    order: 1;
  }

  .brand-mark {
    width: 27px;
    height: 27px;
  }

  .brand-text strong {
    font-size: 16px;
  }

  .brand-text small {
    font-size: 7.5px;
  }

  .top-actions {
    order: 2;
    margin-left: auto;
  }

  .clock-pill {
    display: none;
  }

  .mode-tabs {
    order: 3;
    display: flex;
    width: 100%;
    margin: 0;
    padding: 2px;
    border-radius: var(--r-md);
  }

  .mode-tab {
    flex: 1 1 0;
    height: 34px;
    padding: 0 4px;
    font-size: 11px;
    border-radius: var(--r-sm);
  }

  .account-bar {
    position: relative;
    top: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 9px var(--page-pad) 10px;
    row-gap: 8px;
  }

  .account-lead {
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }

  .account-lead .equity {
    font-size: 24px;
  }

  .account-metric {
    border-left: 0;
    padding-left: 0;
  }

  .account-metric:nth-child(2) {
    padding-left: 0;
  }

  .account-metric > strong {
    font-size: 15px;
  }

  .metric-level .margin-gauge {
    max-width: 100%;
  }

  .workspace {
    padding: 10px var(--page-pad) 32px;
  }

  .market-panel {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
  }

  .market-filter {
    height: 36px;
  }

  .pair-row {
    min-width: 132px;
  }

  .chart-panel {
    padding: 11px 12px 9px;
  }

  .pair-title h1 {
    font-size: 21px;
  }

  .price {
    font-size: 20px;
  }

  .bidask {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    padding-top: 7px;
    border-top: 1px dashed var(--border-soft);
  }

  .chart-toolbar {
    gap: 6px;
  }

  .chart-toolbar-right {
    gap: 4px;
  }

  .playback {
    order: 4;
    flex-basis: 100%;
  }

  #chartWrap,
  .chart-wrap {
    height: 280px;
  }

  /* 小屏由图表内信息条承担模式提示，避免与右侧当前价标签重叠 */
  .chart-badge {
    display: none;
  }

  .news-ticker {
    height: 36px;
  }

  .news-ticker .text-button span {
    display: none;
  }

  .desk-body {
    padding: 8px 9px 10px;
  }

  .positions-list {
    max-height: 62vh;
  }

  .pos-actions {
    gap: 6px;
  }

  .pos-btn {
    min-height: 40px;
  }

  .quick-lots button,
  .seg.mini button,
  .outline-button.small,
  .icon-button {
    min-height: 40px;
  }

  .seg.mini button {
    min-height: 34px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .playback .icon-button {
    width: 38px;
    height: 38px;
  }

  .outline-button.small {
    min-height: 38px;
  }

  .order-ticket {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 94dvh;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: var(--r-3xl) var(--r-3xl) 0 0;
    border-bottom: 0;
    animation: modal-up-in var(--dur-2) var(--ease-out) both;
  }

  .modal.wide,
  .modal.story-card,
  .modal.share-card-modal {
    width: 100%;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    padding-top: 10px;
    background: var(--surface-raised);
  }

  .ach-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .battle-grid {
    grid-template-columns: 1fr;
  }

  .stats-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news-float {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }

  .toast {
    bottom: 12px;
  }

  .disclaimer {
    font-size: 9.5px;
  }

  .settings-row small {
    max-width: none;
  }
}

/* 窄屏细节 */
@media (max-width: 479px) {
  .account-lead .equity {
    font-size: 22px;
  }

  .brand-text small {
    display: none;
  }

  .topbar {
    padding: 6px var(--page-pad);
  }

  #chartWrap,
  .chart-wrap {
    height: 280px;
  }

  .pair-row {
    min-width: 124px;
  }

  .seg button {
    min-height: 26px;
    padding: 0 6px;
    font-size: 10.5px;
  }

  .seg.full button {
    min-height: 32px;
  }

  .chart-toolbar-right .outline-button.small {
    padding: 0 7px;
    font-size: 10.5px;
  }

  .chart-foot {
    font-size: 9px;
  }

  .desk-tabs {
    padding: 6px;
  }

  .desk-tab {
    font-size: 11px;
    padding: 0 6px;
  }

  .pos-pnl {
    font-size: 13px;
  }

  .pos-meta {
    gap: 7px;
  }

  .field-grid {
    gap: 6px;
  }

  .input-shell input {
    font-size: 12.5px;
  }

  .quick-lots button {
    font-size: 9px;
    padding: 0 2px;
  }

  .trade-button {
    height: 50px;
    gap: 4px;
    font-size: 12.5px;
  }

  .trade-button em {
    font-size: 9px;
  }

  .trade-button .ico {
    width: 15px;
    height: 15px;
  }

  .risk-grid strong {
    font-size: 11.5px;
  }

  .modal {
    padding: 18px 13px calc(14px + env(safe-area-inset-bottom));
  }

  .modal h2 {
    font-size: 19px;
  }

  .modal-actions .primary-button,
  .modal-actions .outline-button,
  .modal-actions .danger-button {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 12px;
  }

  .ach-grid {
    grid-template-columns: 1fr;
  }

  .ch-stats {
    gap: 4px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cal-item {
    grid-template-columns: 66px 38px minmax(0, 1fr);
    gap: 6px;
  }

  .cal-imp {
    display: none;
  }

  .settings-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .seg.mini button {
    padding: 0 6px;
  }
}

/* 320px 极窄屏 */
@media (max-width: 359px) {
  .account-lead .equity {
    font-size: 20px;
  }

  .brand-text strong {
    font-size: 15px;
  }

  .top-actions .text-button {
    width: 30px;
  }

  .mode-tab {
    font-size: 10px;
    height: 32px;
  }

  .pair-row {
    min-width: 116px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-hero {
    grid-template-columns: 1fr 1fr;
  }

  .trade-button {
    font-size: 11.5px;
  }

  .trade-button em {
    display: block;
    font-size: 8.5px;
    margin-left: 0;
  }

  .chart-toolbar-right .outline-button.small span {
    display: none;
  }
}

@keyframes modal-up-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   23. 可用性偏好
   -------------------------------------------------------------------------- */
@media (hover: none) {
  .text-button,
  .icon-button,
  .pos-btn,
  .quick-lots button,
  .seg button,
  .outline-button.small {
    min-height: 40px;
  }
}

@media (prefers-contrast: more) {
  :root,
  html[data-theme="night"] {
    --border: var(--border-strong);
    --border-soft: var(--border);
    --shadow-1: none;
    --shadow-2: 0 2px 10px rgba(0, 0, 0, .2);
  }

  body {
    background-image: none;
  }

  .panel,
  .input-shell,
  .select-shell,
  .form-field input,
  .form-field select {
    border-width: 1.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .ticker-track {
    padding-left: 0;
    animation: none;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .ach-item.unlocked::after {
    display: none;
  }

  .dot-live {
    animation: none;
  }
}

/* css/extra.css */
/* 项目补充样式：生成样式表之后的小修与交互兜底 */
.hidden { display: none !important; }

/* 快讯浮卡不阻挡下单：只有关闭按钮可点 */
.news-float { pointer-events: none; }
.news-float .nf-close { pointer-events: auto; }

/* 回放模式下不可交易的货币对 */
.pair-row:disabled,
.pair-row.disabled {
  opacity: .42;
  cursor: not-allowed;
  filter: saturate(.6);
}

/* 宽弹窗兜底 */
.modal.wide { width: min(720px, calc(100vw - 32px)); }

/* 表单：历史回放设置 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field > span { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.form-field input,
.form-field select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--ink);
  font: 500 13px var(--font-mono);
  width: 100%;
  box-sizing: border-box;
}
.form-field input:focus-visible,
.form-field select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.quick-range { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.quick-range button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  color: var(--ink-2);
  font: 600 11px var(--font-ui);
  cursor: pointer;
}
.quick-range button:hover { border-color: var(--brass); color: var(--brass-strong); }

@media (max-width: 720px) {
  .form-grid, .form-grid.two { grid-template-columns: 1fr; }
}

/* 教程里的小演示条 */
.tut-demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--text-muted);
  font: 500 12px var(--font-mono);
}

/* 结算行 */
.settle-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 13px;
}
.settle-line > span { color: var(--text-muted); }
.settle-line.big strong { font-size: 24px; color: var(--brass); }
.history-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--brass);
  background: var(--brass-soft);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.7;
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.settle-warn { color: var(--danger); font-size: 12px; margin-top: 8px; }

/* 持仓卡片里的“市价/限价”小标签 */
.pos-tag {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border-radius: var(--r-xs);
  background: var(--surface-sunken);
  color: var(--text-faint);
  font-size: 9px;
  letter-spacing: .02em;
}
.pos-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }

/* 屏幕阅读器 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 弹窗打开时，Toast 不应压住弹窗按钮 */
#toast { z-index: 65; pointer-events: none; }
#toast .toast-item { pointer-events: none; }

/* 账户条的盈亏颜色：容器规则优先级高于 .up/.down，需要显式覆盖 */
#floatingValue.up, #equityDelta.up { color: var(--mkt-up); }
#floatingValue.down, #equityDelta.down { color: var(--mkt-down); }

/* 通用弹窗必须高于设置/战役等专用弹窗（例如“清除存档”确认框从设置里打开） */
#modal.modal-backdrop { z-index: 90; }

/* 按 2% 风险计算手数 */
.risk-size {
  align-self: flex-start;
  margin: -2px 0 8px;
  font-size: 11px;
  color: var(--brass-strong);
}
.risk-size:hover { color: var(--brass); text-decoration: underline; }

/* 弹窗打开时的 Toast 必须在遮罩之上，否则校验错误完全不可见 */
#toast { z-index: 96; }

/* 新闻浮卡固定在右下角，宽度收进右栏，避免遮挡中栏持仓 */
.news-float {
  width: min(300px, calc(100vw - 32px));
  max-height: 180px;
  overflow: hidden;
}
.news-float #nfBody {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 单列/手机布局下不浮出卡片，快讯只走图表内的快讯条与新闻中心 */
@media (max-width: 1079px) {
  .news-float {
    display: none !important;
  }
}

/* 禁用态统一视觉 */
.outline-button:disabled,
.primary-button:disabled,
.danger-button:disabled,
.pos-btn:disabled,
.text-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
select:disabled { opacity: .5; cursor: not-allowed; }

/* 结算/统计里的涨跌色曾被 .settle-line strong 等覆盖 */
.settle-line strong.up, .stats-hero strong.up, .stat-cell strong.up { color: var(--mkt-up); }
.settle-line strong.down, .stats-hero strong.down, .stat-cell strong.down { color: var(--mkt-down); }

/* 每日挑战全球排行榜 */
.lb-tabs { display: flex; gap: 8px; margin: 4px 0 10px; }
.lb-tab {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  color: var(--ink-2);
  font: 600 12px var(--font-ui);
  cursor: pointer;
}
.lb-tab:hover { border-color: var(--brass); color: var(--brass-strong); }
.lb-tab.active { border-color: var(--brass); background: var(--brass-soft); color: var(--brass-strong); }
.lb-meta { margin: 0 0 8px; color: var(--text-muted); font: 500 11px var(--font-mono); }
.lb-content { max-height: min(50vh, 340px); }
.lb-row .ldr-name small {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font: 400 10px var(--font-mono);
}
.lb-me { margin-top: 8px; }
.lb-name-row { display: flex; gap: 8px; margin-top: 12px; }
.lb-name-input {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--ink);
  font: 500 13px var(--font-ui);
  box-sizing: border-box;
}
.lb-name-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.lb-note { margin-top: 8px; }
@media (max-width: 560px) {
  .lb-name-row { flex-direction: column; }
}

/* --------------------------------------------------------------------------
   久留美彩蛋：图表角落头像 + 浮动卡片
   -------------------------------------------------------------------------- */
.kurumi-avatar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 38px;
  height: 38px;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  background: linear-gradient(140deg, #F2A7BB 0%, #D45C7D 55%, #8E3555 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .38);
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.kurumi-avatar:hover {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.kurumi-avatar:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.kurumi-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}
.kurumi-avatar-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #FFF;
  font: 700 15px/1 var(--font-ui);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.kurumi-avatar.has-img .kurumi-avatar-fallback { display: none; }
.kurumi-avatar.img-error img { display: none; }

/* 模式角标左移，给头像让位 */
.chart-wrap .chart-badge { right: 54px; }

.kurumi-float {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 61; /* 高于新闻浮卡 60：用户主动打开时优先显示 */
  width: min(360px, calc(100vw - 32px));
  overflow: hidden;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
  animation: toast-in var(--dur-2) var(--ease-out) both;
}
.kurumi-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(150deg, #D96A86, #7A2F4A);
}
.kurumi-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.kurumi-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 16px;
  color: #FFF;
  background: linear-gradient(160deg, rgba(217, 106, 134, .95), rgba(90, 30, 55, .98));
}
.kurumi-fallback b { font-size: 15px; letter-spacing: .08em; }
.kurumi-fallback em { font-size: 12px; font-style: normal; opacity: .92; }
.kurumi-float.has-img .kurumi-fallback { display: none; }
.kurumi-float.img-error img { display: none; }
.kurumi-float .modal-x {
  top: 8px;
  right: 8px;
  background: rgba(15, 20, 22, .45);
  color: #FFF;
  backdrop-filter: blur(4px);
}
.kurumi-float .modal-x:hover { background: rgba(15, 20, 22, .72); color: #FFF; }
.kurumi-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px 10px;
}
.kurumi-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.kurumi-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #D45C7D;
  box-shadow: 0 0 0 2px rgba(212, 92, 125, .18);
}

@media (max-width: 720px) {
  .kurumi-avatar { top: 6px; right: 6px; width: 34px; height: 34px; }
  .chart-wrap .chart-badge { right: 48px; }
  .kurumi-float { right: 10px; bottom: 10px; left: 10px; width: auto; max-width: none; }
}

/* css/claude.css */
/* ==========================================================================
   Claude 风格界面细化
   暖纸底、陶土橙主色、衬线标题、克制边框与柔和圆角。
   只覆盖视觉细节，不改变布局与游戏逻辑。
   ========================================================================== */

body {
  background-image: none;
  letter-spacing: .003em;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

/* 顶栏与账户条：更像应用外壳，而不是交易终端 */
.topbar,
.account-bar {
  background: var(--bg);
  box-shadow: none;
  border-bottom: 1px solid var(--border);
}

.topbar {
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
}

.brand-mark {
  filter: none;
}

.brand-text strong {
  font-weight: 600;
  letter-spacing: -.01em;
}

.brand-text small,
.kicker,
.pair-group-label {
  letter-spacing: .14em;
  color: var(--accent);
}

.kicker {
  letter-spacing: .12em;
}

.mode-tabs {
  background: var(--surface-sunken);
  border-color: var(--border-soft);
}

.mode-tab {
  font-weight: 500;
}

.mode-tab.active {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(38, 38, 36, .06);
}

.top-actions .text-button {
  color: var(--text-muted);
  font-weight: 500;
}

.text-button:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.clock-pill,
.mode-badge,
.order-pair,
.count-pill {
  border-radius: var(--r-pill);
}

.mode-badge,
.order-pair,
.desk-tab.active .count-pill {
  background: var(--brass-soft);
  color: var(--brass-strong);
}

.account-lead {
  border-left-color: var(--brand);
}

.equity {
  font-weight: 500;
  letter-spacing: -.03em;
}

.metric-level .gauge,
.gauge {
  background: var(--gauge-track);
}

/* 面板与标题 */
.panel {
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-1);
}

.panel-heading h2,
.modal h2,
.story-body h2 {
  font-weight: 600;
  letter-spacing: -.012em;
}

.corner-mark {
  display: none;
}

.heading-glyph {
  color: var(--accent);
  opacity: .45;
}

/* 按钮 */
.primary-button,
.outline-button,
.danger-button {
  border-radius: var(--r-md);
  font-weight: 600;
}

.primary-button {
  background: var(--action);
  border-color: var(--action);
  color: var(--action-contrast);
}

.primary-button:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
}

.outline-button {
  background: var(--surface-raised);
  border-color: var(--border);
  color: var(--ink-2);
}

.outline-button:hover {
  background: var(--surface-hover);
  border-color: var(--brand);
  color: var(--brand-2);
}

.danger-button {
  background: var(--danger);
  border-color: var(--danger);
}

.text-button {
  border-radius: var(--r-md);
}

/* 分段控件 */
.seg {
  background: var(--surface-sunken);
  border-color: var(--border-soft);
  border-radius: var(--r-md);
}

.seg button {
  border-radius: calc(var(--r-md) - 2px);
  font-weight: 500;
}

.seg button.active {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(38, 38, 36, .06);
}

/* 输入 */
.input-shell,
.select-shell {
  background: var(--surface-raised);
  border-color: var(--border);
  border-radius: var(--r-md);
}

.input-shell:focus-within,
.select-shell:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-shell input,
.select-shell select {
  color: var(--ink);
}

/* 市场列表 */
.pair-row {
  border-radius: var(--r-md);
}

.pair-row:hover {
  background: var(--surface-hover);
}

.pair-row.selected {
  background: var(--brass-soft);
  border-left-color: var(--brand);
}

.pair-row.selected .pair-id {
  color: var(--brand-2);
}

.pair-id,
.pair-price,
.pair-chg,
.pair-spread {
  font-variant-numeric: tabular-nums;
}

.market-foot {
  border-top-color: var(--border-soft);
}

/* 图表容器 */
.chart-wrap {
  border-radius: var(--r-xl);
  box-shadow: none;
}

.chart-badge {
  background: var(--chart-bg-elev);
  color: var(--chart-axis);
}

.chart-toolbar {
  border-color: var(--border-soft);
}

/* 下单票 */
.order-ticket {
  background: var(--surface);
}

.trade-button {
  height: 50px;
  border-radius: var(--r-lg);
  font-weight: 600;
  letter-spacing: .01em;
}

.trade-button.long {
  background: var(--mkt-up);
  border-color: var(--mkt-up);
  color: var(--mkt-up-on);
}

.trade-button.long:hover {
  background: var(--mkt-up-strong);
  border-color: var(--mkt-up-strong);
  color: var(--mkt-up-on);
}

.trade-button.short {
  background: var(--mkt-down);
  border-color: var(--mkt-down);
  color: var(--mkt-down-on);
}

.trade-button.short:hover {
  background: var(--mkt-down-strong);
  border-color: var(--mkt-down-strong);
  color: var(--mkt-down-on);
}

.trade-button em {
  opacity: .72;
}

.quick-lots button {
  border-radius: var(--r-pill);
}

.order-preview div {
  border-bottom-color: var(--border-soft);
}

.risk-size {
  color: var(--brand-2);
}

/* 持仓 / 挂单 / 历史 */
.desk-tabs {
  border-bottom-color: var(--border);
}

.desk-tab {
  font-weight: 500;
}

.desk-tab.active {
  color: var(--ink);
  border-bottom-color: var(--brand);
}

.position-card,
.order-card,
.history-row {
  border-radius: var(--r-lg);
}

.pos-btn {
  border-radius: var(--r-sm);
}

/* 弹窗与浮层 */
.modal-backdrop {
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal {
  border-radius: var(--r-3xl);
  box-shadow: var(--shadow-float);
}

.modal-icon {
  border-radius: var(--r-lg);
}

.toast-item {
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
}

.news-float {
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
}

/* 战役 / 挑战 / 成就卡片 */
.battle-card,
.challenge-card,
.achievement-card {
  border-radius: var(--r-xl);
}

.battle-card:hover:not(:disabled) {
  border-color: var(--brand);
}

.battle-card.cleared {
  border-color: var(--brand);
}

.challenge-card {
  border-top-color: var(--brand);
}

/* 滚动条与焦点 */
* {
  scrollbar-color: var(--scrollbar) transparent;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* 去掉票券缺口，保持 Claude 的干净卡片 */
.challenge-card {
  background: var(--surface-raised);
}

.challenge-card h3 {
  font-weight: 600;
}

/* 选中行底色更深，改用强色保证小字对比度 */
.pair-row.selected .pair-chg.up { color: var(--mkt-up-strong); }
.pair-row.selected .pair-chg.down { color: var(--mkt-down-strong); }
.pair-row.selected .pair-spread { color: var(--ink-2); }
