/* ============ GOLD TERMINAL · 深色金融终端风格 ============ */
:root {
  --bg: #0b0e14;
  --bg-soft: #111621;
  --card: #151b28;
  --card-hover: #1a2230;
  --border: #232c3d;
  --gold: #d4af37;
  --gold-soft: #f0d47a;
  --green: #26a69a;   /* 涨(中国习惯:红涨,但期货终端常用绿涨红跌国际色;这里用国际色系区分方向 */
  --up: #ef5350;      /* 涨-红 */
  --down: #26a69a;    /* 跌-绿 */
  --text: #e6e9ef;
  --text-dim: #8b95a7;
  --text-mute: #5c6675;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(0,0,0,.3);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.terminal { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- 顶栏 ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 40px);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--gold); font-size: 24px; line-height: 1; }
.brand-text { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.brand-accent { color: var(--gold); }
.brand-sub { color: var(--text-mute); font-size: 12px; margin-left: 6px; padding-left: 12px; border-left: 1px solid var(--border); }
.topbar-right { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.stage-badge { background: rgba(212,175,55,.12); color: var(--gold-soft); border: 1px solid rgba(212,175,55,.3); padding: 4px 10px; border-radius: 20px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); }
.status-dot.online { background: var(--down); box-shadow: 0 0 8px var(--down); }
.status-dot.offline { background: var(--up); }
.status-text { color: var(--text-dim); }

/* ---- 主体 ---- */
.main { flex: 1; padding: clamp(16px, 3vw, 28px) clamp(16px, 4vw, 40px); max-width: 1400px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

/* ---- 概览卡片 ---- */
.overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--gold); opacity: .7; }
.stat-label { color: var(--text-dim); font-size: 12px; margin-bottom: 10px; }
.unit { color: var(--text-mute); font-size: 11px; }
.stat-value { font-size: clamp(24px, 3vw, 32px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .5px; color: var(--text); }
.stat-change { margin-top: 6px; font-size: 13px; font-weight: 600; }
.stat-change.up { color: var(--up); }
.stat-change.down { color: var(--down); }
.stat-foot { margin-top: 8px; color: var(--text-mute); font-size: 11px; }

/* ---- 区块标题 ---- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.section-title .bar { width: 3px; height: 16px; background: var(--gold); border-radius: 2px; }
.title-note { color: var(--text-mute); font-size: 11px; font-weight: 400; }

/* ---- 区间切换 ---- */
.range-tabs { display: flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 8px; }
.range-btn { background: transparent; color: var(--text-dim); border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; transition: .2s; }
.range-btn:hover { color: var(--text); }
.range-btn.active { background: var(--gold); color: #1a1405; font-weight: 700; }

/* ---- 图表 ---- */
.chart-wrap { position: relative; height: 320px; width: 100%; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }
.chart-legend { display: flex; gap: 20px; margin-top: 12px; font-size: 11px; color: var(--text-dim); }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.lg-line { width: 16px; height: 2px; background: var(--gold); display: inline-block; }
.lg-bar { width: 10px; height: 10px; background: rgba(38,166,154,.4); display: inline-block; }

/* ---- 下方两栏 ---- */
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dist-wrap { display: flex; align-items: center; gap: 20px; }
.dist-wrap canvas { width: 160px !important; height: 160px !important; flex-shrink: 0; }
.dist-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.dist-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dist-item i { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.dist-item .num { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.dist-note { color: var(--text-mute); font-size: 11px; line-height: 1.6; margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }

.sys-info { list-style: none; display: flex; flex-direction: column; }
.sys-info li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sys-info li:last-child { border-bottom: none; }
.sys-info li span { color: var(--text-dim); }
.sys-info li b { font-weight: 600; color: var(--text); text-align: right; }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.data-table th { color: var(--text-mute); font-weight: 500; text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid rgba(35,44,61,.5); white-space: nowrap; }
.data-table tbody tr:hover { background: var(--card-hover); }
.data-table .up { color: var(--up); }
.data-table .down { color: var(--down); }

/* ---- 页脚 ---- */
.footer { display: flex; justify-content: space-between; padding: 20px clamp(16px,4vw,40px); color: var(--text-mute); font-size: 11px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 8px; }
.disclaimer { color: var(--text-mute); }

/* ---- 响应式 ---- */
@media (max-width: 1024px) {
  .overview { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .bottom-grid { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .stage-badge { display: none; }
  .chart-wrap { height: 260px; }
}
@media (max-width: 480px) {
  .overview { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .dist-wrap { flex-direction: column; }
  .dist-wrap canvas { width: 140px !important; height: 140px !important; }
  .range-btn { padding: 5px 8px; font-size: 11px; }
}
