:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #161b22; --muted: #5b6470; --faint: #848d97; --rule: #e2e5e9; --rule-strong: #cfd4da;
  --accent: #0a66c2; --accent-soft: #e7f0fa;
  --ok: #1a7f37; --ok-soft: #e6f4ea; --warn: #9a6200; --warn-soft: #fbf1d9; --bad: #c2321f; --bad-soft: #fdebe8;
  --hot: #d9480f; --on-hot: #ffffff;
  --l0: #e6e9ed; --l1: #b9e3c5; --l2: #74c58f; --l3: #2f9e58; --l4: #1a7f37; --nodata: transparent;
  --heat: 26, 127, 55;
  --radius: 10px;
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --panel: #151b23; --ink: #e6edf3; --muted: #9ba6b2; --faint: #6f7882; --rule: #262e38; --rule-strong: #343e4a;
    --accent: #5aa7ff; --accent-soft: #11294a;
    --ok: #3fb950; --ok-soft: #10301b; --warn: #d6a02a; --warn-soft: #342709; --bad: #f47067; --bad-soft: #3d1714;
    --hot: #ff8a4c; --on-hot: #1b0d05;
    --l0: #212932; --l1: #1a4a2a; --l2: #226b39; --l3: #2ea043; --l4: #56d364;
    --heat: 63, 185, 80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --panel: #151b23; --ink: #e6edf3; --muted: #9ba6b2; --faint: #6f7882; --rule: #262e38; --rule-strong: #343e4a;
  --accent: #5aa7ff; --accent-soft: #11294a;
  --ok: #3fb950; --ok-soft: #10301b; --warn: #d6a02a; --warn-soft: #342709; --bad: #f47067; --bad-soft: #3d1714;
  --hot: #ff8a4c; --on-hot: #1b0d05;
  --l0: #212932; --l1: #1a4a2a; --l2: #226b39; --l3: #2ea043; --l4: #56d364;
  --heat: 63, 185, 80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
