:root {
  --bg: #f1eadc;
  --paper: #fbf6ea;
  --paper-2: #eee5d5;
  --ink: #101010;
  --muted: #5c574e;
  --faint: #d8cfbd;
  --accent: #24c786;
  --danger: #bc3b2d;
  --warn: #d99520;
  --blue: #2c6ecb;
  --cyan: #1f8aa0;
  --gray: #8b8178;
  --shadow: 7px 7px 0 var(--ink);
  --font-display: Impact, Haettenschweiler, "Arial Black", "Microsoft YaHei", sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(16, 16, 16, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(36, 199, 134, 0.045) 0 1px, transparent 1px 48px),
    var(--bg);
  color: var(--ink);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

img,
canvas {
  display: block;
}

h1,
h2,
p {
  margin: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 12px 28px;
  border-bottom: 5px solid var(--ink);
  background: rgba(241, 234, 220, 0.96);
  backdrop-filter: blur(10px);
}

.brand-lockup {
  display: grid;
  grid-template-columns: 46px minmax(0, auto);
  gap: 10px;
  align-items: center;
  width: max-content;
  max-width: 100%;
  color: var(--ink);
  text-decoration: none;
}

.brand-lockup img {
  width: 46px;
  height: 46px;
  border: 4px solid var(--ink);
  background: #fff;
  object-fit: cover;
  transform: rotate(-2deg);
}

.brand-lockup strong,
.brand-lockup em {
  display: block;
  overflow-wrap: anywhere;
}

.brand-lockup strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
}

.brand-lockup em {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.top-actions {
  display: grid;
  grid-auto-flow: column;
  gap: 10px;
  align-items: center;
}

.paper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 4px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-weight: 1000;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}

.paper-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.paper-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.paper-btn.is-live {
  background: var(--accent);
}

.paper-btn.is-dark {
  background: var(--ink);
  color: var(--paper);
}

.paper-btn.small {
  min-height: 36px;
  padding: 0 12px;
  border-width: 3px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.82rem;
}

.page-shell {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 24px 28px 72px;
}

.hero-grid,
.content-grid,
.archive-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  border: 5px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(16, 16, 16, 0.028) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 16, 16, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px, 24px 24px, auto;
  box-shadow: var(--shadow);
}

.panel-pad {
  padding: 22px;
}

.weather-card {
  grid-column: span 8;
  min-height: 488px;
  overflow: hidden;
}

.broadcast-card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  min-height: 488px;
  background: #070806;
  color: #f5f4e9;
}

.chart-card,
.control-card,
.share-card,
.history-card,
.source-card {
  margin-top: 20px;
}

.chart-card {
  padding: 26px;
}

.control-card {
  grid-column: span 7;
}

.share-card {
  grid-column: span 5;
}

.history-card {
  grid-column: span 8;
}

.source-card {
  grid-column: span 4;
}

.kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 1000;
  line-height: 1.2;
}

.ticker-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 16px 20px;
  border-bottom: 4px solid var(--ink);
}

.ticker-top strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 2.4rem;
  line-height: 1;
}

.weather-main {
  display: grid;
  grid-template-columns: minmax(168px, 248px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 24px 20px 22px;
}

.panda-board {
  position: relative;
  aspect-ratio: 1;
  border: 6px solid var(--ink);
  background: #fff;
  box-shadow: 7px 7px 0 var(--ink);
  transform: rotate(-1.5deg);
}

.panda-board::after {
  content: "链上天气员";
  position: absolute;
  left: 15px;
  bottom: 15px;
  border: 3px solid var(--ink);
  background: var(--accent);
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 1000;
}

.panda-board img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.12);
}

.weather-copy {
  min-width: 0;
}

.state-stamp {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 15px;
  border: 4px solid var(--ink);
  background: var(--gray);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 0 12px;
  font-weight: 1000;
  transform: rotate(-1.5deg);
}

.index-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: end;
}

.big-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 7.5rem;
  font-weight: 1000;
  line-height: 0.78;
}

.index-label {
  border-left: 4px solid var(--ink);
  padding-left: 18px;
}

.index-label span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.index-label strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1;
}

.weather-line {
  margin-top: 13px;
  max-width: 680px;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.weather-subline {
  margin-top: 9px;
  max-width: 720px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ticker-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 4px solid var(--ink);
}

.ticker-strip div {
  min-width: 0;
  padding: 13px 17px;
  border-right: 4px solid var(--ink);
}

.ticker-strip div:last-child {
  border-right: 0;
}

.ticker-strip span {
  display: block;
  font-size: 0.84rem;
  font-weight: 900;
}

.ticker-strip strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 1.75rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.ticker-strip .negative {
  color: var(--danger);
}

.ticker-strip .positive {
  color: var(--accent);
}

.mini-trend-strip {
  padding: 10px 20px 18px;
  border-top: 4px solid var(--ink);
}

.mini-trend-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 1000;
}

