:root {
  color-scheme: light;
  --bg: #d8cdb7;
  --paper: #f6ecd9;
  --paper-light: #fff7e8;
  --paper-deep: #eadcc2;
  --ink: #191713;
  --ink-soft: #3c352c;
  --muted: #746956;
  --rule: #2b261f;
  --hairline: rgba(43, 38, 31, 0.24);
  --red: #a82922;
  --green: #17674a;
  --blue: #214b73;
  --gold: #8a581d;
  --amber: #87580e;
  --radius: 4px;
  --shadow: 10px 12px 0 rgba(25, 23, 19, 0.18), 0 28px 58px rgba(25, 23, 19, 0.16);
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='4' seed='18'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 .28'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23paper)' opacity='.58'/%3E%3C/svg%3E");
  --fiber-lines: repeating-linear-gradient(96deg, rgba(86, 65, 38, 0.035) 0 1px, transparent 1px 9px);
  --font-title: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", SimSun, serif;
  --font-body: "FangSong", "仿宋", "Songti SC", "STSong", SimSun, serif;
  --font-number: Georgia, "Times New Roman", "Songti SC", "STSong", SimSun, serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-snap-type: y mandatory;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    var(--paper-grain),
    repeating-linear-gradient(0deg, rgba(25, 23, 19, 0.035) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 28% 14%, rgba(255, 247, 232, 0.44), transparent 32%),
    linear-gradient(180deg, #e7dbc4 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 24%, rgba(111, 75, 38, 0.16), transparent 24%),
    radial-gradient(circle at 84% 72%, rgba(255, 247, 225, 0.22), transparent 28%),
    var(--fiber-lines);
  content: "";
  opacity: 0.72;
  pointer-events: none;
}

h1,
h2,
h3,
p,
dl,
dd,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

.snap-deck {
  width: 100%;
}

.snap-card {
  display: grid;
  min-height: 100svh;
  padding: 30px 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.card-frame {
  position: relative;
  width: min(1180px, calc(100% - 46px));
  height: calc(100svh - 60px);
  margin: auto;
  overflow: hidden;
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  outline: 1px solid var(--rule);
  outline-offset: -9px;
  background:
    var(--paper-grain),
    repeating-linear-gradient(90deg, rgba(25, 23, 19, 0.025) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 18% 22%, rgba(145, 96, 42, 0.13), transparent 30%),
    radial-gradient(circle at 82% 78%, rgba(255, 249, 231, 0.4), transparent 34%),
    linear-gradient(180deg, var(--paper-light), var(--paper));
  box-shadow:
    inset 0 0 0 1px rgba(255, 249, 231, 0.62),
    inset 0 0 48px rgba(87, 62, 32, 0.1),
    var(--shadow);
}

.card-frame::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(25, 23, 19, 0.09), transparent 2.5%, transparent 96.5%, rgba(25, 23, 19, 0.07)),
    linear-gradient(180deg, rgba(255, 250, 236, 0.38), transparent 26%, rgba(84, 58, 29, 0.07)),
    repeating-linear-gradient(0deg, rgba(25, 23, 19, 0.035) 0 1px, transparent 1px 4px),
    var(--fiber-lines);
  content: "";
  mix-blend-mode: multiply;
  opacity: 0.7;
  pointer-events: none;
}

.card-frame::after {
  position: absolute;
  inset: 12px;
  z-index: 1;
  border: 1px solid rgba(43, 38, 31, 0.2);
  background:
    radial-gradient(circle at 16% 22%, rgba(43, 38, 31, 0.07) 0 1px, transparent 1px 9px),
    radial-gradient(circle at 72% 64%, rgba(43, 38, 31, 0.05) 0 1px, transparent 1px 11px);
  content: "";
  mix-blend-mode: multiply;
  opacity: 0.42;
  pointer-events: none;
}

.card-frame > * {
  position: relative;
  z-index: 2;
}

.market-frame {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.72fr);
  grid-template-rows: 1fr auto;
}

.market-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 48px 48px 44px;
}

.kicker {
  display: inline-flex;
  width: fit-content;
  border-top: 2px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 5px 0 4px;
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.25;
}

h1 {
  max-width: 8em;
  margin-top: 20px;
  font-family: var(--font-title);
  font-size: 82px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.92;
  text-shadow: 0.7px 0 var(--ink), 0 0.7px rgba(25, 23, 19, 0.22);
}

h2 {
  font-family: var(--font-title);
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.95;
  text-shadow: 0.45px 0 var(--ink), 0 0.45px rgba(25, 23, 19, 0.18);
}

.market-note {
  max-width: 36em;
  margin-top: 22px;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.85;
}

