/* ═══════════════════════════════════════════════════════
   INVESTING.COM 完全精确设计规范
   数据来源：直接观察investing.com截图像素值

   亮色模式（Light）:
     顶栏:       #1a1a1a 黑  白字rgba(255,255,255,.88)
     侧栏:       #ffffff 白  #333333灰字  橙色active
     页面背景:   #f5f5f5
     卡片:       #ffffff + shadow
     正文:       #333333  14px Roboto
     次文:       #6d6d6d
     辅文:       #9b9b9b
     涨:         #00b050  跌: #cc0000
     分割线:     #e0e0e0

   深色模式（Dark，参照TradingView/investing dark）:
     顶栏:       #1a1a1a 黑（相同）
     侧栏:       #1e222d 深蓝灰  rgba(255,255,255,.72)
     页面背景:   #131722
     卡片:       #1e222d
     正文:       #d1d4dc
     次文:       #9598a1
     涨:         #26a69a  跌: #ef5350
═══════════════════════════════════════════════════════ */

/* ─── 全局固定（不随主题切换）─── */
:root {
  --font-body:   'Inter', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  --font-hud:    'Noto Sans CJK SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:   'Roboto Mono', 'SF Mono', Consolas, monospace;
  --radius-sm:   2px;
  --radius-md:   4px;
  --radius-lg:   6px;
  --sidebar-w:   220px;
  --topbar-h:    48px;

  /* 顶栏：永远深色（与侧边栏统一）*/
  --nbar-bg:          #131722;
  --nbar-border:      #1e222d;
  --nbar-text:        rgba(255,255,255,.90);
  --nbar-text-dim:    rgba(255,255,255,.50);
  --nbar-sep:         rgba(255,255,255,.08);
  --topbar-bg:        #131722;
  --topbar-border:    #1e222d;
  --topbar-ticker-bg: #0f1320;
  --topbar-ticker-border: #1e222d;

  /* 顶栏/侧栏/行情条等「深色铬」区：两档字色，避免多套 rgba 白 */
  --chrome-text:     rgba(255,255,255,.94);
  --chrome-text-dim: rgba(255,255,255,.55);

  /* ═══════════════════════════════════════
     配色哲学：极简三色原则
     仅保留 accent（品牌橙）/ up（涨绿）/ down（跌红）
     铜铝不再各自独立配色，统一用 accent 区分活跃态
  ═══════════════════════════════════════ */

  /* 唯一品牌色（永贸橙）*/
  --accent:       #d4870a;  /* 降饱和橙，不刺眼 */
  --accent-dim:   rgba(224,120,24,.15);
  --accent-border:rgba(224,120,24,.28);

  /* 涨跌语义色（仅限数字涨跌）*/
  --up:    #e85865;  /* 涨=红 */
  --down:  #26a69a;  /* 跌=绿 */

  /* 品类色：统一用 accent，不再独立配色 */
  --cu-color:   var(--accent);
  --al-color:   var(--accent);

  /* 交易所色：统一用 accent */
  --lme-color:   var(--accent);
  --comex-color: var(--accent);
  --cj-color:    var(--accent);
  --shfe-color:  var(--accent);
}

/* ─── 亮色主题（默认，investing.com白色模式）─── */
:root, [data-theme="light"] {
  --sidebar-bg:           #1e222d;
  --sidebar-border:       #2a2e39;
  --sidebar-divider:      #2a2e39;
  --sidebar-text:         rgba(255,255,255,.85);
  --sidebar-text-hover:   rgba(255,255,255,.97);
  --sidebar-label:        rgba(255,255,255,.60);
  --sidebar-active-text:  #ffffff;
  --sidebar-active-bg:    #f0851a;
  --sidebar-active-bar:   rgba(255,255,255,.5);
  --sidebar-icon-muted:   rgba(255,255,255,.38);

  --bg-base:       #e8ecf4;
  --bg-card:       #ffffff;
  --bg-panel:      var(--bg-card);
  --bg-hover:      #eef1f8;
  --bg-input:      #fafbfe;
  --bg-tag:        #eef1f8;
  --bg-elevated:   var(--bg-input); /* 与输入框同底，避免未定义变量导致原生控件白底 */

  --text-primary:   #12161d;
  --text-secondary: #3d424c;
  --text-tertiary:  #555b66;
  --text-disabled:  #9aa0ac;

  --border-base:    #e0e3eb;
  --border-split:   #eaecf2;
  --border-hover:   #9196a8;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.14);

  --tbl-head-bg:   #f8f9fd;
  --tbl-row-hover: #f0f3fa;
  --scrollbar:     #c5c8d4;
  --scrollbar-hover: #a8afc0;

  --primary:        #f0851a;
  --primary-hover:  #d4720f;
  --primary-bg:     #fff5e8;
  --primary-border: #f5c878;

  --success:        #e85865;  /* 涨=红 */
  --success-bg:     #fef0f1;
  --success-border: #f8b4b8;
  --error:          #26a69a;  /* 跌=绿 */
  --error-bg:       #eaf5f3;
  --error-border:   #9fd8ce;
  --warning:        #f79426;
  --warning-bg:     #fef8f0;
  --warning-border: #f8d8a0;

  --cu-bg:     #fff8f0;
  --cu-border: #f0c890;
  --al-bg:     #fff8f0;
  --al-border: #f0c890;

  --text-main: var(--text-primary);
  --border: var(--border-base);
  --border-main: var(--border-base);
  --text-dim: var(--text-secondary);
  --ai-chat-bg: #e4e8f1;
  --ai-msg-user-bg: rgba(200, 100, 8, 0.14);
  --ai-msg-user-border: rgba(180, 85, 6, 0.42);
  --ai-msg-assistant-bg: #f7f8fc;
  --ai-msg-assistant-border: #cfd4e0;
}

/* ─── 深色主题：映射 globals.css 黑金 token（废金属/贵金属叙事，与行情红绿语义并存）─── */
[data-theme="dark"] {
  --accent:             var(--gold-500);
  --accent-dim:         rgba(201, 162, 39, 0.15);
  --accent-border:      rgba(201, 162, 39, 0.28);

  --nbar-bg:            var(--bg-surface);
  --nbar-border:        var(--stroke-1);
  --topbar-bg:          var(--bg-surface);
  --topbar-border:      var(--stroke-1);
  --topbar-ticker-bg:   var(--bg-canvas);
  --topbar-ticker-border: var(--stroke-1);

  --sidebar-bg:         var(--bg-surface);
  --sidebar-border:     var(--stroke-1);
  --sidebar-divider:    var(--stroke-1);
  --sidebar-text:       var(--text-muted);
  --sidebar-text-hover: var(--text-1);
  --sidebar-label:      var(--text-muted);
  --sidebar-active-text:  var(--gold-50);
  --sidebar-active-bg:    transparent;
  --sidebar-active-bar:   var(--gold-500);
  --sidebar-icon-muted:   var(--text-muted);

  --chrome-text:     var(--text-1);
  --chrome-text-dim: var(--text-muted);

  --bg-base:       var(--bg-canvas);
  --bg-card:       var(--bg-surface-2);
  --bg-panel:      var(--bg-card);
  --bg-hover:      var(--bg-elev);
  --bg-input:      var(--bg-elev);
  --bg-tag:        var(--bg-surface-2);
  --bg-elevated:   var(--bg-input);

  /* 正文仅两档：主文 / 弱文（与 globals 一致） */
  --text-primary:   var(--text-1);
  --text-secondary: var(--text-muted);
  --text-tertiary:  var(--text-muted);
  --text-disabled:  #7a6e54;

  --border-base:    var(--stroke-1);
  --border-split:   var(--stroke-2);
  --border-hover:   var(--stroke-strong);

  --shadow-sm:  0 1px 3px rgba(0,0,0,.45);
  --shadow-md:  0 4px 12px rgba(0,0,0,.55);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.65);

  --tbl-head-bg:   var(--bg-surface);
  --tbl-row-hover: var(--bg-elev);
  --scrollbar:     var(--stroke-2);
  --scrollbar-hover: var(--gold-700);

  --primary:        var(--gold-500);
  --primary-hover:  var(--gold-400);
  --primary-bg:     rgba(201, 162, 39, 0.12);
  --primary-border: rgba(201, 162, 39, 0.35);

  /* 语义色：涨跌仍用红/绿，与 Metal 报价习惯一致行 */
  --success:        #e85865;
  --success-bg:     rgba(232,88,101,.08);
  --success-border: rgba(232,88,101,.20);
  --error:          #26a69a;
  --error-bg:       rgba(38,166,154,.12);
  --error-border:   rgba(38,166,154,.28);
  --warning:        var(--gold-300);
  --warning-bg:     rgba(201, 162, 39, 0.1);
  --warning-border: rgba(201, 162, 39, 0.3);

  --cu-color:   var(--gold-400);
  --al-color:   var(--gold-400);
  --lme-color:  var(--gold-400);
  --comex-color:var(--gold-400);
  --cj-color:   var(--gold-400);
  --shfe-color: var(--gold-400);
  --cu-bg:      rgba(201, 162, 39, 0.1);
  --cu-border:  rgba(201, 162, 39, 0.28);
  --al-bg:      rgba(201, 162, 39, 0.1);
  --al-border:  rgba(201, 162, 39, 0.28);

  --up:   #e85865;
  --down: #26a69a;

  --text-main: var(--text-primary);
  --border: var(--border-base);
  --border-main: var(--border-base);
  --text-dim: var(--text-secondary);
  --ai-chat-bg: var(--bg-surface);
  --ai-msg-user-bg: rgba(201, 162, 39, 0.18);
  --ai-msg-user-border: rgba(201, 162, 39, 0.45);
  --ai-msg-assistant-bg: var(--bg-elev);
  --ai-msg-assistant-border: var(--stroke-2);
}

/* 深色：卡片/面板与黑金描边、header 微金Tint */
[data-theme="dark"] .panel-head {
  background: rgba(201, 162, 39, 0.07);
  border-bottom-color: var(--stroke-strong);
}
[data-theme="dark"] .card {
  border-color: var(--stroke-2);
}
[data-theme="dark"] .disc-block-head {
  background: rgba(201, 162, 39, 0.05);
}

/* ══════════════════════════════════
   RESET
══════════════════════════════════ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
input, select, textarea, button { font-family:inherit; font-size:inherit; }
html { height:100%; font-size:15px; }
body { font-family:var(--font-body); font-size:15px; line-height:1.65; background-color:var(--bg-base); color:var(--text-primary); min-height:100vh; overflow-x:hidden; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; text-rendering:optimizeLegibility; }
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--scrollbar); border-radius:2px; }
::-webkit-scrollbar-thumb:hover { background:var(--scrollbar-hover); }

/* ══════════════════════════════════
   LAYOUT
══════════════════════════════════ */
.app { display:flex; min-height:100vh; }

/* ══════════════════════════════════
   SIDEBAR
══════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);        /* 永远深色 */
  position: fixed; top:0; left:0; height:100vh;
  display:flex; flex-direction:column;
  z-index: 200; flex-shrink:0;
  transition: transform .25s ease;
  border-right: 1px solid rgba(255,255,255,.06);
}

.sider-logo {
  height: 56px;
  display:flex; align-items:center;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-divider);
  flex-shrink:0;
}
.sider-logo-text {
  font-size:15px; font-weight:700; color:#ffffff;
  letter-spacing: .3px; line-height:1.3;
  white-space:nowrap; overflow:hidden;
}
.sider-logo-text span {
  display:block; font-size:11px; font-weight:400;
  color:rgba(255,255,255,.4); letter-spacing:.8px; margin-top:2px;
  text-transform:uppercase;
}

.sider-nav { flex:1; overflow-y:auto; padding:6px 0; scrollbar-width:none; }
.sider-nav::-webkit-scrollbar { display:none; }

.nav-group-label {
  font-size:11px; font-weight:600;
  color: rgba(255,255,255,.55);
  padding: 14px 20px 5px; letter-spacing:1.2px;
  text-transform:uppercase;
}
.nav-item {
  display:flex; align-items:center; gap:10px;
  padding: 9px 20px;
  font-size:14px; font-weight:400;
  color: var(--sidebar-text);
  cursor:pointer; transition:background .12s, color .12s;
  user-select:none; position:relative;
  white-space:nowrap;
}
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--sidebar-text-hover);
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight:500;
}
.nav-icon { font-size:15px; width:18px; text-align:center; flex-shrink:0; opacity:.85; }

.sider-bottom {
  padding:10px 14px;
  border-top: 1px solid var(--sidebar-divider);
  flex-shrink:0;
}
.status-bar {
  display:flex; align-items:center; gap:8px;
  padding:7px 11px;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-md);
  font-size:12px; color:rgba(255,255,255,.62);
}
.s-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.s-ok  { background: var(--success); box-shadow:0 0 5px var(--success); animation:blink 2.4s infinite; }
.s-err { background: var(--error); }
.s-ld  { background: var(--accent); animation:blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ══════════════════════════════════════════════
   NAV v2 — 四模块折叠导航
══════════════════════════════════════════════ */
.nav-module {
  margin: 0;
}
/* 模块标题行（可点击折叠）*/
.nav-module-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 14px;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
  border-left: 3px solid transparent;
}
.nav-module-hd:hover { background: rgba(255,255,255,.06); }
.nav-module-hd.open  { border-left-color: var(--mod-color); }

/* 模块色带 */
.nav-module-hd .mod-ic {
  font-size: 14px; width: 18px; text-align:center; flex-shrink:0;
}
.nav-module-hd .mod-label {
  flex:1; font-size:13px; font-weight:600;
  letter-spacing:.9px; text-transform:uppercase;
  color: var(--chrome-text);
}
.nav-module-hd .mod-badge {
  font-size:10px; font-family:var(--font-mono);
  color: var(--chrome-text-dim);
  background: transparent;
  border-radius: 3px; padding: 1px 5px;
}
.nav-module-hd .mod-arrow {
  font-size:12px; color:var(--chrome-text-dim);
  transition: transform .2s;
  flex-shrink:0;
}
.nav-module-hd.open .mod-arrow { transform: rotate(90deg); }

/* 模块子项容器 */
.nav-module-bd {
  overflow: hidden;
  transition: max-height .22s ease, opacity .15s;
  max-height: 0; opacity: 0;
}
.nav-module-bd.open { max-height: 400px; opacity: 1; }

