/* ============================================================
   吾爱比价 · 前台设计系统
   纸面行情台：暖白纸底 + 墨黑强调 + 细边框白卡 + 小字距眉题
   ============================================================ */

/* 自托管展示字体（数字/拉丁），符合 CSP style-src/font-src 'self' */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #111110;
  --paper: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --surface-3: #eeeeeb;
  --text: #111110;
  --muted: #6b6b66;
  --faint: #9b9b94;
  --line: #e4e4df;
  --line-strong: #d8d8d2;
  --grid-line: rgba(17, 17, 16, .04);

  --nav-active-bg: #111110;
  --nav-active-text: #ffffff;
  --accent-text: #111110;
  --accent-soft: #eeeeeb;
  --accent-glow: rgba(17, 17, 16, .12);

  --green: #16a34a;
  --green-bright: #22c55e;
  --amber: #d97706;
  --blue: #2563eb;
  --red: #dc2626;

  --shadow-sm: 0 1px 2px rgba(17, 17, 16, .04), 0 1px 3px rgba(17, 17, 16, .06);
  --shadow-md: 0 2px 6px rgba(17, 17, 16, .06), 0 10px 26px rgba(17, 17, 16, .07);
  --shadow-lg: 0 6px 18px rgba(17, 17, 16, .1), 0 22px 50px rgba(17, 17, 16, .12);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --ease: cubic-bezier(.22, .9, .3, 1);
  --sidebar-w: 232px;
  --topbar-h: 64px;

  --font-body: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  color-scheme: light;
}

[data-theme="dark"] {
  --ink: #f2f2ef;
  --paper: #0e0e0d;
  --surface: #161615;
  --surface-2: #1c1c1a;
  --surface-3: #232321;
  --text: #f2f2ef;
  --muted: #a3a39c;
  --faint: #6f6f68;
  --line: #262624;
  --line-strong: #333331;
  --grid-line: rgba(242, 242, 239, .035);

  --nav-active-bg: #f2f2ef;
  --nav-active-text: #111110;
  --accent-text: #f2f2ef;
  --accent-soft: #232321;
  --accent-glow: rgba(242, 242, 239, .16);

  --green: #4ade80;
  --green-bright: #4ade80;
  --amber: #fbbf24;
  --blue: #60a5fa;
  --red: #f87171;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .4), 0 10px 26px rgba(0, 0, 0, .35);
  --shadow-lg: 0 6px 18px rgba(0, 0, 0, .5), 0 22px 50px rgba(0, 0, 0, .45);

  color-scheme: dark;
}

/* ---------- 基础 ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 纸面细网格环境底纹 */
.directory-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
p { margin: 0; }
strong { font-weight: 700; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.01em; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--nav-active-bg); color: var(--nav-active-text); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }

.wrap, .live-sync-bar, .directory-section, .directory-announcement, .page-head, .stat-grid, .snapshot-section {
  width: min(1240px, 100% - 48px);
  margin-inline: auto;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
}