.mini-trend-head span {
  color: var(--muted);
  text-align: right;
}

#miniTrendChart {
  width: 100%;
  height: 88px;
  border: 3px solid var(--ink);
  background: #fffdf5;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 3px solid #f5f4e9;
}

.terminal-head span {
  width: 12px;
  height: 12px;
  border: 2px solid #f5f4e9;
  background: var(--accent);
}

.terminal-head span:nth-child(2) {
  background: var(--warn);
}

.terminal-head span:nth-child(3) {
  background: var(--danger);
}

.terminal-head b {
  margin-left: 5px;
  color: #f5f4e9;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.terminal-body {
  display: grid;
  gap: 0;
  padding: 22px 18px 10px;
}

.terminal-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border-bottom: 1px dashed rgba(245, 244, 233, 0.22);
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.terminal-line span {
  color: rgba(245, 244, 233, 0.58);
  font-weight: 800;
}

.terminal-line strong {
  color: #d6ffe9;
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.terminal-insight {
  margin: 8px 18px 14px;
  border: 2px solid rgba(245, 244, 233, 0.9);
  padding: 12px;
}

.terminal-insight p {
  color: rgba(245, 244, 233, 0.58);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 1000;
}

.terminal-insight strong {
  display: block;
  margin-top: 7px;
  color: #f5f4e9;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.stat-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: auto;
  border-top: 3px solid #f5f4e9;
}

.stat-stack div {
  min-width: 0;
  padding: 18px;
}

.stat-stack div + div {
  border-left: 3px solid #f5f4e9;
}

.stat-stack span {
  display: block;
  color: rgba(245, 244, 233, 0.62);
  font-size: 0.82rem;
  font-weight: 900;
}

.stat-stack strong {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 2rem;
  line-height: 1;
}

.stat-stack em {
  display: block;
  margin-top: 8px;
  color: rgba(245, 244, 233, 0.7);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.35;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.section-head.compact {
  align-items: start;
}

h2 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
}

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

.range-btn {
  min-height: 36px;
  min-width: 66px;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.86rem;
  font-weight: 1000;
}

.range-btn.is-active {
  background: var(--accent);
}

.chart-wrap {
  position: relative;
  border: 5px solid var(--ink);
  background: #fffdf5;
  overflow: hidden;
}

#weatherChart {
  width: 100%;
  height: 372px;
}

.chart-tip {
  position: absolute;
  z-index: 5;
  width: min(260px, calc(100% - 24px));
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 12px;
  pointer-events: none;
}

.chart-tip b,
.chart-tip strong,
.chart-tip span {
  display: block;
}

.chart-tip strong {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 1.18rem;
}

.chart-tip span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.legend-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.legend-item,
.mini-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 2px solid var(--ink);
  background: #fffdf5;
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: 1000;
}

.legend-item i,
.mini-state::before {
  width: 12px;
  height: 12px;
  border: 1px solid var(--ink);
  content: "";
  flex: 0 0 auto;
}

.component-list {
  display: grid;
  gap: 12px;
}

.component-card {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.3fr) 84px;
  gap: 12px;
  align-items: center;
  border: 4px solid var(--ink);
  background: #fffdf5;
  padding: 13px;
}

.component-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1;
}

