/* ═══════════════════════════════════════════════════════════
   商品价格追踪 Web UI v3 — 样式表
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-body:       #121418;
    --bg-card:       #1a1d24;
    --bg-input:      #1f2937;
    --bg-hover:      #374151;
    --border:        #2d3748;
    --border-light:  #374151;
    --text-primary:  #e6e8ef;
    --text-secondary:#8b90a0;
    --text-muted:    #6b7280;
    --accent-blue:   #3b82f6;
    --accent-green:  #26de81;
    --accent-red:    #ff5252;
    --accent-amber:  #f59e0b;
    --accent-purple: #7c3aed;

    /* 按钮统一变量 */
    --btn-radius: 6px;
    --btn-padding: 6px 14px;
    --btn-font-size: 13px;
    --btn-border: var(--border-light);
    --btn-bg: var(--bg-input);
    --btn-color: var(--text-primary);
    --btn-hover-bg: #1e3a5f;
    --btn-hover-border: var(--accent-blue);
    --btn-active-bg: var(--accent-blue);
    --btn-active-border: var(--accent-blue);
}

/* ─── Glass surface utility ──────────────────────────────── */
.glass-surface { background:rgba(18,20,24,0.65); -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px); border:1px solid rgba(255,255,255,0.06); box-shadow:0 4px 20px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.03) inset; border-radius:10px; }
[data-theme='light'] .glass-surface { background:rgba(255,255,255,0.7); border:1px solid rgba(0,0,0,0.06); box-shadow:0 2px 12px rgba(0,0,0,0.04), 0 0 0 1px rgba(255,255,255,0.5) inset; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ─── 统一按钮系统 ──────────────────────────────── */
.btn {
    padding: var(--btn-padding);
    border-radius: var(--btn-radius);
    border: 1px solid var(--btn-border);
    background: transparent;
    color: var(--btn-color);
    font-size: var(--btn-font-size);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn:hover {
    border-color: var(--btn-hover-border);
    background: var(--btn-hover-bg);
}

.btn.active {
    background: var(--btn-active-bg);
    border-color: var(--btn-active-border);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled:hover {
    border-color: var(--btn-border);
    background: var(--btn-bg);
}

/* ─── Header ─────────────────────────────────────────────── */
.header {
    padding: 8px 30px;
    min-height: 48px;
    border-bottom: 1px solid #252a34;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
}
.header h1 { font-size: 22px; color: var(--accent-blue); white-space: nowrap; }
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex-shrink: 1; }

/* ─── 统一Controls栏（page-controls，浅色深色一致） ──── */
.page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 24px;
    flex-wrap: wrap;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
}

/* ─── Detail Header ───────────────────────────────────────── */
.detail-header {
    display: none; align-items: center; gap: 10px; white-space: nowrap;
}
.detail-header .back-btn {
    padding: 4px 12px;
    background: transparent;
    color: var(--text-secondary);
}
.detail-header .back-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.detail-header .detail-name {
    font-size: 18px; font-weight: 700; color: var(--accent-amber);
}
.detail-fav-star {
    font-size: 24px; color: var(--text-muted); cursor: pointer;
    transition: all 0.2s; line-height: 1; margin-left: 4px;
}
.detail-fav-star:hover { color: var(--accent-amber); transform: scale(1.2); }
.detail-fav-star.active { color: var(--accent-amber); }

/* ─── 导航按钮（上一个/下一个） ─────────── */
.nav-btn {
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 2px 10px;
    border-radius: var(--btn-radius);
    transition: all 0.15s;
    line-height: 1.4;
    user-select: none;
}
.nav-btn:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.nav-btn:active { background: var(--bg-hover); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }

/* ─── 全部商品面板：涨幅TOP红色 / 跌幅TOP绿色 ─── */
.chip-gainer { color: var(--accent-red) !important; }
.chip-loser  { color: var(--accent-green) !important; }

/* ─── 详情页章节导航（首行靠右） ──────── */
.section-nav-inline {
    display: flex; gap: 6px; margin-left: auto;
}
.section-nav-btn {
    flex-shrink: 0;
    padding: 5px 14px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    transition: all 0.15s;
}
.section-nav-btn:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.section-nav-btn.active {
    background: var(--accent-blue); border-color: var(--accent-blue); color: #fff;
}

/* 图表容器滚动偏移（避开 sticky header） */
#priceChartBox, #invChartBox, #basisChartBox, #allStockChartsSection {
    scroll-margin-top: 80px;
}

/* ─── Search ─────────────────────────────────────────────── */
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 400px; }
.search-box input {
    width: 100%; padding: 10px 14px; border-radius: 8px;
    border: 1px solid var(--border-light); background: var(--bg-input);
    color: var(--text-primary); font-size: 14px; outline: none;
    transition: border-color 0.2s;
}
.search-box input:focus { border-color: var(--accent-blue); }

.dropdown, .search-suggestions {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-input); border: 1px solid var(--border-light);
    border-radius: 0 0 8px 8px; max-height: 300px; overflow-y: auto;
    z-index: 100; display: none;
}
.search-suggestions { max-height: 400px; }
.dropdown.show, .search-suggestions.show { display: block; }