/* 子项按钮 */
.nav-item2 {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px 8px 32px;
  font-size: 13px; font-weight: 400;
  color: var(--chrome-text-dim);
  cursor: pointer;
  transition: background .1s, color .1s;
  user-select: none; white-space: nowrap;
  border-left: 3px solid transparent;
}
.nav-item2:hover {
  background: rgba(255,255,255,.06);
  color: var(--chrome-text);
}
.nav-item2.active {
  background: var(--primary-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
  border-left-color: var(--mod-color);
}
.nav-item2 .ni2 { font-size:14px; width:16px; text-align:center; flex-shrink:0; opacity:.92; }

/* 模块主色（亮色下保留区分；深色黑金统一金强调） */
.mod-macro  { --mod-color: #60a5fa; }
.mod-metals { --mod-color: #e85865; }
.mod-tools  { --mod-color: #f59e0b; }
.mod-signal { --mod-color: #a78bfa; }

[data-theme="dark"] .mod-macro,
[data-theme="dark"] .mod-metals,
[data-theme="dark"] .mod-tools,
[data-theme="dark"] .mod-signal {
  --mod-color: var(--gold-400);
}

/* 顶部"实时行情"快捷入口（独立，不折叠）*/
.nav-top-item {
  display:flex; align-items:center; gap:9px;
  padding:10px 16px; margin:6px 10px 2px;
  border-radius:6px;
  font-size:14px; font-weight:600;
  color:#fff;
  background: var(--sidebar-active-bg);
  cursor:pointer; transition:opacity .12s;
  user-select:none;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
[data-theme="dark"] .nav-top-item {
  color: var(--text-1);
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  text-shadow: none;
}
.nav-top-item:hover { opacity:.88; }
.nav-top-item .ni2 { font-size:15px; width:18px; text-align:center; }

/* ══════════════════════════════════════════════
   DISC MODAL — 扣减指标弹窗
══════════════════════════════════════════════ */
.disc-modal-overlay {
  display:none; position:fixed; inset:0; z-index:1000;
  background:rgba(0,0,0,.55); backdrop-filter:blur(3px);
  align-items:center; justify-content:center;
}
.disc-modal-overlay.show { display:flex; }
.disc-modal {
  background:var(--bg-card); border:1px solid var(--border-base);
  border-radius:10px; width:520px; max-width:95vw;
  max-height:88vh; display:flex; flex-direction:column;
  box-shadow:0 20px 60px rgba(0,0,0,.4);
}
.disc-modal-head {
  display:flex; align-items:center; padding:16px 20px;
  border-bottom:1px solid var(--border-split); flex-shrink:0;
}
.disc-modal-head .dm-title { flex:1; font-size:15px; font-weight:600; color:var(--text-primary); }
.disc-modal-head .dm-close {
  width:28px; height:28px; border-radius:50%; border:none;
  background:rgba(255,255,255,.08); color:var(--text-tertiary);
  cursor:pointer; font-size:15px; display:flex; align-items:center; justify-content:center;
  transition:background .12s;
}
.disc-modal-head .dm-close:hover { background:rgba(255,255,255,.15); color:var(--text-primary); }
.disc-modal-body { flex:1; overflow-y:auto; padding:16px 20px; }
.disc-modal-foot {
  display:flex; gap:10px; justify-content:flex-end;
  padding:14px 20px; border-top:1px solid var(--border-split); flex-shrink:0;
}

/* 品种行 */
.disc-row {
  display:flex; align-items:center; gap:8px;
  padding:7px 0; border-bottom:1px solid var(--border-split);
}
.disc-row:last-child { border-bottom:none; }
.disc-row-name { flex:1; font-size:14px; color:var(--text-primary); }
.disc-row-unit {
  font-size:12px; font-family:var(--font-mono);
  background:rgba(255,255,255,.07); border:1px solid var(--border-base);
  border-radius:4px; padding:2px 7px; cursor:pointer; color:var(--text-secondary);
  transition:background .12s; user-select:none; white-space:nowrap;
}
.disc-row-unit:hover { background:rgba(255,255,255,.13); }
.disc-row-input {
  width:90px; text-align:right; font-family:var(--font-mono);
  background:var(--bg-input,rgba(255,255,255,.06));
  border:1px solid var(--border-base); border-radius:4px;
  padding:4px 8px; font-size:14px; color:var(--text-primary);
}
.disc-row-del {
  width:22px; height:22px; border-radius:50%; border:none;
  background:transparent; color:var(--text-tertiary); cursor:pointer;
  font-size:14px; display:flex; align-items:center; justify-content:center;
  transition:color .12s;
}
.disc-row-del:hover { color:var(--error); }

/* 添加品种下拉 */
.add-item-wrap { position:relative; margin-top:10px; }
.add-item-btn {
  display:flex; align-items:center; gap:6px;
  font-size:13px; color:var(--primary); cursor:pointer;
  background:none; border:1px dashed var(--primary);
  border-radius:6px; padding:6px 12px; width:100%;
  justify-content:center; transition:background .12s;
}
.add-item-btn:hover { background:rgba(240,133,26,.08); }
.add-item-dropdown {
  display:none; position:absolute; top:calc(100% + 4px); left:0; right:0;
  background:var(--bg-card); border:1px solid var(--border-base);
  border-radius:8px; z-index:10; box-shadow:0 8px 24px rgba(0,0,0,.3);
  max-height:220px; overflow-y:auto;
}
.add-item-dropdown.show { display:block; }
.add-item-opt {
  display:flex; align-items:center; gap:8px; padding:8px 14px;
  font-size:13px; color:var(--text-secondary); cursor:pointer;
  transition:background .1s;
}
.add-item-opt:hover { background:rgba(255,255,255,.06); color:var(--text-primary); }
.add-item-divider { height:1px; background:var(--border-split); margin:4px 0; }
.add-item-new { padding:10px 14px; }
.add-item-new input {
  width:100%; background:var(--bg-input,rgba(255,255,255,.06));
  border:1px solid var(--border-base); border-radius:4px;
  padding:6px 10px; font-size:13px; color:var(--text-primary);
  margin-bottom:6px;
}
.add-item-new-row { display:flex; gap:6px; align-items:center; }
.add-item-new-row select {
  flex:1; background:var(--bg-input,rgba(255,255,255,.06));
  border:1px solid var(--border-base); border-radius:4px;
  padding:5px 8px; font-size:13px; color:var(--text-primary);
}

/* 展示块 edit按钮 */
.disc-block {
  background:var(--bg-card); border:1px solid var(--border-split);
  border-radius:8px; margin-bottom:12px; overflow:hidden;
}
.disc-block-head {
  display:flex; align-items:center; padding:10px 16px;
  border-bottom:1px solid var(--border-split);
  background:rgba(255,255,255,.03);
}
.disc-block-head .db-title { flex:1; font-size:14px; font-weight:600; color:var(--text-primary); }
.disc-block-body { padding:12px 16px; }
.disc-item-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:5px 0; border-bottom:1px solid var(--border-split); font-size:13px;
}
.disc-item-row:last-child { border-bottom:none; }
.disc-item-name { color:var(--text-secondary); font-family:var(--font-body); font-size:13px; }
.disc-item-val  { font-family:var(--font-mono); font-weight:600; }

/* ══════════════════════════════════
   MAIN
══════════════════════════════════ */
.main-wrap { margin-left:var(--sidebar-w); flex:1; display:flex; flex-direction:column; min-height:100vh; }

/* TOPBAR — 永远深色（investing.com特征）*/
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);          /* 深黑 #111 */
  border-bottom: 1px solid var(--topbar-border);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 20px;
  position:sticky; top:0; z-index:100;
  flex-shrink:0;
}
.breadcrumb { display:flex; align-items:center; gap:5px; font-size:14px; }
.bc-sep { color:var(--chrome-text-dim); font-size:13px; }
.bc-current { color:var(--chrome-text); font-weight:600; }
.bc-parent  { color:var(--chrome-text-dim); }
.topbar-right { display:flex; align-items:center; gap:14px; }
.tb-clock {
  font-family: var(--font-mono); font-size:14px; font-weight:600;
  color: var(--chrome-text); letter-spacing:.5px;
}
.tb-date  { font-size:13px; color:var(--chrome-text-dim); font-family:var(--font-mono); }
.admin-tag {
  font-size:12px; padding:2px 10px; border-radius:20px;
  background: var(--primary-bg); color: var(--primary);
  border: 1px solid var(--primary-border);
}

/* TICKER — 深色条（与topbar连贯）*/
.ticker {
  background: var(--topbar-ticker-bg);   /* #1a1a1a */
  border-bottom: 1px solid var(--topbar-ticker-border);
  display:flex; overflow-x:auto; scrollbar-width:none;
  flex-shrink:0;
}
.ticker::-webkit-scrollbar { display:none; }
.tk {
  display:flex; align-items:center; gap:7px;
  padding:6px 18px;
  border-right: 1px solid rgba(255,255,255,.08);
  white-space:nowrap; flex-shrink:0;
  cursor:default;
}
.tk:hover { background:rgba(255,255,255,.04); }
.tk-l { font-size:11px; color:var(--chrome-text-dim); text-transform:uppercase; letter-spacing:.5px; }
.tk-v { font-size:14px; font-weight:500; color:var(--chrome-text); font-variant-numeric:tabular-nums; }
.tk-c { font-size:12px; }
.up   { color:#e85865 !important; }  /* 涨=红 */
.down { color:#26a69a !important; }  /* 跌=绿 */
.flat { color:var(--text-tertiary); }

/* CONTENT */
.content { padding:20px 24px; flex:1; }

/* ══════════════════════════════════
   PAGES
══════════════════════════════════ */
.page { display:none; animation:fadein .2s ease; }
.page.active { display:block; }
@keyframes fadein { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

/* ══════════════════════════════════
   PAGE HEADER
══════════════════════════════════ */
.pg-head {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:16px;
}
.pg-title { font-size:16px; font-weight:600; color:var(--text-primary); }
.pg-extra { display:flex; align-items:center; gap:8px; }

/* ══════════════════════════════════
   SECTION
══════════════════════════════════ */
.section { margin-bottom:20px; }
.section-title {
  font-size:13px; font-weight:600; color:var(--text-secondary);
  margin-bottom:12px; display:flex; align-items:center; gap:8px;
}
.section-title::after { content:''; flex:1; height:1px; background:var(--border-base); }

/* ══════════════════════════════════
   CARD
══════════════════════════════════ */
.card {
  background:var(--bg-card);
  border:1px solid var(--border-base);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}
.card-head {
  padding:14px 18px 0;
  display:flex; align-items:center; justify-content:space-between;
}
.card-title { font-size:15px; font-weight:600; color:var(--text-primary); }
.card-body  { padding:14px 18px 18px; }
.card-full  { padding:18px; }

/* ══════════════════════════════════
   STAT CARDS (行情大卡)
══════════════════════════════════ */
.stat-card {
  background:var(--bg-card);
  border:1px solid var(--border-base);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  padding:16px 18px;
  position:relative;
  overflow:hidden;
  transition:box-shadow .2s, border-color .2s;
}
.stat-card:hover { box-shadow:var(--shadow-md); border-color:var(--border-hover); }
.stat-card-top { width:32px; height:3px; border-radius:2px; margin-bottom:12px; }
.sc-cu .stat-card-top { background:var(--cu-color); }
.sc-al .stat-card-top { background:var(--al-color); }
.sc-gr .stat-card-top { background:var(--success); }
.sc-pr .stat-card-top { background:var(--primary); }
.sc-w  .stat-card-top { background:var(--warning); }

.stat-label { font-size:13px; color:var(--text-tertiary); margin-bottom:4px; }
.stat-name  { font-size:13px; color:var(--text-secondary); margin-bottom:8px; }
.stat-value { font-family:var(--font-body); font-size:22px; font-weight:600; font-variant-numeric:tabular-nums; color:var(--text-primary); line-height:1.1; margin-bottom:4px; }
.stat-change { font-size:13px; margin-bottom:8px; }
.stat-footer {
  display:flex; justify-content:space-between; align-items:center;
  padding-top:10px; border-top:1px solid var(--border-split);
  font-size:12px; color:var(--text-tertiary); /* lifted */
}
.stat-footer-item { display:flex; flex-direction:column; gap:1px; }
.sf-label { font-size:11px; color:var(--text-tertiary); letter-spacing:.5px; }
.sf-value { font-family:var(--font-mono); font-size:12px; color:var(--text-tertiary); }

/* ══════════════════════════════════
   GRIDS
══════════════════════════════════ */
.g4  { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:18px; }
.g3  { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:18px; }
.g2  { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:18px; }
.g21 { display:grid; grid-template-columns:2fr 1fr; gap:16px; margin-bottom:18px; }
.mb0 { margin-bottom:0 !important; }
.mb16{ margin-bottom:16px; }

/* ══════════════════════════════════
   TABLE
══════════════════════════════════ */
.tbl-wrap { border:1px solid var(--border-base); border-radius:var(--radius-lg); overflow:hidden; background:var(--bg-card); box-shadow:var(--shadow-sm); }
.tbl { width:100%; border-collapse:collapse; font-size:14px; }
.tbl thead { background: var(--tbl-head-bg); }
.tbl th {
  padding:10px 14px; text-align:left;
  font-size:13px; font-weight:500; color:var(--text-secondary);
  border-bottom:1px solid var(--border-base);
  white-space:nowrap;
}
.tbl td {
  padding:11px 14px;
  color:var(--text-primary);
  border-bottom:1px solid var(--border-split);
}
.tbl tr:last-child td { border-bottom:none; }
.tbl tbody tr { transition:background .15s; }
.tbl tbody tr:hover td { background: var(--tbl-row-hover); }
.tbl .mono { font-family:var(--font-mono); }
.tbl .buy  { color:var(--success); font-weight:500; }
.tbl .sell { color:var(--cu-color); font-weight:500; }
.tbl .sub  { font-size:12px; color:var(--text-tertiary); }

/* ══════════════════════════════════
   TAGS / BADGES
══════════════════════════════════ */
.tag {
  display:inline-flex; align-items:center; gap:4px;
  font-size:12px; padding:1px 8px; border-radius:20px;
  font-weight:500; white-space:nowrap;
}
.tag-cu  { background:var(--cu-bg);      color:var(--cu-color);  border:1px solid var(--cu-border); }
.tag-al  { background:var(--al-bg);      color:var(--al-color);  border:1px solid var(--al-border); }
.tag-ok  { background:transparent;       color:var(--success);   border:1px solid var(--success-border); }
.tag-warn{ background:transparent;       color:var(--warning);   border:1px solid var(--warning-border); }
.tag-err { background:transparent;       color:var(--error);     border:1px solid var(--error-border); }
.tag-pr  { background:var(--primary-bg); color:var(--primary);   border:1px solid var(--primary-border); }
.tag-gray{ background:var(--tag-bg, #2c3038);           color:var(--text-secondary); border:1px solid var(--border-base); }

/* ══════════════════════════════════
   ALERT / NOTICE
══════════════════════════════════ */
.alert {
  display:flex; align-items:flex-start; gap:10px;
  padding:10px 14px; border-radius:var(--radius-md);
  font-size:14px; margin-bottom:16px; line-height:1.6;
}
.alert-info  { background:var(--primary-bg); border:1px solid var(--primary-border); color:#40a9ff; }
.alert-warn  { background:var(--warning-bg); border:1px solid var(--warning-border); color:#d89614; }
.alert-bull  { background:var(--success-bg); border:1px solid var(--success-border); color: var(--success); }
.alert-bear  { background:var(--error-bg);   border:1px solid var(--error-border);   color: var(--error); }
[data-theme="dark"] .alert-info { color: var(--gold-300); }
[data-theme="dark"] .alert-warn { color: var(--gold-400); }
.alert-icon  { font-size:15px; flex-shrink:0; margin-top:1px; }

/* ══════════════════════════════════
   FORM INPUTS
══════════════════════════════════ */
.form-item { display:flex; flex-direction:column; gap:5px; margin-bottom:14px; }
.form-label { font-size:13px; color:var(--text-secondary); font-weight:500; }
.form-input, .form-select {
  height:32px; padding:0 11px;
  border:1px solid var(--border-base);
  border-radius:var(--radius-md);
  font-family:var(--font-mono); font-size:14px;
  color:var(--text-primary); background:var(--bg-card);
  width:100%; transition:border-color .2s, box-shadow .2s;
  outline:none;
}
.form-input:hover, .form-select:hover { border-color:var(--primary-hover); }
.form-input:focus, .form-select:focus { border-color:var(--primary); box-shadow:0 0 0 2px rgba(27,117,188,0.25); }
.form-input::placeholder { color:var(--text-disabled); font-family:var(--font-body); }
.form-select { appearance:none; cursor:pointer; }
.ig2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ig3 { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.ig4 { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }

/* ══════════════════════════════════
   BUTTONS
══════════════════════════════════ */
.btn {
  display:inline-flex; align-items:center; gap:6px;
  height:32px; padding:0 16px;
  border-radius:var(--radius-md);
  font-family:var(--font-body); font-size:14px; font-weight:500;
  cursor:pointer; border:1px solid transparent;
  transition:all .15s; white-space:nowrap; user-select:none;
}
.btn:active { transform:scale(.98); }
.btn-primary { background:var(--primary); color:#fff; border-color:var(--primary); }
.btn-primary:hover { background:var(--primary-hover); border-color:var(--primary-hover); }
.btn-default { background: var(--bg-tag); color: var(--text-primary); border-color: var(--border-base); }
.btn-default:hover { border-color:var(--primary); color:var(--primary); }
.btn-success { background:var(--success); color:#fff; }
.btn-success:hover { opacity:.88; }
.btn-warning { background:var(--warning); color:#fff; }
.btn-warning:hover { opacity:.88; }
.btn-sm  { height:28px; padding:0 12px; font-size:13px; }
.btn-full{ width:100%; justify-content:center; }
.btn-group { display:flex; gap:8px; flex-wrap:wrap; }

/* ══════════════════════════════════
   RESULT / SUMMARY ROWS
══════════════════════════════════ */
.result-list { border:1px solid var(--border-base); border-radius:var(--radius-lg); overflow:hidden; }
.result-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 16px; font-size:14px;
  border-bottom:1px solid var(--border-split);
}
.result-row:last-child { border-bottom:none; }
.result-row:nth-child(odd) { background: var(--tbl-head-bg); }
.rl { color:var(--text-secondary); }
.rv { font-family:var(--font-mono); font-weight:500; }
.result-total {
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 16px;
  background:var(--primary-bg);
  border:1px solid var(--primary-border);
  border-radius:var(--radius-md);
  font-size:15px; font-weight:600; margin-top:12px;
}
.profit-pos { color:var(--success); }
.profit-neg { color:var(--error); }

/* ══════════════════════════════════
   FORMULA CHIP
══════════════════════════════════ */
.fml { font-size:12px; color:var(--text-secondary); font-family:var(--font-mono); background:var(--bg-tag); padding:2px 7px; border-radius:3px; border:1px solid var(--border-base); display:inline-block; }

/* ══════════════════════════════════
   LOGIN OVERLAY
══════════════════════════════════ */
.overlay { position:fixed; inset:0; z-index:500; background:rgba(0,0,0,.70); display:flex; align-items:center; justify-content:center; }
.overlay.hidden { display:none; }
.login-modal {
  background:var(--bg-card); border-radius:var(--radius-lg);
  padding:32px; width:340px;
  box-shadow:0 12px 48px rgba(0,0,0,.70);
}
.modal-title { font-size:18px; font-weight:600; color:var(--text-primary); text-align:center; margin-bottom:6px; }
.modal-sub   { font-size:14px; color:var(--text-tertiary); text-align:center; margin-bottom:24px; }
.modal-err   { font-size:13px; color:var(--error); text-align:center; margin-top:8px; min-height:18px; }

/* ══════════════════════════════════
   HISTORY
══════════════════════════════════ */
.hist-item {
  background:var(--bg-card); border:1px solid var(--border-base);
  border-radius:var(--radius-lg); padding:16px;
  margin-bottom:12px; box-shadow:var(--shadow-sm);
}
.hist-date { font-size:15px; font-weight:600; color:var(--primary); margin-bottom:10px; display:flex; align-items:center; gap:10px; }
.hist-prices { display:flex; gap:20px; margin-left:auto; font-size:13px; color:var(--text-tertiary); }
.hist-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.hist-cell { background:var(--bg-card); border:1px solid var(--border-split); border-radius:var(--radius-md); padding:8px 10px; }
.hc-label { font-size:12px; color:var(--text-secondary); margin-bottom:3px; }
.hc-val   { font-family:var(--font-mono); font-size:14px; color:var(--text-primary); font-weight:500; }
.hc-sub   { font-size:12px; color:var(--text-secondary); margin-top:1px; }

/* ══════════════════════════════════
   DIVIDER
══════════════════════════════════ */
.divider { height:1px; background:var(--border-base); margin:16px 0; }
.mt8  { margin-top:8px; }
.mt12 { margin-top:12px; }
.mt16 { margin-top:16px; }
.flex-between { display:flex; justify-content:space-between; align-items:center; }
.text-xs { font-size:13px; color:var(--text-tertiary); }

/* ══════════════════════════════════
   MOBILE
══════════════════════════════════ */
.mob-overlay { display:none; }
.mob-nav     { display:none; }

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform:translateX(-208px); }
  .sidebar.open { transform:translateX(0); }
  .main-wrap { margin-left:0; }
  .mob-overlay {
    display:block; position:fixed; inset:0; z-index:190;
    background:rgba(0,0,0,.5); opacity:0; pointer-events:none; transition:opacity .25s;
  }
  .mob-overlay.show { opacity:1; pointer-events:all; }
  .mob-nav {
    display:flex; position:fixed; bottom:0; left:0; right:0; z-index:150;
    background:var(--sidebar-bg);
    border-top:1px solid var(--sidebar-border);
    box-shadow:0 -2px 8px rgba(0,0,0,.5);
    padding:4px 0 max(env(safe-area-inset-bottom),6px);
  }
  .mob-nav-item {
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
    padding:5px 4px; font-size:11px; color:var(--text-tertiary);
    cursor:pointer; transition:color .15s;
  }
  .mob-nav-item.active { color:var(--primary); }
  .mob-icon { font-size:18px; line-height:1; }
  .content { padding:14px 14px 80px; }
  .topbar { padding:0 14px; }
  .topbar .hamb-btn { display:flex; }
  .g4 { grid-template-columns:repeat(2,1fr); }
  .g3 { grid-template-columns:repeat(2,1fr); }
  .g2,.g21 { grid-template-columns:1fr; }
  .ig4,.ig3 { grid-template-columns:repeat(2,1fr); }
  .hist-grid { grid-template-columns:repeat(2,1fr); }
  .hist-prices { display:none; }
}
@media (max-width: 500px) {
  .g4 { grid-template-columns:1fr 1fr; gap:8px; }
  .stat-value { font-size:18px; }
  .ticker { display:none; }
}

.hamb-btn {
  display:none; background:none; border:none;
  font-size:18px; cursor:pointer; color:var(--text-primary);
  padding:6px; border-radius:var(--radius-sm);
}
.hamb-btn:hover { background:rgba(255,255,255,.08); }

/* ═══════════════════════════════════════
   V14 HUD 布局层 (适配v14 HTML结构)
═══════════════════════════════════════ */
#starfield { display:none; }

/* v14用.hud作为根布局 */
.hud {
  display: flex;
  flex-direction: column;
  height: 100vh; width: 100vw;
  overflow: hidden;
  background: var(--bg-base);
}

/* ── HUD Header (替代topbar) ── */
.hud-header {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: relative; z-index: 100;
  flex-shrink: 0;
}
.hud-header::before { display:none; }

/* Logo — topbar永远深色，白字橙点 */
.hdr-logo {
  font-family: var(--font-body);
  font-size: 15px; font-weight: 700;
  color: var(--chrome-text);
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  max-width: 260px;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.hdr-logo span { color: var(--primary); text-shadow: 0 0 12px rgba(201, 162, 39, 0.35); }
.hdr-logo em   { color: var(--chrome-text-dim); font-style:normal; font-weight:400; font-size:13px; margin-left:6px; text-transform:uppercase; letter-spacing:.8px; }

.hdr-center {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  flex: 0;  /* 不占空间，待后续启用 */
}
/* hdr-ticker: 深色topbar内的小pill */
.hdr-ticker-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 4px;
}
.hdr-ticker-label { color: var(--chrome-text-dim); font-size: 9px; letter-spacing:.8px; text-transform:uppercase; }
.hdr-ticker-val   { color: var(--chrome-text); font-size:14px; font-weight:500; font-variant-numeric:tabular-nums; }

.hdr-right { display: flex; align-items: center; gap: 12px; }
.hdr-clock { font-family: var(--font-mono); font-size: 14px; font-weight:500; color: var(--chrome-text); letter-spacing:1px; }
.hdr-date  { font-size: 11px; color: var(--chrome-text-dim); }

.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: blink 2.4s infinite;
}

/* ── HUD Body ── */
.hud-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  width: 100%;
}

/* ── 侧栏导航 ── */
.hud-nav {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
  overflow-y: auto; scrollbar-width: none;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  flex-shrink: 0;
  min-height: 0;
}
.hud-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase; padding: 16px 18px 5px;
  color: var(--sidebar-label);
}
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; width: 100%;
  font-family: var(--font-body); font-size: 13px; font-weight: 400;
  color: var(--sidebar-text);
  background: none; border: none; cursor: pointer;
  border-left: 3px solid transparent;
  text-align: left; white-space: nowrap;
  transition: background .12s, color .12s;
}
.nav-btn:hover { background: rgba(255,255,255,.07); color: var(--sidebar-text-hover); }
.nav-btn.active {
  background: var(--primary-bg);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  font-weight: 500;
}
.nav-btn .ni { font-size: 15px; width: 18px; text-align:center; flex-shrink:0; }
.nav-divider { height:1px; background:var(--sidebar-border); margin:6px 12px; }
.nav-bottom {
  margin-top: auto; padding: 10px 12px;
  border-top: 1px solid var(--sidebar-border);
}
.status-indicator {
  display:flex; align-items:center; gap:8px; padding:7px 10px;
  border-radius:var(--radius-md); font-size:12px;
  color: var(--chrome-text-dim);
  background: rgba(128,128,128,.08);
  border: 1px solid var(--sidebar-border);
}
.admin-btn-nav {
  display:flex; align-items:center; gap:7px; padding:7px 10px;
  margin-bottom:5px; cursor:pointer; font-family:var(--font-body);
  font-size:13px; color: var(--chrome-text-dim); background:none;
  width:100%; border:1px solid rgba(255,255,255,.14);
  border-radius:var(--radius-md); transition:all .12s; text-align:left;
}
.admin-btn-nav:hover { background: rgba(255,255,255,.07); color: var(--chrome-text); }

/* ── Pages ── */
.page { display: none; height: 100%; overflow-y: auto; width: 100%; box-sizing: border-box; }
.page.active { display: block; animation: fadein .2s ease; width: 100%; }
.page-content { padding: 20px 24px; width: 100%; box-sizing: border-box; }

/* ── PANEL (v14 panel → v3 card 风格) ── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}
.panel::before, .panel::after { display: none; }
.panel-top-line { display: none; }
.panel-head {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-base);
  background: rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-body);
  letter-spacing: 0;
}
.panel-tag {
  font-family: var(--font-mono); font-size: 11px; padding: 1px 8px;
  border-radius: 20px; font-weight: 500; white-space: nowrap;
  background: var(--primary-bg); color: var(--primary);
  border: 1px solid var(--primary-border);
}
.panel-body { padding: 14px 16px; }

/* ── STAT (v14 stat → v3 stat-card 风格) ── */
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  position: relative; overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.stat::before { content:''; position:absolute; top:0; left:0; width:32px; height:3px; border-radius:0 0 2px 0; }
.stat.cu::before { background: var(--cu-color); }
.stat.al::before { background: var(--al-color); }
.stat.gn::before { background: var(--success); }
.stat.wh::before { background: var(--primary); }
.stat:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }

.stat-label { font-size: 11px; color: var(--text-tertiary); margin-bottom: 3px; font-family: var(--font-body); }
.stat-name  { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-val   { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--text-primary); line-height: 1.1; margin-bottom: 4px; }
.stat-val.cu { color: var(--text-primary); }
.stat-val.al { color: var(--text-primary); }
.stat-val.gn { color: var(--success); }
.stat-val.wh { color: var(--text-primary); }
.stat-chg  { font-size: 12px; margin-bottom: 6px; font-family: var(--font-mono); }
.stat-foot {
  display: flex; justify-content: space-between;
  padding-top: 8px; border-top: 1px solid var(--border-split);
  font-size: 11px; color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* ══ 非标铝锭采购（#nonstdAlContainer）：与全局 body/panel/stat 对齐 ══ */
#nonstdAlContainer {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* 页顶 KPI：5 格（当前价 / 人民币价值 / A00 / 保太ADC12 / 折扣）*/
#nonstdAlContainer .g4.nonstd-top-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
#nonstdAlContainer .stat .nonstd-stat-foot {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
  line-height: 1.35;
}
#nonstdAlContainer .nonstd-subbar {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
#nonstdAlContainer .nonstd-subbar-title {
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 600;
}
#nonstdAlContainer .nonstd-quote-id {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  color: var(--primary);
}
#nonstdAlContainer .nonstd-comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  gap: 10px;
}
#nonstdAlContainer .nonstd-comp-cell {
  padding: 12px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  text-align: center;
}
#nonstdAlContainer .nonstd-comp-cell .nc-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.35;
}
#nonstdAlContainer .nonstd-comp-cell .nc-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
#nonstdAlContainer .nonstd-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
#nonstdAlContainer .hud-table.nonstd-table {
  font-size: 13px;
  width: 100%;
  margin: 0;
}
#nonstdAlContainer .hud-table.nonstd-table th,
#nonstdAlContainer .hud-table.nonstd-table td {
  padding: 10px 12px;
}
/* 表头：加大字号、提高对比（覆盖全局 hud-table th 的 tertiary+12px） */
#nonstdAlContainer .hud-table.nonstd-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border-base);
  white-space: nowrap;
}
[data-theme="light"] #nonstdAlContainer .hud-table.nonstd-table thead th {
  color: var(--text-primary);
}

