/* ------------------------------------------------------------------
   宠物用品选品库 — 视觉层 v3
   跟随工具箱主题：默认深色（夜），html.light 为暖白版
   主色 墨绿 / 夜版转为薄荷绿；语义色三档 绿/琥珀/红
   ------------------------------------------------------------------ */

/* ---------- 深色（默认） ---------- */
:root {
  --bg: #070B0A;
  --bg-2: #0B1210;
  --card: #0E1614;
  --ink: #E9F3EF;
  --ink-2: #B6C9C2;
  --ink-3: #89A09A;
  --ink-4: #566862;
  --line: #1C2724;
  --line-2: #161F1C;
  --line-strong: #2B3A35;
  --hover: #131D1A;
  --green: #43DFA4;
  --green-soft: #12251E;
  --red: #FF8375;
  --red-soft: #2A1715;
  --amber: #E9BA63;
  --amber-soft: #2A2115;
  --brand: #0F6B4F;
  --brand-2: #4FE3AF;
  --brand-txt: #6FEBBB;
  --brand-deep: #0B5741;
  --brand-soft: #10241D;
  --brand-line: #2A4A3E;
  --bar-bg: rgba(7, 11, 10, .84);
  --red-dim: #C57A6E;
  --on-ink: #FFFFFF;
  --on-ink-dim: rgba(255, 255, 255, .72);
  --r: 12px;
  --r-lg: 16px;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-m: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 22px -14px rgba(0, 0, 0, .9);
  --shadow-l: 0 2px 6px rgba(0, 0, 0, .55), 0 18px 40px -20px rgba(0, 0, 0, .9);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

/* ---------- 浅色（暖白，原版） ---------- */
html.light {
  --bg: #F6F6F3;
  --bg-2: #F1F1ED;
  --card: #FFFFFF;
  --ink: #14181F;
  --ink-2: #4A505B;
  --ink-3: #8A8F98;
  --ink-4: #B3B7BE;
  --line: #E6E7E3;
  --line-2: #EFEEE9;
  --line-strong: #C9CAC4;
  --hover: #FCFCFB;
  --green: #0B6B4A;
  --green-soft: #E9F3EE;
  --red: #B2392B;
  --red-soft: #FBEFED;
  --amber: #8A6210;
  --amber-soft: #F6EED8;
  --brand: #0F3B2E;
  --brand-2: #1E5A45;
  --brand-txt: #0F3B2E;
  --brand-deep: #0A3227;
  --brand-soft: #EAF1ED;
  --brand-line: #C7D9D1;
  --bar-bg: rgba(255, 255, 255, .82);
  --red-dim: #9C5246;
  --on-ink: #FFFFFF;
  --on-ink-dim: rgba(255, 255, 255, .72);
  --shadow-s: 0 1px 2px rgba(20, 24, 31, .04);
  --shadow-m: 0 1px 2px rgba(20, 24, 31, .04), 0 8px 22px -14px rgba(20, 24, 31, .14);
  --shadow-l: 0 2px 6px rgba(20, 24, 31, .06), 0 18px 40px -20px rgba(20, 24, 31, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

b, strong { font-weight: 600; }
a { color: inherit; }
button { font-family: inherit; }

.n, .num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------------- 顶栏 ---------------- */

.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 62px; padding: 0 36px;
  background: var(--bar-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.bar-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
  text-decoration: none; color: var(--ink);
}

.bar-logo .dot {
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-s);
}
.bar-logo .dot svg { width: 14px; height: 14px; }

.bar-sep { width: 1px; height: 18px; background: var(--line); }

.bar-tag {
  font-size: 12.5px; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 7px;
}
.bar-tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-2);
}

.bar-right {
  margin-left: auto; display: flex; align-items: center; gap: 12px;
  font-size: 12.5px; color: var(--ink-3);
}

/* 主题按钮（与工具箱一致） */
.theme-btn {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); color: var(--brand-2); cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.theme-btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow-s); }
.theme-btn:active { transform: scale(.94); }
.theme-btn svg { width: 15px; height: 15px; display: block; }
.theme-btn .ico-moon { display: none; }
html.light .theme-btn .ico-sun { display: none; }
html.light .theme-btn .ico-moon { display: block; }

/* ---------------- 站点选择器（与工具箱同款） ---------------- */

