:root {
  --ink: #121823;
  --muted: #5d6878;
  --paper: #f6f4ee;
  --surface: rgba(255, 255, 250, 0.84);
  --surface-strong: rgba(255, 255, 250, 0.96);
  --line: rgba(18, 24, 35, 0.14);
  --line-strong: rgba(18, 24, 35, 0.24);
  --green: #2c6d54;
  --blue: #255f87;
  --amber: #9b641f;
  --red: #92323d;
  --violet: #5b568a;
  --olive: #687145;
  --shadow: 0 18px 54px rgba(18, 24, 35, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(37, 95, 135, 0.09), transparent 31%),
    linear-gradient(180deg, rgba(44, 109, 84, 0.08), transparent 42%),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.08;
}

.btc-shell {
  display: grid;
  gap: 20px;
  width: min(1480px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 30px 26px 52px;
}

.btc-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.btc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 24px;
}

.btc-nav a,
.btc-thesis button,
.control-actions button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 250, 0.72);
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 760;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.btc-nav a:hover,
.btc-nav a:focus-visible,
.btc-thesis button:hover,
.btc-thesis button:focus-visible,
.control-actions button:hover,
.control-actions button:focus-visible {
  border-color: rgba(37, 95, 135, 0.34);
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.btc-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 330px);
  gap: 18px;
  align-items: end;
}

.btc-title-row > * {
  min-width: 0;
}

.btc-kicker,
.panel-kicker {
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  font-size: 3.25rem;
  overflow-wrap: anywhere;
}

h2 {
  margin: 7px 0 0;
  font-size: 1.5rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.btc-now,
.btc-thesis,
.live-data-panel,
.signal-panel,
.map-panel,
.control-panel,
.scenario-card,
.matrix-panel,
.watchlist-panel,
.allocation-panel,
.decision-context-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 250, 0.96), rgba(255, 255, 250, 0.74)),
    var(--surface);
  box-shadow: var(--shadow);
}

.btc-now {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
}

.btc-now span,
.btc-thesis span,
.price-levels span,
.scenario-card span,
.allocation-list dt,
.watchlist-item span,
.control-field span,
.select-field span,
.score-copy span,
.dimension-card span,
.dimension-card small,
.matrix-table strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.btc-now strong {
  color: var(--green);
  font-size: 1.55rem;
  overflow-wrap: anywhere;
}

.btc-thesis {
  display: grid;
  grid-template-columns: minmax(210px, 0.45fr) minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  margin-top: 20px;
  padding: 16px;
}

.btc-thesis div {
  display: grid;
  gap: 4px;
}

.btc-thesis strong {
  color: var(--amber);
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.btc-thesis p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 620;
  line-height: 1.65;
}

.btc-refresh-stack {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.btc-thesis button,
.control-actions button {
  background: #1d2735;
  color: #fffdf7;
  font-weight: 820;
  line-height: 1;
  text-indent: 0;
}

.btc-refresh-stack span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  white-space: nowrap;
}

.live-data-panel {
  padding: 16px;
}