/* 非标铝页 · 深色：与 globals 黑金一致（取消独立蓝灰板） */
[data-theme="dark"] #nonstdAlContainer .nonstd-comp-cell {
  background: var(--bg-elev);
  border-color: var(--stroke-2);
  box-shadow: inset 0 1px 0 rgba(201, 162, 39, 0.08);
}
[data-theme="dark"] #nonstdAlContainer .nonstd-comp-cell .nc-label {
  color: var(--text-muted);
}
[data-theme="dark"] #nonstdAlContainer .nonstd-comp-cell .nc-val {
  color: var(--text-1);
}
[data-theme="light"] #nonstdAlContainer .nonstd-comp-cell {
  background: #f3f5fa;
  border-color: #d5dae6;
}
[data-theme="light"] #nonstdAlContainer .nonstd-comp-cell .nc-label {
  color: #3a4150;
}
[data-theme="light"] #nonstdAlContainer .nonstd-comp-cell .nc-val {
  color: #12161d;
}

[data-theme="dark"] #nonstdAlContainer .nonstd-subbar {
  background: var(--bg-surface);
  border-color: var(--stroke-2);
}
[data-theme="light"] #nonstdAlContainer .nonstd-subbar {
  background: #eef2f8;
  border-color: #cfd6e4;
}

