/* 三套配色共用相同布局；内容面板保持不透明，背景不干扰规格阅读。 */
:root {
  color-scheme: light;
  --bg: #f5f6fb; --bg-soft: #eef0f7; --panel: #ffffff;
  --ink: #202738; --ink-2: #39445c; --muted: #626e85; --muted-2: #6d7890;
  --line: #dfe4ef; --line-2: #edf0f6;
  --brand: #5765b5; --brand-2: #444f95; --brand-soft: #eef0fd;
  --ok: #148264; --ok-soft: #eaf5ef; --warn: #9a621c; --warn-soft: #fbf2e5;
  --red: #bd454b; --red-soft: #fbecee;
  --scene-opacity: .36; --scene-filter: saturate(.7);
  --header: rgba(255,255,255,.95); --button-ink: #fff;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151b29; --bg-soft: #272f43; --panel: #1e2636;
  --ink: #e5e9f4; --ink-2: #cbd3e5; --muted: #a8b3ca; --muted-2: #9ba8c2;
  --line: #364057; --line-2: #30394d;
  --brand: #b0baff; --brand-2: #c6cdff; --brand-soft: #303956;
  --ok: #81d7b3; --ok-soft: #203e38; --warn: #e7bf80; --warn-soft: #463b2d;
  --red: #f4a5ad; --red-soft: #4b2c39;
  --scene-opacity: .15; --scene-filter: saturate(.55) brightness(.7);
  --header: rgba(30,38,54,.96); --button-ink: #182032;
}
:root[data-theme="eye"] {
  color-scheme: light;
  --bg: #f2eddf; --bg-soft: #e9e7d7; --panel: #faf7ec;
  --ink: #323c31; --ink-2: #485444; --muted: #636e59; --muted-2: #72775f;
  --line: #d8dac5; --line-2: #e6e6d5;
  --brand: #526e4d; --brand-2: #3d5639; --brand-soft: #e5ecdc;
  --ok: #466d41; --ok-soft: #e5edda; --warn: #91642d; --warn-soft: #f3ead5;
  --red: #9d5145; --red-soft: #f1e3d8;
  --scene-opacity: .22; --scene-filter: sepia(.35) saturate(.5);
  --header: rgba(250,247,236,.96); --button-ink: #fff;
}
body { background: var(--bg); isolation: isolate; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url('/static/railgun-bg.webp') center 42% / cover no-repeat;
  opacity: var(--scene-opacity); filter: var(--scene-filter);
}
.top { background: var(--header); backdrop-filter: blur(12px); }
.top-in { position: relative; }
.theme-switch {
  margin-left: auto; display: flex; align-items: center; flex-shrink: 0; gap: 2px;
  padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft);
}
.theme-switch button {
  border: 0; background: transparent; color: var(--muted); border-radius: 7px;
  min-height: 32px; padding: 4px 9px; display: flex; align-items: center; gap: 5px;
  font-size: 12px; line-height: 1.4; white-space: nowrap;
}
.theme-switch button > span:first-child { font-size: 18px; line-height: 1; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--panel); color: var(--brand); box-shadow: 0 1px 4px #0000000d; font-weight: 600; }
.brand-mark { background: var(--brand); }
.avatar { background: var(--bg-soft); }
.nav a:hover, .nav a.on, .mnav a.on { background: var(--brand-soft); }
/* 覆盖旧工具风样式里的固定白底；不对整个页面使用滤镜。 */
.plan.is-in, .plan.is-out, .panel, .side-card, .search-box, .search-box:focus-within,
.chip, .btn, .bell-btn, .pg, .buy-card, .buy-card.is-out, .contact, .feed-note, .dev-box,
.favorites-toolbar, [data-favorites-toolbar], .foot, .buybar, .m-hero, .radio-card,
.seg, .oe-spark, .skip, .gcol, .spec-cell, .grade-row, .dev-link, .foot-tg,
.mnav a, .field input[type=email]:focus, .favorite-btn, [data-favorite] { background: var(--panel); border-color: var(--line); }
.dev-link { color: var(--warn); }
[data-favorite][aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.btn-primary, .pg.on { background: var(--brand); border-color: var(--brand); color: var(--button-ink); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--button-ink); }
.chip.on, .chip:hover, .pg:hover, .btn-ghost:hover, .m-item.on, .m-item:hover,
.radio-card.on, .radio-card:has(input:checked), .seg label:has(input:checked) span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.stock.in { background: var(--ok-soft); color: var(--ok); }
.stock.out, .tag-warn { background: var(--warn-soft); color: var(--warn); }
.btn-danger { color: var(--red); background: var(--red-soft); }
.oe-art { background: var(--brand-soft); border-color: var(--line); }
.offers-empty { background: radial-gradient(ellipse at top, var(--brand-soft), var(--panel) 75%); }
[data-favorites-subscribe]:not(:disabled) { background: var(--brand); border-color: var(--brand); color: var(--button-ink); }
.toast { background: var(--ink); color: var(--panel); }
/* 问号仅在具体线路旁出现：柔化的是图标，不模糊说明正文。 */
.line-value { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.line-help { position: relative; z-index: 3; display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: help; }
.line-help > span { display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid currentColor; border-radius: 50%; font: 11px/1 system-ui, sans-serif; opacity: .48; transition: opacity .15s; }
.line-help:hover > span, .line-help:focus-visible > span, .line-help[aria-expanded="true"] > span { opacity: 1; }
.line-help:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.line-popover { position: fixed; z-index: 1000; box-sizing: border-box; width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink-2); box-shadow: 0 10px 40px #0003; font-size: 12px; line-height: 1.8; text-align: left; overflow-wrap: anywhere; }
.line-popover[hidden] { display: none; }
.line-popover b { color: var(--ink); font-size: 14px; }
.line-popover p { margin: 8px 0; }
.line-popover small { display: block; color: var(--muted); font-size: 11px; }
.line-sources { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.line-sources a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.background-credit { font-size: 10px; color: var(--muted); padding-bottom: 20px; line-height: 1.8; }
.background-credit a { text-decoration: underline; text-underline-offset: 2px; }
/* 商家列表：点名称就地展开，而不是把用户带离筛选页。 */
.merchant-entry > summary { cursor: pointer; list-style: none; user-select: none; }
.merchant-entry > summary::-webkit-details-marker { display: none; }
.merchant-entry .m-item { gap: 8px; }
.merchant-entry .m-info { flex: 1; }
.merchant-entry .m-info small { white-space: normal; }
.merchant-entry .live-dot { margin-left: 0; width: 6px; height: 6px; }
.m-expand { display: grid; place-items: center; color: var(--muted); }
.m-expand .i { transition: transform .15s ease; width: 15px; height: 15px; }
.merchant-entry[open] .m-expand .i { transform: rotate(90deg); }
.merchant-entry[open] > summary { border-color: var(--brand); background: var(--brand-soft); }
.merchant-profile { padding: 14px 0 2px; font-size: 13px; }
.merchant-intro {
  margin: 0 0 14px; padding: 12px 13px; border: 1px solid var(--line-2); border-left: 4px solid var(--brand);
  border-radius: 0 10px 10px 0; background: var(--bg-soft); color: var(--ink-2); line-height: 1.75;
}
.merchant-policy { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px 16px; margin: 0; }
.merchant-policy > div { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 7px; padding: 9px 0; border-top: 1px solid var(--line-2); align-items: center; min-width: 0; }
.merchant-policy dt { color: var(--muted); font-weight: 650; white-space: nowrap; }
.merchant-policy dt::after { content: "："; }
.merchant-policy dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.policy-ok { color: var(--ok); font-weight: 600; }
.policy-unknown { color: var(--muted) !important; }
.payment-row { grid-column: 1 / -1; align-items: start !important; }
.payment-methods { display: flex; flex-wrap: wrap; gap: 5px; color: inherit !important; }
.payment-methods span { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink-2); font-size: 11px; line-height: 1; white-space: nowrap; }
.payment-methods span:first-child { color: #1677ff; border-color: color-mix(in srgb, #1677ff 30%, var(--line)); }
.merchant-source { border-top: 1px solid var(--line-2); padding-top: 11px; margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.merchant-source a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.merchant-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.merchant-links a { color: var(--brand); font-weight: 600; }
.merchant-links .i { display: inline-block; vertical-align: -2px; margin-left: 2px; }
@media (max-width: 900px) {
  .top-in { justify-content: space-between; height: 62px; gap: 12px; }
  .theme-switch { margin-left: auto; }
  .merchant-policy { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 22px; }
  .merchant-intro { max-width: 70ch; }
}
@media (max-width: 560px) {
  .top-in { gap: 8px; }
  .theme-switch { padding: 2px; gap: 0; }
  .theme-switch button { padding: 5px 7px; min-height: 34px; gap: 3px; }
  .theme-switch button > span:first-child { font-size: 16px; }
  .brand { gap: 7px; }
  .brand-text b { font-size: 14px; }
  .brand-text small { font-size: 10px; }
  .brand-mark { width: 30px; height: 30px; }
  .merchant-policy { column-gap: 14px; }
  .merchant-policy > div { grid-template-columns: 1fr; gap: 2px; }
  body::before { background-position: 52% 38%; background-size: cover; }
}
@media (max-width: 370px) {
  .theme-switch button { padding: 5px 6px; }
  .theme-switch button > span:first-child { display: none; }
}
/* 全站视觉规范：同一表面、控件与字号层级，三种配色共享。 */
:root { --r: 12px; --r-sm: 8px; --shadow: 0 2px 10px #00000008; --shadow-lg: 0 4px 18px #00000010; }
body { font-size: 15px; line-height: 1.75; }
.panel, .side-card, .plan, .buy-card, .m-hero, .m-filters, [data-favorites-toolbar] { border-radius: var(--r); box-shadow: var(--shadow); }
.panel, .buy-card, .m-hero { padding: 20px; }
.plan { padding: 17px 18px; gap: 10px; }
.plan:hover, .plan.is-in:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); }
.plan-title a, .favorite-title { font-size: 16px; font-weight: 650; line-height: 1.5; }
.specs > div { font-size: 14px; padding: 6px 0; }
.specs dd { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.plan-sub, .favorite-spec, .favorite-pick { font-size: 13px; }
.price b, .favorite-price { font-size: 22px; }
.price span, .updated, .result-meta, .m-toolbar-right { font-size: 12px; }
.stock, .tag { font-size: 12px; border-radius: 6px; }
.btn, .btn-lg { min-height: 42px; height: auto; padding: 9px 16px; border-radius: var(--r-sm); font-size: 14px; line-height: 1.5; }
.btn:hover, .bell-btn:hover, [data-favorite]:hover { border-color: var(--brand); }
.btn-primary:hover, [data-favorites-subscribe]:not(:disabled):hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--button-ink); }
.plan [data-favorite][aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.search-box { height: 42px; border-radius: var(--r-sm); }
.search-box input, .field input[type=email] { font-size: 16px; }
.chip { height: auto; min-height: 32px; font-size: 13px; padding: 3px 10px; border-radius: var(--r-sm); }
.chip em { font-size: 11px; }
.flabel, .result-bar, .m-toolbar { font-size: 14px; }
.nav a, .mnav a { font-size: 14px; border-radius: var(--r-sm); }
.page-head h1, .pd-head h1, .m-hero-title h1 { font-size: clamp(25px, 2.4vw, 30px); }
.page-head p { font-size: 15px; color: var(--ink-2); }
.pd-specs h2, .pd-history h2, .pd-rel h2, .about-grid h2, .anchor h2, .contact h2, .sub-side h3 { font-size: 18px; font-weight: 650; }
.spec-k, .src-note, .buy-tip, .buy-status, .pd-meta { font-size: 13px; }
.spec-v { font-size: 16px; }
.spec-cell { padding: 14px; }
.anchor p, .about-grid p, .contact p, .sub-side p, .ticks li, .tl-empty p { font-size: 15px; }
.field > label, .radio-card b, .timeline b, .tl-empty b { font-size: 15px; }
.field small, .radio-card span, .consent, .form-note, .timeline span { font-size: 13px; line-height: 1.75; }
.form-note { align-items: flex-start; }
.form-note .i { margin-top: 4px; }
.m-info b { font-size: 16px; }
.m-info small, .side-head { font-size: 12px; }
.merchant-profile { font-size: 14px; }
.merchant-source { font-size: 12px; }
.merchant-policy > div { grid-template-columns: max-content minmax(0,1fr); }
.line-popover { font-size: 14px; }
.line-popover b { font-size: 16px; }
.line-popover small { font-size: 12px; }
.offers-empty { min-height: 320px; background: var(--panel); }
.offers-empty::after { display: none; }
.oe-art { width: 64px; height: 64px; border-radius: var(--r); box-shadow: none; margin-bottom: 18px; }
.oe-art > .i { width: 30px; height: 30px; }
.oe-spark { display: none; }
.oe-inner h2 { font-size: 22px; }
.radio-card, .seg, .spec-grid, .tl-empty { border-radius: var(--r-sm); }
.m-hero-actions, .kv.wide > div { border-top-color: var(--line); border-bottom-color: var(--line); }
.compact-footer { font-size: 12px; }
@media (max-width: 900px) {
  .merchant-policy > div { grid-template-columns: max-content minmax(0,1fr); }
}
@media (max-width: 560px) {
  .panel, .buy-card, .m-hero { padding: 16px; }
  .filters { padding: 12px; }
  .plan { padding: 15px; }
  .plan-title a, .favorite-title { font-size: 16px; }
  .specs > div { font-size: 14px; }
  .spec-cell { padding: 12px 10px; }
  .spec-v { font-size: 15px; }
  .merchant-policy { column-gap: 10px; }
  .merchant-policy > div { grid-template-columns: max-content minmax(0,1fr); gap: 4px; }
  .merchant-policy dt { font-size: 12px; }
  .payment-methods span { min-height: 25px; padding-inline: 6px; }
  .buybar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .buybar .btn { padding: 8px; font-size: 13px; min-width: 0; white-space: normal; }
  .buybar-p b { font-size: 21px; }
  .offers-empty { min-height: 260px; padding: 32px 16px; }
  .oe-inner h2 { font-size: 21px; }
}
/* 商家资料需要比旧侧栏更宽，避免把简介和基础信息挤成一条长列。 */
@media (min-width: 1081px) {
  .dash { grid-template-columns: 360px minmax(0, 1fr); }
}
@media (min-width: 901px) and (max-width: 1080px) {
  .dash { grid-template-columns: 280px minmax(0, 1fr); }
  .merchant-policy { grid-template-columns: 1fr; }
  .payment-row { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  .m-expand .i { transition: none; }
}