.live-data-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.live-data-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.live-data-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.live-data-card {
  min-width: 0;
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.live-data-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.live-data-card strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.live-data-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.live-data-card p[data-tone="up"] {
  color: var(--green);
}

.live-data-card p[data-tone="down"] {
  color: var(--red);
}

.live-data-card p[data-tone="flat"] {
  color: var(--muted);
}

.btc-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(420px, 1.22fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.signal-panel,
.map-panel,
.control-panel,
.matrix-panel,
.watchlist-panel,
.allocation-panel {
  padding: 18px;
}

.control-panel {
  position: sticky;
  top: 18px;
}

.panel-head {
  display: grid;
  gap: 3px;
}

.score-stage {
  position: relative;
  display: grid;
  min-height: 188px;
  margin-top: 14px;
  place-items: center;
}

.score-stage canvas {
  width: 100%;
  max-width: 320px;
  height: 180px;
}

.score-copy {
  position: absolute;
  bottom: 21px;
  left: 50%;
  display: grid;
  width: min(220px, 82%);
  transform: translateX(-50%);
  text-align: center;
}

.score-copy strong {
  font-size: 2rem;
}

.score-copy p {
  margin: 0;
}

.score-summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
}

.dimension-grid {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.dimension-card {
  display: grid;
  grid-template-columns: minmax(78px, 0.35fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.dimension-card strong {
  color: var(--ink);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.dimension-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.dimension-card i {
  display: block;
  width: 54px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}

.dimension-card i::after {
  display: block;
  width: var(--bar, 50%);
  height: 100%;
  border-radius: inherit;
  content: "";
  background: var(--tone, var(--blue));
}

.map-panel {
  min-width: 0;
}

.map-panel canvas {
  display: block;
  width: 100%;
  height: 330px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.price-levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.price-levels article {
  min-width: 0;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.price-levels strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.price-levels p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.price-levels article:nth-child(2) strong,
.price-levels article:nth-child(3) strong {
  color: var(--green);
}

.price-levels article:nth-child(4) strong {
  color: var(--olive);
}

.price-levels article:nth-child(5) strong,
.price-levels article:nth-child(6) strong {
  color: var(--amber);
}

.price-levels article:nth-child(8) strong {
  color: var(--green);
}

.price-levels article:nth-child(9) strong {
  color: var(--red);
}

.monitor-form {
  display: grid;
  gap: 15px;
  margin-top: 16px;
}

.metric-source-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
  line-height: 1.45;
}

.control-field,
.select-field {
  display: grid;
  gap: 7px;
}

.control-field {
  grid-template-columns: minmax(88px, 1fr) minmax(120px, 1.3fr) minmax(54px, auto);
  align-items: center;
}

.metric-sparkline {
  grid-column: 1 / -1;
  width: 100%;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.32)),
    rgba(255, 255, 255, 0.42);
}

.control-field input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.control-field strong {
  justify-self: end;
  color: var(--ink);
  font-size: 0.88rem;
}

.select-field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
}

.select-field select:focus,
.control-field input:focus {
  outline: 3px solid rgba(37, 95, 135, 0.14);
}

.control-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.scenario-card {
  min-height: 150px;
  padding: 18px;
}

.scenario-card h3 {
  margin-top: 9px;
  font-size: 1.35rem;
}

.scenario-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 610;
  line-height: 1.65;
}

.scenario-card[data-scenario="base"] span {
  color: var(--blue);
}

.scenario-card[data-scenario="bull"] span {
  color: var(--green);
}

.scenario-card[data-scenario="bear"] span {
  color: var(--red);
}

.matrix-table {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.matrix-table [role="row"] {
  display: grid;
  grid-template-columns: minmax(128px, 0.55fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.matrix-table [role="row"] > * {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 0.88rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.matrix-table [role="row"]:first-child > * {
  background: rgba(18, 24, 35, 0.05);
}

.matrix-table [data-tone="buy"] span:first-child {
  color: var(--green);
  font-weight: 820;
}

.matrix-table [data-tone="hold"] span:first-child {
  color: var(--blue);
  font-weight: 820;
}

.matrix-table [data-tone="watch"] span:first-child {
  color: var(--amber);
  font-weight: 820;
}

.matrix-table [data-tone="reduce"] span:first-child,
.matrix-table [data-tone="risk"] span:first-child {
  color: var(--red);
  font-weight: 820;
}

.watchlist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.46fr);
  gap: 16px;
  align-items: start;
}

.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.watchlist-item {
  min-height: 134px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.watchlist-item h3 {
  margin-top: 6px;
  font-size: 1rem;
}

.watchlist-item p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.allocation-list {
  display: grid;
  gap: 10px;
  margin: 15px 0 0;
}

.allocation-list div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.allocation-list dd {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.55;
}

.decision-context-slot {
  min-height: 100px;
  padding: 16px;
}

.btc-footer {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

@media (max-width: 1180px) {
  .btc-dashboard,
  .watchlist-layout {
    grid-template-columns: 1fr;
  }

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

  .control-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .btc-shell {
    padding: 20px 14px 38px;
  }

  .btc-title-row,
  .btc-thesis,
  .live-data-head,
  .scenario-grid,
  .price-levels,
  .watchlist-grid {
    grid-template-columns: 1fr;
  }

  .live-data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .btc-refresh-stack {
    justify-items: start;
  }

  h1 {
    font-size: 2.35rem;
  }

  .matrix-table {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .matrix-table [role="row"] {
    min-width: 760px;
  }

  .map-panel canvas {
    height: 260px;
  }
}

@media (max-width: 520px) {
  .btc-nav a {
    flex: 1 1 130px;
  }

  .btc-thesis button,
  .control-actions button {
    width: 100%;
  }

  .live-data-grid {
    grid-template-columns: 1fr;
  }

  .control-field {
    grid-template-columns: 1fr;
  }

  .control-field strong {
    justify-self: start;
  }

  .dimension-card {
    grid-template-columns: 1fr;
  }

  .dimension-card i {
    width: 100%;
  }
}