[data-theme="dark"] #nonstdAlContainer .nonstd-table-wrap {
  background: var(--bg-surface-2);
  border-color: var(--stroke-2);
}
[data-theme="dark"] #nonstdAlContainer .hud-table.nonstd-table thead th {
  background: var(--bg-surface);
  color: var(--text-1);
  border-bottom-color: var(--stroke-strong);
}
[data-theme="dark"] #nonstdAlContainer .hud-table.nonstd-table tbody td {
  color: var(--text-1);
  border-bottom-color: var(--stroke-1);
}
[data-theme="dark"] #nonstdAlContainer .hud-table.nonstd-table tbody td.nonstd-td-samp {
  color: var(--text-muted);
}
[data-theme="dark"] #nonstdAlContainer .hud-table.nonstd-table tbody td.nonstd-td-mean {
  background: rgba(201, 162, 39, 0.14);
  color: var(--text-1);
  border-left: 1px solid var(--primary-border);
  border-right: 1px solid rgba(201, 162, 39, 0.22);
}
[data-theme="dark"] #nonstdAlContainer .hud-table.nonstd-table tbody tr:hover td {
  background: var(--bg-hover);
}
[data-theme="dark"] #nonstdAlContainer .hud-table.nonstd-table tbody tr:hover td.nonstd-td-mean {
  background: rgba(201, 162, 39, 0.2);
}

[data-theme="light"] #nonstdAlContainer .hud-table.nonstd-table thead th {
  background: #e8ecf6;
  color: #1a1f28;
  border-bottom-color: #c5ccda;
}
[data-theme="light"] #nonstdAlContainer .hud-table.nonstd-table tbody td {
  color: #12161d;
  border-bottom-color: #e8ebf2;
}
[data-theme="light"] #nonstdAlContainer .hud-table.nonstd-table tbody td.nonstd-td-samp {
  color: #3d424c;
}
[data-theme="light"] #nonstdAlContainer .hud-table.nonstd-table tbody td.nonstd-td-mean {
  background: #fff5e8;
  color: #12161d;
  border-left: 1px solid rgba(224, 120, 24, 0.45);
}

[data-theme="dark"] #nonstdAlContainer .nonstd-hint {
  color: var(--text-muted);
}
[data-theme="dark"] #nonstdAlContainer .nonstd-kvbar {
  color: var(--text-muted);
}
[data-theme="dark"] #nonstdAlContainer .stat .nonstd-stat-foot {
  color: var(--text-muted);
}

#nonstdAlContainer .nonstd-section-strong {
  color: var(--primary);
  font-weight: 600;
}
#nonstdAlContainer .nonstd-td-adc {
  color: var(--primary);
  font-weight: 500;
}
#nonstdAlContainer .nonstd-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.55;
  margin-top: 10px;
  font-family: var(--font-body);
}
#nonstdAlContainer .nonstd-kvbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  line-height: 1.45;
}
#nonstdAlContainer .nonstd-mini-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
#nonstdAlContainer .nonstd-mini-stat .stat-label { margin-bottom: 6px; }
#nonstdAlContainer .nonstd-mini-stat .stat-val { font-size: 18px; margin-bottom: 4px; }
#nonstdAlContainer .nonstd-ded-total {
  font-size: 20px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
#nonstdAlContainer .nonstd-ded-total.is-deduct {
  color: var(--success);
}
#nonstdAlContainer .nonstd-ded-final {
  font-size: 20px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--primary);
}
#nonstdAlContainer .panel.nonstd-panel-accent {
  border-left: 3px solid var(--primary);
}

/* 非标铝 · 长说明（ADC12 脚注、扣减说明）：字号与底色拉开对比 */
#nonstdAlContainer .nonstd-note {
  font-size: 13px;
  line-height: 1.6;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  border: 1px solid var(--border-base);
}
[data-theme="dark"] #nonstdAlContainer .nonstd-note {
  color: var(--text-1);
  background: var(--bg-surface);
  border-color: var(--stroke-2);
}
[data-theme="light"] #nonstdAlContainer .nonstd-note {
  color: #252b38;
  background: #eef2f9;
  border-color: #c8d0e0;
}

/* 非标铝 · 状态/规则/提示条（替代半透明 success-bg 等，避免与深色底糊成一团） */
#nonstdAlContainer .nonstd-callout {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.55;
  font-family: var(--font-body);
  border-left: 3px solid var(--border-base);
}
#nonstdAlContainer .nonstd-callout:last-child {
  margin-bottom: 0;
}
#nonstdAlContainer .nonstd-callout .mono {
  font-family: var(--font-mono);
}
[data-theme="dark"] #nonstdAlContainer .nonstd-callout--success {
  background: rgba(232, 88, 101, 0.14);
  border-left-color: var(--success);
  color: var(--text-1);
}
[data-theme="light"] #nonstdAlContainer .nonstd-callout--success {
  background: #fff0f1;
  border-left-color: #e85865;
  color: #5c1a22;
}
[data-theme="dark"] #nonstdAlContainer .nonstd-callout--warning {
  background: var(--primary-bg);
  border-left-color: var(--gold-300);
  color: var(--text-1);
}
[data-theme="light"] #nonstdAlContainer .nonstd-callout--warning {
  background: #fff8ee;
  border-left-color: #e07818;
  color: #4a3010;
}
[data-theme="dark"] #nonstdAlContainer .nonstd-callout--neutral {
  margin-top: 12px;
  margin-bottom: 0;
  background: var(--bg-elev);
  border: 1px solid var(--stroke-2);
  border-left: 3px solid var(--stroke-strong);
  color: var(--text-1);
}
[data-theme="light"] #nonstdAlContainer .nonstd-callout--neutral {
  margin-top: 12px;
  background: #f4f6fb;
  border: 1px solid #d8dde8;
  color: #2c3340;
}
[data-theme="dark"] #nonstdAlContainer .nonstd-callout--primary {
  background: var(--primary-bg);
  border-left-color: var(--gold-300);
  color: var(--text-1);
}
[data-theme="light"] #nonstdAlContainer .nonstd-callout--primary {
  background: #fff6ec;
  border-left-color: #e07818;
  color: #3d2a12;
}
[data-theme="dark"] #nonstdAlContainer .nonstd-callout--tip {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.55;
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  color: var(--text-1);
  border-left: 3px solid var(--gold-400);
}
[data-theme="light"] #nonstdAlContainer .nonstd-callout--tip {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  background: #eaf3fc;
  border: 1px solid #b8d4f0;
  color: #1a3354;
}

#nonstdAlContainer .nonstd-alert-note {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--error);
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  font-family: var(--font-body);
}
[data-theme="dark"] #nonstdAlContainer .nonstd-alert-note {
  background: var(--error-bg);
  border-left-color: var(--error);
  color: var(--text-1);
  border-top: 1px solid var(--error-border);
  border-right: 1px solid var(--border-base);
  border-bottom: 1px solid var(--border-base);
}
[data-theme="light"] #nonstdAlContainer .nonstd-alert-note {
  background: #e6f7f5;
  border-left-color: #26a69a;
  color: #0d3d38;
  border: 1px solid #b2dfdb;
  border-left-width: 3px;
}
#nonstdAlContainer .fld input.nonstd-input-ro,
#nonstdAlContainer .fld input[readonly] {
  opacity: 0.95;
  cursor: default;
  background: var(--bg-hover);
}
#nonstdAlContainer .nonstd-btn-switch,
#nonstdAlContainer .nonstd-btn-edit,
#nonstdAlContainer .nonstd-btn-delete {
  padding: 5px 10px;
  border: 1px solid var(--border-base);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  font-size: 11px;
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-body);
}
#nonstdAlContainer .nonstd-btn-switch:hover,
#nonstdAlContainer .nonstd-btn-edit:hover,
#nonstdAlContainer .nonstd-btn-delete:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}
#nonstdAlContainer select.nonstd-ded-mode,
#nonstdAlContainer input.nonstd-ded-rate {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
}
#nonstdAlContainer select.nonstd-ded-mode {
  max-width: 128px;
  min-height: 30px;
}
#nonstdAlContainer input.nonstd-ded-rate {
  width: 80px;
  min-height: 30px;
}
#nonstdAlContainer select.nonstd-ded-mode:focus,
#nonstdAlContainer input.nonstd-ded-rate:focus {
  border-color: var(--primary);
}
#nonstdAlContainer .nonstd-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}
#nonstdAlContainer tr.nonstd-hist-latest td {
  background: var(--tbl-row-hover);
}
#nonstdAlContainer .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ══ 非标铝采购页 · 手机/窄屏（覆盖全局 .g4 单列，避免四格过长） ══ */
@media (max-width: 768px) {
  #nonstdAlContainer {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
  }
  #nonstdAlContainer.page-content {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
  #nonstdAlContainer .g4.nonstd-top-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }
  #nonstdAlContainer .stat {
    padding: 12px 12px;
    min-width: 0;
  }
  #nonstdAlContainer .stat .stat-label {
    font-size: 12px;
  }
  #nonstdAlContainer .stat .stat-val {
    font-size: 20px;
  }
  #nonstdAlContainer .nonstd-stat-foot {
    font-size: 12px;
  }
  #nonstdAlContainer .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }
  #nonstdAlContainer .panel-title {
    font-size: 14px;
    line-height: 1.35;
    min-width: 0;
  }
  #nonstdAlContainer .panel-body {
    padding: 12px 12px;
  }
  #nonstdAlContainer .nonstd-subbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  #nonstdAlContainer .nonstd-subbar-title {
    font-size: 14px;
  }
  #nonstdAlContainer .nonstd-quote-id {
    font-size: 13px;
    text-align: center;
    word-break: break-all;
  }
  #nonstdAlContainer .nonstd-comp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  #nonstdAlContainer .nonstd-comp-cell {
    padding: 10px 8px;
    min-width: 0;
  }
  #nonstdAlContainer .nonstd-comp-cell .nc-label {
    font-size: 12px;
  }
  #nonstdAlContainer .nonstd-comp-cell .nc-val {
    font-size: 17px;
  }
  #nonstdAlContainer .nonstd-table-wrap {
    margin-left: -4px;
    margin-right: -4px;
    border-radius: var(--radius-md);
    -webkit-overflow-scrolling: touch;
  }
  #nonstdAlContainer .hud-table.nonstd-table {
    font-size: 13px;
  }
  #nonstdAlContainer .hud-table.nonstd-table thead th {
    font-size: 12px;
    padding: 8px 10px;
  }
  #nonstdAlContainer .hud-table.nonstd-table tbody td {
    padding: 8px 10px;
  }
  #nonstdAlContainer .ig3 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  #nonstdAlContainer .nonstd-mini-stat .stat-val {
    font-size: 20px;
  }
  #nonstdAlContainer .nonstd-ded-total,
  #nonstdAlContainer .nonstd-ded-final {
    font-size: 22px;
  }
  #nonstdAlContainer .nonstd-kvbar {
    font-size: 13px;
    gap: 8px 14px;
  }
  #nonstdAlContainer .nonstd-note,
  #nonstdAlContainer .nonstd-callout,
  #nonstdAlContainer .nonstd-callout--tip {
    font-size: 14px;
  }
  #nonstdAlContainer .nonstd-alert-note {
    font-size: 14px;
  }
  #nonstdAlContainer .nonstd-hint {
    font-size: 12px;
  }
  #nonstdAlContainer .fld label {
    font-size: 13px;
  }
  #nonstdAlContainer .fld input,
  #nonstdAlContainer .fld select {
    min-height: 44px;
    font-size: 16px;
  }
  #nonstdAlContainer select.nonstd-ded-mode {
    max-width: none;
    width: 100%;
    min-height: 44px;
    font-size: 15px;
  }
  #nonstdAlContainer input.nonstd-ded-rate {
    width: 100%;
    max-width: 160px;
    min-height: 44px;
    font-size: 16px;
  }
  #nonstdAlContainer .btn-row {
    flex-direction: column;
    align-items: stretch;
  }
  #nonstdAlContainer .btn-row .hbtn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    font-size: 14px;
  }
  #nonstdAlContainer .nonstd-btn-switch,
  #nonstdAlContainer .nonstd-btn-edit,
  #nonstdAlContainer .nonstd-btn-delete {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 10px;
    font-size: 14px;
  }
}