.mkt { position: relative; flex: none; }
.mkt-btn {
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 6px 0 9px; max-width: 172px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 9px; box-shadow: var(--shadow-s);
  cursor: pointer; color: var(--ink); font-size: 12.5px; font-weight: 620;
  transition: border-color .2s, box-shadow .2s;
}
.mkt-btn:hover { border-color: var(--line-strong); }
.mkt-btn[aria-expanded="true"] { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 16%, transparent); }
.mkt-lab {
  font-size: 9px; color: var(--ink-3); letter-spacing: 1.1px;
  text-transform: uppercase; flex: none;
}
.mkt-name { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-arw {
  display: grid; place-items: center; width: 13px; flex: none;
  color: var(--ink-3); transition: transform .18s, color .18s;
}
.mkt-arw svg { width: 10px; height: 10px; display: block; }
.mkt-btn[aria-expanded="true"] .mkt-arw { transform: rotate(180deg); color: var(--brand-2); }
.mkt-native { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mkt-cur {
  font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--brand-txt);
  background: var(--brand-soft); border-radius: 5px; padding: 1px 5px;
  flex: none; letter-spacing: .3px;
}
.mkt.gate .mkt-btn { border-color: color-mix(in srgb, var(--red) 34%, transparent); background: var(--red-soft); }
.mkt.gate .mkt-cur { background: transparent; color: var(--red); }

.mkt-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70;
  width: min(486px, calc(100vw - 24px));
  max-height: min(600px, calc(100vh - 96px)); overflow-y: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px 8px;
  align-content: start;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 13px; box-shadow: var(--shadow-l); padding: 6px;
  animation: mktIn .16s ease-out;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.mkt-pop[hidden] { display: none; }
@keyframes mktIn { from { opacity: 0; transform: translateY(-6px); } }
.mkt-pop::-webkit-scrollbar { width: 6px; }
.mkt-pop::-webkit-scrollbar-thumb { background: var(--brand-line); border-radius: 3px; }
.mkt-pop::-webkit-scrollbar-track { background: transparent; }
.mkt-pop.is-scroll {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
}
.mp-hd {
  grid-column: 1 / -1;
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 9px 8px; background: var(--card);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.3px;
  color: var(--ink-3); text-transform: uppercase;
  border-bottom: 1px solid var(--line-2);
}
.mp-hd b { font-weight: 600; color: var(--brand-txt); letter-spacing: .6px; }
.mp-grp {
  grid-column: 1 / -1;
  padding: 8px 9px 3px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.4px;
  color: var(--ink-4); text-transform: uppercase;
}
.mp-it {
  width: 100%; display: flex; align-items: center; gap: 7px;
  padding: 6px 9px; border: 0; border-radius: 8px; background: transparent;
  text-align: left; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  transition: background .12s, color .12s;
}
.mp-it:hover { background: var(--hover); color: var(--ink); }
.mp-it.on { background: var(--brand-soft); color: var(--brand-txt); font-weight: 640; }
.mp-it.on .mp-c { color: var(--brand-txt); }
.mp-it.on .mp-l { color: var(--brand-txt); border-color: var(--brand-line); }
.mp-n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-l {
  flex: none; font-size: 9px; color: var(--ink-4); letter-spacing: .3px;
  border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; line-height: 1.5;
}
.mp-c {
  flex: none; font-family: var(--mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: .4px;
}

/* 站点口径提示 */
.mk-note {
  margin-top: 14px; padding: 10px 13px;
  border: 1px solid var(--line); border-left: 2px solid var(--brand-2);
  border-radius: 0 var(--r) var(--r) 0; background: var(--bg-2);
  font-size: 12.5px; line-height: 1.7; color: var(--ink-2);
}
.mk-note b { color: var(--ink); font-weight: 620; }
.mk-note .mk-us { color: var(--green); }
.mk-note .mk-d { color: var(--amber); }

/* ---------------- 容器 ---------------- */

.wrap { max-width: 1200px; margin: 0 auto; padding: 44px 32px 96px; }

/* ---------------- 数据来源卡（合并 notice + 图例） ---------------- */

.source-card {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 13px 18px; margin-bottom: 30px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r); box-shadow: var(--shadow-s);
}
.source-card .sc-text {
  font-size: 13px; color: var(--ink-2); line-height: 1.55;
  flex: 1 1 320px; min-width: 280px;
}
.source-card .sc-text b { color: var(--ink); }

.legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  font-size: 11.5px; color: var(--ink-3);
  flex: 0 1 auto;
}
.legend-t { display: none; }
.legend-i { display: inline-flex; align-items: center; gap: 5px; }
.legend-i b { font-weight: 400; color: var(--ink-2); }