.market-width {
  width: min(100%, 540px);
  margin-top: 32px;
}

.market-track {
  display: flex;
  height: 13px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
}

.market-track span {
  display: block;
  height: 100%;
}

.market-up {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0 3px, transparent 3px 6px),
    var(--red);
}

.market-down {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 3px, transparent 3px 6px),
    var(--green);
}

.width-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--font-number);
  font-size: 11px;
  line-height: 1.4;
}

.market-metrics,
.price-block,
.stock-metrics {
  display: grid;
  gap: 12px;
}

.market-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 640px);
  margin-top: 34px;
}

.metric {
  min-width: 0;
  border-top: 2px solid var(--rule);
  padding-top: 10px;
}

.metric dt {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.35;
}

.metric dd {
  overflow: hidden;
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric small {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-side {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  border-left: 2px solid var(--rule);
  background:
    var(--paper-grain),
    repeating-linear-gradient(0deg, rgba(43, 38, 31, 0.03) 0 1px, transparent 1px 7px),
    rgba(234, 220, 194, 0.66);
  background-blend-mode: multiply, normal, normal;
}

.panel {
  min-width: 0;
  padding: 34px 34px 30px;
}

.panel + .panel {
  border-top: 2px solid var(--rule);
}

.panel h2 {
  border-bottom: 4px double var(--rule);
  padding-bottom: 10px;
  font-size: 28px;
  line-height: 1.12;
}

.news-list {
  display: grid;
  gap: 15px;
  margin-top: 22px;
}

.news-list li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.78;
}

.news-list li::before {
  position: absolute;
  top: 11px;
  left: 0;
  width: 6px;
  height: 6px;
  border: 1px solid var(--rule);
  background: var(--gold);
  content: "";
}

.sector-list {
  display: grid;
  margin-top: 20px;
}

.sector-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 45px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
}

.sector-row:first-child {
  border-top: 1px solid var(--hairline);
}

.sector-row span {
  color: var(--gold);
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 850;
}

.sector-row strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-row em {
  font-family: var(--font-number);
  font-size: 13px;
  font-style: normal;
  font-weight: 820;
}

.source-note {
  grid-column: 1 / -1;
  overflow: hidden;
  border-top: 2px solid var(--rule);
  padding: 14px 48px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-frame {
  display: grid;
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 1fr);
}

.stock-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
}

.stock-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
}

.stock-title h2 {
  overflow-wrap: anywhere;
}

.stock-title p {
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

.rank {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 58px;
  height: 42px;
  border: 2px solid var(--rule);
  background: var(--paper-deep);
  color: var(--gold);
  font-family: var(--font-number);
  font-size: 15px;
  font-weight: 860;
}

.price-block {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 40px;
}

.price-block .metric dd {
  font-size: 26px;
}

.signal-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}

.signal-strip strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-strip span {
  flex: 0 0 auto;
  color: var(--blue);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 850;
}

