:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #090a0b;
  --panel-alt: #0d1115;
  --line: #29291e;
  --line-soft: #1a1c1c;
  --text: #edf0e8;
  --muted: #8190a0;
  --yellow: #f1e64d;
  --red: #ff4058;
  --cyan: #00d3e8;
  --green: #20bf77;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", monospace;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", var(--sans); font-size: 15px; }
button, a { font: inherit; }

.sector-topbar {
  position: sticky; top: 0; z-index: 10; height: 72px; padding: 0 32px;
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 28px;
  border-bottom: 1px solid #34331b; background: rgba(0, 0, 0, .96); backdrop-filter: blur(14px);
}
.sector-brand { display: flex; align-items: baseline; gap: 16px; color: var(--text); text-decoration: none; }
.sector-brand span { color: var(--yellow); font: 700 14px/1 "Stork Chinese Kai", "Stork Chinese Kai Fallback", var(--mono); letter-spacing: .18em; }
.sector-brand strong { font-size: 18px; }
.sector-topbar-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 12px rgba(241,230,77,.7); }
.status-dot.delayed { background: #d6993d; }
.status-dot.error { background: var(--red); }
.back-link { color: var(--yellow); text-decoration: none; border: 1px solid #454220; border-radius: 7px; padding: 9px 13px; font-size: 13px; font-weight: 700; }

.sector-shell { padding: 32px; max-width: 1900px; margin: 0 auto; }
.sector-hero { display: grid; grid-template-columns: minmax(420px, .9fr) 1.1fr; gap: 42px; align-items: end; margin-bottom: 24px; }
.eyebrow { margin: 0 0 12px; color: var(--yellow); font: 800 14px/1 "Stork Chinese Kai", "Stork Chinese Kai Fallback", var(--mono); letter-spacing: .16em; }
.eyebrow span { display: inline-block; width: 30px; height: 2px; margin-right: 10px; vertical-align: middle; background: var(--yellow); }
.sector-hero h1 { margin: 0; color: var(--yellow); font-size: calc(clamp(28px, 3.2vw, 44px) + 2px); letter-spacing: -.04em; }
.sector-hero p:not(.eyebrow) { max-width: 760px; margin: 16px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.hero-metrics { margin: 0; padding: 18px 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.hero-metrics div { padding: 2px 24px; border-left: 1px solid var(--line-soft); }
.hero-metrics div:first-child { border-left: 0; }
.hero-metrics dt { color: var(--muted); font-size: 14px; }
.hero-metrics dd { margin: 9px 0 0; color: var(--text); font: 700 18px/1.2 "Stork Chinese Kai", "Stork Chinese Kai Fallback", var(--mono); }

.panel { overflow: hidden; margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.panel-head { min-height: 76px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.panel-head.compact { min-height: 68px; }
.panel-head > div:first-child { display: flex; align-items: center; gap: 14px; }
.panel-index { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid #6b2e36; border-radius: 7px; color: var(--red); font: 800 13px/1 "Stork Chinese Kai", "Stork Chinese Kai Fallback", var(--mono); }
.panel h2 { margin: 0; font-size: 19px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.segmented { display: flex; border: 1px solid #3c3a20; border-radius: 7px; overflow: hidden; }
.segmented button { padding: 9px 14px; border: 0; border-left: 1px solid #2b2a1c; background: #050505; color: var(--muted); font-size: 13px; cursor: pointer; }
.segmented button:first-child { border-left: 0; }
.segmented button.active { background: #25230c; color: var(--yellow); box-shadow: inset 0 -2px var(--yellow); }
.chart-stage { position: relative; background: #020303; }
.chart-stage canvas { display: block; width: 100%; height: 100%; }
.live-chart-stage { height: 430px; }
.sankey-stage { height: 490px; }
.panel-foot { min-height: 43px; padding: 11px 18px; display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 14px; }
.panel-foot strong, .panel-foot.warning { color: #d9b456; }
.empty-state { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; color: var(--muted); font-size: 14px; text-align: center; }

.fund-card-grid { min-height: 400px; padding: 16px; display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 10px; }
.fund-card { min-height: 152px; padding: 14px 14px 9px; border: 1px solid var(--line-soft); border-radius: 9px; background: linear-gradient(180deg, #0b0d0e, #050606); }
.fund-card.positive { background: linear-gradient(180deg, rgba(255,64,88,.08), #050606 75%); }
.fund-card.negative { background: linear-gradient(180deg, rgba(0,211,232,.07), #050606 75%); }
.fund-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.fund-card h3 { margin: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fund-card strong { font: 800 15px/1 "Stork Chinese Kai", "Stork Chinese Kai Fallback", var(--mono); white-space: nowrap; }
.positive-value { color: var(--red) !important; }
.negative-value { color: var(--cyan) !important; }
.fund-card canvas { display: block; width: 100%; height: 76px; margin-top: 7px; }
.fund-card footer { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

.analysis-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 20px; }
.ranking-scroll { height: 533px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; z-index: 1; padding: 11px 13px; background: #10110f; color: #c9bf4e; font-size: 13px; text-align: right; }
th:nth-child(1), th:nth-child(2) { text-align: left; }
td { padding: 13px; border-top: 1px solid var(--line-soft); text-align: right; font: 600 14px/1.2 "Stork Chinese Kai", "Stork Chinese Kai Fallback", var(--mono); }
td:nth-child(1), td:nth-child(2) { text-align: left; }
td:nth-child(2) { color: #efe9bd; font-family: "Stork Chinese Kai", "Stork Chinese Kai Fallback", var(--sans); font-weight: 700; }

.truth-strip { margin: 20px 0 8px; padding: 15px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; border: 1px solid #3b391e; border-radius: 9px; color: var(--muted); font-size: 14px; }
.truth-strip strong { color: var(--yellow); }
.truth-strip b { color: var(--text); }
.truth-strip code { color: #b8c9d5; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px 2px 36px; color: var(--muted); font-size: 12px; }
.site-footer strong { color: var(--yellow); letter-spacing: .1em; }
.site-footer .icp-record-link { color: inherit; text-decoration: none; white-space: nowrap; }
.site-footer .icp-record-link:hover, .site-footer .icp-record-link:focus-visible { color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1380px) {
  .fund-card-grid { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
  .analysis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .sector-topbar { height: auto; min-height: 64px; padding: 12px 16px; gap: 12px; }
  .sector-brand { flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
  .sector-shell { padding: 20px 16px; }
  .sector-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .fund-card-grid { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
  .panel-head, .panel-foot, .site-footer { flex-wrap: wrap; }
  .analysis-grid > *, .hero-metrics > * { min-width: 0; }
}
