/* ============ 主题变量 ============ */
:root {
  --up: #ff5467;
  --down: #16c8a0;
  --warn: #f2b544;
  --accent: #4d8dff;
  --radius: 14px;
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  --bg: #070b14;
  --bg-glow: #0d1a33;
  --surface: #0d1422;
  --surface-2: #121c2e;
  --surface-3: #17243a;
  --border: #1d2b43;
  --border-soft: #16233a;
  --text: #e8eef9;
  --text-2: #aebbd0;
  --muted: #70809a;
  --shadow: 0 10px 34px rgba(0, 0, 0, .32);
  --grid-line: #1a2740;
  --up-soft: rgba(255, 84, 103, .14);
  --down-soft: rgba(22, 200, 160, .13);
  --accent-soft: rgba(77, 141, 255, .14);
  --bar-empty: #18263d;
}

:root[data-theme="light"] {
  --bg: #f2f5fa;
  --bg-glow: #e2ecff;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef3fb;
  --border: #dfe6f1;
  --border-soft: #e9eef6;
  --text: #16233a;
  --text-2: #4a5b75;
  --muted: #8a98ad;
  --shadow: 0 8px 26px rgba(24, 47, 88, .07);
  --grid-line: #e6ecf5;
  --up-soft: rgba(240, 62, 82, .1);
  --down-soft: rgba(10, 165, 130, .1);
  --accent-soft: rgba(47, 110, 230, .1);
  --bar-empty: #eaf0f8;
  --up: #ef3e52;
  --down: #0aa582;
  --warn: #d29213;
  --accent: #2f6ee6;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 540px at 12% -12%, var(--bg-glow), transparent 70%),
    radial-gradient(900px 480px at 92% -4%, var(--accent-soft), transparent 72%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

button { font-family: inherit; cursor: pointer; }

.app-shell { max-width: 1680px; margin: 0 auto; padding: 0 26px 40px; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 13px; flex-shrink: 0; }

.brand-text h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.brand-text p { margin: 3px 0 0; font-size: 10px; letter-spacing: .15em; color: var(--muted); font-weight: 600; }
.brand-text .sep { opacity: .5; margin: 0 3px; }

.topbar-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-pill.is-live { color: var(--up); border-color: color-mix(in srgb, var(--up) 35%, transparent); background: var(--up-soft); }
.status-pill.is-live .dot { background: var(--up); box-shadow: 0 0 0 4px var(--up-soft); animation: breathe 1.8s infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px transparent; } }

.demo-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--warn); border: 1px dashed color-mix(in srgb, var(--warn) 45%, transparent);
  padding: 5px 9px; border-radius: 6px; white-space: nowrap;
}
.demo-tag.is-live {
  color: var(--down); border: 1px solid color-mix(in srgb, var(--down) 45%, transparent);
  background: var(--down-soft);
}

.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.clock strong { font-family: var(--mono); font-size: 17px; letter-spacing: .02em; }
.clock small { font-size: 10px; color: var(--muted); margin-top: 3px; }

.topbar-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }

.icon-btn, .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  transition: .18s ease;
}
.icon-btn { width: 38px; position: relative; }
.icon-btn:hover, .btn-primary:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn.is-paused { color: var(--muted); }
.icon-btn.is-paused .live-dot { background: var(--muted); animation: none; box-shadow: none; }

.live-dot {
  position: absolute; right: 6px; top: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--down); box-shadow: 0 0 0 3px var(--down-soft);
}