@media (max-width: 479px) {
  #nonstdAlContainer .g4.nonstd-top-stats {
    grid-template-columns: 1fr !important;
  }
  #nonstdAlContainer .nonstd-comp-grid {
    grid-template-columns: 1fr;
  }
  #nonstdAlContainer .stat .stat-val {
    font-size: 22px;
  }
  #nonstdAlContainer .nonstd-comp-cell .nc-val {
    font-size: 18px;
  }
}

/* ── MCARD (v14 unified market card) ── */
.mcard {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
  position: relative; overflow: hidden;
  transition: box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column;
  min-width: 0;   /* 防止grid列被内容撑宽溢出 */
  width: 100%;
  box-sizing: border-box;
}
/* 铜/铝行情首行四卡：网格拉伸等高，「查看详情」贴底对齐 */
#cuCards,
#alCards {
  align-items: stretch;
}
#cuCards > .mcard,
#alCards > .mcard {
  height: 100%;
  min-height: 0;
}
#cuCards > .mcard > .mc-toggle-btn,
#alCards > .mcard > .mc-toggle-btn {
  margin-top: auto;
}
.mcard::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--mc-accent, var(--border-base));
  opacity: 1;
}
.mcard::after { display: none; }
.mcard:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* Exchange accent：统一品牌橙，取消各交易所独立颜色 */
/* investing.com: 卡片顶线用品牌色，价格统一用主文字色 */
.mcard.lme   { --mc-accent: var(--accent); }
.mcard.comex { --mc-accent: var(--accent); }
.mcard.cj    { --mc-accent: #5d8fb8; }  /* 长江铜：蓝灰 */
.mcard.shfe  { --mc-accent: #5d8fb8; }
.mcard.lme-al  { --mc-accent: var(--accent); }
.mcard.shfe-al { --mc-accent: #5d8fb8; }
.mcard.cj-al   { --mc-accent: #5d8fb8; }
.mcard.profit  { --mc-accent: var(--success); }
.mcard.cu  { --mc-accent: var(--accent); }
.mcard.al  { --mc-accent: var(--accent); }
.mcard.wh  { --mc-accent: #5d8fb8; }
.mcard.gn  { --mc-accent: var(--success); }

.mc-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-base);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  background: transparent;
  min-width: 0;
}
.mc-head > div:first-child { min-width: 0; flex: 1; overflow: hidden; }
.mc-label {
  font-size: 12px; letter-spacing: .3px;
  color: var(--text-primary);
  margin-bottom: 3px;
  font-family: var(--font-body); font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-name {
  font-family: var(--font-body); font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-session {
  font-family: var(--font-mono); font-size: 10px;
  padding: 2px 7px; border-radius: 4px; letter-spacing: .3px;
  flex-shrink: 0; font-weight: 600;
  white-space: nowrap;
}
.s-open  { color: #58a6ff; background: rgba(88,166,255,.1); border: 1px solid rgba(88,166,255,.3); }
.s-close { color: var(--error); background: rgba(38,166,154,.08); border: 1px solid var(--error-border); }
.s-pre   { color: var(--warning); background: transparent; border: 1px solid var(--warning-border); }

.mc-price-row {
  padding: 10px 16px 6px;
  display: flex; align-items: baseline; gap: 8px; flex-shrink: 0;
  flex-wrap: wrap; min-width: 0;
}
.mc-val {
  font-family: var(--font-mono); font-size: 26px; font-weight: 700;
  color: #e6edf3;
  line-height: 1; letter-spacing: -0.5px;
  white-space: nowrap;
}
.mc-chg { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }

.mc-time {
  padding: 0 16px 8px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-secondary);
  opacity: 1;
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.mc-time-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #3fb950; animation: blink 2.4s infinite; flex-shrink: 0;
  opacity: 1;
}

/* 数据血缘（方案 A）：紧贴时间块下方一行灰字，与 .mc-time 左右对齐，不改栅格 */
.mc-prov {
  padding: 0 16px 10px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-secondary);
  opacity: 0.88;
  word-break: break-word;
}

/* 金属卡：长江/SHFE 元信息两行（日期·单位 / 时钟·数据时间·来源） */
.mc-time.mc-time--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.mc-meta-line1 {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
  width: 100%;
}
.mc-time--stack .mc-domestic-inv-line {
  padding: 0 0 4px 0;
  width: 100%;
}
/* 与外盘宏观行一致：单行 + 省略，避免「长江有色、保太」等换行拉高卡片 */
.mc-time--stack .mc-domestic-inv-line .mc-dxy-quote-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.mc-time--stack .mc-domestic-inv-line {
  min-width: 0;
}
/* Westmetall 等：来源与日期同一逻辑行，避免窄屏折成两行 */
.mc-time.mc-time-nowrap {
  flex-wrap: nowrap;
}
.mc-time.mc-time-nowrap .mc-time-body {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* 宏观卡：来源行下方的报价时钟（DXY 等） */
.mc-quote-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}
.mc-quote-clock-ico {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}
/* 交易时段语义色（勿用 --success/--error：主题里涨跌红绿与「开/休」相反） */
.mc-quote-clock--live {
  color: #3fb950;
}
.mc-quote-clock--live .mc-quote-clock-ico {
  color: #3fb950;
}
.mc-quote-clock--closed {
  color: #f85149;
}
.mc-quote-clock--closed .mc-quote-clock-ico {
  color: #f85149;
}
.mc-quote-clock--live .mc-dxy-clock-svg {
  color: inherit;
}
.mc-quote-clock--closed .mc-dxy-clock-svg {
  color: inherit;
}
/* BDI 等每日指标 */
.mc-quote-clock--daily {
  color: var(--warning);
}
.mc-quote-clock--daily .mc-dxy-clock-svg {
  color: inherit;
}
/* 宏观卡 ·时间 英为财情 单行 */
.mc-quote-clock.mc-inv-source-line {
  flex-wrap: nowrap;
}
.mc-dxy-clock-svg {
  flex-shrink: 0;
  display: block;
  color: inherit;
}
.mc-inv-source-line .mc-dxy-quote-text {
  letter-spacing: 0.02em;
  white-space: nowrap;
  min-width: 0;
  color: inherit;
  font-family: var(--font-mono), sans-serif;
}

.mc-chart { padding: 4px 10px 2px; height: 64px; flex-shrink: 0; position: relative; }
.mc-chart canvas { width: 100%; height: 100%; display: block; }
.mc-axis {
  display: flex; justify-content: space-between;
  padding: 0 10px 6px;
  font-family: var(--font-mono); font-size: 8px;
  color: var(--text-tertiary); opacity:.88; flex-shrink: 0;
}

.mc-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border-split); flex: 1;
}
.mc-cell {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-split);
  display: flex; justify-content: space-between; align-items: center;
}
.mc-cell:nth-child(odd) { border-right: 1px solid var(--border-split); }
.mc-cell-l { font-family: var(--font-body); font-size: 12px; color: var(--text-secondary); }
.mc-cell-v { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }
.mc-cell-v.hi { color: var(--error); }
.mc-cell-v.lo { color: var(--success); }
.mc-cell-v.cu { color: var(--text-primary); }
.mc-cell-v.al { color: var(--text-primary); }
.mc-cell-v.gn { color: var(--success); }
.mc-cell-v.rd { color: var(--error); }

.mc-range { padding: 8px 16px 12px; border-top: 1px solid var(--border-split); flex-shrink: 0; }
.mc-range-lbl {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 9px; color: var(--text-secondary); margin-bottom: 4px;
}
.mc-range-track { height: 4px; background: var(--border-split); border-radius: 2px; position: relative; }
.mc-range-fill {
  position: absolute; top: 0; left: 0; right: 0; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--success) 0%, var(--warning) 50%, var(--error) 100%);
  opacity: .45;
}
.mc-range-dot {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-secondary);
  border: 1.5px solid rgba(255,255,255,.4);
}

/* 长江铜/铝卡片 · 近30天查询（修复无效 --bg-elevated 导致白底+浅字不可见） */
.mc-spot-hist {
  padding: 8px 12px 10px;
  margin-top: 2px;
  border-top: 1px solid var(--border-split);
  background: var(--bg-hover);
}
.mc-spot-hist-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}
.mc-spot-hist .mc-spot-select,
select.mc-spot-select {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 6px 10px;
  min-height: 32px;
  font-size: 12px;
  font-family: var(--font-body);
  line-height: 1.35;
  color: var(--text-primary);
  background-color: var(--bg-input);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%),
    linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.mc-spot-hist .mc-spot-select:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-tag);
}
.mc-spot-hist .mc-spot-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}
.mc-spot-hist .mc-spot-select option {
  background-color: var(--bg-card);
  color: var(--text-primary);
  padding: 6px;
}
[data-theme="dark"] .mc-spot-hist .mc-spot-select { color-scheme: dark; }
:root:not([data-theme="dark"]) .mc-spot-hist .mc-spot-select,
[data-theme="light"] .mc-spot-hist .mc-spot-select { color-scheme: light; }

/* 近30天查询移入「更多数据」展开区时，避免与展开内容双顶边线 */
.mc-expand .mc-spot-hist {
  margin-top: 0;
  border-top: none;
}

/* 长江现货 / 沪铜铝 · 近30天归档表（与下拉同源） */
.mc-hist30-wrap--wide {
  max-height: 240px;
}
.mc-hist30-wrap {
  max-height: 220px;
  overflow: auto;
  margin: 0 12px 8px;
  border: 1px solid var(--border-split);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
}
.mc-hist30-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}
.mc-hist30-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-split);
}
.mc-hist30-table tbody td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-split);
  color: var(--text-primary);
}
.mc-hist30-table tbody tr:last-child td { border-bottom: none; }
.mc-hist30-date { font-family: var(--font-mono); font-size: 10px; }
.mc-hist30-num { text-align: right; font-family: var(--font-mono); }
.mc-hist30-up { color: var(--error); }
.mc-hist30-down { color: var(--success); }
.mc-hist30-note,
.mc-hist30-foot {
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.45;
  margin: 0 12px 10px;
  padding: 0 2px;
}
.mc-hist30-table--period thead th { font-size: 10px; white-space: nowrap; }

/* 主力价卡 · 同期历史对比（折叠可见） */
.mc-period-compare {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0 12px 8px;
  padding: 6px 8px;
  font-size: 10px;
  line-height: 1.4;
  border-radius: 6px;
  border: 1px solid var(--border-split);
  background: rgba(0, 0, 0, 0.1);
}
.mc-period-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 4px;
}
.mc-period-item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px;
}
.mc-period-lbl { color: var(--text-tertiary); }
.mc-period-old {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 9px;
}
.mc-period-up { color: var(--error); font-family: var(--font-mono); font-weight: 600; }
.mc-period-down { color: var(--success); font-family: var(--font-mono); font-weight: 600; }
.mc-period-flat { color: var(--text-tertiary); }
.mc-period-date {
  font-size: 8px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.mc-period-hint {
  flex: 1 1 100%;
  font-size: 9px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* 价差表 · 历史日期（与 h-input 一致对比度，去掉白底灰字过弱） */
select.spread-date-select {
  width: auto;
  min-width: 148px;
  max-width: min(280px, 100%);
  height: auto;
  min-height: 28px;
  padding: 4px 10px;
  font-size: 11px;
}

/* 废铝计价器 header 5列响应式 */
.isri-al-header { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:10px; }
@media (max-width:768px) { .isri-al-header { grid-template-columns:repeat(2,1fr); } }
@media (max-width:479px) { .isri-al-header { grid-template-columns:1fr; } }
.mc-expand.open { max-height: min(72vh, 640px); opacity: 1; border-top-width: 1px; }
.mc-expand-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; padding: 7px 12px;
  background: none; border: none; border-top: 1px solid var(--border-split);
  cursor: pointer;
  font-family: var(--font-body); font-size: 11px;
  color: var(--text-tertiary); transition: all .15s; flex-shrink: 0;
}
.mc-expand-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.mc-expand-btn .arrow { display: inline-block; font-size: 10px; transition: transform .25s; }
.mc-expand-btn.open .arrow { transform: rotate(180deg); }
.mc-expand-btn.open { color: var(--primary); }
.mc-expand-section {
  padding: 5px 14px 3px;
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  color: var(--text-primary);
  background: rgba(0,0,0,.2);
  border-bottom: 1px solid var(--border-split);
}
.mc-expand .mc-grid-inner { display: grid; grid-template-columns: 1fr 1fr; }
.mc-expand .mc-grid-inner .mc-cell:nth-child(odd) { border-right: 1px solid var(--border-split); }
/* 展开详情容器：防止内容撑宽卡片 */
.mcard#macro_cu_al_ratio.expanded .mc-expand-detail,
.mcard#macro_cu_comex_lme_basis.expanded .mc-expand-detail,
.mcard#macro_al_comex_lme_basis.expanded .mc-expand-detail {
  display: block;
}
.mc-basis-wrap .mc-basis-table tbody tr:last-child td {
  border-bottom: none;
}

.mc-expand-detail {
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}

/* profit */
.mc-profit-val { font-family: var(--font-mono); font-size: 20px; font-weight: 600; padding: 10px 16px 4px; line-height: 1; }
.mc-profit-tag { padding: 0 14px 8px; }
.mc-profit-detail { flex: 1; padding: 6px 14px 8px; border-top: 1px solid var(--border-split); }
.mc-profit-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 12px; font-family: var(--font-mono);
  border-bottom: 1px solid var(--border-split);
}
.mc-profit-row:last-child { border-bottom: none; }
.mc-src-tag { display: none; }