/* ---------------- 页头 ---------------- */

.head h1 {
  margin: 0; font-size: 30px; font-weight: 600;
  letter-spacing: -.022em; line-height: 1.25; color: var(--ink);
}
.head p {
  margin: 12px 0 0; font-size: 14.5px; color: var(--ink-2); max-width: 640px;
  line-height: 1.65;
}

.head-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin-top: 28px; padding: 0;
  border-top: 0;
}
.head-stats > div {
  padding: 16px 22px 4px; border-top: 2px solid var(--line);
  position: relative;
}
.head-stats > div:nth-child(1) { border-top-color: var(--brand); }
.head-stats > div:nth-child(2) { border-top-color: var(--green); }
.head-stats > div:nth-child(3) { border-top-color: var(--ink-3); }
.head-stats > div:nth-child(4) { border-top-color: var(--red); }
.head-stats > div + div { border-left: 1px solid var(--line-2); }

.hs-l { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.hs-v { font-size: 26px; font-weight: 600; letter-spacing: -.022em; margin-top: 6px; line-height: 1.1; }
.hs-v small { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }

/* ---------------- 控件面板（发货方式 + 筛选） ---------------- */

.modebar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 34px 0 0; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-s);
}

.mb-label {
  font-size: 11px; color: var(--ink-3); letter-spacing: .06em;
  text-transform: uppercase; margin-right: 2px;
}

.mb {
  appearance: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 8px 14px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 1px;
  transition: all .15s ease;
}
.mb:hover { border-color: var(--line-strong); background: var(--hover); }
.mb.on { background: var(--brand); border-color: var(--brand); box-shadow: var(--shadow-s); }
.mb-t { font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.mb-s { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.mb.on .mb-t { color: var(--on-ink); }
.mb.on .mb-s { color: var(--on-ink-dim); }

.filters {
  margin: 0; padding: 6px 16px 10px;
  background: var(--card); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: var(--shadow-s);
}

.frow {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.frow:first-child { border-top: 0; }
.frow:last-child { border-bottom: 0; }
.frow-label {
  width: 64px; flex-shrink: 0;
  font-size: 11px; color: var(--ink-3); letter-spacing: .04em;
}

.chip {
  appearance: none; border: 1px solid var(--line); background: transparent;
  border-radius: 99px; padding: 5px 13px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: all .14s ease;
}
.chip:hover { border-color: var(--line-strong); background: var(--hover); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-txt);
  font-weight: 500;
}

.fnum { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
.fnum b { color: var(--ink); font-weight: 600; }

.fclear {
  appearance: none; border: 0; background: transparent;
  font-size: 12.5px; color: var(--ink-3); cursor: pointer;
  padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px;
}
.fclear:hover { color: var(--red); }

/* ---------------- 列表卡片 ---------------- */

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

.card {
  position: relative; overflow: hidden;
  display: block; text-decoration: none;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 20px 16px;
  box-shadow: var(--shadow-s);
  transition: border-color .15s ease, box-shadow .18s ease, transform .15s ease;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--ink-4);
}
.card.v-go::before { background: var(--green); }
.card.v-watch::before { background: var(--amber); }
.card.v-no::before { background: var(--red); }
.card:hover {
  border-color: var(--line-strong); box-shadow: var(--shadow-m); transform: translateY(-2px);
}

.c-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.c-cat { font-size: 11px; color: var(--ink-3); letter-spacing: .03em; text-transform: uppercase; }
.c-name {
  font-size: 15px; font-weight: 600; letter-spacing: -.012em;
  margin: 6px 0 0; line-height: 1.4; color: var(--ink);
}

.badge {
  flex-shrink: 0; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap;
}
.badge.go { background: var(--green-soft); color: var(--green); }
.badge.watch { background: var(--amber-soft); color: var(--amber); }
.badge.no { background: var(--red-soft); color: var(--red); }

.c-mid {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-top: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2);
}
.c-margin { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.c-margin.pos { color: var(--green); }
.c-margin.neg { color: var(--red); }
.c-margin small { font-size: 14px; font-weight: 500; margin-left: 1px; }
.c-margin-l { font-size: 11px; color: var(--ink-3); margin-top: 7px; letter-spacing: .02em; }
.c-price { text-align: right; }
.c-price-v { font-size: 15px; font-weight: 600; }
.c-price-l { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

.c-tr {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 14px;
}
.c-tr div { min-width: 0; }
.c-tr dt { font-size: 10.5px; color: var(--ink-3); letter-spacing: .02em; }
.c-tr dd { margin: 3px 0 0; font-size: 13px; font-weight: 500; }
.c-tr dd.warn { color: var(--amber); }

/* 卡片底部来源标注：彩色圆点 + 文字 */

.c-src {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 11px;
  border-top: 1px solid var(--line-2);
  font-size: 10.5px; color: var(--ink-3);
}
.c-src span { display: inline-flex; align-items: center; gap: 5px; }
.sdot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink-4);
}
.sdot.m { background: var(--green); }
.sdot.d { background: var(--amber); }
.sdot.e { background: var(--red); }
.sdot.x { background: transparent; border: 1.5px dashed var(--red); }

.empty {
  padding: 70px 0; text-align: center;
  font-size: 14px; color: var(--ink-3);
}

/* ---------------- 详情 ---------------- */

.detail { display: none; }
.app[data-view="detail"] .list { display: none; }
.app[data-view="detail"] .detail { display: block; }

.d-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2); text-decoration: none;
  padding: 5px 10px 5px 6px; border-radius: 7px; margin-bottom: 22px;
}
.d-back:hover { color: var(--ink); background: var(--bg-2); }