.component-card p,
.component-card small {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.component-card small {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-weight: 800;
}

.component-meter {
  min-width: 0;
}

.bar {
  height: 16px;
  border: 3px solid var(--ink);
  background: var(--paper-2);
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.component-score {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 1000;
}

#shareCanvas {
  width: 100%;
  height: auto;
  border: 4px solid var(--ink);
  background: var(--paper);
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.table-shell {
  border: 4px solid var(--ink);
  background: #fffdf5;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

th,
td {
  border-bottom: 2px solid var(--ink);
  padding: 10px;
  text-align: right;
  white-space: nowrap;
}

th {
  background: var(--ink);
  color: #f5f4e9;
}

th:first-child,
td:first-child,
th:nth-child(3),
td:nth-child(3) {
  text-align: left;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.is-active {
  background: #d5f4e4;
}

.mini-state {
  padding: 4px 7px;
}

.source-list {
  display: grid;
  gap: 12px;
}

.source-item {
  border: 4px solid var(--ink);
  background: #fffdf5;
  padding: 12px;
}

.source-item strong {
  display: block;
  font-size: 1rem;
  line-height: 1.25;
}

.source-item p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.source-item a {
  display: inline-block;
  max-width: 100%;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.method-note {
  margin-top: 14px;
  border: 3px solid var(--ink);
  background: var(--paper-2);
  padding: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.55;
}

.frozen {
  background: var(--gray);
}

.low-liquidity {
  background: var(--warn);
}

.tradable {
  background: var(--accent);
}

.risk-recovery {
  background: var(--cyan);
}

.strong-speculation {
  background: var(--blue);
}

.overheated {
  background: var(--danger);
}

@media (max-width: 1180px) {
  .weather-card,
  .broadcast-card,
  .control-card,
  .share-card,
  .history-card,
  .source-card {
    grid-column: 1 / -1;
  }

  .broadcast-card {
    min-height: auto;
  }

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

@media (max-width: 760px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .brand-lockup {
    width: 100%;
  }

  .brand-lockup strong {
    font-size: 1.25rem;
  }

  .brand-lockup em {
    font-size: 0.7rem;
  }

  .top-actions {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 9px;
  }

  .paper-btn {
    flex: 1 1 calc(50% - 5px);
    width: auto;
    max-width: calc(50% - 5px);
    min-width: 0;
    min-height: 42px;
    padding: 0 8px;
    font-size: 0.88rem;
  }

  .page-shell {
    padding: 12px 10px 48px;
  }

  .hero-grid,
  .content-grid,
  .archive-grid {
    gap: 14px;
  }

  .panel {
    border-width: 4px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .panel-pad,
  .chart-card {
    padding: 14px;
  }

  .weather-card {
    min-height: auto;
  }

  .ticker-top {
    padding: 12px;
  }

  .ticker-top strong {
    font-size: 1.6rem;
  }

  .weather-main {
    grid-template-columns: minmax(108px, 32vw) minmax(0, 1fr);
    gap: 12px;
    padding: 14px 12px 16px;
  }

  .panda-board {
    border-width: 4px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .panda-board::after {
    left: 8px;
    bottom: 8px;
    border-width: 2px;
    padding: 5px 6px;
    font-size: 0.62rem;
  }

  .index-line {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .big-index {
    font-size: 4.6rem;
  }

  .index-label {
    border-left: 0;
    border-top: 3px solid var(--ink);
    padding-top: 8px;
    padding-left: 0;
  }

  .index-label strong {
    font-size: 1.8rem;
  }

  .state-stamp {
    min-height: 30px;
    margin-bottom: 8px;
    border-width: 3px;
    padding: 0 8px;
    font-size: 0.8rem;
  }

  .weather-line {
    margin-top: 9px;
    font-size: 1.48rem;
    line-height: 1.1;
  }

  .weather-subline {
    font-size: 0.82rem;
    line-height: 1.4;
  }

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

  .ticker-strip div {
    border-bottom: 4px solid var(--ink);
    padding: 10px 12px;
  }

  .ticker-strip div:nth-child(2n) {
    border-right: 0;
  }

  .ticker-strip div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .ticker-strip strong {
    font-size: 1.35rem;
  }

  .mini-trend-strip {
    padding: 8px 10px 10px;
  }

  .mini-trend-head {
    font-size: 0.65rem;
  }

  #miniTrendChart {
    height: 74px;
  }

  .terminal-line {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    font-size: 0.86rem;
  }

  .terminal-body {
    padding: 14px 16px 6px;
  }

  .stat-stack {
    grid-template-columns: 1fr;
  }

  .stat-stack div + div {
    border-top: 3px solid #f5f4e9;
    border-left: 0;
  }

  h2 {
    font-size: 2rem;
  }

  .section-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .range-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .range-btn {
    width: 100%;
    min-width: 0;
  }

  #weatherChart {
    height: 300px;
  }

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

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

  .component-score {
    justify-self: start;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
    font-size: 0.78rem;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 3px solid var(--ink);
    padding: 8px 0;
  }

  td {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
    border-bottom: 1px dashed var(--faint);
    padding: 7px 10px;
    text-align: left;
    white-space: normal;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 1000;
  }

  .source-item a {
    font-size: 0.68rem;
  }
}

@media (max-width: 430px) {
  .weather-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .panda-board {
    width: min(168px, 58vw);
  }

  .big-index {
    font-size: 4rem;
  }

  .index-label strong {
    font-size: 1.55rem;
  }

  .weather-line {
    font-size: 1.34rem;
  }

  .ticker-strip span {
    font-size: 0.72rem;
  }

  .ticker-strip strong {
    font-size: 1.18rem;
  }

  .legend-row,
  .range-tabs {
    grid-template-columns: 1fr;
  }
}