/* ── LME卡(lme-card) → 复用 mcard 风格 ── */
.lme-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.lme-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 32px; height: 3px;
  background: var(--cu-color);
}
.lme-card-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border-split);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 6px; min-width: 0;
}
.lme-card-head > div { min-width: 0; flex: 1; overflow: hidden; }
.lme-card-label {
  font-size: 11px; color: var(--cu-color); text-transform: uppercase;
  font-weight: 500; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lme-card-sub {
  font-size: 11px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lme-card-session {
  font-family: var(--font-mono); font-size: 9px;
  padding: 1px 6px; border-radius: 20px; border: 1px solid;
  white-space: nowrap; flex-shrink: 0;
}
.session-open  { color: var(--success); background: transparent;        border-color: var(--success-border); }
.session-close { color: var(--error);   background: transparent;        border-color: var(--error-border); }
.session-pre   { color: var(--warning); background: transparent;        border-color: var(--warning-border); }

.lme-price-row  { padding: 8px 14px 4px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.lme-main-price { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--text-primary); line-height: 1; white-space: nowrap; }
.lme-chg        { font-family: var(--font-mono); font-size: 12px; }
.lme-time       { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); padding: 0 14px 6px; display: flex; align-items: center; gap: 5px; }
.lme-time-dot   { width: 5px; height: 5px; border-radius: 50%; background: var(--success); animation: blink 2.4s infinite; }
.lme-chart-wrap { padding: 4px 10px 6px; height: 80px; position: relative; }
.lme-chart-canvas { width: 100%; height: 100%; display: block; }
.lme-chart-axis { display: flex; justify-content: space-between; padding: 0 10px 6px; font-family: var(--font-mono); font-size: 8px; color: var(--text-tertiary); opacity: .88; }
.lme-stats-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border-split); }
.lme-stat-item  { padding: 7px 14px; border-bottom: 1px solid var(--border-split); display: flex; justify-content: space-between; align-items: center; }
.lme-stat-item:nth-child(odd) { border-right: 1px solid var(--border-split); }
.lme-stat-label { font-size: 11px; color: var(--text-secondary); }
.lme-stat-val   { font-family: var(--font-mono); font-size: 11px; color: var(--text-primary); font-weight: 500; }
.lme-stat-val.hi { color: var(--error); }
.lme-stat-val.lo { color: var(--success); }
.lme-range-bar   { padding: 8px 16px 12px; border-top: 1px solid var(--border-split); }
.lme-range-label { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9px; color: var(--text-tertiary); margin-bottom: 4px; }
.lme-range-track { height: 4px; background: var(--border-split); border-radius: 2px; position: relative; }
.lme-range-fill  { position: absolute; top: 0; left: 0; right: 0; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--success), var(--accent)); opacity:.5; }
.lme-range-dot   { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--cu-color); border: 1.5px solid rgba(255,255,255,.4); }

/* ── HUD Table (v14) → v3 tbl 风格 ── */
.hud-table-wrap {
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.hud-table-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-base);
  background: var(--tbl-head-bg);
  display: flex; align-items: center; justify-content: space-between;
}
.hud-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hud-table th {
  padding: 10px 14px; text-align: left;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-base);
  background: var(--tbl-head-bg);
  white-space: nowrap;
  font-family: var(--font-body);
}
.hud-table td {
  padding: 11px 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-split);
  font-family: var(--font-body);
}
.hud-table tbody tr:hover td { background: var(--tbl-row-hover); }
.hud-table .buy-v  { color: var(--success); font-weight: 500; font-family: var(--font-mono); }
.hud-table .sell-v { color: var(--cu-color); font-weight: 500; font-family: var(--font-mono); }
.hud-table .fml    { font-size: 10px; color: var(--text-tertiary); font-family: var(--font-mono); }
.hud-table .mono   { font-family: var(--font-mono); }
.hud-table .cu-name { color: var(--cu-color); font-family: var(--font-body); font-weight: 500; }
.hud-table .al-name { color: var(--al-color); font-family: var(--font-body); font-weight: 500; }

/* ── HTAG → 极简标签：3色原则 ── */
.htag { display: inline-flex; align-items: center; font-size: 11px; padding: 1px 8px; border-radius: 20px; font-weight: 500; white-space: nowrap; }
/* 铜/铝统一用品牌橙 */
.htag-cu   { background: transparent; color: var(--cu-color); border: 1px solid rgba(232,88,101,.4); }
.htag-al   { background: transparent; color: var(--al-color); border: 1px solid rgba(38,166,154,.4); }
[data-theme="dark"] .htag-al {
  color: var(--primary);
  border-color: var(--primary-border);
}
/* 状态：3色 */
.htag-ok   { background: var(--success-bg);  color: var(--success);  border: 1px solid var(--success-border); }
.htag-warn { background: transparent; color: var(--primary); border: 1px solid var(--primary-border); }
.htag-err  { background: var(--error-bg);    color: var(--error);    border: 1px solid var(--error-border); }
.htag-pr   { background: transparent; color: var(--primary); border: 1px solid var(--primary-border); }
.htag-gray { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-base); }

/* ── HBTN (v14 buttons) → 复用 btn ── */
.hbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s; white-space: nowrap; user-select: none;
}
.hbtn:active { transform: scale(.98); }
.hbtn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.hbtn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.hbtn-cu { background: var(--cu-bg); color: var(--cu-color); border: 1px solid var(--cu-border); }
.hbtn-cu:hover { opacity: .85; }
.hbtn-sm { height: 28px; padding: 0 12px; font-size: 12px; }
.hbtn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-base); }
.hbtn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* 通用输入（含 AI 配置等）：与主题对比度一致 */
.h-input {
  box-sizing: border-box;
  width: 100%;
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.h-input:hover { border-color: var(--border-hover); }
.h-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}
.h-input::placeholder { color: var(--text-disabled); opacity: 0.92; }

/* AI 对话消息区：与白色面板区分层次，减轻眩光 */
#aiMessages {
  background: var(--ai-chat-bg);
  border-radius: 6px;
}

/* ── FLD (v14 form fields) ── */
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.fld label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.fld input, .fld select {
  height: 32px; padding: 0 11px;
  background: var(--bg-input);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-primary);
  width: 100%; outline: none; transition: border-color .2s, box-shadow .2s;
}
.fld input:focus, .fld select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(23,125,220,0.25);
}
.fld input::placeholder { color: var(--text-disabled); font-family: var(--font-body); }

/* ── RLIST / RROW (v14 result rows) ── */
.rlist { border: 1px solid var(--border-base); border-radius: var(--radius-lg); overflow: hidden; }
.rrow {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border-split);
}
.rrow:last-child { border-bottom: none; }
.rrow:nth-child(odd) { background: var(--tbl-head-bg); }
.rl { color: var(--text-secondary); }
.rv { font-family: var(--font-mono); font-weight: 500; color: var(--text-primary); }
.rtotal {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; margin-top: 10px;
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
}

/* ── HALERT (v14 alerts) → 复用 alert ── */
.halert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-md);
  font-size: 13px; margin-bottom: 12px; line-height: 1.6;
}
.halert.bull { background: var(--success-bg); border: 1px solid var(--success-border); border-left: 3px solid var(--success); color: var(--text-primary); }
.halert.bear { background: var(--error-bg); border: 1px solid var(--error-border); border-left: 3px solid var(--error); color: var(--text-primary); }
.halert.warn { background: var(--warning-bg); border: 1px solid var(--warning-border); border-left: 3px solid var(--warning); color: var(--text-primary); }
.halert.info { background: var(--primary-bg); border: 1px solid var(--primary-border); border-left: 3px solid var(--primary); color: var(--text-primary); }
.halert .hl  { color: var(--text-primary); font-weight: 600; }

/* ── SH (section head) ── */
.sh { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sh-line { flex: 1; height: 1px; background: var(--border-base); }
.sh-note { font-size: 11px; color: var(--text-secondary); font-family: var(--font-mono); }

/* ── HIST ENTRY (v14 history) ── */
.hist-entry {
  background: var(--bg-card); border: 1px solid var(--border-base);
  border-radius: var(--radius-lg); padding: 14px 16px;
  margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.hist-entry::before { display: none; }
.hist-date   { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); }
.hist-prices { display: flex; gap: 16px; font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); margin-left: auto; }
.hist-grid   { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.hcell       { background: var(--bg-tag); border: 1px solid var(--border-split); border-radius: var(--radius-md); padding: 8px 10px; }
.hcell-lbl   { font-size: 11px; color: var(--text-tertiary); margin-bottom: 3px; }
.hcell-val   { font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); font-weight: 500; }
.hcell-sub   { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; font-family: var(--font-mono); }

/* ── LOGIN BOX (v14) ── */
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 32px; width: 360px;
  box-shadow: 0 12px 48px rgba(0,0,0,.70);
}
.login-box::before, .login-box::after { display: none; }
.login-title { font-size: 18px; font-weight: 600; color: var(--text-primary); text-align: center; margin-bottom: 6px; font-family: var(--font-body); letter-spacing: .5px; }
.login-sub   { font-size: 13px; color: var(--text-tertiary); text-align: center; margin-bottom: 24px; }
.login-err   { font-size: 12px; color: var(--error); text-align: center; margin-top: 8px; min-height: 16px; }

/* ── ADMIN ROW ── */
.admin-row { background: var(--tbl-head-bg); border: 1px solid var(--border-base); border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: 8px; }
.admin-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.admin-row-name { font-family: var(--font-body); font-size: 13px; color: var(--text-primary); font-weight: 500; }
.admin-row-ref  { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }

.brand-banner.collapsed { padding: 8px 16px 8px 18px; }
.brand-banner-logo {
  flex-shrink: 0; font-family: var(--font-body);
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  border-right: 1px solid var(--border-base); padding-right: 16px;
  line-height: 1.6;
}
.brand-banner-logo em { display: block; font-style: normal; font-size: 10px; font-weight: 400; color: var(--primary); letter-spacing: 2px; margin-top: 2px; }
.brand-banner-text { flex: 1; font-size: 12px; line-height: 1.8; color: var(--text-secondary); }
.brand-banner-text strong { color: var(--text-primary); font-weight: 500; }
.brand-banner-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.brand-banner-tags span { font-size: 10px; padding: 1px 7px; border: 1px solid var(--border-base); color: var(--primary); border-radius: 20px; }
.brand-banner-close, .brand-banner-toggle { position: absolute; background: none; border: none; cursor: pointer; color: var(--text-tertiary); opacity: .6; transition: opacity .15s; padding: 2px 6px; }
.brand-banner-close { top: 8px; right: 8px; font-size: 12px; }
.brand-banner-toggle { bottom: 6px; right: 8px; font-size: 11px; font-family: var(--font-mono); }
.brand-banner-close:hover, .brand-banner-toggle:hover { opacity: 1; }
.brand-banner.collapsed .brand-banner-text { display: none; }
.brand-banner.collapsed .brand-banner-logo { border-right: none; padding-right: 0; }



/* ── 数字更新动画 ── */
@keyframes numFlash { 0%{opacity:.4} 40%,100%{opacity:1} }
.num-updated { animation: numFlash 0.6s ease-out; }

/* ── 汉堡按钮 ── */
.hamb {
  display: none; background: none;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm); padding: 5px 8px;
  cursor: pointer; color: var(--text-secondary); font-size: 16px;
}
@media (max-width:768px) { .hamb { display: block; } }

/* ── Mobile 响应式 ── */
@media (max-width:768px) {
  html, body { overflow: auto; }
  .hud { overflow: auto; height: auto; }
  .page { overflow: visible; height: auto; }
  .hud-body { flex-direction: column; }
  .hud-nav { display: none; width:100%; max-width:100%; min-width:0; }
  .hud-nav.open { display: flex; position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: 220px; z-index: 300; }
  .mob-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: var(--bg-card);
    border-top: 1px solid var(--border-base);
    box-shadow: 0 -2px 8px rgba(0,0,0,.5);
    padding: 4px 0 max(env(safe-area-inset-bottom),6px);
  }
  .mob-item { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; padding:6px 2px; font-size:12px; color:var(--text-tertiary); cursor:pointer; transition:color .2s; }
  .mob-item.active { color: var(--primary); }
  .mob-icon { font-size: 20px; }
  .page-content { padding: 12px 10px 80px; }
  .hud-header { padding: 0 12px; }
  .hdr-center { display: none; }
  .mob-overlay { display: block; position: fixed; inset: 0; z-index: 290; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .mob-overlay.show { opacity: 1; pointer-events: all; }

  /* 网格：768px以下统一单列或两列 */
  .g4, .g3, .g2, .g21 { grid-template-columns: 1fr; gap: 10px; }
  #cuCards, #alCards, #profitCards { grid-template-columns: 1fr !important; }
  #macroCards { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .ig4, .ig3, .ig2     { grid-template-columns: 1fr 1fr; }
  .hist-grid           { grid-template-columns: repeat(2,1fr); }
}

@media (min-width:480px) and (max-width:768px) {
  /* 平板/大手机：两列卡片 */
  #cuCards, #alCards, #profitCards { grid-template-columns: repeat(2,1fr) !important; }
  #macroCards { grid-template-columns: repeat(2,1fr) !important; }
  .g4 { grid-template-columns: repeat(2,1fr) !important; }
  .g3 { grid-template-columns: repeat(2,1fr) !important; }
}

@media (max-width:479px) {
  /* 小手机：单列，字体收缩 */
  #cuCards, #alCards, #profitCards { grid-template-columns: 1fr !important; }
  #macroCards { grid-template-columns: 1fr !important; }
  .mc-val  { font-size: 20px !important; }
  .stat-val{ font-size: 18px !important; }
  .lme-main-price { font-size: 20px !important; }
  .mc-label { font-size: 9px !important; }
  .mc-session  { display: none; }
  .lme-card-session { display: none; }
  .page-content { padding: 10px 8px 80px; }
}

/* ── 卡片展开/折叠 v25 ── */
@keyframes expandFade { from{opacity:0;transform:translateY(-5px)} to{opacity:1;transform:none} }

/* 默认折叠：隐藏详情区 */
.mcard .mc-chart   { display:none; }
.mcard .mc-axis    { display:none; }
.mcard .mc-grid    { display:none; }
.mcard .mc-range   { display:none; }
.mcard .mc-expand-btn { display:none; }
.mcard .mc-expand  { display:none !important; }
.mcard .mc-profit-detail { display:none; }