.d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.d-head h2 {
  margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3;
}
.d-meta {
  margin: 10px 0 0; font-size: 13px; color: var(--ink-3);
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
.d-meta span { display: inline-flex; align-items: center; gap: 6px; }
.d-meta .cf { margin-left: 2px; }

.d-verdict {
  flex-shrink: 0; padding: 10px 16px; border-radius: var(--r);
  text-align: center; min-width: 76px;
}
.d-verdict-l { font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.d-verdict-v { font-size: 18px; font-weight: 600; margin-top: 3px; }
.d-verdict.go { background: var(--green-soft); }
.d-verdict.watch { background: var(--amber-soft); }
.d-verdict.no { background: var(--red-soft); }
.d-verdict.go .d-verdict-v { color: var(--green); }
.d-verdict.watch .d-verdict-v { color: var(--amber); }
.d-verdict.no .d-verdict-v { color: var(--red); }

.d-prov {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  margin: 20px 0 4px; padding: 12px 16px;
  background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: var(--r);
  font-size: 12px; color: var(--ink-2);
}
.d-prov-t { font-size: 10.5px; color: var(--brand-2); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.d-prov-g { display: block; }
.d-prov-g .cf { margin: 0 3px; vertical-align: 1px; }
.d-prov-g b { font-weight: 600; color: var(--ink); }

.d-cols {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; margin-top: 18px;
}

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 20px 18px;
  box-shadow: var(--shadow-s);
}
.panel h3 {
  margin: 0 0 16px; font-size: 13px; font-weight: 600; color: var(--ink);
  letter-spacing: -.005em;
  display: flex; align-items: center; gap: 8px;
}
.panel .pn {
  font-size: 10.5px; font-weight: 700; color: var(--brand-2);
  letter-spacing: .04em;
  padding: 2px 6px; border-radius: 4px;
  background: var(--brand-soft);
}

.kv {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 6px 0; font-size: 13.5px;
}
.kv-k {
  color: var(--ink-2); display: flex; align-items: center; gap: 7px;
  flex: 1 1 auto; min-width: 0; flex-wrap: wrap;
}
/* 数值永远不被挤压：窄栏下让标签换行，而不是把数字挤出边界 */
.kv-v { font-weight: 500; flex: 0 0 auto; }
.kv-v.mute { color: var(--ink-3); font-weight: 400; }
.kv-total {
  margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line);
  font-weight: 600;
}

.bar-track {
  width: 46px; height: 3px; border-radius: 2px;
  background: var(--line); overflow: hidden; flex-shrink: 0;
}
.bar-fill { height: 100%; border-radius: 2px; background: var(--ink-3); }

.d-note {
  margin-top: 16px; padding: 18px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-s);
  display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: start;
}
.d-note-l { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.d-note p { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink); }