.btn-primary {
  padding: 0 15px; font-size: 12px; font-weight: 600;
  color: #fff; background: var(--accent); border-color: transparent;
}
.btn-primary:hover { filter: brightness(1.1); color: #fff; }
.btn-primary.is-loading svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 区块 / 面板 ============ */
.dashboard { display: flex; flex-direction: column; gap: 22px; padding-top: 24px; }
.section { display: flex; flex-direction: column; gap: 12px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.section-head .en { font-size: 10px; font-weight: 600; letter-spacing: .16em; color: var(--muted); margin-left: 8px; }
.hint { font-size: 11px; color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.panel-sub { margin: 5px 0 0; font-size: 11px; color: var(--muted); }

.tag { font-size: 10px; font-weight: 700; padding: 5px 9px; border-radius: 6px; white-space: nowrap; }
.tag-up { color: var(--up); background: var(--up-soft); }
.tag-down { color: var(--down); background: var(--down-soft); }
.tag-neutral { color: var(--muted); background: var(--surface-3); }

/* ============ 指数卡片 ============ */
.index-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }

.index-card {
  position: relative; overflow: hidden;
  padding: 15px 15px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: .2s ease;
  text-align: left;
  color: inherit;
  width: 100%;
}
.index-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.index-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow); }
.index-card.is-active::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.index-card::after {
  content: ""; position: absolute; right: -30px; top: -40px;
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--tint, transparent); filter: blur(28px); opacity: .5;
  pointer-events: none;
}

.index-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.index-name { font-size: 12px; font-weight: 600; color: var(--text-2); }
.index-code { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.index-value { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 6px; }
.index-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; }
.index-amount { color: var(--muted); font-weight: 500; margin-top: 6px; font-size: 10px; }
.spark { height: 34px; margin-top: 8px; }
.spark svg { display: block; width: 100%; height: 100%; overflow: visible; }

.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.flat { color: var(--text-2) !important; }

.chg-chip { padding: 2px 6px; border-radius: 5px; font-family: var(--mono); }
.chg-chip.up { background: var(--up-soft); }
.chg-chip.down { background: var(--down-soft); }
.chg-chip.flat { background: var(--surface-3); }

/* ============ 市场总览 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.stat-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  min-width: 0;
}
.stat-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.tint-up { background: var(--up-soft); color: var(--up); }
.stat-icon.tint-down { background: var(--down-soft); color: var(--down); }
.stat-icon.tint-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }

.stat-body { min-width: 0; flex: 1; }
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.stat-value small { font-size: 11px; font-family: var(--font); font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-sub { font-size: 10px; color: var(--muted); margin-top: 5px; }

.breadth-bar { display: flex; height: 5px; border-radius: 99px; overflow: hidden; margin-top: 9px; background: var(--bar-empty); }
.breadth-bar i { display: block; height: 100%; }
.breadth-legend { display: flex; gap: 10px; font-size: 10px; margin-top: 6px; font-family: var(--mono); }

/* ============ 主图 ============ */
.main-grid { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(320px, 1fr); gap: 14px; }
.sub-grid { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }

.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border); }
.segmented button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11px; font-weight: 600; padding: 6px 13px; border-radius: 6px; transition: .18s;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.12); }

.chart-legend { display: flex; align-items: center; gap: 16px; font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { width: 13px; height: 2px; border-radius: 2px; display: inline-block; }
.legend-note { margin-left: auto; font-family: var(--mono); }

.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-tooltip {
  position: absolute; pointer-events: none; opacity: 0;
  transform: translate(-50%, -110%);
  padding: 9px 11px; border-radius: 9px;
  background: var(--surface-3); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 11px; white-space: nowrap;
  transition: opacity .12s; z-index: 5; line-height: 1.7;
}
.chart-tooltip.show { opacity: 1; }
.chart-tooltip b { font-family: var(--mono); }
.chart-tooltip .tt-label { color: var(--muted); margin-bottom: 3px; }

/* ============ 资金流 ============ */
.flow-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.flow-box { padding: 12px 13px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--surface-2); }
.flow-box .lb { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.flow-box .lb i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.flow-box .val { font-family: var(--mono); font-size: 19px; font-weight: 700; margin-top: 7px; letter-spacing: -.02em; }
.flow-box .sub { font-size: 10px; color: var(--muted); margin-top: 4px; }

.flow-bars { display: flex; flex-direction: column; gap: 12px; }
.flow-row { display: grid; grid-template-columns: 52px 1fr 74px; align-items: center; gap: 10px; font-size: 11px; }
.flow-row .fl-name { color: var(--text-2); }
.flow-row .fl-val { text-align: right; font-family: var(--mono); font-weight: 600; }
.flow-track { position: relative; height: 9px; border-radius: 99px; background: var(--bar-empty); }
.flow-track::after { content: ""; position: absolute; left: 50%; top: -2px; width: 1px; height: 13px; background: var(--border); }
.flow-fill { position: absolute; top: 0; height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.22,1,.36,1); }
.flow-fill.pos { left: 50%; background: linear-gradient(90deg, color-mix(in srgb, var(--up) 65%, transparent), var(--up)); }
.flow-fill.neg { right: 50%; background: linear-gradient(270deg, color-mix(in srgb, var(--down) 65%, transparent), var(--down)); }

