:root {
  --bg: #0f1113;
  --bg-soft: #15191b;
  --ink: #eef5f2;
  --muted: #8e9b98;
  --subtle: #5f6c69;
  --line: rgba(119, 142, 137, 0.24);
  --line-strong: rgba(84, 211, 224, 0.38);
  --panel: rgba(20, 25, 27, 0.88);
  --panel-soft: rgba(24, 30, 33, 0.74);
  --row: rgba(255, 255, 255, 0.035);
  --red: #ff5d68;
  --green: #2bd39f;
  --amber: #f2bd57;
  --blue: #45c7d8;
  --violet: #a988ff;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  --glow: 0 0 0 1px rgba(69, 199, 216, 0.08), 0 16px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(135deg, #101214 0%, #171b1d 44%, #101113 100%);
  background-size: 34px 34px, 34px 34px, 100% 100%;
  font-variant-numeric: tabular-nums;
}

.shell {
  width: min(1800px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 14px 0 16px;
}

.topbar,
.score-card,
.metric-card,
.panel,
.annual-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    var(--panel);
  box-shadow: var(--glow);
  backdrop-filter: blur(14px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 5;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 3px;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: 800;
}

.eyebrow,
.label {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.clock {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-items: end;
  gap: 4px 12px;
}

.clock span {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #071012;
  background: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.clock strong {
  font-size: 27px;
  line-height: 1;
}

.clock small {
  grid-column: 1 / -1;
}

.clock small,
.muted,
.hint,
footer {
  color: var(--muted);
}

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

.score-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 14px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0deg, rgba(255, 255, 255, 0.08) 0deg);
  box-shadow: inset 0 0 18px rgba(69, 199, 216, 0.18);
}

.score-ring span {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #111618;
  font-size: 25px;
  font-weight: 900;
}

.score-card h2 {
  margin: 4px 0 6px;
  font-size: 18px;
}

.score-card .muted {
  max-width: 620px;
  font-size: 13px;
  line-height: 1.45;
}

.metric-card {
  display: grid;
  align-content: space-between;
  min-height: 112px;
  padding: 13px;
}

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

.metric-top span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.metric-value {
  margin-top: 8px;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
}

.spark,
.proxy-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.spark {
  margin-top: 12px;
}

.spark span,
.proxy-bar span {
  display: block;
  width: 0%;
  height: 100%;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
}

.panel {
  grid-column: span 3;
  min-height: 0;
  padding: 12px;
  overflow: visible;
}

.wide {
  grid-column: span 6;
}

.dashboard > .panel:nth-child(11) {
  grid-column: span 9;
}

.annual-card {
  width: 100%;
  margin-top: 10px;
  padding: 13px;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin-top: 3px;
}

.hint {
  max-width: 320px;
  text-align: right;
  font-size: 11px;
  line-height: 1.45;
}

.quote-list,
.north-stack,
.sector-grid,
.rank-list,
.proxy-list,
.us-china-box,
.us-list {
  display: grid;
  gap: 7px;
}

.us-list {
  max-height: 292px;
  overflow: auto;
  padding-right: 2px;
}

.rank-list {
  max-height: 368px;
  overflow: auto;
  padding-right: 2px;
}

.proxy-list,
#sectors,
#foreignHeavy {
  max-height: 304px;
  overflow: auto;
  padding-right: 2px;
}

.us-list::-webkit-scrollbar,
.rank-list::-webkit-scrollbar,
.proxy-list::-webkit-scrollbar,
#sectors::-webkit-scrollbar,
#foreignHeavy::-webkit-scrollbar {
  width: 6px;
}

.us-list::-webkit-scrollbar-thumb,
.rank-list::-webkit-scrollbar-thumb,
.proxy-list::-webkit-scrollbar-thumb,
#sectors::-webkit-scrollbar-thumb,
#foreignHeavy::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(69, 199, 216, 0.32);
}

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

.quote-row,
.sector-tile,
.rank-row,
.north-item,
.index-item,
.proxy-item,
.us-row,
.us-summary,
.fx-main,
.fx-note,
.annual-chart-wrap,
.monthly-board {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--row);
}