.d-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 9px 16px;
  font-size: 13.5px; color: var(--ink-2); cursor: pointer;
  transition: all .14s ease; text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-s); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-ink); }
.btn.primary:hover { background: var(--brand-deep); color: var(--on-ink); box-shadow: var(--shadow-m); }

/* ---------------- 物流三档对比 ---------------- */

.logi-cmp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lc {
  padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg);
}
.lc.on { border-color: var(--brand); background: var(--brand-soft); }
.lc-l { font-size: 11px; color: var(--ink-3); }
.lc-v { font-size: 22px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; margin-top: 6px; color: var(--green); }
.lc-v.neg { color: var(--red); }
.lc-n { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

/* ---------------- 置信度标记 ----------------
   M 实测 / D 推算 / E 估算 三色；X 未采集沿用红但改虚线框 */

.cf {
  display: inline-flex; align-items: center; flex-shrink: 0;
  font-size: 9.5px; line-height: 1; font-style: normal; font-weight: 600;
  padding: 3px 5px; border-radius: 4px; letter-spacing: .02em;
  white-space: nowrap; border: 1px solid transparent;
}
.cf-m { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, currentColor 22%, transparent); }
.cf-d { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, currentColor 22%, transparent); }
.cf-e { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, currentColor 22%, transparent); }
.cf-x { background: transparent; color: var(--red-dim); border: 1px dashed color-mix(in srgb, currentColor 40%, transparent); }

/* ---------------- 方法学 ---------------- */

.method {
  margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line);
}
.method h4 { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: -.005em; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.method-grid h5 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.method-grid p { margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); }
.method-grid code { font-family: var(--mono); font-size: 11.5px; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }

.prov-note {
  margin-top: 24px; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--amber); border-radius: 10px;
}
.prov-note h5 { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.prov-note p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); }
.prov-note p:last-child { margin-bottom: 0; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-cols { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  .head-stats { grid-template-columns: repeat(2, 1fr); }
  .head-stats > div:nth-child(3) { border-left: 0; }
}

@media (max-width: 640px) {
  .wrap { padding: 28px 18px 64px; }
  .bar { padding: 0 18px; }
  .grid { grid-template-columns: 1fr; }
  .head h1 { font-size: 24px; }
  .d-head { flex-direction: column; }
  .d-note { grid-template-columns: 1fr; gap: 8px; }
  /* 竖排时 flex-basis 会变成高度，来源卡里会撑出一大块空白 */
  .source-card { flex-direction: column; align-items: flex-start; }
  .source-card .sc-text, .source-card .legend { flex: 0 0 auto; }
  .mb { flex: 1 1 100%; }
  .mkt-lab { display: none; }
  .mkt-btn { height: 30px; padding: 0 5px 0 7px; gap: 4px; font-size: 12px; max-width: 128px; }
  .mkt-cur { font-size: 9px; padding: 1px 4px; }
  /* 面板挂在顶栏右侧，左边留给它的空间有限，宽度按视口留出右侧 72px */
  .mkt-pop { width: min(310px, calc(100vw - 72px)); max-height: 64vh; grid-template-columns: 1fr; }
  .mp-it { padding: 9px 10px; font-size: 13px; }
  .mp-hd { padding: 9px 10px; }
  .logi-cmp { grid-template-columns: 1fr; }
}

/* ---------------- 返回工具箱 ---------------- */

.bar-back {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--ink-3);
  text-decoration: none; white-space: nowrap;
  padding: 5px 9px 5px 7px; margin-left: -7px;
  border-radius: 7px;
  transition: background .14s ease, color .14s ease;
}
.bar-back svg { width: 13px; height: 13px; margin-top: -.5px; }
.bar-back:hover { background: var(--bg); color: var(--ink); }

/* 窄屏优先保住核心信息：先收标签，再收日期 */
@media (max-width: 900px) {
  .bar-tag { display: none; }
}
@media (max-width: 720px) {
  .bar-back { font-size: 0; gap: 0; padding: 6px; margin-left: -6px; }
  .bar-back svg { width: 16px; height: 16px; margin: 0; }
  .bar-right > span:nth-child(n+2) { display: none; }
}