.flow-split { display: flex; align-items: center; gap: 18px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.donut { width: 104px; height: 104px; flex-shrink: 0; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-family: var(--mono); font-size: 16px; }
.donut-center small { font-size: 9px; color: var(--muted); }
.split-legend { flex: 1; display: flex; flex-direction: column; gap: 11px; font-size: 11px; }
.split-legend .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.split-legend .row .k { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.split-legend .row .k i { width: 8px; height: 8px; border-radius: 3px; }
.split-legend .row .v { font-family: var(--mono); font-weight: 700; }
.panel-footnote { font-size: 10px; line-height: 1.6; color: var(--muted); margin: 16px 0 0; }

/* ============ 板块 ============ */
.sector-list { display: flex; flex-direction: column; gap: 11px; }
.sector-row { display: grid; grid-template-columns: 68px 1fr 62px 52px; align-items: center; gap: 10px; font-size: 11px; }
.sector-name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sector-track { height: 8px; background: var(--bar-empty); border-radius: 99px; position: relative; }
.sector-track::after { content: ""; position: absolute; left: 50%; top: -2px; height: 12px; width: 1px; background: var(--border); }
.sector-fill { position: absolute; top: 0; height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.22,1,.36,1); }
.sector-fill.pos { left: 50%; background: var(--up); opacity: .85; }
.sector-fill.neg { right: 50%; background: var(--down); opacity: .85; }
.sector-net, .sector-pct { text-align: right; font-family: var(--mono); font-weight: 600; }

/* ============ 涨跌分布 ============ */
.dist-chart svg { display: block; width: 100%; height: auto; }
.sentiment { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.sentiment-gauge { flex: 1; }
.sentiment-gauge .lb { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 7px; }
.sentiment-track { height: 7px; border-radius: 99px; background: linear-gradient(90deg, var(--down), var(--bar-empty) 50%, var(--up)); position: relative; opacity: .8; }
.sentiment-marker { position: absolute; top: -4px; width: 4px; height: 15px; border-radius: 3px; background: var(--text); box-shadow: 0 0 0 2px var(--surface-2); transition: left .6s; }
.sentiment-score { font-family: var(--mono); font-size: 22px; font-weight: 700; white-space: nowrap; }
.sentiment-score small { display: block; font-family: var(--font); font-size: 10px; font-weight: 500; color: var(--muted); text-align: right; margin-top: 2px; }

/* ============ 快讯 ============ */
.news-panel { display: flex; flex-direction: column; }
.pulse-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--up); }
.pulse-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--up); animation: breathe 1.8s infinite; }
.news-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 292px; flex: 1; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.news-list::-webkit-scrollbar { width: 5px; }
.news-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9px; }
.news-item { display: flex; gap: 11px; padding: 11px 2px; border-bottom: 1px solid var(--border-soft); animation: slideIn .35s ease; }
.news-item:last-child { border-bottom: 0; }
.news-time { font-family: var(--mono); font-size: 10px; color: var(--muted); flex-shrink: 0; padding-top: 2px; }
.news-text { font-size: 11px; line-height: 1.65; color: var(--text-2); }
.news-text b { color: var(--text); font-weight: 600; }
.news-item .news-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }

/* ============ 表格 ============ */
.rank-head { align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 11px; font-weight: 600; padding: 7px 12px; border-radius: 8px; transition: .18s;
}
.tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs button.active { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

.table-wrap { overflow-x: auto; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 780px; }
.rank-table th {
  text-align: left; padding: 10px 12px; font-size: 10px; font-weight: 600;
  letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
.rank-table th:first-child { border-radius: 8px 0 0 8px; }
.rank-table th:last-child { border-radius: 0 8px 8px 0; }
.rank-table th.num, .rank-table td.num { text-align: right; }
.rank-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.rank-table tbody tr { transition: background .15s; }
.rank-table tbody tr:hover { background: var(--surface-2); }
.rank-table tbody tr:last-child td { border-bottom: 0; }
.col-rank { width: 42px; }
.rank-no { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.rank-no.top { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.code { font-family: var(--mono); color: var(--text-2); font-size: 11px; }
.stock-name { font-weight: 600; }
.pct-badge { display: inline-block; min-width: 66px; text-align: right; font-family: var(--mono); font-weight: 700; }
.col-trend { width: 96px; }
.mini-spark svg { display: block; width: 84px; height: 26px; }
.table-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: var(--muted); padding-top: 13px; border-top: 1px solid var(--border-soft); margin-top: 4px; }

/* ============ 页脚 ============ */
.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 12px; padding: 20px 4px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 11px; color: var(--muted);
}
.footer > div { display: flex; flex-direction: column; gap: 5px; }
.footer strong { color: var(--text-2); font-size: 12px; }
.footer-meta { align-items: flex-end !important; }
.footer code { font-family: var(--mono); color: var(--accent); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }

/* ============ Toast ============ */
.toast {
  position: fixed; right: 26px; bottom: 26px; z-index: 60;
  padding: 11px 16px; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--border);
  box-shadow: var(--shadow); color: var(--text);
  font-size: 12px; opacity: 0; transform: translateY(12px);
  pointer-events: none; transition: .25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ============ 响应式 ============ */
@media (max-width: 1400px) {
  .index-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-panel { grid-column: span 2; }
  .news-list { max-height: 210px; }
}

@media (max-width: 1080px) {
  .main-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-status .demo-tag { display: none; }
}

@media (max-width: 720px) {
  .app-shell { padding: 0 14px 28px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 12px 2px; }
  .brand-text h1 { font-size: 15px; }
  .topbar-status { order: 3; width: 100%; justify-content: space-between; }
  .topbar-actions { margin-left: auto; }
  .btn-primary { padding: 0 11px; }
  .btn-primary span { display: none; }
  .index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sub-grid { grid-template-columns: 1fr; }
  .news-panel { grid-column: span 1; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-value { font-size: 17px; }
  .panel { padding: 14px; }
  .footer-meta { align-items: flex-start !important; }
  .chart-legend { gap: 10px; flex-wrap: wrap; }
  .legend-note { display: none; }
}

/* ============ 全球市场 ============ */
.global-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.global-list { display: flex; flex-direction: column; }
.global-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
}
.global-row:last-child { border-bottom: 0; }
.global-row .g-name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-row .g-name small { display: block; font-family: var(--mono); font-size: 9px; color: var(--muted); margin-top: 2px; }
.global-row .g-last { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.global-row .g-pct { font-family: var(--mono); font-weight: 700; min-width: 68px; text-align: right; }
.global-empty { font-size: 11px; color: var(--muted); padding: 12px 2px; }

@media (max-width: 1400px) {
  .global-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .global-grid { grid-template-columns: 1fr; }
}
