[hidden] { display: none !important; }
:root {
  color-scheme: light dark;
  --text: #1d1d1f;
  --text-2: #636366;
  --bg: #f5f5f7;
  --card: #ffffff;
  --tint: #e8e8ea;
  --stroke-2: #1d1d1f12;
  --strong: #1d1d1f;
  --strong-on: #f5f5f7;
  --up: #da2f35;
  --down: #00a665;
  --flat: var(--text-2);
  --fut: #ff4d00;
  --spot: #636366;
  --edge: #1d1d1f3d;
  --shadow: 0 8px 40px #1d1d1f14;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  line-height: 1.3;
}
* { box-sizing: border-box; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --bg: #1d1d1f;
  --card: #2a2a2d;
  --tint: #3a3a3c;
  --stroke-2: #f5f5f712;
  --strong: #f5f5f7;
  --strong-on: #1d1d1f;
  --up: #f1555b;
  --spot: #8e8e93;
  --edge: #f5f5f73d;
}
:root[data-theme="light"] { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }

.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6);
  border-bottom: 1px solid var(--stroke-2);
  padding: calc(14px + env(safe-area-inset-top)) 20px 12px;
}
.top h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.legends { margin-left: auto; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 16px; font-size: 12px; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.tag { font-style: normal; font-size: 10px; font-weight: 500; line-height: 15px; padding: 0 5px; border-radius: 100px; color: #fff; }
.tag.f { background: var(--fut); }
.tag.s { background: var(--spot); }
.views { display: inline-flex; background: var(--tint); border-radius: 100px; padding: 2px; }
.views button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 500; padding: 3px 14px; border-radius: 100px; cursor: pointer; }
.views button.on { background: var(--strong); color: var(--strong-on); }
.theme { border: 0; background: var(--tint); color: var(--text); font: inherit; font-weight: 500; padding: 3px 12px; border-radius: 100px; cursor: pointer; }
.alert { margin-top: 8px; font-size: 13px; background: #fff3e0; background: color-mix(in srgb, var(--fut) 12%, var(--card)); color: var(--text); padding: 6px 12px; border-radius: 12px; }

#board { padding: 16px 20px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); max-width: 1500px; margin: 0 auto; }
.map-wrap { overflow: auto; padding: 16px 20px; -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) { .map-wrap { overflow: hidden; } }
.map-sizer { position: relative; margin: 0 auto; background: var(--card); border-radius: 24px; box-shadow: var(--shadow); }
.map-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; margin: 0; }
.edges { position: absolute; left: 0; top: 0; }
.edges path { fill: none; stroke: var(--edge); stroke-width: 1; }
.node {
  position: absolute; width: 250px; height: 26px; display: grid;
  grid-template-columns: 122px 1fr 58px; align-items: center; column-gap: 6px;
  font-size: 13px; cursor: pointer; transition: background .4s; border-radius: 8px;
}
.node .lb {
  height: 100%; display: flex; align-items: center; justify-content: center; gap: 3px; position: relative;
  background: var(--tint); color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; border-radius: 8px;
}
.node .lb small { font-weight: 400; font-size: 11px; color: var(--text-2); }
.node .lb .tag { position: absolute; right: 0; top: 0; font-size: 8px; line-height: 10px; padding: 0 3px; border-radius: 0 0 0 6px; }
.node .px { text-align: right; font-variant-numeric: tabular-nums; }
.node .chg { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.node:hover .lb { background: var(--strong); color: var(--strong-on); }
.node:hover .lb small { color: inherit; opacity: .7; }
.node.flash-up { background: color-mix(in srgb, var(--up) 14%, transparent); }
.node.flash-down { background: color-mix(in srgb, var(--down) 14%, transparent); }
.group { background: var(--card); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); }
.group h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.tile {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 6px;
  border: 0; border-radius: 16px; padding: 10px 12px;
  background: var(--tint); cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: background .4s;
}
.tile:hover { background: color-mix(in srgb, var(--tint) 100%, var(--text) 6%); }
.tile .nm { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .nm small { font-weight: 400; color: var(--text-2); margin-left: 3px; font-size: 11px; }
.tile .tag { justify-self: end; }
.tile .px { font-size: 18px; font-variant-numeric: tabular-nums; }
.tile .chg { justify-self: end; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tile.flash-up { background: color-mix(in srgb, var(--up) 16%, var(--tint)); }
.tile.flash-down { background: color-mix(in srgb, var(--down) 16%, var(--tint)); }
/* 理论成本：红 = 厂家赚，绿 = 厂家亏（同涨红跌绿） */
.loss { color: var(--down); }
.gain { color: var(--up); }
.pf { font-style: normal; font-size: 10px; font-weight: 600; line-height: 14px; padding: 0 4px; border-radius: 100px; color: #fff; margin-right: 3px; }
.tile .nm .pf { margin: 0 0 0 4px; vertical-align: 1px; }
.pf.loss, .pill.loss { background: var(--down); color: #fff; }
.pf.gain, .pill.gain { background: var(--up); color: #fff; }
.edges path.loss { stroke: var(--down); stroke-width: 1.5; }
.edges path.gain { stroke: var(--up); stroke-width: 1.5; }
.edges path.hl { stroke: #f0a33a; stroke-width: 2.5; }

#profit { padding: 16px 20px; max-width: 1500px; margin: 0 auto; display: grid; gap: 20px; }
.psec h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.pgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.pcard { display: grid; gap: 12px; text-align: left; border: 0; background: var(--card); color: inherit; font: inherit; border-radius: 24px; padding: 16px; box-shadow: var(--shadow); cursor: pointer; }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pc-top .nm { font-size: 17px; font-weight: 600; }
.pc-top .nm small { font-size: 12px; font-weight: 400; color: var(--text-2); margin-left: 6px; }
.pill { font-style: normal; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 100px; white-space: nowrap; }
.pc-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pc-nums small, .cost-head small { display: block; font-size: 12px; color: var(--text-2); }
.pc-nums b { font-size: 18px; font-weight: 400; font-variant-numeric: tabular-nums; }
.gauge { position: relative; height: 6px; border-radius: 100px; background: var(--tint); }
.gauge::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--text-2); }
.gauge span { position: absolute; top: 0; bottom: 0; width: var(--w); border-radius: 100px; }
.gauge.loss span { right: 50%; background: var(--down); }
.gauge.gain span { left: 50%; background: var(--up); }
.pc-foot { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--text-2); }
.pc-foot span { white-space: nowrap; }
.pc-foot .custom { color: var(--fut); }
.cost-tbl .c-fee { width: 90px; text-align: right; font: inherit; font-variant-numeric: tabular-nums; color: var(--text); background: var(--tint); border: 0; border-radius: 8px; padding: 4px 8px; }
.cost-tbl .c-fee-def { color: var(--text-2); }
.fee-reset { border: 0; background: none; color: var(--fut); font: inherit; font-size: 12px; padding: 0 0 0 4px; cursor: pointer; }
.fineprint { font-size: 12px; color: var(--text-2); line-height: 1.6; margin: 0; }

.cost { margin-top: 16px; display: grid; gap: 12px; border-top: 1px solid var(--stroke-2); padding-top: 16px; }
.cost-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cost-head > div { background: var(--tint); border-radius: 12px; padding: 8px 10px; }
.cost-head b { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cost-tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.cost-tbl th { text-align: right; font-weight: 400; color: var(--text-2); padding: 4px 6px; }
.cost-tbl td { text-align: right; padding: 6px; border-top: 1px solid var(--stroke-2); }
.cost-tbl th:first-child, .cost-tbl td:first-child { text-align: left; }
.cost-tbl tr.total td { font-weight: 600; }

.stale .px { opacity: .55; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }

.visits { display: block; margin-top: 4px; }
.foot { font-size: 12px; color: var(--text-2); padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); max-width: 1500px; margin: 0 auto; line-height: 1.6; }
.about-site { margin: 0 0 10px; background: var(--card); border-radius: 14px; padding: 10px 14px; }
.about-site summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.about-site-body { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.about-site-body p { margin: 8px 0 0; }
.about-site-contact { color: var(--text); }
.about-site-contact a { color: var(--fut); text-decoration: none; font-weight: 600; }

.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-mask { position: absolute; inset: 0; background: rgb(0 0 0 / .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow: auto;
  background: var(--card); border-radius: 24px 24px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 760px) {
  .sheet-body { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 720px; border-radius: 24px; box-shadow: var(--shadow); }
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.d-price { margin-top: 6px; }
.d-price b { font-size: 32px; font-weight: 400; font-variant-numeric: tabular-nums; }
.d-price small, .d-sub { color: var(--text-2); font-size: 13px; }
.close { border: 0; background: var(--tint); color: var(--text); width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; }
.ranges { display: flex; gap: 6px; margin: 16px 0 8px; flex-wrap: wrap; }
.ranges button { border: 0; background: var(--tint); color: var(--text); border-radius: 100px; padding: 5px 14px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.ranges button.on { background: var(--strong); color: var(--strong-on); }
.chart { height: 300px; }
.loading { grid-column: 1 / -1; text-align: center; color: var(--text-2); font-size: 13px; padding: 40px 0; }
.stats { margin-top: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: 12px; color: var(--text-2); }
.stats > div { background: var(--tint); border-radius: 12px; padding: 8px 10px; }
.stats b { display: block; color: var(--text); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 2px; }
.legend .pf.loss { margin-left: 8px; }

/* 品种目录只给搜索引擎和读屏读，页面上不占位置 */
.seo-list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 资讯 ---------- */
.views button { position: relative; }
.badge { position: absolute; top: -5px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--up); color: #fff; font-style: normal; font-size: 10px; line-height: 16px; text-align: center; }
#news { padding: 16px 20px; max-width: 1100px; margin: 0 auto; }
.news-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.news-chips button { border: 0; background: var(--tint); color: var(--text); font: inherit; font-size: 13px; padding: 4px 14px; border-radius: 100px; cursor: pointer; }
.news-chips button.on { background: var(--strong); color: var(--strong-on); font-weight: 500; }
.news-list { display: grid; gap: 10px; }
.news-card { background: var(--card); border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; column-gap: 14px; }
.news-card .t { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 2px; white-space: nowrap; }
.news-card h4 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.45; }
.news-card .imp, .d-news-row .imp { display: inline-block; font-size: 11px; font-weight: 600; color: var(--up); background: color-mix(in srgb, var(--up) 16%, transparent); border-radius: 6px; padding: 0 6px; margin-right: 8px; vertical-align: 2px; }
.news-card p { margin: 6px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.news-tag { border: 0; font: inherit; font-size: 12px; background: var(--tint); color: var(--text); border-radius: 8px; padding: 2px 8px; cursor: pointer; }
.news-tag b { font-weight: 500; margin-left: 4px; }
.news-src { margin-left: auto; font-size: 12px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
a.news-src:hover { color: var(--text); }
.news-more { display: block; margin: 16px auto 0; border: 0; background: var(--tint); color: var(--text); font: inherit; font-size: 13px; padding: 6px 18px; border-radius: 100px; cursor: pointer; }
.news-empty { color: var(--text-2); text-align: center; padding: 40px 0; }
.news-tag b.up { color: var(--up); } .news-tag b.down { color: var(--down); }
.d-news { margin-top: 16px; border-top: 1px solid var(--stroke-2); padding-top: 14px; }
.d-news-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.d-news-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.link { border: 0; background: none; color: var(--fut); font: inherit; font-size: 12px; cursor: pointer; padding: 0; }
.d-news-row { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--stroke-2); font-size: 14px; line-height: 1.5; color: var(--text); text-decoration: none; }
.d-news-row:last-child { border-bottom: 0; }
.d-news-row .t { color: var(--text-2); font-size: 12px; padding-top: 2px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  #news { padding: 12px; }
  .news-card { grid-template-columns: 1fr; padding: 12px 14px; }
  .news-card .t { padding: 0 0 4px; }
}

/* ---------- 品种科普：WHAT / HOW / WHY ---------- */
.about { margin-top: 16px; border-radius: 16px; padding: 12px 16px; background: color-mix(in srgb, #f0a33a 7%, var(--card)); border: 1px solid color-mix(in srgb, #f0a33a 45%, transparent); font-size: 13px; line-height: 1.65; }
.about summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.about summary::-webkit-details-marker { display: none; }
.about summary span { font-size: 11px; font-weight: 700; color: #fff; background: #f0a33a; border-radius: 10px; padding: 0 8px; line-height: 20px; }
.about summary::after { content: '展开 ›'; margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text-2); }
.about[open] summary::after { content: '收起 ‹'; }
.about[open] summary { margin-bottom: 4px; }
.about h4 { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
.about h4 em { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: #f0a33a; border-radius: 10px; padding: 0 8px; line-height: 20px; }
.about p { margin: 0 0 6px; }
.about .muted, .about .src { color: var(--text-2); }
.about .src { margin-top: 10px; font-size: 11px; }
.about .bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 6px 0 4px; background: var(--tint); }
.about .bar i { display: block; }
.about .lg { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.about .lg b { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.about .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.about .chips button { border: 0; background: var(--card); color: var(--text); font: inherit; font-size: 12px; border-radius: 100px; padding: 2px 10px; cursor: pointer; }
.about ul { margin: 0; padding-left: 18px; }
.about li::marker { color: #f0a33a; }
.proc-tip { position: fixed; z-index: 50; width: 300px; display: grid; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--card); color: var(--text); border: 1px solid color-mix(in srgb, #f0a33a 45%, transparent); box-shadow: 0 8px 28px rgba(0,0,0,.2); font-size: 12px; line-height: 1.55; pointer-events: none; }
.proc-tip > b { font-size: 14px; font-weight: 600; }
.proc-tip div { display: grid; gap: 1px; }
.proc-tip em { font-style: normal; color: #f0a33a; font-weight: 600; }
.proc-tip span { color: var(--text-2); }