.quote-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 70px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 7px 9px;
}

.name {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.price,
.change,
.flow {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.price {
  font-size: 16px;
  font-weight: 900;
}

.change {
  font-size: 13px;
  font-weight: 900;
}

.red {
  color: var(--red);
}

.green {
  color: var(--green);
}

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

.north-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 50px;
  padding: 9px 10px;
}

.north-item strong {
  align-self: center;
  font-size: 21px;
  line-height: 1;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.index-item {
  min-height: 68px;
  padding: 10px;
}

.index-item .price {
  margin-top: 6px;
  text-align: left;
}

.index-item .change {
  margin-top: 2px;
  text-align: left;
}

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

.sector-tile {
  min-height: 76px;
  padding: 9px;
}

.sector-tile .change {
  margin-top: 8px;
  text-align: left;
  font-size: 20px;
}

.sector-tile .flow {
  margin-top: 2px;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
}

.rank-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 8px;
}

.rank-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(69, 199, 216, 0.08);
  color: var(--blue);
  font-weight: 900;
  font-size: 11px;
}

.proxy-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
}

.proxy-bar {
  margin-top: 7px;
}

.proxy-score {
  text-align: right;
  font-size: 19px;
  font-weight: 900;
}

.fx-box {
  display: grid;
  gap: 8px;
}

.fx-main {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.fx-main strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
}

.fx-main .change {
  margin-top: 6px;
  text-align: left;
  font-size: 16px;
}

.fx-chart-wrap {
  min-width: 0;
}

.range-tabs,
.year-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.range-tabs {
  margin-bottom: 6px;
}

.range-tabs button,
.year-tabs button {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.range-tabs button {
  min-width: 42px;
  height: 24px;
}

.year-tabs {
  max-width: 650px;
}

.year-tabs button {
  min-width: 50px;
  height: 28px;
}

.range-tabs button.active,
.year-tabs button.active {
  border-color: var(--blue);
  color: #061113;
  background: var(--blue);
}

.fx-chart,
.annual-chart {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    rgba(7, 11, 12, 0.42);
  background-size: 28px 28px, 28px 28px, 100% 100%;
}

.fx-chart {
  height: 104px;
}

.fx-chart text,
.annual-chart text {
  fill: var(--muted) !important;
}

.fx-chart line,
.annual-chart line {
  stroke: rgba(142, 155, 152, 0.34) !important;
}

.fx-chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.fx-note {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.us-summary {
  padding: 10px;
}

.us-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1;
}

.us-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px 62px;
  align-items: center;
  gap: 7px;
  min-height: 39px;
  padding: 6px 8px;
}

.us-row .price {
  font-size: 14px;
}

.us-row .change {
  font-size: 12px;
}

.annual-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.annual-chart-wrap {
  padding: 12px;
  min-height: 0;
}

.annual-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 800;
}

.legend-pill.status-real {
  color: var(--red);
  border-color: rgba(255, 93, 104, 0.35);
}

.legend-pill.status-partial,
.legend-pill.status-unavailable {
  color: var(--amber);
  border-color: rgba(242, 189, 87, 0.35);
}

.annual-source-detail {
  flex-basis: 100%;
  justify-content: flex-start;
  border-radius: 6px;
  line-height: 1.45;
  white-space: normal;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.annual-chart-shell {
  min-height: 310px;
}

.annual-chart {
  height: 310px;
}

.monthly-board {
  overflow: hidden;
}

.monthly-head,
.monthly-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.monthly-head {
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(69, 199, 216, 0.075);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 900;
}

.monthly-rows {
  display: grid;
}

.monthly-row {
  min-height: 42px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}

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

.month-label {
  color: var(--ink);
  font-weight: 900;
}

.theme-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 32%;
  min-width: 126px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
}

.theme-chip span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px 0;
  font-size: 11px;
}

@media (max-width: 1280px) {
  body {
    min-width: 980px;
  }

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

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

  .panel {
    grid-column: span 3;
  }

  .wide,
  .dashboard > .panel:nth-child(11) {
    grid-column: span 6;
  }
}