.text-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.text-link .icon { width: 14px; height: 14px; }
.text-link:hover { color: var(--accent-text); text-decoration: underline; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.icon-button:hover { background: var(--surface-3); color: var(--accent-text); }
.icon-button:active { transform: scale(.96); }

/* 分类图标块：低饱和浅色底 */
.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--muted);
}
.icon-tile .icon { width: 20px; height: 20px; }
.tone-indigo { color: #4f46e5; background: rgba(79, 70, 229, .08); }
.tone-mint   { color: #059669; background: rgba(5, 150, 105, .08); }
.tone-peach  { color: #c2620a; background: rgba(217, 119, 6, .1); }
.tone-blue   { color: #2563eb; background: rgba(37, 99, 235, .08); }
.tone-rose   { color: #db2777; background: rgba(219, 39, 119, .08); }
.tone-slate  { color: #475569; background: rgba(71, 85, 105, .08); }
[data-theme="dark"] .icon-tile { background: var(--surface-3); color: var(--muted); }
[data-theme="dark"] .tone-indigo { color: #a5b4fc; background: rgba(165, 180, 252, .1); }
[data-theme="dark"] .tone-mint   { color: #6ee7b7; background: rgba(110, 231, 183, .1); }
[data-theme="dark"] .tone-peach  { color: #fcd34d; background: rgba(252, 211, 77, .1); }
[data-theme="dark"] .tone-blue   { color: #93c5fd; background: rgba(147, 197, 253, .1); }
[data-theme="dark"] .tone-rose   { color: #f9a8d4; background: rgba(249, 168, 212, .1); }
[data-theme="dark"] .tone-slate  { color: #cbd5e1; background: rgba(203, 213, 225, .1); }

/* ---------- 按钮 ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s, transform .16s var(--ease), box-shadow .16s;
}
.button .icon { width: 15px; height: 15px; }
.button.primary { background: var(--nav-active-bg); color: var(--nav-active-text); }
.button.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
[data-theme="dark"] .button.primary { background: var(--nav-active-bg); color: var(--nav-active-text); }
.button.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.button.secondary:hover { background: var(--surface-3); }
.button:active { transform: scale(.98); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

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

.topbar {
  position: fixed;
  inset: 0 0 auto;
  height: var(--topbar-h);
  z-index: 60;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s;
}
body.scrolled .topbar { box-shadow: var(--shadow-sm); }
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(1400px, 100% - 32px);
  height: 100%;
  margin-inline: auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
}
.brand-mark .icon { width: 18px; height: 18px; }
.brand > span:last-child { display: grid; line-height: 1.2; }
.brand strong { font-size: 15px; font-weight: 800; }
.brand small { font-size: 10.5px; letter-spacing: .08em; color: var(--faint); }

.top-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background .16s, color .16s;
}
.top-nav a .icon { width: 16px; height: 16px; }
.top-nav a:hover { background: var(--surface-3); color: var(--accent-text); }
.top-nav a[aria-current="page"] { background: var(--nav-active-bg); color: var(--nav-active-text); }
[data-theme="dark"] .top-nav a[aria-current="page"] { background: var(--nav-active-bg); color: var(--nav-active-text); }

.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.directory-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.directory-admin-link .icon { width: 15px; height: 15px; }
.directory-admin-link:hover { background: var(--surface-3); color: var(--accent-text); }
.directory-mobile-menu { display: none; }

.theme-toggle .theme-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-moon { display: block; }

/* ---------- 侧栏 ---------- */

.directory-sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  padding: 20px 14px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, var(--paper));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .28s var(--ease);
}
.directory-sidebar > * { flex: none; }
.directory-sidebar-head { display: none; }
.directory-sidebar-head strong { font-size: 15px; }
.directory-sidebar-divider { height: 1px; background: var(--line); }

.directory-category-nav { display: grid; gap: 3px; }
.directory-category-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background .16s, color .16s;
}
.directory-category-nav a .icon { width: 16px; height: 16px; }
.directory-category-nav a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.directory-category-nav a small {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
}
.directory-category-nav a:hover { background: var(--surface-3); color: var(--accent-text); }
.directory-category-nav a.active { background: var(--nav-active-bg); color: var(--nav-active-text); }
.directory-category-nav a.active small { background: color-mix(in srgb, var(--nav-active-text) 18%, transparent); color: var(--nav-active-text); }
.directory-category-nav a.active::before { content: none; }
.directory-extra-links a { margin-top: 2px; }

.directory-collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.directory-collapse .icon { width: 15px; height: 15px; transition: transform .24s var(--ease); }
.directory-collapse:hover { background: var(--surface-3); color: var(--accent-text); }
body.directory-collapsed .directory-collapse .icon { transform: rotate(180deg); }
body.directory-collapsed .directory-sidebar { transform: translateX(calc(-1 * var(--sidebar-w) + 46px)); }
body.directory-collapsed .directory-sidebar > *:not(.directory-collapse) { opacity: 0; pointer-events: none; }
body.directory-collapsed .directory-collapse span { display: none; }

.directory-backdrop { position: fixed; inset: 0; background: rgba(17, 17, 16, .4); z-index: 65; }
body.directory-menu-open { overflow: hidden; }

.directory-content { position: relative; z-index: 1; margin-left: var(--sidebar-w); padding-top: var(--topbar-h); transition: margin .28s var(--ease); }
body.directory-collapsed .directory-content { margin-left: 46px; }
.directory-content > main { display: block; padding-bottom: 40px; }

.directory-stock-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding-inline: 6px; }
.directory-stock-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); }

/* ---------- 同步状态条 ---------- */

.live-sync-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 22px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  color: var(--muted);
}
.live-sync-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live-sync-bar[data-state="online"] .dot { background: var(--green-bright); animation: pulse-dot 2s infinite; }
.live-sync-bar[data-state="retrying"] .dot { background: var(--amber); animation: pulse-dot 1s infinite; }
.live-sync-bar[data-state="offline"] .dot { background: var(--red); }
.live-sync-bar[data-state="paused"] .dot { background: var(--faint); }
.live-sync-state { display: inline-flex; align-items: center; gap: 8px; }
.live-sync-state strong { color: var(--text); font-weight: 700; }
.live-update-feedback { margin-left: auto; color: var(--faint); }

/* ---------- 页头 / 统计 ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 30px; }
.page-head-copy { display: grid; gap: 8px; min-width: 0; }
.page-eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.page-eyebrow .icon { width: 14px; height: 14px; color: var(--green); }
.page-title { font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.page-sub { max-width: 62ch; font-size: 13.5px; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.stat-tile {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 4px;
}
.stat-tile::after {
  content: "";
  position: absolute;
  top: -36px;
  right: -36px;
  width: 100px;
  height: 100px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value .unit { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat-caption { font-size: 12px; color: var(--faint); }

/* ---------- 低价风向标 ---------- */

.snapshot-section { margin-top: 34px; }
.snapshot-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.snapshot-head > div { display: grid; gap: 5px; }
.snapshot-head h2 { font-size: 20px; }
.snapshot-note { max-width: 52ch; font-size: 12px; color: var(--faint); text-align: right; }
.snapshot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.snapshot-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 10px;
}
.snapshot-card-head { display: flex; align-items: center; gap: 9px; }
.snapshot-card-head strong { font-size: 13.5px; }
.snapshot-card-head .text-link { margin-left: auto; }
.snapshot-body {
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.snapshot-top { display: flex; align-items: center; gap: 9px; }
.snapshot-top > span:first-child { font-size: 12px; color: var(--muted); }
.snapshot-stock { font-size: 11px; font-weight: 700; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); padding: 2px 8px; border-radius: 999px; }
.snapshot-price { margin-left: auto; font-family: var(--font-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.snapshot-price .currency { font-size: .7em; font-weight: 600; color: var(--muted); }
.snapshot-delta { font-size: 11px; font-weight: 600; color: var(--faint); }
.snapshot-delta.down { color: var(--green); }
.snapshot-delta.up { color: var(--red); }
.snapshot-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snapshot-shop { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snapshot-foot { display: flex; align-items: center; gap: 14px; }
.snapshot-time { margin-left: auto; font-size: 11px; color: var(--faint); }

/* ---------- 通用区块 / 面板 ---------- */

.directory-section { margin-top: 30px; }
.directory-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.directory-section-heading h2 { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; }
.directory-section-heading h2 .icon { width: 18px; height: 18px; color: var(--muted); }
.directory-section-heading h2 small { font-size: 12px; font-weight: 700; color: var(--faint); background: var(--surface-3); padding: 1px 9px; border-radius: 999px; white-space: nowrap; }
.directory-section-note { font-size: 12px; color: var(--faint); }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.panel-hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.panel-hint .icon { width: 15px; height: 15px; color: var(--faint); }

.page-heading { display: grid; gap: 6px; margin-bottom: 18px; }
.page-heading h1 { font-size: 26px; }
.section-head { display: grid; gap: 4px; margin-bottom: 14px; }
.section-head h2 { font-size: 18px; }
.section-head p { font-size: 12.5px; color: var(--muted); }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 12px; color: var(--faint); margin-bottom: 14px; }
.breadcrumbs a:hover { color: var(--accent-text); text-decoration: underline; }
.breadcrumbs span:last-child { color: var(--muted); font-weight: 600; }

/* ---------- 目录面板 + 筛选 ---------- */

.directory-catalog {
  width: min(1240px, 100% - 48px);
  margin: 30px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.directory-catalog > .empty-state { border: 0; border-radius: 0; box-shadow: none; }
.directory-catalog-toolbar { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.directory-catalog-toolbar .directory-section-heading { margin-bottom: 14px; }
.directory-filter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.directory-filter-form .select-control select { max-width: 160px; }
.directory-in-stock { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--green); }
.directory-in-stock .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); }
.directory-in-stock .icon { width: 14px; height: 14px; }
.directory-add-link { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--accent-text); }
.directory-add-link:hover { text-decoration: underline; }
.reset-filters { font-size: 12.5px; font-weight: 600; color: var(--red); }
.reset-filters:hover { text-decoration: underline; }

.catalog-search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 220px;
  height: 40px;
  padding: 0 6px 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .16s, box-shadow .16s;
}
.catalog-search > .icon { width: 16px; height: 16px; color: var(--faint); }
.catalog-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 13px; }
.catalog-search input::placeholder { color: var(--faint); }
.catalog-search:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-glow); }
.catalog-search button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.catalog-search button .icon { width: 14px; height: 14px; }
.catalog-search button:hover { opacity: .9; }
.catalog-search button:active { transform: scale(.97); }