.stock-reason {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.86;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.has-stock-news .stock-reason {
  -webkit-line-clamp: 2;
}

.stock-news {
  min-width: 0;
  margin-top: 24px;
  border-top: 1px solid var(--rule);
  padding-top: 15px;
}

.stock-news-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.stock-news h3 {
  color: var(--ink);
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
}

.stock-news ul {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.stock-news li {
  min-width: 0;
}

.stock-news a,
.stock-news strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.46;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stock-news a:hover {
  color: var(--red);
}

.stock-news small,
.stock-news p {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.chart-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  border-left: 2px solid var(--rule);
  background:
    var(--paper-grain),
    repeating-linear-gradient(90deg, rgba(25, 23, 19, 0.032) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(0deg, rgba(25, 23, 19, 0.032) 0 1px, transparent 1px 36px),
    rgba(255, 247, 232, 0.52);
  background-blend-mode: multiply, normal, normal, normal;
  padding: 34px;
}

.kline {
  display: block;
  align-self: center;
  width: 100%;
  max-height: 100%;
  border-bottom: 1px solid var(--rule);
}

.chart-grid-line {
  stroke: rgba(43, 38, 31, 0.2);
  stroke-width: 1;
}

.candle line {
  stroke-width: 1.2;
}

.candle rect {
  stroke-width: 1;
}

.up-candle line,
.up-candle rect {
  stroke: var(--red);
  fill: var(--red);
}

.down-candle line,
.down-candle rect {
  stroke: var(--green);
  fill: var(--green);
}

.ma {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ma5 {
  stroke: var(--gold);
  stroke-width: 1.55;
}

.ma20 {
  stroke: var(--blue);
  stroke-width: 1.45;
}

.chart-label {
  fill: var(--muted);
  font-family: var(--font-number);
  font-size: 11px;
}

.chart-price {
  fill: var(--ink);
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 780;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
}

.stock-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--rule);
  padding-top: 16px;
}

.stock-metrics .metric {
  border-top: 0;
  padding-top: 0;
}

.stock-metrics .metric dd {
  font-size: 16px;
}

.up {
  color: var(--red) !important;
}

.down {
  color: var(--green) !important;
}

@media (max-width: 980px) {
  .snap-card {
    padding: 18px 0;
  }

  .card-frame {
    width: calc(100% - 28px);
    height: calc(100svh - 36px);
    outline-offset: -7px;
  }

  .market-frame,
  .stock-frame {
    grid-template-columns: 1fr;
  }

  .market-frame {
    grid-template-rows: auto 1fr auto;
  }

  .market-main,
  .stock-copy {
    padding: 28px;
  }

  .market-side,
  .chart-pane {
    border-top: 2px solid var(--rule);
    border-left: 0;
  }

  h1 {
    font-size: 56px;
  }

  h2 {
    font-size: 46px;
  }

  .market-note {
    margin-top: 15px;
    padding-top: 12px;
    font-size: 15px;
    line-height: 1.65;
  }

  .market-width,
  .market-metrics,
  .price-block {
    margin-top: 22px;
  }

  .panel {
    padding: 22px 28px;
  }

  .stock-frame {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .chart-pane {
    padding: 22px 28px;
  }

  .stock-reason {
    -webkit-line-clamp: 2;
  }

  .stock-news {
    margin-top: 16px;
    padding-top: 12px;
  }

  .stock-news li:nth-child(n + 3) {
    display: none;
  }

  .stock-news a,
  .stock-news strong {
    font-size: 13px;
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 640px) {
  .snap-card {
    padding: 9px 0;
  }

  .card-frame {
    width: calc(100% - 18px);
    height: calc(100svh - 18px);
    border-width: 1px;
    outline-offset: -5px;
  }

  .market-main,
  .stock-copy {
    padding: 17px;
  }

  .kicker {
    font-size: 10px;
    padding: 4px 0 3px;
  }

  h1 {
    margin-top: 10px;
    font-size: 40px;
  }

  h2 {
    font-size: 34px;
  }

  .market-note {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 10px;
    padding-top: 9px;
    font-size: 13px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .market-width {
    margin-top: 14px;
  }

  .market-track {
    height: 10px;
  }

  .market-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
  }

  .metric {
    padding-top: 7px;
  }

  .metric dt,
  .width-labels {
    font-size: 10px;
  }

  .metric dd {
    margin-top: 4px;
    font-size: 14px;
  }

  .metric small {
    display: none;
  }

  .panel {
    padding: 13px 17px;
  }

  .panel h2 {
    padding-bottom: 7px;
    font-size: 18px;
  }

  .news-list {
    gap: 8px;
    margin-top: 10px;
  }

  .news-list li {
    display: -webkit-box;
    overflow: hidden;
    padding-left: 13px;
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .news-list li::before {
    top: 7px;
    width: 5px;
    height: 5px;
  }

  .sector-list {
    margin-top: 9px;
  }

  .sector-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 30px;
  }

  .sector-row strong,
  .sector-row em {
    font-size: 12px;
  }

  .source-note {
    padding: 8px 17px;
    font-size: 10px;
  }

  .stock-title {
    gap: 12px;
    margin-top: 10px;
  }

  .stock-title p {
    margin-top: 7px;
    font-size: 12px;
  }

  .rank {
    min-width: 44px;
    height: 32px;
    font-size: 12px;
  }

  .price-block {
    gap: 10px;
    margin-top: 17px;
  }

  .price-block .metric dd {
    font-size: 18px;
  }

  .signal-strip {
    margin-top: 15px;
    padding: 9px 0;
  }

  .signal-strip strong {
    font-size: 14px;
  }

  .signal-strip span {
    font-size: 11px;
  }

  .stock-reason {
    margin-top: 11px;
    font-size: 12px;
    line-height: 1.55;
    -webkit-line-clamp: 2;
  }

  .stock-news {
    margin-top: 10px;
    padding-top: 8px;
  }

  .stock-news h3 {
    font-size: 14px;
  }

  .stock-news small,
  .stock-news p {
    font-size: 10px;
  }

  .stock-news ul {
    gap: 6px;
    margin-top: 7px;
  }

  .stock-news a,
  .stock-news strong {
    font-size: 11px;
    line-height: 1.32;
    -webkit-line-clamp: 1;
  }

  .chart-pane {
    padding: 12px 14px 13px;
  }

  .stock-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 10px;
  }

  .stock-metrics .metric dd {
    font-size: 13px;
  }
}