/* 网站图标：深色主题下不少图标是深色的，垫一块白底 */
.ico { width: 16px; height: 16px; padding: 1px; box-sizing: content-box; border-radius: 4px; background: #fff; object-fit: contain; vertical-align: -4px; margin-right: 6px; }
h1 .ico { width: 20px; height: 20px; vertical-align: -3px; margin-right: 8px; }
.plrow .sub .ico { width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* 顶栏 */
.top { background: var(--panel); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.brand { font-weight: 650; color: var(--ink); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand:hover { text-decoration: none; }
.tabs { display: flex; gap: 2px; margin-left: auto; }
.tabs a { padding: 6px 10px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.tabs a:hover { background: var(--bg); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--bg); font-weight: 600; }
.tg { border: 1px solid var(--rule-strong); border-radius: 8px; padding: 5px 10px; white-space: nowrap; font-size: 13px; }
.tg:hover { background: var(--accent-soft); text-decoration: none; }
.status { color: var(--muted); font-size: 12.5px; padding-bottom: 8px; margin-top: -4px; }
.status b { color: var(--ink); font-weight: 600; }
.status .bad { color: var(--bad); }

main { padding-top: 12px; padding-bottom: 24px; min-height: 60vh; }
.foot { color: var(--faint); font-size: 12px; padding-bottom: 32px; }
.foot p { margin: 4px 0; }

/* 分区 */
.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 20px 0 10px; flex-wrap: wrap; }
.sec .hint { font-size: 12px; color: var(--faint); }
.banner { border: 1px solid var(--warn); background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 8px 12px; margin: 8px 0; font-size: 13px; }
.empty { background: var(--panel); border: 1px dashed var(--rule-strong); border-radius: var(--radius); padding: 20px 16px; text-align: center; color: var(--muted); }
.empty p { margin: 4px 0; }

/* 筛选 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--rule-strong); background: var(--panel); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.chip .n { opacity: .7; margin-left: 4px; }
.chipset { display: contents; }
.search { flex: 1 1 180px; min-width: 0; max-width: 280px; border: 1px solid var(--rule-strong); background: var(--panel); border-radius: 8px; padding: 5px 10px; font: inherit; color: var(--ink); }
select.sort { border: 1px solid var(--rule-strong); background: var(--panel); border-radius: 8px; padding: 5px 8px; font: inherit; color: var(--ink); }

/* 标签 */
.tag { display: inline-block; font-size: 11.5px; line-height: 18px; padding: 0 7px; border-radius: 6px; background: var(--bg); color: var(--muted); border: 1px solid var(--rule); margin: 0 4px 4px 0; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.tier { display: inline-block; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.tier.fast { background: var(--bad-soft); color: var(--bad); }
.tier.quick { background: var(--warn-soft); color: var(--warn); }
.tier.calm { background: var(--ok-soft); color: var(--ok); }
.tier.none { background: var(--bg); color: var(--faint); font-weight: 400; }

/* 卡片 */
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card .head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.card .title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.card .title .m { color: var(--muted); font-weight: 400; }
.live { font-size: 12.5px; color: var(--ok); }
.live.stale { color: var(--warn); }
.code { font-family: var(--mono); background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 5px; padding: 0 5px; cursor: pointer; font-size: 12.5px; }
.code.copied { background: var(--ok-soft); color: var(--ok); }
.note { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; margin-top: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule-strong); border-radius: 8px; padding: 6px 12px; background: var(--panel); color: var(--ink); font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { flex: 1; background: var(--ink); color: var(--panel); border-color: var(--ink); font-weight: 600; }
.btn.primary:hover { opacity: .9; background: var(--ink); }

/* 现在有货：一家商家一块 */
.mlist { display: grid; gap: 12px; }
.mblock { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.mhead { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; padding: 10px 14px; }
.mhead .mname { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.mhead .cnt { color: var(--muted); font-size: 12.5px; }
.mhead .mlink { margin-left: auto; font-size: 12.5px; white-space: nowrap; }
.ghead { padding: 6px 14px 4px; background: var(--bg); border-top: 1px solid var(--rule); }
.ghead .tag { background: var(--panel); margin-bottom: 2px; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 14px; padding: 9px 14px; border-top: 1px solid var(--rule); align-items: center; }
.srow .main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.srow .nm { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.srow .tier, .srow .tag { margin: 0 0 0 4px; vertical-align: 1px; }
.srow .sp { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.srow .lv { font-size: 12px; color: var(--ok); }
.srow .lv.stale { color: var(--warn); }
.srow .pr { text-align: right; white-space: nowrap; }
.srow .pr .big { font-size: 16px; font-weight: 650; font-family: var(--mono); letter-spacing: -.2px; }
.srow .pr .unit { color: var(--muted); font-size: 12.5px; }
.srow .pr .alt { display: block; color: var(--faint); font-size: 12px; }
.btn.go { flex: none; padding: 5px 14px; }
.mfoot { display: block; width: 100%; border: 0; border-top: 1px solid var(--rule); background: var(--panel); color: var(--accent); padding: 8px; font-size: 13px; cursor: pointer; }
.mfoot:hover { background: var(--bg); }

/* 刚卖完 */
.list { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.list > a, .list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--rule); color: var(--ink); align-items: baseline; }
.list > :first-child { border-top: 0; }
.list > a:hover { background: var(--bg); text-decoration: none; }
.list .l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .r { color: var(--muted); white-space: nowrap; font-size: 13px; }
.list .r b { font-weight: 600; }
.list .r b.fast { color: var(--bad); }

/* 库存条 */
.strip { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; }
.strip i { display: block; height: 16px; border-radius: 2px; background: var(--l0); }
.strip i.nd { background: var(--nodata); outline: 1px dashed var(--rule-strong); outline-offset: -1px; }
.strip i.l1 { background: var(--l1); } .strip i.l2 { background: var(--l2); } .strip i.l3 { background: var(--l3); } .strip i.l4 { background: var(--l4); }
.strip i.sel { box-shadow: 0 0 0 2px var(--ink); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--faint); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; background: var(--l0); }
.legend i.nd { background: transparent; outline: 1px dashed var(--rule-strong); outline-offset: -1px; }
.legend i.l1 { background: var(--l1); } .legend i.l3 { background: var(--l3); }

/* 规律列表 */
.rows { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; }
.prow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) auto; gap: 6px 16px; padding: 10px 14px; border-top: 1px solid var(--rule); color: var(--ink); align-items: center; }
.prow:first-child { border-top: 0; }
.prow:hover { background: var(--bg); text-decoration: none; }
.prow .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .sub { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .meta { font-size: 12px; color: var(--muted); }
.prow .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dot { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rule-strong); }
.dot.on { color: var(--ok); } .dot.on::before { background: var(--ok); }

/* 单品页 */
.back { display: inline-block; margin: 4px 0 8px; font-size: 13px; }
.hero { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 280px); gap: 16px; }
.hero h1 { font-size: 20px; margin: 0 0 4px; overflow-wrap: anywhere; }
.hero h1 .m { color: var(--muted); font-weight: 400; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; font-size: 13px; margin: 8px 0 0; }
.kv dt { color: var(--faint); white-space: nowrap; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.buy { display: flex; flex-direction: column; gap: 8px; }
.buy .btn.primary { flex: none; padding: 9px 12px; }
.state { font-weight: 600; }
.state.on { color: var(--ok); } .state.off { color: var(--muted); }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable td { padding: 3px 0; border-top: 1px solid var(--rule); }
.ptable td:last-child { text-align: right; color: var(--faint); }
.ptable tr:first-child td { border-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.tile { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.tile .k { font-size: 12px; color: var(--faint); }
.tile .v { font-size: 18px; font-weight: 650; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { font-size: 12px; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; min-width: 0; }
.panel h2 { margin-bottom: 8px; }
.panel .lead { font-size: 12.5px; color: var(--faint); margin: -4px 0 10px; }
.cal { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 4px 8px; align-items: center; }
.cal .d { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.dayinfo { font-size: 12.5px; color: var(--muted); min-height: 20px; margin-top: 8px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; }
.bars { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.bars .t { color: var(--muted); white-space: nowrap; }
.bars .b { height: 12px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.bars .b span { display: block; height: 100%; background: var(--l3); border-radius: 3px; }
.bars .n { color: var(--faint); font-family: var(--mono); text-align: right; }
.heat { display: grid; grid-template-columns: 22px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 10.5px; color: var(--faint); }
.heat i { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--l0); min-height: 8px; }
.heat .hl { text-align: left; white-space: nowrap; overflow: visible; }
.heat .wl { line-height: 1; align-self: center; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--faint); font-size: 12px; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--rule); }
.tbl td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num { font-family: var(--mono); white-space: nowrap; }
.tbl td.fast { color: var(--bad); font-weight: 600; }
.scroll { overflow-x: auto; }
.chg { font-size: 13px; padding: 6px 0; border-top: 1px solid var(--rule); }
.chg:first-of-type { border-top: 0; }
.chg .when { color: var(--faint); font-family: var(--mono); font-size: 12px; margin-right: 8px; }
.err { color: var(--bad); }

/* 论坛优惠 */
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.offer { scroll-margin-top: 120px; }
.offer.open { grid-column: 1 / -1; }
.offer .when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pills .tag { margin: 0; }
.pill { font-size: 12px; line-height: 18px; padding: 0 7px; border-radius: 6px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.v-hot { background: var(--hot); color: var(--on-hot); }
.v-good { background: var(--ok-soft); color: var(--ok); }
.v-meh { background: var(--bg); color: var(--muted); border-color: var(--rule); font-weight: 500; }
.v-dear, .v-none { background: var(--bg); color: var(--faint); border-color: var(--rule); font-weight: 400; }
.r-ok { color: var(--ok); border-color: var(--ok); }
.r-warn { color: var(--warn); border-color: var(--warn); }
.r-bad { background: var(--bad); color: var(--panel); }
.otitle { font-size: 12.5px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cheap { font-size: 13.5px; overflow-wrap: anywhere; }
.flags { display: flex; gap: 4px; flex-wrap: wrap; }
.flag { font-size: 11.5px; line-height: 18px; padding: 0 7px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.seller { font-size: 12px; color: var(--faint); }
.more { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 12px; display: grid; gap: 14px; min-width: 0; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.65; max-width: 760px; }
.msg b { font-weight: 650; }
.msg blockquote { margin: 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--rule-strong); }
.plist { font-size: 13px; max-width: 760px; }
.plist .k { font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.plist .pi { padding: 6px 0; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
.plist .pp { color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.plist .pp .y { color: var(--ink); font-weight: 600; }

/* 套餐比价 */
.plrow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(110px, auto); gap: 4px 16px; padding: 10px 14px; border-top: 1px solid var(--rule); color: var(--ink); align-items: center; }
.plrow:first-child { border-top: 0; }
.plrow:hover { background: var(--bg); text-decoration: none; }
.plrow .name { font-weight: 600; overflow-wrap: anywhere; }
.plrow .sub { font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }
.plrow .pills { margin-top: 3px; }
.plrow .cfg { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.plrow .yr { text-align: right; white-space: nowrap; }
.plrow .yr .big { font-size: 17px; font-weight: 650; font-family: var(--mono); }
.plrow .yr .unit { color: var(--muted); }
.plrow .yr .s { font-size: 12px; color: var(--faint); }

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
  .prow { grid-template-columns: minmax(0, 1fr) auto; }
  .prow .strip { grid-column: 1 / -1; grid-row: 2; }
  .prow .meta { grid-column: 1 / -1; }
  .plrow { grid-template-columns: minmax(0, 1fr) auto; }
  .plrow .cfg { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 640px) {
  .bar { flex-wrap: wrap; row-gap: 0; padding-top: 8px; min-height: 0; }
  .tg { margin-left: auto; }
  .tabs { order: 3; width: 100%; margin: 0 0 6px -8px; overflow-x: auto; scrollbar-width: none; }
  .status { margin-top: 0; }
}
@media (max-width: 480px) {
  .tg { padding: 4px 8px; font-size: 12.5px; }
  .bar { gap: 8px; }
  .tabs a { padding: 6px 8px; }
  .offers { grid-template-columns: minmax(0, 1fr); }
  .srow { grid-template-columns: minmax(0, 1fr) auto; }
  .srow .main { grid-row: span 2; }
  .srow .go { justify-self: end; }
  .srow .sp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .list > a { flex-direction: column; gap: 0; }
  .list .l { white-space: normal; }
  .search { max-width: none; }
  .heat { grid-template-columns: 18px repeat(24, minmax(0, 1fr)); gap: 1px; }
  .tbl .pc { display: none; }
  .tbl { font-size: 12.5px; }
}