/* 展开时显示 */
.mcard.expanded .mc-chart   { display:block; animation:expandFade .25s ease; }
.mcard.expanded .mc-axis    { display:flex;  animation:expandFade .25s ease; }
.mcard.expanded .mc-grid    { display:grid;  animation:expandFade .25s ease; }
.mcard.expanded .mc-range   { display:block; animation:expandFade .25s ease; }
.mcard.expanded .mc-expand-btn  { display:flex; }
.mcard.expanded .mc-expand.open { display:block !important; }
.mcard.expanded .mc-profit-detail { display:block; animation:expandFade .25s ease; }

/* 折叠简要行：展开时隐藏 */
.mc-collapsed-row { display:flex; }
.mcard.expanded .mc-collapsed-row { display:none; }

/* 折叠/展开按钮条 */
.mc-toggle-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 16px;
  background: none; border: none;
  border-top: 1px solid var(--border-base);
  cursor: pointer; user-select: none;
  font-family: var(--font-body); font-size: 12px;
  color: var(--text-tertiary);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.mc-toggle-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.mcard.expanded .mc-toggle-btn { color: var(--primary); }
.mc-toggle-arrow {
  font-size: 10px;
  transition: transform 0.28s ease;
  display: inline-block;
}
.mcard.expanded .mc-toggle-arrow { transform: rotate(180deg); }

/* 折叠态：卡片底部信息条（显示简要数据） */
.mc-collapsed-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--border-split);
  font-family: var(--font-mono); font-size: 11px;
}
/* 与 LME/COMEX 一致：日高·日低单行不换行，底边对齐 */
#mc_lme_cu .mc-collapsed-row,
#mc_comex_cu .mc-collapsed-row,
#mc_lme_al .mc-collapsed-row,
#mc_comex_al .mc-collapsed-row,
#mc_cj_cu .mc-collapsed-row,
#mc_shfe_cu .mc-collapsed-row,
#mc_cj_al .mc-collapsed-row,
#mc_shfe_al .mc-collapsed-row {
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  column-gap: 10px;
}
#mc_lme_cu .mc-collapsed-row > span,
#mc_comex_cu .mc-collapsed-row > span,
#mc_lme_al .mc-collapsed-row > span,
#mc_comex_al .mc-collapsed-row > span,
#mc_cj_cu .mc-collapsed-row > span,
#mc_shfe_cu .mc-collapsed-row > span,
#mc_cj_al .mc-collapsed-row > span,
#mc_shfe_al .mc-collapsed-row > span {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

/* LME/COMEX：昨收单独一行，避免与日高日低挤在一行截断 */
.mc-collapsed-row.mc-collapsed-sub {
  border-top: none;
  padding-top: 2px;
  justify-content: flex-start;
}
#mc_lme_cu .mc-collapsed-sub > span,
#mc_comex_cu .mc-collapsed-sub > span,
#mc_lme_al .mc-collapsed-sub > span,
#mc_comex_al .mc-collapsed-sub > span,
#mc_cj_cu .mc-collapsed-sub > span,
#mc_shfe_cu .mc-collapsed-sub > span,
#mc_cj_al .mc-collapsed-sub > span,
#mc_shfe_al .mc-collapsed-sub > span {
  white-space: nowrap;
}

.mc-collapsed-lbl { color: var(--text-secondary); font-size: 10px; }
.mc-collapsed-val { color: var(--text-primary); font-weight: 500; }
/* 展开时隐藏简要条 */
.mcard.expanded .mc-collapsed-row { display: none; }

/* 进口盈亏卡片 profit-detail 也支持展开 */
.mcard .mc-profit-detail { display: none; }
.mcard.expanded .mc-profit-detail { display: block; animation: expandFade 0.25s ease; }

/* 盈亏速览 · 近期归档（与 history / auto_snap 同源） */
.mcard .mc-pl-hist {
  display: none;
  padding: 8px 12px 6px;
  border-top: 1px solid var(--border-split);
}
.mcard.expanded .mc-pl-hist {
  display: block;
  animation: expandFade 0.25s ease;
}





/* ════════════════════════════════
   GLOBAL COMPONENT THEME RULES
   （纯变量驱动，亮暗自动切换）
════════════════════════════════ */
body { background-color: var(--bg-base); color: var(--text-primary); font-size:15px; line-height:1.65; text-rendering:optimizeLegibility; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }

/* 顶栏：永远黑 */
.hud-header, .topbar {
  background: var(--nbar-bg) !important;
  border-bottom: 1px solid var(--nbar-border) !important;
}
.hdr-logo { color: var(--nbar-text) !important; }
.hdr-logo span { color: #f0851a !important; }
.hdr-clock, .tb-clock { color: var(--nbar-text) !important; }
.hdr-date, .tb-date   { color: var(--nbar-text-dim) !important; }
.hdr-ticker-item {
  background: rgba(255,255,255,.07) !important;
  border-color: var(--nbar-sep) !important;
}
.hdr-ticker-label { color: var(--nbar-text-dim) !important; }
.hdr-ticker-val   { color: var(--nbar-text) !important; }

/* ticker条：同顶栏风格 */
.ticker { background: var(--nbar-bg) !important; border-bottom-color: var(--nbar-border) !important; }
.tk { border-right-color: var(--nbar-sep) !important; }
.tk-l { color: var(--nbar-text-dim) !important; }
.tk-v { color: var(--nbar-text) !important; }

/* 切换按钮：顶栏内 */
#themeToggle {
  background: rgba(255,255,255,.09) !important;
  border-color: rgba(255,255,255,.18) !important;
  color: rgba(255,255,255,.78) !important;
}