.dropdown-item {
    padding: 8px 14px; cursor: pointer; font-size: 13px;
    display: flex; justify-content: space-between; transition: background 0.15s;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item .tag {
    font-size: 11px; padding: 1px 6px; border-radius: 4px;
    background: var(--accent-blue); color: white;
}

.search-suggestions .suggestion-header {
    padding: 8px 14px; font-size: 11px; color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.search-suggestions .suggestion-item {
    padding: 8px 14px; cursor: pointer; font-size: 13px;
    display: flex; justify-content: space-between; align-items: center;
    transition: background 0.15s;
}
.search-suggestions .suggestion-item:hover { background: var(--bg-hover); }
.search-suggestions .suggestion-item .rank { width: 20px; color: var(--text-muted); font-size: 11px; }
.search-suggestions .suggestion-item .sname { flex: 1; color: var(--text-primary); }
.search-suggestions .suggestion-item .spct { font-size: 12px; }

/* ─── Controls ───────────────────────────────────────────── */
.controls { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}
.controls select, .controls button {
    padding: 8px 14px; border-radius: var(--btn-radius); border: 1px solid var(--border-light);
    background: var(--bg-input); color: var(--text-primary); font-size: 13px; cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.controls button:hover { background: var(--accent-blue); border-color: var(--accent-blue); }
.controls button.active { background: var(--accent-green); border-color: var(--accent-green); }

/* ─── Main ───────────────────────────────────────────────── */
.main { padding: 20px 30px; }

/* ─── Overview Cards ─────────────────────────────────────── */
.overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }
.overview-card {
    background:rgba(18,20,24,0.65); -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px); border:1px solid rgba(255,255,255,0.06); box-shadow:0 4px 20px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.03) inset;
    border-radius: 10px; padding: 20px;
}
.overview-card h3 {
    font-size: 14px; color: var(--text-secondary); margin-bottom: 12px;
    display: flex; align-items: center; gap: 6px;
}
.overview-card .item {
    display: flex; align-items: center; padding: 6px 0;
    border-bottom: 1px solid var(--bg-body); font-size: 13px;
}
.overview-card .item > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-card .item > span:nth-child(2) { width: 70px; text-align: center; flex-shrink: 0; }
.overview-card .item > span:nth-child(3) { width: 90px; text-align: right; flex-shrink: 0; }
.overview-card .item.clickable { cursor: pointer; border-radius: 4px; padding: 6px 8px; margin: 0 -8px; transition: background 0.15s; }
.overview-card .item.clickable:hover { background: var(--bg-hover); }
.overview-card .item:last-child { border-bottom: none; }
.overview-card .item.item-header {
    font-size: 13px; color: var(--text-secondary); font-weight: 600;
    border-bottom: 1px solid var(--border); padding: 8px;
    cursor: default !important; background: var(--bg-card);
}
.overview-card .item.item-header:hover { background: var(--bg-card) !important; }
.overview-card .item.item-header span { color: var(--text-secondary); }
.overview-card .item .name { cursor: pointer; color: var(--text-primary); transition: color 0.2s; }
.overview-card .item .name:hover { color: var(--accent-blue); text-decoration: underline; }
.overview-card .item .price-tag { font-size: 10px; padding: 1px 4px; border-radius: 3px; margin-left: 4px; }
.overview-card .item .update-date { font-size: 12px; color: var(--text-muted); }
.price-tag.futures { background: rgba(148,163,184,0.08); color: #94a3b8; }
.price-tag.spot    { background: rgba(148,163,184,0.12); color: #cbd5e1; }
.up   { color: var(--accent-red); }
.down { color: var(--accent-green); }

/* ─── Overview v2 — Card header / filters / badges ─────────── */
.ov-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ov-card-header h3 {
    margin-bottom: 0 !important;
}
.ov-view-all {
    font-size: 12px;
    color: var(--accent-blue);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s;
    flex-shrink: 0;
}
.ov-view-all:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* ─── Filter bar (price cards) ─────────────────────────────── */
.ov-filter-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.ov-filter-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.ov-filter-tag:hover {
    color: var(--text-primary);
    border-color: var(--accent-blue);
}
.ov-filter-tag.active {
    color: #fff;
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* ─── Toggle bar (inventory card) ──────────────────────────── */
.ov-toggle-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
.ov-toggle-btn {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.ov-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-blue);
}
.ov-toggle-btn.active {
    color: #fff;
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* ─── Industry tag (colored pill inside row) ───────────────── */
.ov-ind-tag {
    display: inline-block;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 4px;
    vertical-align: middle;
    line-height: 1.6;
}

/* ─── Rank badge (TOP3: 1/2/3) ────────────────────────────── */
.ov-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}
.ov-rank-badge.rank-1 {
    background: #ef4444;
}
.ov-rank-badge.rank-2 {
    background: #f59e0b;
}
.ov-rank-badge.rank-3 {
    background: #6b7280;
}

/* ─── 板块标签（industry-tag）─── */
.industry-tag {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 500; white-space: nowrap;
}
.industry-tag.metals    { background: rgba(59,130,246,0.15); color: #60a5fa; }
.industry-tag.energy    { background: rgba(245,158,11,0.15); color: #fbbf24; }
.industry-tag.agri      { background: rgba(16,185,129,0.15); color: #34d399; }
.industry-tag.chemical  { background: rgba(168,85,247,0.15); color: #a78bfa; }
.industry-tag.soft      { background: rgba(236,72,153,0.15); color: #f472b6; }
.industry-tag.other     { background: rgba(148,163,184,0.12); color: #94a3b8; }

/* ─── TOP3 徽章 ─── */
.top-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    font-size: 11px; font-weight: 700; line-height: 1; flex-shrink: 0;
}
.top-badge.gold   { background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.top-badge.silver { background: linear-gradient(135deg,#94a3b8,#64748b); color: #fff; box-shadow: 0 0 6px rgba(148,163,184,0.3); }
.top-badge.bronze { background: linear-gradient(135deg,#cd7f32,#a0522d); color: #fff; box-shadow: 0 0 6px rgba(205,127,50,0.35); }

/* ─── 筛选标签 ─── */
.filter-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 6px;
    background: #252a34; color: var(--text-secondary);
    font-size: 12px; cursor: pointer; user-select: none;
    transition: all 0.15s; border: 1px solid transparent;
}
.filter-tag:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.filter-tag.active { background: #1e3a5f; border-color: var(--accent-blue); color: var(--accent-blue); }
.filter-tag .remove { font-size: 14px; line-height: 1; opacity: 0.6; }
.filter-tag .remove:hover { opacity: 1; }

/* ─── 库存语义标签 ─── */
.inv-label {
    display: inline-block; padding: 1px 6px; border-radius: 4px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.inv-label.high    { background: rgba(239,68,68,0.15); color: #f87171; }
.inv-label.medium  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.inv-label.low     { background: rgba(16,185,129,0.15); color: #34d399; }
.inv-label.critical{ background: rgba(239,68,68,0.25); color: #fca5a5; animation: invPulse 1.5s ease-in-out infinite; }
@keyframes invPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ─── 斑马纹行 ─── */
.item.zebra { background: rgba(255,255,255,0.02); }
.item.zebra:nth-child(even) { background: rgba(255,255,255,0.04); }
.item.zebra:hover { background: var(--bg-hover) !important; }

/* ─── Chart Container ─────────────────────────────────────── */
.chart-container {
    background:rgba(18,20,24,0.65); -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px); border:1px solid rgba(255,255,255,0.06); box-shadow:0 4px 20px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.03) inset;
    border-radius: 10px; padding: 16px;
    margin-bottom: 16px;
}
.chart-container h3 { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.price-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.price-header h3 { margin-bottom: 0; }
.chart-wrap { position: relative; height: 350px; }

/* ─── Stats ──────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
    background:rgba(18,20,24,0.65); -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px); border:1px solid rgba(255,255,255,0.06); box-shadow:0 4px 20px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.03) inset;
    border-radius: 10px; padding: 16px;
    text-align: center;
}
.stat-card .label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.stat-card .value { font-size: 20px; font-weight: 700; }
.stat-card .value .price-tag { font-size: 11px; font-weight: 500; vertical-align: middle; margin-left: 4px; }

/* El Niño 标签卡片 */
.stat-card.elnino-card {
    cursor: pointer;
    border-color: #ff7a45;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255,122,69,0.08) 100%);
    transition: all 0.2s;
}
.stat-card.elnino-card:hover {
    border-color: #ff9a6c;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255,122,69,0.15) 100%);
}
.stat-card.elnino-card .value {
    font-size: 14px;
    font-weight: 600;
}
.elnino-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.elnino-badge.strong {
    background: rgba(255,122,69,0.3);
    color: #ff7a45;
    border: 1px solid #ff7a45;
}
.elnino-badge.super-strong {
    background: rgba(255,69,0,0.3);
    color: #ff4500;
    border: 1px solid #ff4500;
    box-shadow: 0 0 8px rgba(255,69,0,0.3);
}
.elnino-badge.medium {
    background: rgba(255,154,108,0.2);
    color: #ff9a6c;
    border: 1px solid #ff9a6c;
}
.elnino-badge.weak {
    background: rgba(255,154,108,0.1);
    color: #ffb088;
    border: 1px solid #ffb088;
}
.elnino-badge.neutral {
    background: rgba(107,114,128,0.2);
    color: #9ca3af;
    border: 1px solid #6b7280;
}
/* ─── Stocks Bar ─────────────────────────────────────────── */
.stocks-bar {
    background: rgba(18, 20, 24, 0.5); border-radius: 10px; padding: 12px 16px;
    margin-bottom: 16px; border: 1px solid rgba(255,255,255,0.06); font-size: 13px;
    color: #94a3b8; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.stocks-bar .stock-link {
    color: var(--accent-blue); text-decoration: none; padding: 2px 8px;
    border-radius: 6px; background: var(--btn-hover-bg); transition: all 0.2s; white-space: nowrap;
    cursor: pointer;
}
.stocks-bar .stock-link:hover { background: var(--accent-blue); color: white; }
.stocks-bar-label {
    color: var(--accent-blue); cursor: pointer; transition: color 0.15s;
}
.stocks-bar-label:hover { color: #60a5fa; text-decoration: underline; }

/* ─── 商品简介 ─────────────────────────────────────────── */
.commodity-intro {
    background: rgba(18, 20, 24, 0.5); border-radius: 10px; padding: 12px 16px;
    margin-bottom: 16px; border: 1px solid rgba(255,255,255,0.06); font-size: 13px;
    color: #94a3b8; display: flex; align-items: flex-start; gap: 8px; line-height: 1.7;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.commodity-intro-label {
    color: var(--accent-blue); font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.commodity-intro-text { color: #cbd5e1; }

/* ─── Stock Tags (价格总览行内) ────────────────────────── */
.price-detail-table .stocks { white-space: nowrap; text-align: left; max-width: 200px; }
.price-detail-table .stock-tag {
    display: inline-block; padding: 1px 6px; margin: 1px 2px;
    background: var(--btn-hover-bg); border: 1px solid #334155; border-radius: 4px;
    font-size: 11px; color: var(--accent-blue); cursor: pointer; white-space: nowrap;
    transition: all 0.15s;
}
.price-detail-table .stock-tag:hover { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }
.text-muted { color: var(--text-muted); }

/* ─── Stock Charts ───────────────────────────────────────── */
.all-stock-charts-section { margin-top: 20px; }
.all-stock-charts-section h3 { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.all-stock-charts { display: flex; flex-direction: column; gap: 16px; }
.stock-chart-card {
    background: rgba(18, 20, 24, 0.5); border-radius: 10px; padding: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.stock-chart-header {
    display: flex; align-items: center; margin-bottom: 6px;
}
.stock-chart-header .stock-chart-title { font-size: 14px; color: var(--text-primary); font-weight: 600; }
.stock-chart-controls {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; gap: 8px; flex-wrap: wrap;
}
.stock-chart-days { display: flex; gap: 4px; }
.stock-chart-period { display: flex; gap: 6px; }
.days-btn {
    padding: 3px 10px;
    border-radius: var(--btn-radius);
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
}
.days-btn:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.days-btn.active { background: var(--accent-blue); border-color: var(--accent-blue); color: white; }
.period-btn {
    padding: 4px 12px;
    border-radius: var(--btn-radius);
    color: var(--text-secondary);
    font-size: 12px;
}
.period-btn:hover { border-color: var(--accent-amber); color: var(--text-primary); }
.period-btn.active { background: var(--accent-amber); border-color: var(--accent-amber); color: white; }
.stock-chart-wrap {
    position: relative; height: 300px; background: var(--bg-body);
    border-radius: 6px; padding: 6px;
}

/* ─── All Commodities Panel ──────────────────────────────── */
.all-commodities-btn {
    padding: 8px 14px;
    border-radius: var(--btn-radius);
}
.all-commodities-btn:hover { border-color: var(--accent-blue); background: var(--btn-hover-bg); }

.all-commodities-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 200; display: none;
}
.all-commodities-overlay.show { display: flex; justify-content: center; align-items: flex-start; padding-top: 60px; }

.all-commodities-panel {
    background:rgba(18,20,24,0.75); -webkit-backdrop-filter:blur(24px); backdrop-filter:blur(24px); border:1px solid rgba(255,255,255,0.08); box-shadow:0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.03) inset;
    border-radius: 12px;
    width: 90%; max-width: 800px; max-height: 80vh; overflow: hidden;
    display: flex; flex-direction: column;
}
.panel-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.panel-tabs { display: flex; gap: 4px; }
.panel-tab {
    background: transparent;
    color: var(--text-secondary);
}
.panel-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.panel-tab.active { background: var(--accent-blue); border-color: var(--accent-blue); color: white; }
.panel-header h3 { font-size: 16px; color: var(--text-primary); }
.panel-header .close-btn {
    background: none; border: none; color: var(--text-secondary);
    font-size: 20px; cursor: pointer; padding: 4px 8px;
}
.panel-header .close-btn:hover { color: var(--text-primary); }

.panel-search { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.panel-search input {
    width: 100%; padding: 8px 12px; border-radius: 6px;
    border: 1px solid var(--border-light); background: var(--bg-body);
    color: var(--text-primary); font-size: 13px; outline: none;
}
.panel-search input:focus { border-color: var(--accent-blue); }

.panel-body { overflow-y: auto; padding: 0; flex: 1; scroll-behavior: smooth; }
.source-group {
    padding: 0 20px; border-bottom: 1px solid var(--border);
}
.source-group:last-child { border-bottom: none; }
.source-group h4 {
    font-size: 12px; color: var(--text-muted); padding: 12px 0 8px;
    text-transform: uppercase; letter-spacing: 0.5px;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; user-select: none; position: sticky; top: 0;
    background: var(--bg-card); z-index: 1;
}
.source-group h4::after {
    content: ''; flex: 1; height: 1px; background: var(--border-light); opacity: 0.5;
}
.source-group h4 .toggle-icon {
    font-size: 10px; color: var(--text-muted); transition: transform 0.2s;
}
.source-group h4 .count { color: var(--text-muted); font-weight: 400; }
.source-group.collapsed h4 .toggle-icon { transform: rotate(-90deg); }
.commodity-grid {
    display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px;
    max-height: 300px; overflow: hidden; transition: max-height 0.3s ease;
}
.source-group.collapsed .commodity-grid { max-height: 72px; }
.source-group.collapsed .grid-wrap::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 32px;
    background: linear-gradient(transparent, var(--bg-card)); pointer-events: none;
}
.grid-wrap { position: relative; }
.commodity-chip {
    padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border-light);
    background: var(--bg-input); color: var(--text-primary); font-size: 12px;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 4px;
}
.commodity-chip:hover { border-color: var(--accent-blue); background: var(--btn-hover-bg); color: var(--accent-blue); }
.commodity-chip.favorited { border-color: #f59e0b40; background: #f59e0b10; }
.commodity-chip.favorited:hover { border-color: var(--accent-amber); background: #f59e0b20; }
.commodity-chip .chip-name { display: inline; }
.commodity-chip .fav-star {
    font-size: 11px; color: var(--text-muted); cursor: pointer;
    transition: all 0.2s; margin-left: 2px; line-height: 1;
}
.commodity-chip .fav-star:hover { color: var(--accent-amber); transform: scale(1.3); }
.commodity-chip.favorited .fav-star { color: var(--accent-amber); }
.commodity-chip .chip-tag { font-size: 10px; padding: 1px 4px; border-radius: 3px; margin-left: 4px; }
.commodity-chip .chip-tag.futures { background: rgba(148,163,184,0.08); color: #94a3b8; }
.commodity-chip .chip-tag.spot    { background: rgba(148,163,184,0.12); color: #cbd5e1; }

/* ─── Loading Overlay ────────────────────────────────────── */
.loading-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,17,23,0.7); z-index: 300;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center; align-items: center;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
    width: 48px; height: 48px; border: 4px solid var(--border-light);
    border-top-color: var(--accent-blue); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ──────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 24px; right: 24px; padding: 12px 20px;
    border-radius: 8px; font-size: 13px; z-index: 400;
    animation: slideIn 0.3s ease-out;
}
.toast.success { background: var(--accent-green); color: white; }
.toast.error   { background: var(--accent-red);   color: white; }
.toast.info    { background: var(--accent-blue);   color: white; }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── Export Button ──────────────────────────────────────── */
.export-btn {
    padding: 6px 12px;
    border: 1px solid var(--accent-blue);
    background: transparent;
    color: var(--accent-blue);
    font-size: 12px;
    text-decoration: none;
    gap: 4px;
}
.export-btn:hover { background: var(--accent-blue); color: white; }

/* ─── Empty State ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }

/* ─── Watchlist Empty ────────────────────────────────────── */
.watchlist-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.watchlist-empty .icon { font-size: 48px; margin-bottom: 16px; }
.watchlist-empty .hint { font-size: 12px; margin-top: 8px; color: var(--text-muted); }

/* ─── Footer Ad ────────────────────────────────────────── */
.footer-ad {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    margin-top: 6px;
}
.footer-ad .highlight { color: var(--accent-amber); font-weight: 600; }
.footer-ad a { color: var(--accent-blue); text-decoration: none; }
.footer-ad a:hover { text-decoration: underline; color: #60a5fa; }

/* QR Modal */
.qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    pointer-events: none;
}
.qr-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px 20px 14px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    pointer-events: auto;
}
.qr-modal-card img {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 6px;
    object-fit: contain;
}
.qr-modal-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* ─── Footer ───────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 20px 16px 28px;
    margin-top: 32px;
    border-top: 1px solid var(--border);
}
.footer p {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* ─── ALL Prices Detail Page ──────────────────────────────────── */
.all-prices-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.all-prices-header h2 {
    font-size: 20px;
    color: var(--accent-amber);
    margin: 0;
}

.all-prices-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.all-prices-controls .back-btn {
    padding: 6px 16px;
    background: transparent;
    color: var(--text-secondary);
}

.all-prices-controls .back-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.all-prices-controls input {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 200px;
}

.all-prices-controls input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* ─── ALL Prices Table ────────────────────────────────────── */
.all-prices-table {
    padding: 0 20px;
}
.price-group {
    margin-bottom: 24px;
}
.price-group h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.price-group h4:hover {
    color: var(--text-primary);
}
.price-group h4 .toggle-icon {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
    margin-left: auto;
}
.price-group.collapsed h4 .toggle-icon {
    transform: rotate(-90deg);
}
.price-group.collapsed .price-table-wrap {
    display: none;
}
.price-table-wrap {
    overflow-x: auto;
}
.price-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 700px;
}
.price-detail-table th {
    text-align: center;
    padding: 8px 10px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(18, 20, 24, 0.5);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
}
.price-detail-table th.sortable {
    cursor: pointer;
    color: var(--accent-blue);
    user-select: none;
    transition: color 0.2s;
}
.price-detail-table th.sortable:hover {
    color: var(--accent-amber);
}
.price-detail-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}
.price-detail-table tr:hover td {
    background: var(--bg-hover);
}
.price-detail-table td.idx {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    width: 30px;
}
.price-detail-table td.name {
    white-space: nowrap;
    font-weight: 500;
}
.price-detail-table td.price {
    text-align: right;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.price-detail-table td.up {
    color: var(--accent-red);
    text-align: right;
    font-weight: 600;
}
.price-detail-table td.down {
    color: var(--accent-green);
    text-align: right;
    font-weight: 600;
}
.price-detail-table td.date {
    color: var(--text-muted);
    text-align: right;
    font-size: 12px;
    white-space: nowrap;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .header { 
        padding: 6px 12px; 
        min-height: 40px;
        gap: 6px;
    }
    .header h1 { 
        font-size: 14px; 
        white-space: nowrap;
    }
    .header-left {
        flex-shrink: 0;
    }
    .controls { 
        gap: 4px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .controls button,
    .controls select,
    .controls .all-commodities-btn {
        padding: 4px 8px;
        font-size: 11px;
        flex-shrink: 0;
    }
    .main { padding: 10px 12px; }
    .chart-wrap { height: 200px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .overview { grid-template-columns: 1fr; }
    
    /* 涨跌TOP卡片在手机上优化 */
    .overview-card { padding: 12px; }
    .overview-card h3 { font-size: 12px; margin-bottom: 8px; }
    .overview-card .item { padding: 4px 0; font-size: 12px; }
    .overview-card .item.item-header { display: none; }
    
    /* 价格总览页工具栏 */
    .ap-toolbar {
        padding: 6px 12px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
    }
    .ap-toolbar-left {
        gap: 6px;
    }
    .ap-toolbar-right {
        gap: 6px;
        justify-content: flex-start;
    }
    .ap-toolbar-title {
        font-size: 12px;
    }
    .ap-search {
        padding: 4px 8px;
        font-size: 12px;
        width: 100%;
        flex: 1;
        min-width: 0;
    }
    .ap-filter-group {
        gap: 4px;
    }
    .ap-filter-btn {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    /* 价格总览页 — 隐藏侧边栏 */
    .ap-sidebar {
        display: none;
    }
    .ap-body {
        flex-direction: column;
    }
    
    /* 表格优化 */
    .ap-table {
        font-size: 12px;
    }
    .ap-table th {
        padding: 6px 8px;
        font-size: 11px;
    }
    .ap-table td {
        padding: 4px 8px;
    }
    /* 隐藏10日和30日列 */
    .ap-table th:nth-child(5),
    .ap-table td:nth-child(5),
    .ap-table th:nth-child(6),
    .ap-table td:nth-child(6) {
        display: none;
    }
    /* 相关个股列压缩 */
    .ap-table .td-stocks {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .ap-table .stock-tag {
        font-size: 10px;
        padding: 1px 4px;
    }
    /* 品种名称列压缩 */
    .ap-table td:first-child {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 380px) {
    .header { padding: 4px 8px; gap: 4px; }
    .header h1 { font-size: 12px; }
    .controls button,
    .controls select,
    .controls .all-commodities-btn { 
        padding: 3px 6px; 
        font-size: 10px; 
    }
    /* 极窄屏隐藏emoji图标 */
    .controls .btn-icon { display: none; }
    
    /* 价格总览页 */
    .ap-toolbar { padding: 4px 8px; }
    .ap-toolbar-title { font-size: 11px; }
    .ap-search { width: 100%; font-size: 11px; padding: 3px 6px; }
    .ap-filter-btn { padding: 2px 6px; font-size: 10px; }
    
    /* 表格进一步压缩 */
    .ap-table {
        font-size: 11px;
    }
    .ap-table th {
        padding: 4px 6px;
        font-size: 10px;
    }
    .ap-table td {
        padding: 3px 6px;
    }
    /* 隐藏5日列 */
    .ap-table th:nth-child(4),
    .ap-table td:nth-child(4) {
        display: none;
    }
    /* 品种名称进一步压缩 */
    .ap-table td:first-child {
        max-width: 90px;
    }
    .ap-table .td-stocks {
        max-width: 70px;
    }
}

/* ═══════════════════════════════════════════════════════════
   价格总览页 — All Prices Page (ap-*)
   ═══════════════════════════════════════════════════════════ */

/* ─── Toolbar ──────────────────────────────────────────── */
.ap-toolbar {
    background:rgba(22,24,30,0.7); -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px); border:1px solid rgba(255,255,255,0.06); box-shadow:0 4px 20px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.03) inset;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 12px;
    flex-wrap: wrap;
}
.ap-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.ap-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}
.ap-toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* ─── Search box ───────────────────────────────────────── */
.ap-search {
    border-radius: 6px;
    background: rgba(31,41,55,0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e6e8ef;
    padding: 6px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    width: 200px;
}
.ap-search:focus {
    border-color: #3b82f6;
}

/* ─── Sort select ─────────────────────────────────────── */
/* ─── Sort select removed - sorting via table headers ──── */

/* ─── Filter group ─────────────────────────────────────── */
.ap-filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.ap-filter-btn {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #8b90a0;
    background: transparent;
    border: 1px solid #374151;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.ap-filter-btn:hover {
    color: #e6e8ef;
    border-color: #3b82f6;
}
.ap-filter-btn.active {
    color: #fff;
    background: #3b82f6;
    border-color: #3b82f6;
}

/* ─── Body layout ─────────────────────────────────────── */
.ap-body {
    display: flex;
    gap: 0;
}

/* ─── Sidebar ──────────────────────────────────────────── */
.ap-sidebar {
    width: 20%;
    min-width: 180px;
    max-width: 220px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    padding: 16px 0;
    background: rgba(18, 20, 24, 0.5);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}
.ap-sidebar-title {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px 4px;
    font-weight: 600;
}
.ap-sidebar-item {
    display: block;
    padding: 6px 16px;
    font-size: 13px;
    color: #8b90a0;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    border-left: 3px solid transparent;
    line-height: 1.5;
}
.ap-sidebar-item:hover {
    color: #e6e8ef;
    background: rgba(255,255,255,0.03);
}
.ap-sidebar-item.active {
    color: #f59e0b;
    border-left-color: #f59e0b;
    font-weight: 600;
}

/* ─── Table wrap ───────────────────────────────────────── */
.ap-table-wrap {
    flex: 1;
    overflow-x: auto;
    padding: 0;
}

/* ─── Table ────────────────────────────────────────────── */
.ap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

/* ─── Table thead ──────────────────────────────────────── */
.ap-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background:rgba(18,20,24,0.8); -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ap-table th {
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-bottom: 1px solid #252a34;
    user-select: none;
}
.ap-table th.th-commodity {
    text-align: left;
}
.ap-table th.th-price {
    text-align: right;
}
.ap-table th.th-chg {
    text-align: right;
    width: 80px;
}
.ap-table th.th-stocks {
    text-align: left;
    min-width: 120px;
}
.ap-table th.sortable {
    cursor: pointer;
    color: var(--accent-blue);
    user-select: none;
    transition: color 0.2s;
}
.ap-table th.sortable:hover {
    color: var(--accent-amber);
}
.ap-table th.sortable .sort-icon::after {
    content: '⇅';
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.5;
}
.ap-table th.sortable[data-sort-active="desc"] .sort-icon::after {
    content: '▼';
    opacity: 1;
}
.ap-table th.sortable[data-sort-active="asc"] .sort-icon::after {
    content: '▲';
    opacity: 1;
}
.ap-table .td-stocks {
    white-space: nowrap;
    max-width: 200px;
    text-align: left;
}
.ap-table .stock-tag {
    display: inline-block;
    padding: 1px 6px;
    margin: 1px 2px;
    background: var(--btn-hover-bg);
    border: 1px solid #334155;
    border-radius: 4px;
    font-size: 11px;
    color: var(--accent-blue);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.ap-table .stock-tag:hover {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

/* ─── Table tbody rows ────────────────────────────────── */
.ap-table tbody tr {
    height: 36px;
    cursor: pointer;
    transition: background 0.15s;
}
.ap-table tbody tr:nth-child(even) {
    background: #1e222b;
}

.ap-table tbody tr:hover {
    background: #2d3748;
}

/* ─── Section header rows ─────────────────────────────── */
.ap-table tbody tr.section-header {
    background: #161920;
    color: #fff;
    font-weight: 700;
    cursor: default;
}
.ap-table tbody tr.section-header td {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 700;
}
.ap-table tbody tr.section-header:hover {
    background: #161920;
}

/* ─── Anomaly rows ─────────────────────────────────────── */
.ap-table tbody tr.anomaly-up {
    background-color: rgba(255, 82, 82, 0.08);
}
.ap-table tbody tr.anomaly-down {
    background-color: rgba(38, 222, 129, 0.08);
}

/* ─── Table cells ──────────────────────────────────────── */
.ap-table td {
    padding: 4px 12px;
    text-align: right;
    border-bottom: 1px solid #252a34;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.ap-table td:first-child {
    text-align: left;
}

/* ─── Color block (section header indicator) ───────────── */
.ap-table .color-block {
    width: 4px;
    height: 16px;
    border-radius: 2px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    flex-shrink: 0;
}

/* ─── Price tag in table ───────────────────────────────── */
.ap-table .price-tag {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}
.ap-table .price-tag.futures {
    background: rgba(148,163,184,0.08);
    color: #94a3b8;
}
.ap-table .price-tag.spot {
    background: rgba(148,163,184,0.12);
    color: #cbd5e1;
}

/* ─── Up / Down colors ─────────────────────────────────── */
.up-red { color: #ff5252; }
.down-green { color: #26de81; }

/* ─── Back-to-top button ──────────────────────────────── */
.ap-back-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a1d24;
    border: 1px solid #374151;
    color: #8b90a0;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.ap-back-top:hover {
    background: #2d3748;
    color: #e6e8ef;
    border-color: #3b82f6;
}

/* ─── Industry color classes (for .color-block) ───────── */
.industry-chemical    { background: #5f27cd; }
.industry-black       { background: #576574; }
.industry-nonferrous  { background: #00d2d3; }
.industry-agri        { background: #ff9f43; }
.industry-construction{ background: #ee5a24; }
.industry-precious    { background: #fbbf24; }
.industry-energy      { background: #0abde3; }
.industry-shipping    { background: #8b5cf6; }
.industry-rare-earth  { background: #ec4899; }
.industry-other       { background: #6b7280; }

/* ═══════════════════════════════════════════════════════════
   统一Header/Footer组件 (ui-ux-pro-max设计系统)
   ═══════════════════════════════════════════════════════════ */

/* ─── 统一Header ──────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(18, 20, 24, 0.65);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.header-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-blue);
    text-decoration: none;
    white-space: nowrap;
}

.header-logo:hover {
    color: #60a5fa;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* 窄屏 nav 禁止换行，改用水平滚动 */
@media (max-width: 640px) {
    .header-nav {
        flex-wrap: nowrap !important;
    }
}

/* theme-toggle inside nav — flush with nav items */
.header-nav .theme-toggle {
    margin-left: 2px;
    padding: 4px 8px !important;
    min-width: 32px;
    min-height: 32px;
    font-size: 15px !important;
    border-radius: 6px;
}

.nav-link {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    font-weight: 600;
    border-bottom: 2px solid #3b82f6;
    border-radius: 6px 6px 0 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ─── 统一Footer ──────────────────────────────────────── */
.site-footer {
    margin-top: 40px;
    padding: 24px 16px 32px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    line-height: 1.6;
}

.footer-ad {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.6;
}

.footer-ad .highlight {
    color: var(--accent-amber);
    font-weight: 600;
}

.footer-ad a {
    color: var(--accent-blue);
    text-decoration: none;
    cursor: pointer;
}

.footer-ad a:hover {
    text-decoration: underline;
    color: #60a5fa;
}

/* ─── QR弹窗 ──────────────────────────────────────────── */
.qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.qr-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px 20px 14px;
    text-align: center;
    pointer-events: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.qr-modal-label {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ─── 响应式：移动端导航 ──────────────────────────────── */
@media (max-width: 640px) {
    .site-header {
        height: auto;
        padding: 6px 8px;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .header-left {
        width: 100%;
        justify-content: space-between;
    }
    
    .header-logo {
        font-size: 15px;
    }
    
    .header-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding: 2px 0;
        -webkit-overflow-scrolling: touch;
        gap: 2px;
        scrollbar-width: none;
    }
    .header-nav::-webkit-scrollbar { display: none; }
    
    .nav-link {
        padding: 4px 10px;
        font-size: 13px;
        flex-shrink: 0;
    }
    
    .header-right {
        flex-wrap: wrap;
        gap: 4px;
    }
}

/* ─── iPhone小屏幕适配 ──────────────────────────────── */
@media (max-width: 380px) {
    .site-header {
        padding: 4px 6px;
        gap: 4px;
    }
    
    .header-logo {
        font-size: 14px;
    }
    
    .header-nav {
        gap: 1px;
    }
    
    .nav-link {
        padding: 3px 8px;
        font-size: 12px;
    }
    
    .header-nav .theme-toggle {
        min-width: 28px;
        min-height: 28px;
        padding: 3px 6px !important;
        font-size: 14px !important;
    }
}

/* 超小屏幕 (iPhone SE等) */
@media (max-width: 320px) {
    .site-header {
        padding: 3px 4px;
        gap: 3px;
    }

    .header-logo {
        font-size: 12px;
    }
    
    .nav-link {
        padding: 2px 5px;
        font-size: 10px;
    }

    .header-nav {
        gap: 1px;
    }

    .header-nav .theme-toggle {
        min-width: 24px;
        min-height: 24px;
        padding: 2px 4px !important;
        font-size: 12px !important;
        margin-left: 1px;
    }
}

/* ═══════════════════════════════════════════════════════════
   全局小屏幕适配 (iPhone/移动端)
   ═══════════════════════════════════════════════════════════ */

/* ─── 通用组件适配 ──────────────────────────────────────── */
@media (max-width: 640px) {
    .main { padding: 10px 12px; }
    
    /* Footer适配 */
    .site-footer {
        padding: 16px 12px 24px;
        margin-top: 24px;
    }
    .footer-disclaimer { font-size: 11px; }
    .footer-ad { font-size: 11px; }
    
    /* QR弹窗适配 */
    .qr-modal-card { padding: 16px; }
    .qr-modal-card img { max-width: 200px; }
    
    /* 按钮适配 */
    .btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* 卡片适配 */
    .card { padding: 12px; }
    
    /* 表格适配 */
    table { font-size: 12px; }
    th, td { padding: 6px 8px; }
}

@media (max-width: 380px) {
    .site-footer {
        padding: 12px 8px 20px;
    }
    .footer-disclaimer { font-size: 10px; }
    .footer-ad { font-size: 10px; }
}

/* ─── 首页专用适配 ──────────────────────────────────────── */
@media (max-width: 640px) {
    /* 概览卡片 */
    .overview { 
        grid-template-columns: 1fr; 
        gap: 8px; 
    }
    
    /* 价格总览 */
    .ap-toolbar {
        flex-direction: column;
        gap: 8px;
    }
    .ap-toolbar-left, .ap-toolbar-right {
        width: 100%;
    }
    .ap-search {
        width: 100%;
    }
    .ap-filter-group {
        flex-wrap: wrap;
    }
    .ap-filter-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* 价格表格 */
    .ap-table {
        font-size: 11px;
    }
    .ap-table th, .ap-table td {
        padding: 6px 4px;
    }
    .th-stocks { display: none; }
    .td-stocks { display: none; }
    
    /* 图表容器 */
    .chart-container {
        padding: 12px;
    }
    .chart-container h3 {
        font-size: 14px;
    }
    .chart-wrap { height: 200px; }
    
    /* 统计卡片 */
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .stat-item {
        padding: 8px;
    }
    .stat-value {
        font-size: 16px;
    }
    
    /* 商品列表面板 */
    .all-commodities-panel {
        width: 95%;
        max-height: 80vh;
    }
    .panel-header {
        padding: 12px;
    }
    .panel-tab {
        padding: 6px 10px;
        font-size: 12px;
    }
    .panel-search input {
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    /* 极窄屏隐藏部分列 */
    .ap-table .th-chg:nth-child(4),
    .ap-table .td-chg:nth-child(4) { display: none; }
    .ap-table .th-chg:nth-child(5),
    .ap-table .td-chg:nth-child(5) { display: none; }
}

/* ─── 小屏适配 ──────────────────────────────────────────── */
@media (max-width: 640px) {
    /* 概览卡片 */
    .overview-grid { 
        grid-template-columns: 1fr; 
        gap: 8px; 
    }
    .ov-card { padding: 12px 16px; }
    .ov-value { font-size: 24px; }
    
    /* 行业排名表 */
    .ind-table { font-size: 12px; }
    .ind-table th, .ind-table td { padding: 4px 6px; }
    
    /* 题材板块 */
    .theme-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 6px;
    }
    .theme-item { padding: 8px 10px; }
    .theme-name { font-size: 12px; }
    .theme-change { font-size: 12px; }
    
    /* 涨幅榜 */
    .stock-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .stock-item { padding: 8px 10px; }
    .stock-name { font-size: 12px; }
    .stock-change { font-size: 13px; }
}

@media (max-width: 380px) {
    .ov-value { font-size: 20px; }
    .theme-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─── 超小屏幕全局适配 (320px) ──────────────────────────── */
@media (max-width: 320px) {
    .main { padding: 8px; }
    
    /* Footer */
    .site-footer {
        padding: 12px 8px 16px;
    }
    .footer-disclaimer { font-size: 10px; }
    .footer-ad { font-size: 10px; }
    
    /* 按钮 */
    .btn {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    /* 表格 */
    table { font-size: 10px; }
    th, td { padding: 4px 6px; }
    
    /* 卡片 */
    .card { padding: 8px; }
}

/* ═══════════════════════════════════════════════════════════
   浅色主题 — 清爽版
   ═══════════════════════════════════════════════════════════ */
[data-theme="light"] {
    --bg-body:       #FFFFFF;
    --bg-card:       #FFFFFF;
    --bg-input:      #FFFFFF;
    --bg-hover:      #F5F6F7;
    --border:        #EBEDF0;
    --border-light:  #F0F1F3;
    --text-primary:  #1D2129;
    --text-secondary:#6B7785;
    --text-muted:    #9BA3AF;
}

[data-theme="light"] body {
    background: #FFFFFF;
    color: #1D2129;
}

/* 卡片 — 纯白底 + 极浅边框 */
[data-theme='light'] .chart-container,
[data-theme='light'] .stat-card,
[data-theme='light'] .stock-chart-card,
[data-theme='light'] .all-commodities-panel,
[data-theme='light'] .overview-card {
    background: #FFFFFF;
    border: 1px solid #EBEDF0;
    box-shadow: none;
}

/* Header 已由下面的毛玻璃样式覆盖 */

/* 核心大数字指标（统一质感和字号，不因主题变化布局） */
[data-theme='light'] .stat-card .label { color: #9BA3AF; }
[data-theme="light"] .rise { color: #F53F3F; }
[data-theme="light"] .fall { color: #00B42A; }

/* 表格样式 */
[data-theme="light"] .data-table { background: #fff; border-collapse: collapse; }
[data-theme="light"] .data-table tr:nth-child(even) { background: #FAFBFC; }
[data-theme="light"] .data-table td { border-bottom: 1px solid #EBEDF0; color: #6B7785; }

/* 斑马纹行 */
[data-theme="light"] .item.zebra { background: rgba(0,0,0,0.01); }
[data-theme="light"] .item.zebra:nth-child(even) { background: #FAFBFC; }

/* price detail table (价格总览) */
[data-theme="light"] .price-detail-table td { color: #6B7785; }

/* stocks bar */
[data-theme='light'] .stocks-bar { background: #FAFBFC; border-color: #EBEDF0; color: #6B7785; }
[data-theme='light'] .stocks-bar .stock-link { background: #F5F6F7; }
[data-theme='light'] .stock-tag { background: #F5F6F7; border-color: #E0E2E6 !important; color: #1D2129; }

/* detail page period select — inside .page-controls */
[data-theme='light'] .page-controls select.btn,
[data-theme='light'] #days.btn {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #6B7785;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.2s;
}

/* overview cards */
[data-theme="light"] .ov-card { background: #FFFFFF; border-color: #EBEDF0; }
[data-theme="light"] .ov-value { color: #1D2129; }
[data-theme="light"] .ov-change.rise { color: #F53F3F; }
[data-theme="light"] .ov-change.fall { color: #00B42A; }
[data-theme="light"] .ov-sublabel { color: #9BA3AF; }

/* Chart.js 图表 canvas 背景 */
[data-theme="light"] .chart-wrap { background: #FFFFFF; }
[data-theme="light"] canvas { background: #FFFFFF; }

/* 加载遮罩 */
[data-theme="light"] .loading-overlay { background: rgba(255,255,255,0.75); }
[data-theme="light"] .all-commodities-overlay { background: rgba(0,0,0,0.08); }

/* site footer */
[data-theme="light"] .site-footer { color: #9BA3AF; border-top-color: #EBEDF0; }

/* ═══════════════════════════════════════════════════════════
   浅色主题 — 顶部导航栏 重新设计
   ═══════════════════════════════════════════════════════════ */

/* Header 毛玻璃+细节 */
[data-theme='light'] .site-header {
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Logo */
[data-theme='light'] .header-logo {
    color: #2563eb;
}

/* ─── 导航链接: Pill 按钮风格 ─── */
[data-theme='light'] .nav-link {
    color: #6B7785;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
[data-theme='light'] .nav-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #1D2129;
}
[data-theme='light'] .nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    font-weight: 600;
    border-bottom: 2px solid #2563eb;
    border-radius: 6px 6px 0 0;
}

/* ─── Header 右侧操作按钮 ─── */
[data-theme='light'] .header-right .btn {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #6B7785;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
[data-theme='light'] .header-right .btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
    color: #1D2129;
}
[data-theme='light'] .header-right .btn:active {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.4);
    color: #2563eb;
}

/* ─── 主题切换按钮 ─── */
.theme-toggle {
    font-size: 16px !important;
    padding: 6px 10px !important;
    line-height: 1;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

[data-theme='light'] .theme-toggle {
    background: transparent;
    border: none;
    font-size: 16px !important;
    padding: 6px 10px !important;
    line-height: 1;
    color: #6B7785;
}
[data-theme='light'] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #1D2129;
}

/* ─── 详情页导航栏 ─── */
[data-theme='light'] .detail-header {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    padding: 4px 12px;
}
[data-theme='light'] .detail-header .btn {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #6B7785;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 13px;
}
[data-theme='light'] .detail-header .btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
    color: #1D2129;
}
[data-theme='light'] .detail-header .nav-btn {
    width: 28px; height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ─── select 下拉框按钮 ─── */
[data-theme='light'] .header-right select.btn {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #6B7785;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.2s;
}
[data-theme='light'] .header-right select.btn:hover {
    border-color: rgba(59, 130, 246, 0.3);
    color: #1D2129;
}

/* ─── Section nav inline (详情页跳转按钮) ─── */
[data-theme='light'] .section-nav-btn {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #6B7785;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 12px;
    transition: all 0.2s;
}
[data-theme='light'] .section-nav-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
    color: #1D2129;
}
[data-theme='light'] .section-nav-btn.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #2563eb;
}

/* ─── 移动端响应 ─── */
@media (max-width: 640px) {
    [data-theme='light'] .site-header {
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    [data-theme='light'] .nav-link {
        padding: 4px 10px;
        font-size: 12px;
    }
    [data-theme='light'] .theme-toggle {
        padding: 6px 10px !important;
        font-size: 16px !important;
        min-width: 36px;
        min-height: 36px;
    }
}

/* ═══════════════════════════════════════════════════════════
   浅色主题 — 用户原始样式（直接覆盖）
   ═══════════════════════════════════════════════════════════ */
[data-theme="light"] body {
  background: #FFFFFF !important;
  color: #1D2129 !important;
}

[data-theme="light"] .data-card {
  background: #F7F8FA !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

[data-theme="light"] .kpi-num {
  font-size: 32px !important;
  font-weight: bold !important;
  color: #1D2129 !important;
}

[data-theme="light"] .rise { color: #F53F3F !important; }
[data-theme="light"] .fall { color: #00B42A !important; }

[data-theme="light"] .data-table {
  background: #fff !important;
  border-collapse: collapse !important;
}
[data-theme="light"] .data-table tr:nth-child(even) {
  background: #F7F8FA !important;
}
[data-theme="light"] .data-table td {
  border-bottom: 1px solid #E5E7EB !important;
  color: #6B7785 !important;
}

/* ─── Light theme glass overrides ─── */
[data-theme='light'] .overview-card { background:rgba(255,255,255,0.7); border:1px solid rgba(0,0,0,0.06); }
[data-theme='light'] .chart-container { background:rgba(255,255,255,0.7); border:1px solid rgba(0,0,0,0.06); }
[data-theme='light'] .stat-card { background:rgba(255,255,255,0.7); border:1px solid rgba(0,0,0,0.06); }
[data-theme='light'] .ap-toolbar { background:rgba(255,255,255,0.7); border-bottom:1px solid rgba(0,0,0,0.06); }
[data-theme='light'] .ap-sidebar { background:rgba(255,255,255,0.6); border-right:1px solid rgba(0,0,0,0.06); }
[data-theme='light'] .ap-table thead { background:rgba(255,255,255,0.7); }
[data-theme='light'] .ap-table th { color:#1D2129; border-bottom:1px solid rgba(0,0,0,0.06); }
[data-theme='light'] .ap-table td { border-bottom:1px solid rgba(0,0,0,0.04); color:#6B7785; }
[data-theme='light'] .ap-table tbody tr { background:transparent; }
[data-theme='light'] .ap-table tbody tr:nth-child(even) { background:#FAFBFC; }
[data-theme='light'] .ap-table tbody tr:hover { background:#F5F6F7; }
[data-theme='light'] .ap-table tbody tr.section-header { background:rgba(255,255,255,0.85); color:#1D2129; }
[data-theme='light'] .ap-table tbody tr.section-header:hover { background:rgba(255,255,255,0.85); }
[data-theme='light'] .ap-table .stock-tag { background:#F5F6F7; border-color:#E0E2E6 !important; color:#1D2129; }
[data-theme='light'] .all-commodities-panel { background:rgba(255,255,255,0.85); border:1px solid rgba(0,0,0,0.08); }
[data-theme='light'] .loading-overlay { background:rgba(255,255,255,0.7); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); }
[data-theme='light'] .ap-search { background:rgba(255,255,255,0.5); border-color:rgba(0,0,0,0.08); color:#1D2129; }
[data-theme='light'] .ap-search:focus { border-color:#3b82f6; }
[data-theme='light'] .panel-search input { background:rgba(255,255,255,0.5); border-color:rgba(0,0,0,0.08); color:#1D2129; }
[data-theme='light'] .panel-search input:focus { border-color:#3b82f6; }
[data-theme='light'] .panel-tab { color:#6B7785; }
[data-theme='light'] .panel-tab:hover { background:rgba(0,0,0,0.04); color:#1D2129; }
[data-theme='light'] .ap-sidebar-item { color:#6B7785; }
[data-theme='light'] .ap-sidebar-item:hover { color:#1D2129; background:rgba(0,0,0,0.02); }
[data-theme='light'] .ap-sidebar-title { color:#9BA3AF; background:transparent; }
[data-theme='light'] .ap-sidebar { border-right-color:rgba(0,0,0,0.06); }
[data-theme='light'] .ap-filter-btn { border-color:rgba(0,0,0,0.08); color:#6B7785; background:rgba(255,255,255,0.5); }
[data-theme='light'] .ap-filter-btn:hover { color:#1D2129; border-color:#3b82f6; }
[data-theme='light'] .site-footer { border-top-color:rgba(0,0,0,0.06); }
[data-theme='light'] .stat-card.elnino-card { background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,122,69,0.08) 100%); }
[data-theme='light'] .overview-card .item.item-header { background:rgba(255,255,255,0.85); }
[data-theme='light'] .overview-card .item.item-header:hover { background:rgba(255,255,255,0.85) !important; }
[data-theme='light'] .overview-card .item.clickable:hover { background:rgba(0,0,0,0.02); }
[data-theme='light'] .price-tag.futures { background:rgba(148,163,184,0.12); color:#64748b; }
[data-theme='light'] .price-tag.spot { background:rgba(148,163,184,0.15); color:#475569; }
[data-theme='light'] .stocks-bar { background:#FAFBFC; border-color:#EBEDF0; color:#6B7785; }
[data-theme='light'] .commodity-intro { background:#FAFBFC; border-color:#EBEDF0; color:#6B7785; }
[data-theme='light'] .commodity-intro-text { color:#3D4654; }
[data-theme='light'] .stock-chart-card { background:rgba(255,255,255,0.7); border:1px solid rgba(0,0,0,0.06); }
[data-theme='light'] .price-detail-table th { background:rgba(255,255,255,0.85); }
[data-theme='light'] .price-detail-table .stock-tag { background:#F5F6F7; border-color:#E0E2E6 !important; color:#1D2129; }

/* 涨跌家数+中位数显示 */
.temp-breadth {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
}
.breadth-up { color: var(--accent-red); font-weight: 600; }
.breadth-down { color: var(--accent-green); font-weight: 600; }
.breadth-sep { color: var(--text-muted); }
.breadth-median {
    color: var(--text-secondary);
    margin-left: 4px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}