.platform-tabs { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.platform-tabs a { padding: 6px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.platform-tabs a:hover { color: var(--accent-text); }
.platform-tabs a[aria-current="page"] { background: var(--nav-active-bg); color: var(--nav-active-text); }

.search-control, .select-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .16s, box-shadow .16s;
}
.search-control .icon, .select-control > .icon:first-child { width: 15px; height: 15px; color: var(--faint); }
.search-control input { border: 0; background: none; outline: none; font-size: 13px; min-width: 0; }
.search-control:focus-within, .select-control:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-glow); }
.select-control { position: relative; }
.select-control select { appearance: none; border: 0; background: none; outline: none; font-size: 13px; font-weight: 600; padding-right: 20px; cursor: pointer; }
.select-control .select-arrow { position: absolute; right: 10px; width: 14px; height: 14px; color: var(--faint); pointer-events: none; }
.directory-search { display: flex; gap: 10px; margin-bottom: 16px; }
.directory-search .search-control { flex: 1; }

/* ---------- 商品行列表 ---------- */

.catalog-list { background: transparent; }
.row-costs, .quote-basis { color: var(--muted); font-size: 12px; line-height: 1.5; }
.row-costs { white-space: nowrap; }
.detail-price .quote-basis { text-align: right; }
.catalog-list-head, .catalog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px 150px 168px;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
}
.catalog-list-head {
  padding: 10px 22px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.catalog-list-head span:nth-child(3), .catalog-list-head span:nth-child(4) { text-align: right; }
.catalog-row { border-bottom: 1px solid var(--line); transition: background .14s; }
.catalog-row:last-child { border-bottom: 0; }
.catalog-row:hover { background: var(--surface-2); }
.catalog-list > .catalog-row:last-child,
.catalog-list > .source-group:last-child .catalog-row:last-child { border-bottom: 0; }

html.js-reveal .reveal { opacity: 0; transform: translateY(14px); }
html.js-reveal .reveal.revealed { opacity: 1; transform: translateY(0); transition: opacity .5s var(--ease), transform .5s var(--ease); }

.row-identity { display: flex; align-items: center; gap: 13px; min-width: 0; color: inherit; }
.row-thumb { flex: none; }
.row-thumb .icon-tile { width: 44px; height: 44px; border-radius: 12px; }
.row-thumb .icon-tile .icon { width: 20px; height: 20px; }
.row-main { display: grid; gap: 4px; min-width: 0; }
.row-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-name strong { font-size: 14px; font-weight: 700; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-identity:hover .row-name strong { text-decoration: underline; }
.row-badge { flex: none; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.badge-low { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.badge-pending { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.row-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-stock { font-style: normal; font-weight: 700; color: var(--green); }

.row-shop { display: flex; align-items: center; gap: 10px; min-width: 0; }
.platform-pill { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; border: 1px solid transparent; white-space: nowrap; }
.pf-16688 { color: var(--amber); background: color-mix(in srgb, var(--amber) 9%, transparent); border-color: color-mix(in srgb, var(--amber) 28%, transparent); }
.pf-ldxp { color: var(--blue); background: color-mix(in srgb, var(--blue) 9%, transparent); border-color: color-mix(in srgb, var(--blue) 28%, transparent); }
.row-shop-text { display: grid; gap: 1px; min-width: 0; line-height: 1.3; }
.row-shop-text strong { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-shop-text small { font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-price { display: grid; gap: 2px; justify-items: end; text-align: right; }
.row-amount { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.row-amount .currency { font-size: .72em; font-weight: 600; color: var(--muted); }
.trend-icon { width: 15px; height: 15px; }
.row-delta { font-size: 11.5px; font-weight: 600; }
.row-delta.down { color: var(--green); }
.row-delta.up { color: var(--red); }
.row-delta.flat, .row-delta.first { color: var(--faint); }
.catalog-row:has(.row-delta.down) .trend-icon { color: var(--green); }
.catalog-row:has(.row-delta.up) .trend-icon { color: var(--red); }
.catalog-row:has(.row-delta.flat) .trend-icon { color: var(--faint); }

.row-actions { display: grid; gap: 6px; justify-items: end; }
.row-expand { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.row-expand .icon { width: 13px; height: 13px; }
.row-expand:hover { color: var(--accent-text); text-decoration: underline; }
.row-buttons { display: flex; gap: 8px; }
.row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 7px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  transition: background .14s, border-color .14s, transform .14s var(--ease);
}
.row-btn:hover { background: var(--surface-2); border-color: var(--faint); transform: translateY(-1px); }

/* 相似商品分组 */
.source-group-child { display: none; background: var(--surface-2); box-shadow: inset 2px 0 0 var(--line-strong); }
.source-group.open .source-group-child { display: grid; }
.source-group-child .row-thumb .icon-tile { width: 36px; height: 36px; border-radius: 10px; }
.source-group-child .row-thumb .icon-tile .icon { width: 17px; height: 17px; }
.source-group-child .row-name strong { font-size: 13px; }
.source-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.source-group-toggle:hover { color: var(--accent-text); text-decoration: underline; }
.source-group-toggle .toggle-chevron { width: 12px; height: 12px; transition: transform .2s var(--ease); }
.source-group.open .source-group-toggle .toggle-chevron { transform: rotate(180deg); }

/* ---------- 价格明细 / 库存 ---------- */

.offer-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.offer-breakdown > div { display: grid; gap: 1px; min-width: 0; }
.offer-breakdown dt { font-size: 11px; letter-spacing: .06em; color: var(--faint); }
.offer-breakdown dd { margin: 0; font-family: var(--font-display); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer-breakdown .currency { font-size: .78em; font-weight: 600; margin-right: 1px; color: var(--muted); }
.offer-breakdown-total dd { font-size: 17px; color: var(--accent-text); }
.offer-breakdown-total dd .currency { color: inherit; }
.fee-pending { font-size: 11.5px; font-weight: 600; color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.fee-status-note { color: var(--faint); font-size: 11.5px; }

.stock-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.stock-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stock-in { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.stock-out { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.stock-unknown { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }

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

.detail-page > .live-sync-bar, .import-page ~ * .live-sync-bar { margin-top: 22px; }
.detail-page > .empty-state { margin-top: 30px; }
.detail-hero { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px; padding: 26px; overflow: hidden; }
.detail-hero > * { position: relative; }
.detail-hero::after { content: none; }
.detail-identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.detail-identity .icon-tile { width: 56px; height: 56px; border-radius: 15px; }
.detail-identity .icon-tile .icon { width: 26px; height: 26px; }
.detail-identity > div { display: grid; gap: 5px; min-width: 0; }
.detail-identity h1 { font-size: 22px; line-height: 1.3; }
.detail-identity p { font-size: 12.5px; color: var(--muted); max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.detail-price { display: grid; gap: 6px; justify-items: end; text-align: right; }
.detail-price > span { font-family: var(--font-display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail-price > small { font-size: 12px; color: var(--faint); }
.detail-offer-breakdown { min-width: 300px; }
.detail-offer-breakdown dd { font-size: 15px; }
.detail-offer-breakdown .offer-breakdown-total dd { font-size: 19px; }
.detail-cta { display: flex; gap: 10px; justify-content: flex-end; width: 100%; }
.detail-section { margin-top: 26px; }

.offer-panel, .chart-panel { padding: 22px; }
.offer-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.offer-filters .directory-in-stock { margin-left: auto; }

.table-scroll { overflow-x: auto; }
.table-title { font-size: 15px; margin-bottom: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table td small { display: block; font-size: 11px; color: var(--faint); }
.data-table time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.data-table .number { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .number .currency { font-size: .75em; font-weight: 600; color: var(--muted); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.best-row { background: color-mix(in srgb, var(--green) 6%, transparent); }
.best-row td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.best-label { font-size: 10.5px; font-weight: 700; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); padding: 1px 8px; border-radius: 999px; margin-left: 7px; white-space: nowrap; }
[data-theme="dark"] .best-label { color: var(--green); }
.count-label { font-size: 12px; color: var(--faint); }
.category-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }

.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.segmented a { padding: 6px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.segmented a:hover { color: var(--accent-text); }
.segmented a[aria-current="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow-sm); }

.chart-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chart-key { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.chart-key .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.chart-scroll { overflow-x: auto; }
.trend-chart { width: 100%; min-width: 520px; height: auto; color: var(--green); }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-label { fill: var(--faint); font-size: 10px; font-family: var(--font-display); }
.chart-line { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-line 1.1s var(--ease) forwards; }
.chart-dot { fill: var(--surface); stroke: var(--green); stroke-width: 2; }
.chart-dot:hover { r: 5; }
.chart-fill-start { stop-color: var(--green); stop-opacity: .18; }
.chart-fill-end { stop-color: var(--green); stop-opacity: 0; }
.chart-caption { font-size: 12px; color: var(--muted); margin-top: 10px; }
.chart-note { font-size: 11.5px; color: var(--faint); margin-top: 6px; }

/* ---------- 提示 / 空态 ---------- */

.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.notice .icon { width: 16px; height: 16px; margin-top: 2px; }
.notice-error { border-color: color-mix(in srgb, var(--red) 35%, transparent); background: color-mix(in srgb, var(--red) 7%, transparent); color: var(--red); }
.notice-error .icon { color: var(--red); }
.notice-info { border-color: color-mix(in srgb, var(--blue) 35%, transparent); background: color-mix(in srgb, var(--blue) 7%, transparent); }
.notice-info .icon { color: var(--blue); }
.notice-success { border-color: color-mix(in srgb, var(--green) 35%, transparent); background: color-mix(in srgb, var(--green) 7%, transparent); }
.notice-success .icon { color: var(--green); }

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 46px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.empty-state .icon-tile { width: 52px; height: 52px; border-radius: 15px; }
.empty-state .icon-tile .icon { width: 24px; height: 24px; }
.empty-state strong { font-size: 15px; }
.empty-state p { font-size: 12.5px; color: var(--muted); max-width: 46ch; }
.empty-state .button { margin-top: 6px; }
.narrow-page { width: min(760px, 100% - 48px); margin-inline: auto; }
.narrow-page .empty-state { margin-top: 30px; }

.directory-announcement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 26px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--muted);
}
.directory-announcement .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--blue); }
.directory-announcement strong { color: var(--text); white-space: nowrap; }

/* ---------- 店铺 / 提交 / 采集 ---------- */

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.shop-card { padding: 20px; display: grid; gap: 10px; transition: border-color .16s, box-shadow .16s, transform .16s var(--ease); }
.shop-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.shop-card h2 { font-size: 16px; }
.shop-card > p { font-size: 12.5px; color: var(--muted); }
.shop-card-actions { display: flex; gap: 8px; margin-top: 4px; }
.product-top { display: flex; align-items: center; gap: 12px; }
.product-top .icon-tile { width: 44px; height: 44px; }

.import-page { padding-top: 8px; }
.import-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 20px; align-items: start; }
.import-intro { display: grid; gap: 8px; margin-bottom: 18px; }
.import-intro h1 { font-size: 26px; }
.import-intro p { font-size: 13px; color: var(--muted); max-width: 64ch; }
.import-card { padding: 24px; display: grid; gap: 16px; }
.import-card h2 { font-size: 17px; }
.import-explainer { font-size: 12.5px; color: var(--muted); }
.import-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.import-steps li { position: relative; padding-left: 34px; counter-increment: step; }
.import-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
}
.import-steps li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 26px; bottom: -12px; width: 1px; background: var(--line); }
.import-steps strong { display: block; font-size: 13.5px; }
.import-steps p { font-size: 12.5px; color: var(--muted); }
.import-url-row { display: flex; gap: 10px; }
.import-url-row input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  outline: none;
  font-size: 13px;
}
.import-url-row input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-glow); }
.stack-form { display: grid; gap: 12px; }
.stack-form label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; }
.stack-form label .optional { font-size: 11px; font-weight: 400; color: var(--faint); }
.field-hint { font-size: 11.5px; color: var(--faint); font-weight: 400; }

.collection-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.collection-metrics > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); display: grid; gap: 2px; }
.collection-metrics dt { font-size: 11px; color: var(--faint); }
.collection-metrics dd { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.collection-metrics span { font-size: 11px; color: var(--muted); }
.collection-title { display: flex; align-items: center; gap: 10px; }
.collection-title h3 { font-size: 15px; }
.collection-actions { display: flex; gap: 10px; }
.collection-skip-note { font-size: 12px; color: var(--muted); }
.collection-skip-note strong { color: var(--amber); }
.collector-progress { display: grid; gap: 14px; }
.collector-progress > p[role="status"] { font-size: 13px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--accent-text); border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------- 页脚 ---------- */

.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; padding-block: 22px; font-size: 12.5px; color: var(--muted); }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); }
.footer-brand .icon { width: 18px; height: 18px; }
.footer-inner > span:nth-child(2) { flex: 1; min-width: 240px; }
.footer-inner a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent-text); }
.footer-inner a .icon { width: 14px; height: 14px; }
.footer-inner a:hover { text-decoration: underline; }

/* ---------- 动画 ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 35%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 质感升级 ---------- */

/* 环境光晕：纸面之上的两团极淡暖光 */
.directory-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(620px 320px at 84% -80px, color-mix(in srgb, var(--green) 7%, transparent), transparent 70%),
    radial-gradient(760px 360px at 10% -100px, color-mix(in srgb, var(--amber) 6%, transparent), transparent 72%);
}
[data-theme="dark"] .directory-body::after {
  background:
    radial-gradient(620px 320px at 84% -80px, color-mix(in srgb, var(--green) 9%, transparent), transparent 70%),
    radial-gradient(760px 360px at 10% -100px, color-mix(in srgb, var(--amber) 7%, transparent), transparent 72%);
}

/* 卡面顶部发丝高光 */
.stat-tile, .snapshot-card, .panel, .directory-catalog, .live-sync-bar, .directory-announcement, .import-card {
  box-shadow: var(--shadow-sm), inset 0 1px 0 color-mix(in srgb, #fff 70%, transparent);
}
[data-theme="dark"] .stat-tile, [data-theme="dark"] .snapshot-card, [data-theme="dark"] .panel,
[data-theme="dark"] .directory-catalog, [data-theme="dark"] .live-sync-bar,
[data-theme="dark"] .directory-announcement, [data-theme="dark"] .import-card {
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.stat-tile, .snapshot-card { transition: border-color .18s, box-shadow .18s var(--ease), transform .18s var(--ease); }
.stat-tile:hover { border-color: var(--line-strong); }
.snapshot-card:hover, .stat-action:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), inset 0 1px 0 color-mix(in srgb, #fff 70%, transparent);
}
[data-theme="dark"] .snapshot-card:hover, [data-theme="dark"] .stat-action:hover {
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* 主按钮釉面 */
.button.primary, .catalog-search button {
  background-image: linear-gradient(180deg, color-mix(in srgb, #fff 14%, transparent), transparent 58%);
}

/* 行内图标微浮起 */
.row-thumb .icon-tile { transition: transform .18s var(--ease), box-shadow .18s; }
.catalog-row:hover .row-thumb .icon-tile { transform: scale(1.06); box-shadow: var(--shadow-sm); }

/* 激活态墨丸投影 */
.directory-category-nav a.active, .top-nav a[aria-current="page"], .platform-tabs a[aria-current="page"] { box-shadow: var(--shadow-sm); }

/* 顶栏阅读进度线 */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--green), var(--amber));
  pointer-events: none;
}

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

@media (max-width: 1100px) {
  .top-nav a span { display: none; }
  .import-layout { grid-template-columns: 1fr; }
  .catalog-list-head, .catalog-row { grid-template-columns: minmax(0, 1fr) 170px 128px 150px; gap: 12px; padding-inline: 16px; }
  .stat-value { font-size: 32px; }
}

@media (max-width: 800px) {
  :root { --topbar-h: 58px; }
  .wrap, .live-sync-bar, .directory-section, .directory-announcement, .page-head, .stat-grid, .snapshot-section, .directory-catalog { width: min(1240px, 100% - 32px); }
  .directory-mobile-menu { display: inline-grid; }
  .top-nav { display: none; }
  .directory-admin-link span { display: none; }
  .directory-admin-link { padding: 8px 11px; }
  .brand small { display: none; }

  .directory-sidebar {
    top: 0;
    width: min(300px, 84vw);
    padding-top: 16px;
    transform: translateX(-105%);
    box-shadow: var(--shadow-lg);
    z-index: 70;
    background: var(--surface);
  }
  body.directory-menu-open .directory-sidebar { transform: translateX(0); }
  body.directory-menu-open { overflow: hidden; }
  .directory-sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-inline: 6px; }
  .directory-collapse { display: none; }
  body.directory-collapsed .directory-sidebar { transform: translateX(-105%); }
  body.directory-collapsed .directory-sidebar > *:not(.directory-collapse) { opacity: 1; pointer-events: auto; }
  body.directory-collapsed.directory-menu-open .directory-sidebar { transform: translateX(0); }
  .directory-content, body.directory-collapsed .directory-content { margin-left: 0; }

  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 22px; }
  .page-title { font-size: 27px; }
  .stat-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat-tile { padding: 16px 18px; }
  .stat-value { font-size: 30px; }
  .snapshot-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .snapshot-note { text-align: left; }
  .snapshot-grid { grid-template-columns: 1fr; }

  .live-sync-bar { border-radius: var(--radius); padding: 10px 16px; }
  .live-update-feedback { margin-left: 0; flex-basis: 100%; }

  .detail-hero { padding: 22px 18px; }
  .detail-price { justify-items: start; text-align: left; width: 100%; }
  .detail-cta { justify-content: flex-start; }
  .detail-offer-breakdown { width: 100%; min-width: 0; }
  .offer-panel, .chart-panel { padding: 18px 16px; }
  .offer-filters .directory-in-stock { margin-left: 0; flex-basis: 100%; }

  .directory-catalog-toolbar { padding: 16px; }
  .collection-metrics { grid-template-columns: repeat(2, 1fr); }
  .import-card { padding: 20px 18px; }
  .import-url-row { flex-direction: column; }

  .catalog-list-head { display: none; }
  .catalog-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "identity price" "shop actions";
    gap: 11px 14px;
    padding: 15px 16px;
  }
  .row-identity { grid-area: identity; }
  .row-price { grid-area: price; }
  .row-shop { grid-area: shop; }
  .row-actions { grid-area: actions; }
}

@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr; }
  .directory-section-heading { flex-direction: column; align-items: flex-start; gap: 10px; }
  .catalog-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "identity" "price" "shop" "actions"; gap: 10px; }
  .row-price { justify-items: start; text-align: left; }
  .row-actions { justify-items: stretch; }
  .row-expand { justify-content: flex-start; }
  .row-buttons { width: 100%; }
  .row-btn { flex: 1; }
  .platform-tabs { width: 100%; justify-content: space-between; }
  .platform-tabs a { flex: 1; text-align: center; padding-inline: 8px; }
  .directory-filter-form .select-control { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .directory-filter-form .select-control select { width: 100%; max-width: none; }
  .directory-add-link { margin-left: 0; }
  .footer-inner > span:nth-child(2) { min-width: 0; }
}

/* ---------- 动效偏好 ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html.js-reveal .reveal { opacity: 1; transform: none; }
  .chart-line { stroke-dashoffset: 0; }
}