/* 卡片/面板 */
.card, .stat-card, .lme-card, .mc-card,
.panel, .tbl-wrap, .hud-table-wrap,
.hist-entry, .rlist, .modal-box {
  background: var(--bg-card);
  border-color: var(--border-base);
  box-shadow: var(--shadow-sm);
}
.panel-head, .hud-table-head, .card-head {
  background: var(--tbl-head-bg);
  border-bottom-color: var(--border-base);
}
.panel-title, .card-title, .pg-title { color: var(--text-primary); font-weight: 600; }
.section-title { color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.section-title::after, .sh-line { background: var(--border-base); }

/* 表格 */
.hud-table th, .tbl th {
  background: var(--tbl-head-bg);
  color: var(--text-tertiary);
  font-size: 12px; font-weight: 500;
  border-bottom-color: var(--border-base);
}
.hud-table td, .tbl td {
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  border-bottom-color: var(--border-split);
}
.tbl .mono, .hud-table .mono { font-family: var(--font-mono); }
.hud-table tr:hover td, .tbl tr:hover td { background: var(--tbl-row-hover); }
.tbl .buy  { color: var(--success); font-weight: 500; }
.tbl .sell { color: var(--cu-color); font-weight: 500; }

/* stat cards */
.stat-label { color: var(--text-tertiary); font-size: 12px; }
.stat-name  { color: var(--text-secondary); font-size: 12px; }
.stat-value { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sf-label, .sf-value, .stat-footer-item { color: var(--text-tertiary); }
.stat-foot, .stat-footer { border-top-color: var(--border-split); }

/* 输入 */
.form-input, .form-select {
  background: var(--bg-input);
  border-color: var(--border-base);
  color: var(--text-primary);
}
.form-input::placeholder { color: var(--text-disabled); }

/* fml / tags / hcell */
.fml   { background: var(--bg-tag); border-color: var(--border-base); color: var(--text-secondary); }
.hcell { background: var(--bg-tag); border-color: var(--border-base); }
.hcell-lbl { color: var(--text-tertiary); }
.hcell-val { color: var(--text-primary); }
.hcell-sub { color: var(--text-secondary); }
.htag-gray, .tag-gray { background: transparent; color: var(--text-secondary); border-color: var(--border-base); }

/* alert */
.halert { border-left-width: 3px; border-left-style: solid; }
.halert.bull { background:var(--success-bg); border-color:var(--success-border); border-left-color:var(--success); }
.halert.bear { background:var(--error-bg);   border-color:var(--error-border);   border-left-color:var(--error);   }
.halert.warn { background:var(--warning-bg); border-color:var(--warning-border); border-left-color:var(--warning); }
.halert.info { background:var(--primary-bg); border-color:var(--primary-border); border-left-color:var(--primary); }

[data-theme="light"] .halert { color: #333; }
[data-theme="light"] .halert .hl { color: #111; font-weight: 600; }
[data-theme="dark"]  .halert { color: var(--text-secondary); }
[data-theme="dark"]  .halert .hl { color: var(--text-primary); font-weight: 600; }

/* up/down */
.up   { color: var(--up);   }
.down { color: var(--down); }
.flat { color: var(--text-tertiary); }

/* result rows */
.rrow { border-bottom-color: var(--border-split); }
.rrow:nth-child(odd) { background: var(--tbl-head-bg); }
.rl { color: var(--text-secondary); }
.rv { color: var(--text-primary); font-weight: 500; }
.rtotal { background: var(--bg-tag); border-color: var(--border-base); }

/* admin */
.admin-row { background: var(--bg-tag); border-color: var(--border-base); }
.admin-row-name { color: var(--text-primary); }

/* modal */
.modal-box { background: var(--bg-card); border-color: var(--border-base); box-shadow: var(--shadow-lg); }
.modal-title { color: var(--text-primary); }

/* scrollbar */
::-webkit-scrollbar-thumb { background: var(--scrollbar) !important; }


/* ══ 10:15 锁定弹窗 ══ */
#lockOverlay{position:fixed;inset:0;background:rgba(0,0,0,.65);z-index:9000;display:none;align-items:center;justify-content:center;}
#lockOverlay.show{display:flex;}
#lockBox{background:#1e222d;border:1px solid #e0a155;border-radius:12px;width:480px;max-width:95vw;padding:0;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.6);}
.lock-head{background:linear-gradient(135deg,#e0a155,#c07820);padding:16px 20px;display:flex;align-items:center;gap:10px;}
.lock-head h2{color:#131722;font-size:15px;font-weight:700;margin:0;}
.lock-head .lt{color:#131722;opacity:.7;font-size:12px;margin-left:auto;}
.lock-body{padding:20px;}
.lock-row{display:flex;align-items:center;gap:12px;padding:9px 0;border-bottom:1px solid #2a2e39;}
.lock-row:last-of-type{border-bottom:none;}
.lock-lbl{flex:0 0 130px;font-size:13px;color:#b2b5be;}
.lock-val{flex:1;font-family:var(--font-mono);font-size:15px;font-weight:600;color:#d1d4dc;}
.lock-val.auto{color:#26a69a;}
.lock-val.manual{color:#e0a155;}
.lock-input{flex:1;background:#131722;border:1px solid #2a2e39;border-radius:5px;padding:6px 10px;color:#d1d4dc;font-family:var(--font-mono);font-size:15px;width:100%;}
.lock-input:focus{outline:none;border-color:#e0a155;}
.lock-disc{background:#131722;border-radius:8px;padding:12px 14px;margin:12px 0;text-align:center;}
.lock-disc .pct{font-size:22px;font-weight:700;font-family:var(--font-mono);}
.lock-disc .sub{font-size:12px;color:#6c7080;margin-top:3px;}
.lock-foot{display:flex;gap:8px;padding:0 20px 16px;}
.lock-foot .btn-lock{flex:1;background:#e0a155;color:#131722;border:none;padding:11px;border-radius:6px;font-weight:700;font-size:14px;cursor:pointer;}
.lock-foot .btn-lock:hover{background:#f0b165;}
.lock-foot .btn-cancel{background:transparent;color:#6c7080;border:1px solid #2a2e39;padding:11px 16px;border-radius:6px;cursor:pointer;font-size:14px;}
.lock-foot .btn-cancel:hover{color:#d1d4dc;}
/* 已锁定状态标记 */
.lock-badge{display:inline-flex;align-items:center;gap:5px;background:var(--error-bg);border:1px solid #26a69a;border-radius:20px;padding:3px 10px;font-size:12px;color:#26a69a;font-family:var(--font-mono);}
.lock-badge.unlocked{background:var(--warning-bg);border-color:#e0a155;color:#e0a155;}
.lock-badge .dot{width:6px;height:6px;border-radius:50%;background:currentColor;}

/* ════════════════════════════════════════════════════
   v184 新增：LME Cash 结算价卡片专用标记
   mcard 通用样式已涵盖大部分，以下为微调补充
   ════════════════════════════════════════════════════ */

/* Cash 价大字颜色与 mc-val 一致，通过 --mc-accent 驱动 */
#macro_lme_cu_cash .mc-val,
#macro_lme_al_cash .mc-val {
  font-size: 26px;
  letter-spacing: -.02em;
}

/* 折叠行价差文字不换行 */
#macro_lme_cu_cash .mc-collapsed-row span,
#macro_lme_al_cash .mc-collapsed-row span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 48%;
}

/* 展开详情里的"说明"行全宽加底色 */
#macro_lme_cu_cash .mc-grid .mc-cell[style*="grid-column:1/-1"],
#macro_lme_al_cash .mc-grid .mc-cell[style*="grid-column:1/-1"] {
  background: var(--bg-hover);
}

/* ── themeToggle 按钮（从 index.html 内联样式提取，第8条修复）── */
.btn-theme-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 4px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--chrome-text-dim);
  transition: all .15s;
  white-space: nowrap;
}
.btn-theme-toggle:hover {
  background: rgba(255,255,255,.14);
  color: var(--chrome-text);
}

/* 外汇 USD/CNY 历史：原生 date，深色下可读、日历图标可辨 */
input.fx-hist-date-cal {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-bottom: 0;
  font-size: 15px;
  font-family: var(--font-mono);
  font-weight: 600;
  border-radius: 6px;
  border: 2px solid var(--primary);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  min-height: 44px;
}
input.fx-hist-date-cal:hover {
  border-color: var(--primary-hover);
}
input.fx-hist-date-cal:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
input.fx-hist-date-cal::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.85;
  filter: invert(0.82);
}
[data-theme="light"] input.fx-hist-date-cal::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 1;
}

/* ══ 关税政策参考页（page-tariffs）══ */
#page-tariffs .page-content {
  min-width: 0;
  padding-left: 14px;
  padding-right: 18px;
  box-sizing: border-box;
}

/* 关税页：下拉与数字框对比度、系统原生列表配色、恢复 number 步进器 */
[data-theme="dark"] #page-tariffs .tariff-lane-select,
[data-theme="dark"] #page-tariffs .tariff-calc-input {
  color-scheme: dark;
}
[data-theme="light"] #page-tariffs .tariff-lane-select,
[data-theme="light"] #page-tariffs .tariff-calc-input,
:root:not([data-theme="dark"]) #page-tariffs .tariff-lane-select,
:root:not([data-theme="dark"]) #page-tariffs .tariff-calc-input {
  color-scheme: light;
}
#page-tariffs .tariff-lane-select option {
  background-color: var(--bg-card);
  color: var(--text-primary);
}
[data-theme="dark"] #page-tariffs .tariff-lane-select option {
  background-color: #252b36;
  color: #eceff4;
}
[data-theme="light"] #page-tariffs .tariff-lane-select option,
:root:not([data-theme="dark"]) #page-tariffs .tariff-lane-select option {
  background-color: #ffffff;
  color: #12161d;
}
#page-tariffs input.tariff-calc-input[type="number"] {
  appearance: auto;
  -moz-appearance: number-input;
}
#page-tariffs input.tariff-calc-input[type="number"]::-webkit-inner-spin-button,
#page-tariffs input.tariff-calc-input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
  height: 1.35rem;
  margin: 2px 2px 2px 0;
  cursor: pointer;
}

.tariff-wrap {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
.tariff-disclaimer {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-secondary);
}
.tariff-meta-bar {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  padding: 0 2px;
}
.tariff-region {
  border: 1px solid var(--border-base);
  border-radius: 8px;
  margin-bottom: 10px;
  background: var(--bg-card);
  overflow: hidden;
}
.tariff-region-sum {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-hover);
}
.tariff-region-sum::-webkit-details-marker {
  display: none;
}
.tariff-region-sum::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s;
  color: var(--accent);
  font-size: 12px;
}
.tariff-region[open] > .tariff-region-sum::before {
  transform: rotate(90deg);
}
.tariff-focus-tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(230, 126, 34, 0.2);
  color: var(--accent);
}
.tariff-region-inner {
  padding: 10px 12px 14px;
}
.tariff-region-intro {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.65;
  margin: 0 0 10px;
}
.tariff-card {
  border: 1px solid var(--border-split);
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--bg-tag);
}
.tariff-card-sum {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.tariff-card-sum::-webkit-details-marker {
  display: none;
}
.tariff-card-sum::before {
  content: '＋';
  margin-right: 6px;
  color: var(--text-tertiary);
  font-size: 11px;
}
.tariff-card[open] > .tariff-card-sum::before {
  content: '−';
}
.tariff-card-body {
  padding: 0 12px 12px 12px;
  border-top: 1px solid var(--border-split);
}
.tariff-p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 10px 0 8px;
}
.tariff-ul {
  margin: 0 0 10px;
  padding-left: 1.2em;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.tariff-hs {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-tertiary);
  padding: 8px 10px;
  border-radius: 4px;
  background: var(--bg-hover);
  margin-bottom: 8px;
}
.tariff-hs-lab {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 4px;
}
.tariff-note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--warning);
  margin: 0 0 8px;
}
.tariff-refs {
  font-size: 12px;
}
.tariff-refs a {
  color: var(--accent);
  text-decoration: none;
}
.tariff-refs a:hover {
  text-decoration: underline;
}

/* 关税页 Tab + 宽表 */
.tariff-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 10px;
}
.tariff-tab-btn {
  font-size: 12px !important;
}
.tariff-tab-btn.active {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: rgba(230, 126, 34, 0.12) !important;
}
.tariff-tab-panel {
  margin-top: 8px;
}
.tariff-matrix-head {
  margin-bottom: 10px;
}
.tariff-matrix-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.tariff-matrix-sub,
.tariff-matrix-legend {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-tertiary);
}
.tariff-legend-top {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border-split);
  margin-bottom: 8px;
}
.tariff-table-scroll {
  overflow-x: auto;
  margin-bottom: 14px;
  margin-left: 0;
  padding-left: 2px;
  padding-right: 4px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.hud-table.tariff-matrix-table th,
.hud-table.tariff-matrix-table td {
  padding-left: 10px;
  padding-right: 10px;
}
.tariff-matrix-table {
  min-width: 880px;
  font-size: 12px;
}
.tariff-matrix-table th {
  white-space: nowrap;
  vertical-align: bottom;
}
.tariff-td-product {
  min-width: 140px;
  font-weight: 500;
  color: var(--text-primary);
}
.tariff-product-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.tariff-product-main {
  font-weight: 600;
  line-height: 1.35;
}
.tariff-product-more {
  margin: 0;
  font-size: 11px;
}
.tariff-product-more-sum {
  cursor: pointer;
  list-style: none;
  color: var(--accent);
  user-select: none;
  font-weight: 400;
  padding-left: 0;
  margin-left: -2px;
}
.tariff-product-more-sum::-webkit-details-marker {
  display: none;
}
.tariff-product-more-sum::before {
  content: '▸ ';
  font-size: 10px;
  color: var(--text-tertiary);
  margin-right: 2px;
}
.tariff-product-more[open] > .tariff-product-more-sum::before {
  content: '▾ ';
}
.tariff-product-more-body {
  margin-top: 4px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border-radius: 4px;
  border: 1px solid var(--border-split);
  max-width: 280px;
}
.tariff-td-hs {
  white-space: nowrap;
}
.tariff-td-cell {
  min-width: 136px;
  line-height: 1.55;
  color: var(--text-secondary);
  vertical-align: top;
}
.tariff-subhd {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  margin: 18px 0 8px;
}
.tariff-placeholder {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.tariff-panel-foot {
  margin-top: 16px;
  padding: 12px 14px;
  font-size: 11px;
  line-height: 1.65;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-base);
  background: var(--bg-hover);
  border-radius: 0 0 6px 6px;
}

/* 矩阵单元格：摘要 + 折叠说明 */
.tariff-cell-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tariff-core-txt {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
}
.tariff-cell-more {
  margin: 0;
  font-size: 11px;
}
.tariff-cell-more-sum {
  cursor: pointer;
  list-style: none;
  color: var(--accent);
  user-select: none;
  padding-left: 0;
  margin-left: -2px;
}
.tariff-cell-more-sum::-webkit-details-marker {
  display: none;
}
.tariff-cell-more-sum::before {
  content: '▸ ';
  font-size: 10px;
  color: var(--text-tertiary);
  margin-right: 2px;
}
.tariff-cell-more[open] > .tariff-cell-more-sum::before {
  content: '▾ ';
}
.tariff-cell-more-body {
  margin-top: 6px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border-radius: 4px;
  border: 1px solid var(--border-split);
}

/* 页顶「列说明」折叠 */
.tariff-legend-fold {
  margin: 8px 0 12px;
  border: 1px solid var(--border-split);
  border-radius: 6px;
  background: var(--bg-tag);
  overflow: hidden;
}
.tariff-legend-fold-sum {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.tariff-legend-fold-sum::-webkit-details-marker {
  display: none;
}
.tariff-legend-fold-body {
  padding: 0 12px 10px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-tertiary);
}

/* ── 国别对 · 关税互换（lane_tool）── */
.tariff-lane-root {
  margin: 12px 0 16px;
  padding: 12px 14px 14px;
  border: 1px solid var(--border-split);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}
[data-theme='light'] .tariff-lane-root {
  background: rgba(0, 0, 0, 0.03);
}
.tariff-lane-head {
  margin-bottom: 10px;
}
.tariff-lane-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.tariff-lane-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-tertiary);
}
.tariff-lane-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-bottom: 10px;
}
.tariff-lane-ctl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.tariff-lane-ctl-grow {
  flex: 1 1 220px;
  min-width: 200px;
}
.tariff-lane-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}
.tariff-lane-select {
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-input);
  border: 1px solid var(--border-base);
  border-radius: 4px;
  max-width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  cursor: pointer;
}
.tariff-lane-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}
.tariff-lane-swap {
  flex: 0 0 auto;
  align-self: center;
  margin-top: 18px;
}
.tariff-lane-hint {
  font-size: 12px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 4px;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.tariff-lane-hint-warn {
  border: 1px solid var(--warning);
  color: var(--warning);
}
.tariff-lane-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px) {
  .tariff-lane-cols {
    grid-template-columns: 1fr;
  }
  .tariff-lane-swap {
    margin-top: 0;
    width: 100%;
  }
}
.tariff-lane-col {
  min-width: 0;
  border: 1px solid var(--border-split);
  border-radius: 6px;
  background: var(--bg-panel);
  overflow: hidden;
}
.tariff-lane-col-h {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-tag);
  border-bottom: 1px solid var(--border-split);
}
.tariff-lane-col-bd {
  padding: 10px;
  font-size: 12px;
}
.tariff-lane-col-bd .tariff-cell-inner {
  font-size: 12px;
}
.tariff-lane-field {
  margin-bottom: 12px;
}
.tariff-lane-field:last-child {
  margin-bottom: 0;
}
.tariff-lane-field-lab {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.tariff-lane-p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.tariff-lane-intro {
  color: var(--text-tertiary);
  font-size: 11px;
}
.tariff-lane-inset {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px dashed var(--border-split);
  background: var(--bg-hover);
}
.tariff-lane-inset-h {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.tariff-lane-ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.tariff-lane-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-tertiary);
}
.tariff-lane-note-sub {
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-tertiary);
}
.tariff-lane-refs {
  margin-top: 8px;
  font-size: 11px;
}
.tariff-lane-refs a {
  color: var(--accent);
}
.tariff-lane-cross {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-split);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.tariff-lane-cross-meta {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ── 到岸成本试算 trade_calc ── */
.tariff-calc-root {
  margin: 14px 0 18px;
  padding: 12px 14px 14px;
  border: 1px solid var(--border-split);
  border-radius: 8px;
  background: rgba(80, 120, 200, 0.06);
}
[data-theme='light'] .tariff-calc-root {
  background: rgba(60, 100, 180, 0.06);
}
.tariff-calc-head {
  margin-bottom: 8px;
}
.tariff-calc-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.tariff-calc-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-tertiary);
}
.tariff-calc-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  cursor: pointer;
}
.tariff-calc-hint {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-tertiary);
}
.tariff-calc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
@media (max-width: 720px) {
  .tariff-calc-grid {
    grid-template-columns: 1fr;
  }
}
.tariff-calc-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tariff-calc-row-full {
  grid-column: 1 / -1;
}
/* 试算：出口国征税单独成栏（与出口物流分列，避免宽屏双列并排误读为同一项） */
.tariff-calc-export-tax-block {
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px dashed var(--border-split);
  background: var(--bg-hover);
}
.tariff-calc-field-note {
  margin: 0 0 6px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-tertiary);
}
.tariff-calc-history-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-split);
}
.tariff-calc-history-hd {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.tariff-calc-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tariff-calc-save-memo {
  flex: 1;
  min-width: 160px;
  max-width: 420px;
}
.tariff-calc-history-hint {
  margin: 0 0 8px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-tertiary);
}
.tariff-calc-history-msg {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--accent);
}
.tariff-calc-history-empty {
  margin: 0;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.tariff-calc-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tariff-calc-history-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-split);
  background: var(--bg-hover);
}
.tariff-calc-history-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tariff-calc-history-item-t {
  font-size: 10px;
  color: var(--text-tertiary);
}
.tariff-calc-history-item-route {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.tariff-calc-history-item-cost {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}
.tariff-calc-history-item-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}
.tariff-calc-k {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.tariff-calc-v {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tariff-calc-fx-line {
  flex: 1;
  min-width: 0;
}

.tariff-calc-fx-line .tariff-calc-fx-pair {
  flex: 0 1 200px;
  min-width: 140px;
}

.tariff-calc-fx-line .tariff-calc-fx-num {
  flex: 1 1 100px;
  min-width: 88px;
  max-width: 160px;
}
.tariff-calc-input {
  width: 100%;
  max-width: 220px;
  padding: 6px 10px;
  min-height: 34px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background-color: var(--bg-input);
  border: 1px solid var(--border-base);
  border-radius: 4px;
  box-sizing: border-box;
}
.tariff-calc-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}
.tariff-calc-check {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.tariff-calc-when-sync {
  font-size: 11px;
  color: var(--accent);
}
.tariff-calc-bilateral {
  margin-top: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-base);
  background: rgba(99, 102, 241, 0.06);
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.tariff-calc-bilateral-hd {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 12px;
}
.tariff-calc-bilateral-route {
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.tariff-calc-bilateral-route strong {
  color: var(--text-primary);
}
.tariff-calc-bilateral-body {
  color: var(--text-secondary);
}

.tariff-calc-fetch-meta {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-tertiary);
  min-height: 0;
}
.tariff-calc-fetch-meta:empty {
  display: none;
  margin: 0;
}
.tariff-calc-out {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-split);
  background: var(--bg-panel);
}
.tariff-calc-out-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.tariff-calc-dl {
  display: grid;
  grid-template-columns: minmax(100px, 38%) 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 12px;
}
.tariff-calc-dl dt {
  margin: 0;
  color: var(--text-tertiary);
}
.tariff-calc-dl dd {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.tariff-calc-dl-note {
  font-size: 10px;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
}
.tariff-calc-dl-tot {
  font-weight: 600;
  padding-top: 6px;
  border-top: 1px dashed var(--border-split);
}
.tariff-calc-dl dt.tariff-calc-dl-tot {
  grid-column: 1;
}
.tariff-calc-dl dd.tariff-calc-dl-tot {
  grid-column: 2;
}

/* ── 全球宏观清单页 ── */
.mcl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
  align-items: center;
}
.mcl-asof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.mcl-asof input[type='date'] {
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: 6px;
  padding: 4px 8px;
}
.mcl-asof-tip {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-right: 4px;
}
.mcl-panel {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-base);
  border-radius: 8px;
  background: var(--bg-card);
}
.mcl-panel-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.mcl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.mcl-chip {
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}
.mcl-chip input {
  margin-right: 4px;
}
.mcl-row-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mcl-row-block {
  padding: 10px 12px;
  border: 1px dashed var(--border-base);
  border-radius: 6px;
  background: var(--bg-tag, rgba(255, 255, 255, 0.02));
}
.mcl-row-block-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold, #c9a227);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.mcl-row-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 10px;
}
@media (max-width: 900px) {
  .mcl-row-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .mcl-row-grid {
    grid-template-columns: 1fr;
  }
}
.mcl-row-item {
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mcl-row-actions {
  grid-column: 1 / -1;
  margin-top: 6px;
}
.mcl-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.mcl-table .mcl-name {
  display: block;
  font-weight: 600;
}
.mcl-table .mcl-cat {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.mcl-table td.empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 20px;
}
