/* ecom-data 页面样式：设计变量（浅色 / 深色）→ 基础 → 布局 → 组件 → 工具类。所有页面共用这一份。 */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --panel-2: #f8f9fb; --panel-3: #eef0f4;
  --text: #111827; --text-2: #374151; --muted: #5f6672; --line: #e5e7eb; --line-2: #d1d5db;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-2: #eef2ff; --accent-text: #3730a3;
  --ok: #047857; --ok-bg: #ecfdf5; --warn: #b45309; --warn-bg: #fffbeb; --bad: #b91c1c; --bad-bg: #fef2f2;
  --info: #0369a1; --info-bg: #f0f9ff;
  --star: #f59e0b; --price: #111827; --code: #f3f4f6; --img-bg: #ffffff; --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 10px 24px -6px rgba(16, 24, 40, .14), 0 4px 8px -4px rgba(16, 24, 40, .08);
  --radius: 12px; --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17; --panel: #131a24; --panel-2: #18202c; --panel-3: #1e2836;
    --text: #e6edf3; --text-2: #c9d1d9; --muted: #8b949e; --line: #263040; --line-2: #34404f;
    --accent: #8b93ff; --accent-hover: #a5abff; --accent-2: #1e2448; --accent-text: #c7cbff;
    --ok: #3fb950; --ok-bg: #0f2a1a; --warn: #d29922; --warn-bg: #2a2110; --bad: #f85149; --bad-bg: #2d1416;
    --info: #58a6ff; --info-bg: #0d2238;
    --price: #f0f6fc; --code: #1c2330; --img-bg: #f8f9fb; --on-accent: #0b0f17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 24px -6px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* 组件自己的 display（如 .btn 的 inline-flex）不能盖过 hidden 属性 */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 22px; margin: 0 0 6px; line-height: 1.3; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 28px 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 18px 0 8px; font-weight: 650; }
p { margin: 6px 0; }
img { max-width: 100%; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--code); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
pre { background: var(--code); padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 8px 0; white-space: pre-wrap; word-break: break-all; }
pre code { background: none; padding: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 顶栏 ---------- */
.topbar { display: flex; align-items: center; gap: 18px; padding: 0 24px; min-height: 58px; background: var(--panel);
          border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; }
.topbar .brand:hover { text-decoration: none; }
.topbar .logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #6366f1, #a855f7);
                display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; }
.topbar nav { display: flex; gap: 2px; }
.topbar nav a, .topbar .nav-group { color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.topbar nav a:hover, .topbar .nav-group:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.topbar nav a[aria-current="page"], .topbar .nav-group.current { color: var(--accent-text); background: var(--accent-2); }
.topbar .nav-item { position: relative; }
.topbar .nav-group { border: 0; background: none; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.topbar .nav-group::after { content: ""; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
                            transform: translateY(-2px) rotate(45deg); }
.topbar .nav-group[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.topbar .nav-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: grid; gap: 2px; min-width: 250px; padding: 6px;
                    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.topbar .nav-menu a { display: grid; gap: 1px; padding: 8px 10px; color: var(--text); white-space: normal; }
.topbar .nav-menu .note { color: var(--muted); font-size: 12px; font-weight: 400; }
.topbar .user { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.topbar .user a[aria-current="page"] { font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 布局 ---------- */
main { padding: 22px 24px 64px; max-width: 1440px; margin: 0 auto; }
main.narrow { max-width: 1040px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.table-picker { display: none; width: 100%; margin-bottom: 16px; }
.split { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-kpi { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.section { margin-top: 26px; }
.section > h2 { margin-top: 0; }
.section[id] { scroll-margin-top: 118px; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 60; background: var(--panel); padding: 10px 16px; border: 2px solid var(--accent); }
.skip-link:focus { top: 8px; }
.section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.section-nav a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.deferred { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }   /* 单列可收缩：里面的宽表横向滚动，不撑宽页面 */
.deferred > .btn { justify-self: start; }

/* ---------- 面板、卡片 ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.scroll { overflow-x: auto; }
.panel > h3:first-child { margin-top: 0; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .k { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #a855f7); border-radius: 3px; }
.bar.warn > span { background: var(--warn); } .bar.bad > span { background: var(--bad); }

/* ---------- 按钮、输入 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel);
       color: var(--text); border-radius: var(--radius-sm); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn[aria-pressed="true"] { background: var(--accent-2); color: var(--accent-text); border-color: var(--accent); }
input, select, textarea { font: inherit; font-size: 13px; color: var(--text); background: var(--panel); border: 1px solid var(--line-2);
                          border-radius: var(--radius-sm); padding: 7px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); border-color: var(--accent); }
textarea { width: 100%; min-height: 120px; font-family: var(--mono); font-size: 12.5px; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { border: 0; background: var(--panel); color: var(--muted); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--line-2); }
.segmented button[aria-pressed="true"] { background: var(--accent-2); color: var(--accent-text); font-weight: 600; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1 1 260px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; background: var(--panel-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--panel-2); }
table.kv td:first-child { color: var(--muted); white-space: nowrap; width: 1%; }
table.kv td { overflow-wrap: anywhere; }
td a:not(.btn):not(.chip), p a:not(.btn), li a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }  /* 正文里的链接不只靠颜色区分 */
table.wide { min-width: 760px; }                 /* 列多的表：窄屏上横向滚动，不把列挤成一字一行 */
td.col-name { min-width: 170px; } td.col-name code, td.nowrap code { white-space: nowrap; }

/* ---------- 徽标、标签 ---------- */
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--panel-3); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.pill.accent { background: var(--accent-2); color: var(--accent-text); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
a.chip:hover { border-color: var(--accent); text-decoration: none; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .muted { color: var(--muted); }
.small { font-size: 12px; } .nowrap { white-space: nowrap; } .num { font-variant-numeric: tabular-nums; }
.callout { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; background: var(--info-bg); color: var(--info); }
.callout.warn { background: var(--warn-bg); color: var(--warn); } .callout.bad { background: var(--bad-bg); color: var(--bad); }
.callout a.inherit { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 任务：最近 N 次的状态条（每次一格，旧的在左；空转矮一半） ---------- */
.strip { display: flex; gap: 2px; align-items: flex-end; height: 16px; }
.strip .tick { flex: none; width: 7px; height: 16px; border-radius: 2px; background: var(--ok); }
.strip .tick.idle { height: 8px; background: var(--line-2); }
.strip .tick.partial { background: var(--warn); } .strip .tick.error { background: var(--bad); } .strip .tick.running { background: var(--info); }
.strip .tick.stopped { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.strip .tick.lost { background: repeating-linear-gradient(45deg, var(--bad) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--bad); }

/* ---------- 商品搜索栏（首页） ---------- */
.searchbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; }
.search-main { display: flex; gap: 8px; align-items: stretch; }
.search-field { position: relative; flex: 1; min-width: 0; display: flex; }
.search-field .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { flex: 1; padding: 10px 12px 10px 38px; font-size: 14.5px; border-radius: 10px; }
.search-main .btn { padding: 0 16px; border-radius: 10px; }
.search-opts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-opts .filters { display: contents; }
select.sel { max-width: 180px; text-overflow: ellipsis; }
.price-range { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.price-range input { width: 78px; }
label.check.toggle { border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 11px 5px 9px; background: var(--panel); }
label.check.toggle:hover { background: var(--panel-2); }
label.check.toggle:has(input:checked) { background: var(--accent-2); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
label.check.toggle input { margin: 0; accent-color: var(--accent); }
.filter-toggle { display: none; }
.filter-toggle .count:not(:empty) { background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 17px; }
#jump-out:empty { display: none; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); border-radius: 999px;
         padding: 3px 6px 3px 11px; font: inherit; font-size: 12.5px; cursor: pointer; max-width: 320px; }
.fchip > span { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--panel-3); color: var(--muted); font-size: 12px; line-height: 1; }
.fchip:hover { border-color: var(--accent); color: var(--accent-text); } .fchip:hover > span { background: var(--accent-2); color: var(--accent-text); }

/* ---------- 商品卡片 ---------- */
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; margin: 16px 2px 12px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
         overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; color: inherit; min-width: 0; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); text-decoration: none; }
.pcard:hover .title { color: var(--accent-text); }
.pcard .img { position: relative; height: 210px; padding: 16px; background: var(--img-bg); display: grid; place-items: center; }
.pcard .img img { max-width: 100%; max-height: 178px; object-fit: contain; }
.pcard .badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.badge { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; line-height: 1.3; white-space: nowrap; }
.badge.deal { background: #dc2626; color: #fff; } .badge.same { background: #047857; color: #fff; } .badge.maybe { background: #b45309; color: #fff; } .badge.variant { background: #4b5563; color: #fff; } .badge.size { background: #1d4ed8; color: #fff; } .badge.substitute { background: #6d28d9; color: #fff; } .badge.different { background: #6b7280; color: #fff; } .badge.multi { background: #111827; color: #fbbf24; } .badge.oos { background: #6b7280; color: #fff; }
.pcard .body { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; border-top: 1px solid var(--line); }
.pcard .brand { font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.45em; }
.pcard .title { font-size: 13.5px; font-weight: 550; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.price { display: flex; align-items: baseline; gap: 2px 8px; flex-wrap: wrap; }
.pcard .price { margin-top: 4px; }
.price .now { font-size: 20px; font-weight: 750; color: var(--price); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price .upto { font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.price .was { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.price .at { font-size: 12px; color: var(--muted); }
.pcard .at { display: flex; align-items: center; gap: 6px; min-height: 19px; font-size: 12px; color: var(--muted); min-width: 0; }
.pcard .at .where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stars { --pct: 0%; display: inline-block; font-size: 13px; letter-spacing: 1px; line-height: 1;
         background: linear-gradient(90deg, var(--star) var(--pct), var(--line-2) var(--pct)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rating { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-height: 18px; }
.rating b { color: var(--text); font-weight: 650; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.meta span { font-size: 11.5px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.pcard .meta { flex-wrap: nowrap; overflow: hidden; margin-top: 2px; padding-top: 0; min-height: 21px; }
.pcard .meta span { white-space: nowrap; flex: none; }
.pcard .meta span:last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pcard .foot { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line);
               padding-top: 9px; margin-top: auto; }
.pcard .body > .meta { margin-bottom: 6px; }
.pcard .foot .src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-align: right; }

/* ---------- 详情页 ---------- */
.detail-top { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 32px; align-items: start; }
.gallery { min-width: 0; position: sticky; top: 78px; }
.gallery .main { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; padding: 22px; background: var(--img-bg); border-radius: 16px; border: 1px solid var(--line); }
.gallery .main img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.gallery .main.empty { color: #5f6672; }
.gallery .counter { position: absolute; right: 10px; bottom: 10px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(17, 24, 39, .6); color: #fff; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 3px; scrollbar-width: thin; }
.gallery .thumbs button { flex: none; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--img-bg); cursor: pointer; }
.gallery .thumbs button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gallery .thumbs img { width: 56px; height: 56px; object-fit: contain; display: block; }
.summary { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.summary h1 { font-size: 24px; line-height: 1.32; margin: 0; overflow-wrap: anywhere; }
.eyebrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow .brand-name { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text); }
.signals { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; color: var(--text-2); font-size: 13px; }
.signals .rating { font-size: 13px; color: var(--text-2); } .signals .stars { font-size: 15px; }
.signals > span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); margin-right: 16px; vertical-align: middle; }
.buybox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.buy-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.buy-head .k { color: var(--muted); font-size: 12.5px; }
.buy-price { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.buy-price .now { font-size: 32px; font-weight: 750; letter-spacing: -.02em; color: var(--price); line-height: 1.15; }
.buy-price .upto { color: var(--muted); font-size: 13px; }
.buy-head > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.buy-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.buy-actions .btn { max-width: 100%; }
.buy-actions .btn { padding: 9px 16px; font-size: 13.5px; border-radius: 10px; }
.btn.product-buy { max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-weight: 600; }
.btn.product-out { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }   /* 零售商域名可能很长（Shopify 店 63 个字符） */
.strip-price { padding-top: 2px; }
.strip-price .track { position: relative; height: 18px; margin: 0 6px; }
.strip-price .track::before { content: ""; position: absolute; left: -6px; right: -6px; top: 8px; height: 2px; border-radius: 1px; background: var(--line); }
.strip-price .dot { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--accent); opacity: .35; }
.strip-price .dot.low { opacity: 1; background: var(--ok); box-shadow: 0 0 0 2px var(--panel); z-index: 1; }
.strip-price .mid { position: absolute; top: 1px; width: 2px; height: 16px; margin-left: -1px; background: var(--text-2); border-radius: 1px; }
.strip-price .ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.specs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 18px; margin: 2px 0 0; font-size: 13px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; overflow-wrap: anywhere; color: var(--text-2); }
.specs .ids { display: flex; gap: 6px; flex-wrap: wrap; } .specs .ids code { font-size: 12px; }

/* 各家报价：桌面一张表、手机一列卡片 */
.row.tight { gap: 6px; } .row.end { justify-content: flex-end; flex-wrap: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offers-note { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.offers-mobile { display: none; }
.offer-who { display: flex; gap: 10px; align-items: center; min-width: 220px; max-width: 360px; }
.offer-thumb { flex: none; width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--img-bg); display: grid; place-items: center; overflow: hidden; }
.offer-thumb img { width: 40px; height: 40px; object-fit: contain; }
.offer-name { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.offer-name a { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.price-cell, .offer-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.price-cell b, .offer-price b { font-size: 14.5px; }
.offers-desktop td { vertical-align: middle; }
.offers-desktop tr.best td { background: color-mix(in srgb, var(--ok-bg) 70%, transparent); }
.offers-desktop td.actions { width: 1%; white-space: nowrap; }
.offers-desktop tbody tr:hover td { background: var(--panel-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { border-color: var(--line-2); background: var(--panel); }
.offers-more { display: flex; justify-content: center; padding: 12px; border-top: 1px solid var(--line); }
.offers-mobile > .offers-more { border: 0; }
.offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.offer.best { border-color: var(--ok); }
.offer .offer-who { min-width: 0; }
.offer-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.offer-meta { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.offer > details { grid-column: 1 / -1; font-size: 12.5px; }
.offer summary { cursor: pointer; color: var(--muted); }
.offer details[open] { display: grid; gap: 6px; }
details > summary { cursor: pointer; color: var(--accent); }
details[open] > summary { margin-bottom: 8px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- 图表 ---------- */
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.chart-card h3 { margin: 0 0 8px; }
.card-title { font-size: 14px; margin: 0; } .side-title { font-size: 14px; margin: 14px 0 4px; }   /* 层级是 h2，样子和 h3 一样 */
.chartbox { position: relative; height: 300px; }
.chartbox.small { height: 220px; }
.series-toggles { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12.5px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* ---------- 比对（同款审核） ---------- */
.compare { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: stretch; }
.compare .side { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; gap: 12px; min-width: 0; }
.compare .side img { width: 88px; height: 88px; object-fit: contain; background: var(--img-bg); border-radius: 8px; flex: none; }
.compare .vs { align-self: center; color: var(--muted); font-weight: 700; }
.candidate { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--panel); box-shadow: var(--shadow); }
.candidate + .candidate { margin-top: 12px; }
.candidate.done { opacity: .55; }
.candidate-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.candidate-card { display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; }
.candidate-card + .candidate-card { margin-top: 0; }
.candidate-card .pcard { flex: 1; border: 0; border-radius: 0; box-shadow: none; }
.candidate-card .pcard .title { display: block; overflow-wrap: anywhere; }
.candidate-card .review { padding: 14px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.candidate-card .review .row:last-child { margin-top: 8px; }

.simcard { display: flex; flex-direction: column; gap: 8px; } .simcard .pcard { flex: 1; } .simcard.done { opacity: .55; }
.simcard .acts { display: flex; gap: 8px; } .simcard .acts .btn { flex: 1; justify-content: center; }
.simcard .why { font-size: 12px; display: flex; flex-direction: column; gap: 4px; padding: 0 2px; }
.simcard .why .line { display: flex; justify-content: space-between; gap: 8px; } .simcard .why .bar { margin-top: 0; }
.simcard .why .bar.same > span { background: #047857; } .simcard .why .bar.maybe > span { background: #b45309; }
.simcard .why .bar.size > span { background: #1d4ed8; } .simcard .why .bar.substitute > span { background: #6d28d9; }
.simcard .why .bar.variant > span, .simcard .why .bar.different > span { background: #6b7280; }
.tier { margin-bottom: 18px; } .tier h3, .tier .h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--text); }
.tier h3 .badge, .tier .h3 .badge { vertical-align: 1px; } .tier > p { margin: 0 0 10px; } details.tier[open] > .cards { margin-top: 10px; }

/* ---------- 以图搜图 ---------- */
/* 以图搜图：左边是图（每件一个框，可拖框选），右边是图里的每一件；下面每件一节（同款 / 相似款 / 全部候选） */
.imgscene { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.scene-stage { position: relative; align-self: start; border-radius: 10px; overflow: hidden; background: var(--img-bg); border: 1px solid var(--line);
               touch-action: none; user-select: none; cursor: crosshair; min-height: 220px; }
.scene-img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; pointer-events: none; }
.scene-stage .query.skeleton { position: absolute; inset: 0; }
.scene-box { position: absolute; padding: 0; border: 2px solid rgba(255, 255, 255, .95); border-radius: 6px; background: transparent;
             box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); pointer-events: none; }   /* 点击由图统一处理（选包含点的最小框） */
.scene-box span { position: absolute; left: -2px; top: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px 0 6px 0;
                  background: rgba(17, 24, 39, .8); color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; }
.scene-box:hover, .scene-box:focus-visible { border-color: var(--accent); }
.scene-box.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgba(0, 0, 0, .28); z-index: 1001 !important; }
.scene-box.on span { background: var(--accent); }
.scene-select { position: absolute; border: 2px dashed var(--accent); background: rgba(79, 70, 229, .12); pointer-events: none; z-index: 2000; }
.scene-select-go { position: absolute; transform: translateY(6px); z-index: 2001; }
.scene-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.scene-pick { display: flex; gap: 8px; align-items: center; text-align: left; font: inherit; color: var(--text); background: var(--panel);
              border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; cursor: pointer; min-width: 0; }
.scene-pick:hover { background: var(--panel-2); }
.scene-pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-2); }
.scene-pick-text { display: flex; flex-direction: column; min-width: 0; }
.scene-pick-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-pick.found .scene-pick-state { color: var(--ok); }
.scene-num { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: var(--panel-2);
             border: 1px solid var(--line); font-size: 12px; font-weight: 600; flex: none; }
.scene-obj { scroll-margin-top: 80px; }
.scene-obj.on { border-color: var(--accent); }
.scene-obj-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.scene-obj-head h3 { margin: 0; display: flex; align-items: center; gap: 6px; }
.scene-thumb { width: 84px; height: 84px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: var(--img-bg); }
.scene-info .chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.scene-row { margin-bottom: 12px; }
.scene-row-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.scene-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.scene-all > summary { cursor: pointer; font-weight: 600; margin: 4px 0 8px; }
.scene-all .tier h4 { margin: 12px 0 4px; }
main.dropping { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 12px; }

/* ---------- 评测 ---------- */
.metrics { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.evalcase { display: grid; grid-template-columns: 150px 150px minmax(0, 1fr); gap: 14px; border: 1px solid var(--line); border-radius: var(--radius);
            padding: 12px; background: var(--panel); }
.evalcase + .evalcase { margin-top: 10px; }
.evalcase .shot { display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 0; }
.evalcase .shot img { width: 150px; height: 150px; object-fit: contain; background: var(--img-bg); border-radius: 8px; border: 1px solid var(--line); }
.evalcase .tops { display: flex; gap: 8px; flex-wrap: wrap; }
.evalcase .top { width: 92px; font-size: 11px; display: flex; flex-direction: column; gap: 2px; }
.evalcase .top img { width: 92px; height: 92px; object-fit: contain; background: var(--img-bg); border-radius: 6px; border: 2px solid var(--line); }
.evalcase .top.correct img { border-color: #047857; }
.evalcase .top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 状态 ---------- */
.skeleton { background: linear-gradient(90deg, var(--panel-2), var(--line), var(--panel-2)); background-size: 200% 100%;
            animation: sk 1.2s infinite; border-radius: 14px; min-height: 120px; }
.cards .skeleton { height: 360px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .pcard { transition: none; } }
.empty { text-align: center; color: var(--muted); padding: 48px 12px; }
.empty p { margin: 0 0 12px; }
.pcard .img .muted { color: #5f6672; }   /* 图片底色（--img-bg）两种模式下都是浅色 */
.error-box { border: 1px solid var(--bad); background: var(--bad-bg); color: var(--bad); border-radius: var(--radius-sm); padding: 12px 14px;
             display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; white-space: pre-wrap; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 16px;
         border-radius: 10px; font-size: 13px; z-index: 50; box-shadow: var(--shadow-lg); }

/* ---------- 登录 ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); display: flex; align-items: center;
         justify-content: center; z-index: 40; }
.modal .box { background: var(--panel); border-radius: 16px; padding: 26px; width: min(420px, 92vw); box-shadow: var(--shadow-lg); }

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .table-picker { display: block; }
  .tables-sidebar { display: none; }
  .detail-top { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .gallery { position: static; }
  .gallery .main { aspect-ratio: auto; height: min(78vw, 340px); padding: 14px; }
  .grid-2, .split { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; } .compare .vs { justify-self: center; }
  .evalcase { grid-template-columns: 1fr 1fr; } .evalcase > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .offers-desktop { display: none; }
  .offers-mobile { display: grid; gap: 10px; }
  .signals > span + span::before { display: none; }
  .pcard .meta span:nth-child(3) { display: none; }
  .gallery .thumbs img { width: 46px; height: 46px; }
  .summary h1 { font-size: 20px; }
  .buy-price .now { font-size: 28px; }
  .buy-actions, .buy-actions .btn { width: 100%; } .buy-actions .btn { justify-content: center; }
  .buybox { padding: 14px; }
  main { padding: 14px 12px 48px; }
  .topbar { padding: 8px 12px; flex-wrap: wrap; gap: 8px; min-height: 85px; }   /* 两行（品牌 + 导航）的高度：占位和填好后一样高 */
  .topbar nav { order: 3; width: 100%; position: relative; }
  .topbar nav { gap: 0; font-size: 13px; }
  .topbar nav a, .topbar .nav-group { padding: 6px 3px; }
  .topbar .nav-group { gap: 5px; }
  .topbar .nav-item { position: static; }   /* 下拉按整行导航定位、占满宽度，靠右的分组也不出屏 */
  .topbar .nav-menu { right: 0; min-width: 0; }
  .topbar .user > span:first-child { display: none; }   /* 手机上不显示邮箱，导航放得下 */
  .cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .pcard .img { height: 150px; padding: 10px; } .pcard .img img { max-height: 130px; }
  .pcard .body { padding: 10px 11px 10px; } .price .now { font-size: 18px; }
  .pcard .foot .src { display: none; }
  .searchbar { padding: 10px; gap: 10px; }
  .search-main .btn { padding: 0 12px; } .search-main .btn .label { display: none; }
  .search-opts .segmented { flex: 1; min-width: 0; } .search-opts .segmented button { flex: 1; }
  .filter-toggle { display: inline-flex; }
  .search-opts > select.sel { flex: 1 1 100%; max-width: none; order: 3; }
  .search-opts .filters { display: none; }
  .search-opts .filters.open { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; order: 4; padding-top: 4px; border-top: 1px solid var(--line); }
  .search-opts .filters.open select.sel { flex: 1 1 100%; max-width: none; }
  .price-range { flex: 1 1 100%; } .price-range input { flex: 1; width: auto; }
  .kpi .v { font-size: 20px; }
  .imgscene { grid-template-columns: 1fr; }
  .scene-thumb { width: 64px; height: 64px; }
  .evalcase .shot img { width: 100%; height: auto; aspect-ratio: 1; }
}

.cards[aria-busy="true"] { opacity: .65; }

/* Review enrichment: theme polarity uses both words and colors. */
.review-themes.compact { flex-wrap: nowrap; overflow: hidden; margin: 0 0 6px; gap: 5px; }
.review-themes.compact .review-theme { white-space: nowrap; flex: none; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; }
.review-themes.compact .review-theme:last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.review-themes { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.review-theme { font-size:12px; padding:4px 8px; border:1px solid var(--line); border-radius:6px; overflow-wrap:anywhere; }
.review-theme.positive { color:var(--ok); }
.review-theme.mixed { color:var(--warn); }
.review-theme.negative { color:var(--bad); }
.review-mentions { opacity:1; }
.review-excerpt { font-size:12px; line-height:1.6; margin:6px 0; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.review-byline { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:12px; color:var(--muted); }
.review-summary p,.review-body { line-height:1.75; white-space:pre-wrap; overflow-wrap:anywhere; }
.review-source { margin-bottom:12px; min-width:0; }
.review-comment { border-top:1px solid var(--line); padding:16px 0; }
.review-comment h3 { font-size:16px; margin:0 0 8px; }
.review-images { display:flex; gap:8px; flex-wrap:wrap; }
.review-images img { width:88px; height:88px; object-fit:cover; border-radius:6px; }

/* Unified product detail tabs; mobile wraps instead of overflowing. */
.detail-tablist { display:flex; gap:2px; margin:28px 0 20px; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none;
                  position:sticky; top:58px; z-index:10; background:var(--bg); }
.detail-tablist::-webkit-scrollbar { display:none; }
.detail-tablist button { flex:none; background:transparent; color:var(--muted); border:0; border-bottom:2px solid transparent; margin-bottom:-1px;
                         padding:12px 14px 11px; font:inherit; font-weight:550; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.detail-tablist button:hover { color:var(--text); }
.detail-tablist button[aria-selected="true"] { color:var(--accent-text); border-bottom-color:var(--accent); font-weight:650; }
.detail-tablist button:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.detail-tablist .count { font-size:11.5px; font-weight:650; padding:0 7px; border-radius:999px; background:var(--panel-3); color:var(--text-2); line-height:18px; }
.detail-tablist button[aria-selected="true"] .count { background:var(--accent-2); color:var(--accent-text); }
.detail-tabs { scroll-margin-top:58px; }
.detail-tabpanel[hidden] { display:none; }
.detail-tabpanel { outline:none; }
.detail-tabpanel > h2 { font-size:18px; margin:0 0 14px; }
@media(max-width:760px) { .detail-tabs { scroll-margin-top:85px; } .detail-tablist { margin:20px -12px 16px; padding:0 4px; top:85px; } .detail-tablist button { padding:11px 10px 10px; font-size:13px; } }

/* ---------- Playground（左边选功能，右边例子 + 输入 + 结果） ---------- */
.pg { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.pg-side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 72px; }
.pg-side button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font: inherit; color: var(--text);
                  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; }
.pg-side button:hover { background: var(--panel-2); }
.pg-side button[aria-pressed="true"] { background: var(--accent-2); border-color: var(--accent); color: var(--accent-text); }
.pg-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pg-body h2 { margin: 0 0 4px; }
.pg-body h2 + p { margin: 0; }
.pg-examples { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-ex { justify-content: flex-start; gap: 10px; text-align: left; padding: 6px 12px 6px 6px; }
.pg-ex-img { width: 56px; height: 56px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: var(--img-bg); }
.pg-ex-img img { width: 100%; height: 100%; object-fit: contain; }
.pg-ex-img img:not([src]), .pg-ex-img img.none { visibility: hidden; }   /* 图还没取到 / 没有图：留空白框，不显示破图 */
.pg-ex-text { display: flex; flex-direction: column; align-items: flex-start; }
.pg-input { flex: 1 1 280px; min-width: 0; }
.pg-target { justify-content: space-between; margin-bottom: 8px; }
.pg-hits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.pg-hit { display: flex; gap: 10px; align-items: center; text-align: left; font: inherit; color: var(--text); background: var(--panel);
          border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; cursor: pointer; min-width: 0; }
.pg-hit:hover { background: var(--panel-2); }
.pg-hit img, .pg-noimg { width: 40px; height: 40px; object-fit: contain; flex: none; border-radius: 4px; background: var(--panel-2); }
.pg-hit-text { display: flex; flex-direction: column; min-width: 0; }
.pg-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 构成分析（components/parts.js） ---------- */
.parts { display: flex; flex-direction: column; gap: 14px; }
.parts-summary { margin: 0; font-size: 15px; }
.parts .grid-kpi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.parts .diy h3 { margin: 0; font-size: 15px; }
.parts .diy { display: flex; flex-direction: column; gap: 8px; }
.parts .diy p { margin: 0; }
.parts .risks { margin: 0; padding-left: 18px; font-size: 13px; }
.stack.tight { gap: 4px; }
.parts-module > h3 { margin: 6px 0 8px; font-size: 16px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.part { padding: 10px 0 16px; }
.part + .part { border-top: 1px dashed var(--line); }
.part-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.part-head h4 { margin: 0; font-size: 15px; }
.part-what { margin: 4px 0; }
.part > p.small { margin: 4px 0 10px; }
@media (max-width: 760px) {
  .pg { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pg-side { position: static; flex-direction: row; }
  .pg-side button { flex: 1 1 0; min-width: 0; }
  .pg-side button .muted { display: none; }   /* 窄屏只留功能名，几个功能平分一行 */
  .pg-examples { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }   /* 例子横着滑，不把输入和结果挤到很下面 */
  .pg-ex { flex: none; }
}

/* ---------- 商品助手 /agent：左历史、中对话、右工作区；窄屏历史是抽屉、工作区是底部面板 ---------- */
body.agent-page { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
body.agent-page .topbar { position: static; flex: none; }
body.agent-page > main { flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0; padding: 0; }   /* 外壳里就占满，脚本加载后不跳（CLS） */
main.agent-app { display: grid; grid-template-columns: 272px minmax(0, 1fr) minmax(320px, 400px); }
main.agent-app.hist-collapsed { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
main.agent-app.hist-collapsed .agent-hist { display: none; }
.agent-hist { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; min-height: 0; }
.agent-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.agent-chat.dropping { outline: 2px dashed var(--accent); outline-offset: -6px; }
.agent-ws { border-left: 1px solid var(--line); background: var(--panel-2); overflow-y: auto; min-height: 0; }
.chat-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--panel); min-height: 50px; }
.chat-title { font-size: 15px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-actions { display: flex; gap: 6px; align-items: center; }
.chat-actions .more { position: relative; }
.chat-actions .more > summary { list-style: none; color: var(--text); }
.chat-actions .more > summary::-webkit-details-marker { display: none; }
.chat-actions .more[open] > summary { margin: 0; }
.chat-actions .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 2px; min-width: 140px; padding: 6px;
                      background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.chat-actions .menu button { justify-content: flex-start; border: 0; }
.agent-log { flex: 1; min-height: 0; overflow-y: auto; padding: 18px max(16px, calc((100% - 780px) / 2)) 8px; overscroll-behavior: contain; }
.chat-foot { flex: none; padding: 8px max(16px, calc((100% - 780px) / 2)) 14px; background: var(--bg); }
.ws-bar, .agent-backdrop { display: none; }

/* 空状态、接着问 */
.agent-empty { max-width: 640px; margin: 6vh auto 0; text-align: center; }
.agent-empty h2 { font-size: 22px; margin: 0 0 8px; }
.examples { display: grid; gap: 8px; margin-top: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); text-align: left; }
.example { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; font: inherit;
           color: var(--text-2); cursor: pointer; overflow-wrap: anywhere; }
.example:hover { border-color: var(--accent); }
.followups { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.followups .chip { cursor: pointer; font: inherit; font-size: 12.5px; padding: 3px 10px; }
.followups .chip:hover { border-color: var(--accent); }

/* 一轮 */
.turn { margin-bottom: 26px; }
.turn .q { margin-left: auto; max-width: 85%; width: fit-content; background: var(--accent-2); border-radius: 14px 14px 4px 14px; padding: 8px 12px; }
.q-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.q-imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.q-imgs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--img-bg); }
.turn .a { margin-top: 12px; }
.steps { font-size: 12.5px; margin-bottom: 10px; }
.steps > summary { color: var(--muted); }
.steps ol { list-style: none; margin: 6px 0 0 3px; padding: 0 0 0 12px; display: grid; gap: 7px; border-left: 2px solid var(--line); }
.step { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.step .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; transform: translateY(-1px); }
.step.running .dot { background: var(--info); animation: agent-pulse 1s ease-in-out infinite; }
.step.error .dot { background: var(--bad); } .step.stopped .dot { background: var(--line-2); }
.step .st { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; color: var(--text-2); }
.step .stitle { font-weight: 600; margin-right: 6px; color: var(--text); }
.step.error .ssum { color: var(--bad); }
.step .slink { white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
.step .sargs { flex-basis: 100%; padding-left: 16px; } .step .sargs > summary { color: var(--muted); font-size: 12px; }
.step .sargs pre { font-size: 11.5px; margin: 4px 0; max-height: 220px; overflow: auto; }
.steps .note { color: var(--muted); font-style: italic; }
.answer { font-size: 14.5px; line-height: 1.75; overflow-wrap: anywhere; }
.answer p { margin: 0 0 8px; } .answer ul, .answer ol { margin: 0 0 8px; padding-left: 22px; } .answer li { margin: 2px 0; }
.answer .answer-heading { margin-top: 12px; }
.answer.typing { color: var(--muted); }
.answer.typing .dots { display: inline-block; animation: agent-blink 1.2s steps(2) infinite; }
.cite { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin: 0 2px; border-radius: 10px; border: 0;
        background: var(--accent); color: var(--on-accent); font: 700 11px/1 var(--font); cursor: pointer; vertical-align: 2px; }
.cite:hover { background: var(--accent-hover); }
.cite.unknown { background: var(--bad-bg); color: var(--bad); cursor: help; }
.turn-foot { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 10px; font-size: 12px; }
.turn-foot .fb { display: inline-flex; gap: 6px; margin-left: auto; }
.fb-note { flex-basis: 100%; display: flex; gap: 8px; align-items: flex-end; }
.fb-note textarea { min-height: 0; font-family: var(--font); font-size: 13px; }
.turn .callout { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.strip-cards { display: none; }
@keyframes agent-pulse { 50% { opacity: .3; } }
@keyframes agent-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .step.running .dot, .answer.typing .dots { animation: none; } }

/* 输入框 */
.composer { display: flex; flex-direction: column; gap: 6px; }
.comp-box { display: flex; align-items: flex-end; gap: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); }
.comp-box:focus-within { border-color: var(--accent); }
.comp-box textarea { flex: 1; border: 0; resize: none; min-height: 36px; max-height: 200px; font-family: var(--font); font-size: 14.5px;
                     line-height: 1.5; background: transparent; padding: 7px 4px; }
.comp-box textarea:focus { outline: none; }
.btn.icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; flex: none; font-weight: 600; }
.comp-box .send, .comp-box .stop { height: 36px; border-radius: 10px; flex: none; }
.comp-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.comp-chips:empty { display: none; }
.comp-img { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 3px; background: var(--panel); max-width: 100%; }
.comp-img.bad { border-color: var(--bad); }
.comp-img img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.comp-img .x { border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--muted); padding: 0 4px; }
.comp-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.comp-chip .k { color: var(--muted); margin-right: 4px; }
.comp-chip.ok { border-color: var(--ok); }

/* 商品卡片（紧凑） */
.mlist { display: grid; gap: 8px; }
.mcard { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: start; background: var(--panel); border: 1px solid var(--line);
         border-radius: 10px; padding: 8px; }
.mcard.flash { outline: 2px solid var(--accent); outline-offset: 1px; }
.mimg { position: relative; width: 64px; height: 64px; background: var(--img-bg); border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.mimg img, .timg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mimg .num, .timg .num { position: absolute; top: 3px; left: 3px; background: var(--accent); color: var(--on-accent); font: 700 11px/1 var(--font); border-radius: 8px; padding: 2px 5px; }
.mbody { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mbrand { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtitle { font-size: 13px; font-weight: 550; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.mtitle:hover { color: var(--accent); }
.mprice { display: flex; gap: 4px 8px; flex-wrap: wrap; align-items: baseline; font-size: 12px; color: var(--muted); }
.mprice b { font-size: 16px; color: var(--price); font-variant-numeric: tabular-nums; }
.mmeta { display: flex; gap: 4px 8px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--muted); }
.fresh.stale { color: var(--warn); }
.verdict-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; font-size: 11.5px; }
.verdict-row .unit.ok { color: var(--ok); } .verdict-row .unit.warn { color: var(--warn); }
.basket-toggle { align-self: start; }
.mtile { flex: 0 0 116px; display: flex; flex-direction: column; gap: 3px; text-align: left; background: var(--panel); border: 1px solid var(--line);
         border-radius: 10px; padding: 6px; font: inherit; font-size: 12px; color: var(--text); cursor: pointer; min-width: 0; }
.mtile .timg { position: relative; height: 80px; background: var(--img-bg); border-radius: 6px; display: grid; place-items: center; overflow: hidden; }
.mtile .badge { align-self: flex-start; font-size: 10.5px; padding: 1px 6px; }
.mtile .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 工作区 */
.ws { min-height: 100%; }
.ws-head { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.ws-close, .hist-close { display: none; margin-left: auto; font-size: 16px; line-height: 1; }
.ws-body { padding: 12px; }
.ws-note { margin: 0 0 6px; overflow-wrap: anywhere; }
.ws-sub { font-size: 12.5px; color: var(--muted); margin: 12px 0 8px; font-weight: 600; }
.ws-empty { color: var(--muted); padding: 28px 8px; text-align: center; }
.ws-actions { margin-bottom: 10px; }
.compare-wrap { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.compare-table { font-size: 12px; }
.compare-table th, .compare-table td { padding: 6px 8px; white-space: nowrap; }
.compare-table thead th a { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.compare-table td.ok { color: var(--ok); font-weight: 600; }

/* 历史会话 */
.hist { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.hist-head { display: flex; align-items: center; gap: 8px; }
.hist-title { margin: 0; font-size: 15px; flex: 1; }
.hist-scope { align-self: flex-start; }
.hist-scope button { padding: 5px 10px; font-size: 12px; }
.hist-group { font-size: 11.5px; color: var(--muted); margin: 10px 6px 4px; font-weight: 600; }
.hist-list section:first-child .hist-group { margin-top: 0; }
/* 删除按钮：电脑上悬停 / 聚焦这一行才出现，触屏一直显示 */
.hist-row { position: relative; }
.hist-row .hist-item { padding-right: 34px; }
.hdel { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; opacity: 0; }
.hist-row:hover .hdel, .hist-row:focus-within .hdel { opacity: 1; }
.hdel:hover, .hdel:focus-visible { background: var(--panel-3); color: var(--bad); }
@media (hover: none) { .hdel { opacity: 1; } }
.hist-item { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; color: var(--text); }
.hist-item:hover { background: var(--panel-2); text-decoration: none; }
.hist-item.current { background: var(--accent-2); }
.hthumb { width: 34px; height: 34px; flex: none; border-radius: 6px; background: var(--img-bg); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; }
.hthumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hthumb:empty { background: var(--panel-3); }
.agent-log > .callout { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.htext { min-width: 0; display: flex; flex-direction: column; }
.htitle { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htitle .star { color: var(--star); }
.hmeta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hmeta .live { color: var(--info); margin-right: 4px; }
.hist-empty { padding: 8px 6px; }

/* 回答里的图块（agent-blocks.js） */
.blk { margin: 10px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 12px; min-width: 0; }
.blk figcaption { display: flex; gap: 6px 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.blk-kind { font-size: 11px; font-weight: 700; color: var(--accent-text); background: var(--accent-2); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.blk-title { flex: 1 1 200px; min-width: 0; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-sub { font-size: 12px; color: var(--muted); }
.blk-pending { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; border-style: dashed; }
.blk-more { display: inline-block; margin-top: 8px; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.boffers { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.boffers li { display: grid; grid-template-columns: minmax(70px, 150px) minmax(50px, 1fr) auto; gap: 2px 10px; align-items: center; font-size: 13px; }
.boffers .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.boffers .bar { height: 8px; background: var(--panel-3); border-radius: 4px; overflow: hidden; margin: 0; }
.boffers .bar span { display: block; height: 100%; background: var(--line-2); border-radius: 4px; }
.boffers li.low .bar span { background: var(--ok); }
.boffers li.oos { opacity: .65; }
.boffers .price { font-variant-numeric: tabular-nums; text-align: right; }
.boffers .tags { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 11.5px; }
.boffers .tags:empty { display: none; }
.bchart { display: flex; flex-direction: column; gap: 4px; }
.bplot-wrap { display: grid; grid-template-columns: 58px minmax(0, 1fr); height: 170px; }
.byaxis { position: relative; font-size: 11px; color: var(--muted); }
.byaxis span { position: absolute; right: 8px; transform: translateY(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bplot { position: relative; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bplot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bplot .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.bplot .line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.blow { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--ok); }
.bxaxis { display: flex; justify-content: space-between; padding-left: 58px; font-size: 11px; color: var(--muted); }
.blegend { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.blegend li { display: flex; align-items: center; gap: 5px; min-width: 0; }
.blegend .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.blegend b { font-variant-numeric: tabular-nums; }
.btiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.btiles.few { grid-template-columns: repeat(auto-fill, minmax(170px, 230px)); }
.btile { display: flex; flex-direction: column; gap: 3px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--panel); color: var(--text); font-size: 12px; }
.btile:hover { border-color: var(--accent); text-decoration: none; }
.bimg { position: relative; height: 92px; background: var(--img-bg); border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.bimg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bimg .num { position: absolute; top: 3px; left: 3px; background: var(--accent); color: var(--on-accent); font: 700 11px/1 var(--font); border-radius: 8px; padding: 2px 5px; }
.btile .badge { align-self: flex-start; font-size: 10.5px; padding: 1px 6px; }
.binfo { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brows { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.btile.row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: start; }
.btile.row .bimg { height: 56px; }
.btitle { font-size: 12.5px; font-weight: 550; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bprice { display: flex; gap: 2px 6px; align-items: baseline; flex-wrap: wrap; } .bprice b { font-size: 15px; font-variant-numeric: tabular-nums; }
.bprice .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bmeta { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: 11.5px; }
.bunit { font-size: 11.5px; font-weight: 600; } .bunit.ok { color: var(--ok); } .bunit.warn { color: var(--warn); }
.btier + .btier { margin-top: 12px; }
.btier-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.bphoto { display: grid; grid-template-columns: 140px auto minmax(0, 1fr); gap: 12px; align-items: center; }
.bphoto .shot { width: 140px; height: 140px; object-fit: contain; background: var(--img-bg); border-radius: 10px; }
.bphoto .arrow { color: var(--muted); font-size: 20px; }

/* 回答模板、配置（agent-config.js） */
.tpl-title { font-size: 13px; color: var(--muted); margin: 24px 0 10px; font-weight: 600; }
.tpl-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); text-align: left; }
.tpl { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel); }
.tpl-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tpl-shape { margin: 0; color: var(--text-2); line-height: 1.6; overflow-wrap: anywhere; }
.tpl .btn { margin-top: auto; white-space: normal; text-align: left; justify-content: flex-start; overflow-wrap: anywhere; }
.model-chip code { background: none; padding: 0; font-size: 12px; }
.model-chip .short { display: none; }
.cfg section + section { margin-top: 18px; }
.cfg h3 { margin: 0 0 8px; font-size: 14px; }
.cfg-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 12.5px; }
.cfg-kv dt { color: var(--muted); } .cfg-kv dd { margin: 0; overflow-wrap: anywhere; }
.cfg-budget .bar { margin: 6px 0; }
.cfg-group h4 { margin: 10px 0 6px; font-size: 12px; color: var(--muted); }
.cfg-tool { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--panel); }
.cfg-tool + .cfg-tool { margin-top: 6px; }
.cfg-tool > summary { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; color: var(--text); list-style: none; }
.cfg-tool > summary::-webkit-details-marker { display: none; }
.cfg-tool-name { font-weight: 600; } .cfg-tool-sum { flex-basis: 100%; font-size: 12px; }
.cfg-params { margin: 4px 0 6px; padding-left: 18px; font-size: 12px; } .cfg-params li { margin: 2px 0; overflow-wrap: anywhere; }
.cfg-routing { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12.5px; }
.cfg-routing li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.cfg-routing code { white-space: nowrap; align-self: flex-start; }
.cfg-prompt { max-height: 360px; overflow: auto; font-size: 11.5px; white-space: pre-wrap; }

@media (min-width: 900px) and (max-width: 1199px) {
  main.agent-app, main.agent-app.hist-collapsed { position: relative; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
  main.agent-app:not(.hist-collapsed) .agent-hist { position: absolute; top: 0; bottom: 0; left: 0; width: 300px; z-index: 30; box-shadow: var(--shadow-lg); }
}
@media (max-width: 899px) {
  main.agent-app, main.agent-app.hist-collapsed { grid-template-columns: minmax(0, 1fr); }
  main.agent-app.hist-collapsed .agent-hist { display: block; }
  .agent-hist, .agent-ws { position: fixed; z-index: 45; box-shadow: var(--shadow-lg); visibility: hidden; transition: transform .2s ease, visibility 0s .2s; }
  .agent-hist { top: 0; bottom: 0; left: 0; width: min(86vw, 340px); transform: translateX(-100%); }
  .agent-ws { left: 0; right: 0; bottom: 0; height: 80vh; height: 80dvh; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 16px 16px 0 0; transform: translateY(100%); }
  main.hist-open .agent-hist, main.ws-open .agent-ws { transform: none; visibility: visible; transition: transform .2s ease; }
  .agent-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 44; }
  .ws-close, .hist-close { display: inline-flex; }
  .chat-head { padding: 8px 12px; }
  .agent-log { padding: 14px 12px 6px; }
  .chat-foot { padding: 6px 10px max(10px, env(safe-area-inset-bottom)); }
  .ws-bar:not([hidden]) { display: flex; justify-content: center; margin-bottom: 6px; }
  .strip-cards { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; margin-top: 10px; scroll-snap-type: x proximity; }
  .strip-cards > * { scroll-snap-align: start; }
  .strip-cards .more { flex: none; align-self: center; }
  .turn .q { max-width: 92%; }
  .turn-foot .fb { margin-left: 0; }
  .comp-box textarea { font-size: 16px; }    /* iOS：小于 16px 的输入框获得焦点时整页放大 */
  .model-chip .full { display: none; } .model-chip .short { display: inline; }
  .bphoto { grid-template-columns: 1fr; } .bphoto .arrow { display: none; } .bphoto .shot { width: 100%; height: 180px; }
  .btiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .btiles.few { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .boffers li { grid-template-columns: minmax(60px, 110px) minmax(30px, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) { .agent-hist, .agent-ws { transition: none !important; } }

/* ---------- 导购内容（components/guide.js、guide-view.js） ---------- */
.guide { display: flex; flex-direction: column; gap: 14px; }
.guide h3 { margin: 0; font-size: 15px; }
.guide h4 { margin: 0; font-size: 14px; }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.guide-prod { display: flex; gap: 12px; align-items: center; min-width: 0; flex: 1 1 360px; }
.guide-prod img { width: 56px; height: 56px; object-fit: contain; background: var(--img-bg); border-radius: 8px; flex: none; }
.guide-prod b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.guide-ctrl select { font: inherit; font-size: 12.5px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); }
.row.tight { gap: 6px; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.guide-steps li { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.guide-steps .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.guide-steps .running .dot { background: var(--accent); animation: gpulse 1s ease-in-out infinite; }
.guide-steps .ok .dot { background: var(--ok); } .guide-steps .paused .dot { background: var(--warn); } .guide-steps .error .dot { background: var(--bad); }
@keyframes gpulse { 50% { opacity: .3; } }
.guide-brief summary { cursor: pointer; }
.guide-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 18px; margin-top: 10px; max-height: 460px; overflow: auto; }
.guide-facts h4 { margin: 8px 0 4px; font-size: 12.5px; color: var(--muted); }
.guide-facts ul { list-style: none; margin: 0; padding: 0; }
.guide-facts li { font-size: 12.5px; padding: 3px 4px; border-radius: 5px; overflow-wrap: anywhere; }
.guide-facts li.hot { background: var(--accent-2); }
.guide-facts code, .guide-cites code { font-size: 11px; color: var(--muted); }

/* 矩阵 */
.guide-matrix { display: flex; flex-direction: column; gap: 8px; }
.gm-rows { display: flex; flex-direction: column; gap: 6px; }
.gm-row { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px;
          background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.gm-row.whole { background: var(--panel-2); }
.gm-angle { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gm-why { color: var(--text-2); }
.gm-score { width: 52px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; display: inline-block; }
.gm-score i { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #a855f7); }
.gm-cells { display: flex; gap: 6px; flex-wrap: wrap; }
.cell { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 120px; flex: 1 1 120px; text-align: left; font: inherit;
        padding: 7px 10px; border-radius: 8px; border: 1px dashed var(--line-2); background: var(--panel); color: var(--text); cursor: pointer; }
.cell:hover { background: var(--panel-2); }
.cell.has { border-style: solid; }
.cell.open { border-color: var(--accent); background: var(--accent-2); }
.cell-form { font-weight: 600; font-size: 13px; }
.cell .muted, .cell-run, .cell-ok { font-size: 12px; }
.cell-ok.ok { color: var(--ok); } .cell-ok.warn { color: var(--warn); }
.cell-run { color: var(--accent-text); display: inline-flex; gap: 5px; align-items: center; }
.spin { width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: gspin .8s linear infinite; }
@keyframes gspin { to { transform: rotate(360deg); } }
.gm-weak ul { margin: 6px 0 0; padding-left: 18px; }

/* 看一篇 + 依据 */
.guide-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.guide-viewer { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.guide-aside { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; }
.guide-aside:empty { display: none; }
.guide-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.guide-tools { margin-left: auto; }
.guide-hint, .guide-wait { padding: 40px 12px; text-align: center; }
.guide-quote { margin: 0; padding: 8px 10px; background: var(--panel-2); border-radius: 8px; font-size: 13.5px; }
.guide-cites { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; }
.guide-cites li { overflow-wrap: anywhere; }
.guide-repairs { margin: 4px 0 0; padding-left: 16px; display: grid; gap: 4px; }
.guide-aside del { color: var(--bad); } .guide-aside ins { color: var(--ok); text-decoration: none; }
.warn-list { margin: 0; padding-left: 16px; color: var(--bad); }

/* 一句话：可以点；核对标记 */
.gu { all: unset; cursor: pointer; border-radius: 3px; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
      text-decoration-color: transparent; transition: background .15s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.gu:hover { background: var(--accent-2); }
.gu:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.gu.pass { text-decoration-color: color-mix(in srgb, var(--ok) 55%, transparent); text-decoration-style: dotted; }
.gu.warn { background: var(--warn-bg); text-decoration-color: var(--warn); }
.gu.fail, .gu.dropped { color: var(--bad); text-decoration-line: line-through; text-decoration-color: var(--bad); }
.gu.checking { background: linear-gradient(90deg, transparent, var(--panel-3), transparent); background-size: 200% 100%; animation: gshine 1.4s linear infinite; }
@keyframes gshine { to { background-position: -200% 0; } }
.gu.sel { background: var(--accent-2); outline: 2px solid var(--accent); outline-offset: 1px; }
.gu.gl { text-decoration: none; }
.gu.gl.warn { background: var(--warn-bg); } .gu.gl.fail, .gu.gl.dropped { color: var(--bad); }

/* 画面 */
.gv-photo { width: 100%; height: 100%; object-fit: contain; background: var(--img-bg); display: block; }
.gv-photo.cover { object-fit: cover; }
.gv-noimg { width: 100%; height: 100%; background: var(--panel-3); }
.gv-scene { position: relative; width: 100%; height: 100%; }
.gv-scene.pending .gv-photo { filter: saturate(.6) opacity(.75); }
.gv-tag { position: absolute; top: 8px; right: 8px; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(17, 24, 39, .62); color: #fff; }
.gv-empty { color: var(--muted); font-size: 12px; padding: 20px; text-align: center; }
.gv-chart { margin: 0; width: 100%; }
.gv-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.gv-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.gv-chart .yr line { stroke: var(--line); stroke-dasharray: 2 3; } .gv-chart .yr text, .gv-chart .axis { font-size: 10px; fill: var(--muted); }
.gv-chart .dip circle { fill: var(--panel); stroke: var(--ok); stroke-width: 1.5; }
.gv-chart .dip.hot circle { fill: var(--ok); } .gv-chart .dip text { font-size: 11px; font-weight: 700; fill: var(--ok); }
.gv-chart .now circle { fill: var(--bad); } .gv-chart .now text { font-size: 11px; font-weight: 700; fill: var(--bad); }
.gv-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; }
.gv-bars li { display: grid; grid-template-columns: minmax(60px, 38%) minmax(30px, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; }
.gv-bars .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gv-bars .b { height: 8px; background: var(--panel-3); border-radius: 4px; overflow: hidden; }
.gv-bars .b i { display: block; height: 100%; background: var(--line-2); border-radius: 4px; }
.gv-bars .ok .b i { background: var(--ok); } .gv-bars .bad .b i { background: var(--bad); } .gv-bars .warn .b i { background: var(--warn); }
.gv-bars .accent .b i { background: var(--accent); } .gv-bars .muted { color: var(--muted); }
.gv-bars .hot { font-weight: 700; } .gv-bars .v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gv-items { display: grid; gap: 6px; width: 100%; }
.gv-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; }
.gv-item .t { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gv-item-img { width: 40px; height: 40px; object-fit: contain; background: var(--img-bg); border-radius: 6px; }
.gv-item.wide { grid-template-columns: 56px minmax(0, 1fr) auto; } .gv-item.wide .gv-item-img { width: 56px; height: 56px; }
.gv-parts { width: 100%; font-size: 12.5px; } .gv-parts ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.gv-parts li { display: flex; gap: 8px; justify-content: space-between; } .gv-parts li.hot { font-weight: 700; }
.gv-big { font-size: 13px; } .gv-big b { font-size: 22px; color: var(--accent-text); }
.gv-quote { margin: 0; font-size: 12.5px; font-style: italic; color: var(--text-2); } .gv-quote .stars { color: var(--star); font-style: normal; display: block; }

/* 图文卡片：3:4 竖卡横向滑 */
.gv-cardset { display: flex; flex-direction: column; gap: 12px; }
.gv-cards { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; }
.gv-card { flex: none; width: 270px; aspect-ratio: 3 / 4; scroll-snap-align: start; background: var(--panel); border: 1px solid var(--line);
           border-radius: 14px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; position: relative; }
.gv-card h4 { font-size: 17px; line-height: 1.3; letter-spacing: -.01em; }
.gv-card-no { position: absolute; bottom: 8px; right: 12px; font-size: 11px; color: var(--muted); }
.gv-card-visual { display: grid; place-items: center; min-height: 110px; max-height: 46%; overflow: hidden; border-radius: 10px; background: var(--panel-2); padding: 8px; }
.gv-card-visual .gv-photo { max-height: 150px; }
.gv-card-body { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; overflow: auto; }
.gv-card-body p { margin: 0; }
.gv-card.textonly { justify-content: center; } .gv-card.textonly h4 { font-size: 20px; }
.gv-card.cover { padding: 0; }
.gv-card.cover .gv-scene, .gv-card.cover > .gv-photo { position: absolute; inset: 0; }
.gv-cover-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 16px; color: #fff;
                 background: linear-gradient(transparent, rgba(0, 0, 0, .72)); display: flex; flex-direction: column; gap: 6px; }
.gv-cover-text h3 { font-size: 24px; line-height: 1.2; color: #fff; } .gv-cover-text p { margin: 0; font-size: 13.5px; }
.gv-cover-text .gu:hover { background: rgba(255, 255, 255, .18); }
.gv-caption { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.gv-caption p { margin: 0; line-height: 1.7; }

/* 短视频：竖屏手机 + 分镜表 */
.gv-video { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.gv-phone-wrap { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.gv-phone { width: 300px; aspect-ratio: 9 / 16; border-radius: 26px; background: #0b0f17; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); color: #fff; }
.gv-stage, .gv-shot { position: absolute; inset: 0; }
.gv-shot-visual { position: absolute; inset: 0; display: grid; place-items: center; background: #fff; color: #111827; }
.gv-shot-visual > .gv-scene, .gv-shot-visual > .gv-photo { position: absolute; inset: 0; }
.gv-shot-visual .gv-photo { object-fit: cover; }
.gv-shot-visual > .gv-chart, .gv-shot-visual > .gv-bars, .gv-shot-visual > .gv-items, .gv-shot-visual > .gv-parts, .gv-shot-visual > .gv-quote { padding: 70px 18px 150px; }
.gv-phone.playing .gv-shot-visual img { animation: gkb 7s ease-out both; }
@keyframes gkb { from { transform: scale(1.0); } to { transform: scale(1.09); } }
.gv-phone.playing .gv-chart .line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: gdraw 2.2s ease-out forwards; }
@keyframes gdraw { to { stroke-dashoffset: 0; } }
/* 播放时画面动起来：条形从 0 长出来、列表一条条进场、价格点亮起来、字幕弹出（每个镜头换画面时重新开始） */
.gv-phone.playing .gv-bars i { transform-origin: left center; animation: ggrow .9s cubic-bezier(.2, .8, .2, 1) both; }
.gv-phone.playing .gv-bars li, .gv-phone.playing .gv-items > *, .gv-phone.playing .gv-parts > * { animation: gin .5s ease-out both; }
.gv-phone.playing .gv-bars li:nth-child(2), .gv-phone.playing .gv-items > :nth-child(2), .gv-phone.playing .gv-parts > :nth-child(2) { animation-delay: .15s; }
.gv-phone.playing .gv-bars li:nth-child(3), .gv-phone.playing .gv-items > :nth-child(3), .gv-phone.playing .gv-parts > :nth-child(3) { animation-delay: .3s; }
.gv-phone.playing .gv-bars li:nth-child(4), .gv-phone.playing .gv-items > :nth-child(4), .gv-phone.playing .gv-parts > :nth-child(4) { animation-delay: .45s; }
.gv-phone.playing .gv-bars li:nth-child(n+5), .gv-phone.playing .gv-items > :nth-child(n+5), .gv-phone.playing .gv-parts > :nth-child(n+5) { animation-delay: .6s; }
.gv-phone.playing .gv-chart .dip, .gv-phone.playing .gv-chart .now { animation: gin .4s ease-out 1.6s both; }
.gv-phone.playing .gv-shot-cap { animation: gpop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes ggrow { from { transform: scaleX(0); } }
@keyframes gin { from { opacity: 0; transform: translateY(8px); } }
@keyframes gpop { from { opacity: 0; transform: scale(.85); } }
.gv-shot-cap { position: absolute; left: 14px; right: 14px; top: 34px; font-size: 22px; font-weight: 800; line-height: 1.25; text-align: center;
               color: #111827; text-shadow: 0 0 10px #fff, 0 0 2px #fff; }
.gv-shot-cap .gu { color: inherit; }
.gv-sub { position: absolute; left: 12px; right: 12px; bottom: 54px; font-size: 13.5px; line-height: 1.45; text-align: center; padding: 6px 8px; border-radius: 8px;
          background: rgba(0, 0, 0, .58); color: #fff; }
.gv-sub:empty { display: none; }
.gv-segs { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; gap: 3px; }
.gv-segs span { flex: 1; height: 3px; border-radius: 2px; background: rgba(17, 24, 39, .25); overflow: hidden; }
.gv-segs span i { display: block; height: 100%; width: 0; background: #111827; }
.gv-segs span.done i { width: 100% !important; transition: none !important; }
.gv-play { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0;
           background: rgba(17, 24, 39, .8); color: #fff; font-size: 14px; cursor: pointer; }
.gv-shots td { vertical-align: top; } .gv-shots tr { cursor: pointer; } .gv-shots tr.cur td { background: var(--accent-2); }
.gv-shots p { margin: 0; }

/* 短讯 */
.gv-post { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.gv-push { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow-lg); display: grid; gap: 6px; font-size: 14px; }
.gv-push-app { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.gv-push-app .logo { width: 20px; height: 20px; border-radius: 5px; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; display: grid; place-items: center; font-size: 11px; }
.gv-push-app .muted { margin-left: auto; }
.gv-social { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.gv-social-head { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.gv-social-head .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-3); }
.gv-social p { margin: 0; line-height: 1.65; }
.gv-social-img { width: 100%; max-height: 220px; object-fit: contain; background: var(--img-bg); border-radius: 10px; }
.gv-titles { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; }

/* 长文、问答、话术、测验、对比 */
.gv-article { max-width: 720px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.8; }
.gv-article h3 { font-size: 22px; line-height: 1.35; } .gv-article h4 { font-size: 17px; margin-top: 10px; }
.gv-article p { margin: 0; } .gv-article .lede { font-size: 16px; color: var(--text-2); }
.gv-hero { height: 220px; border-radius: 12px; overflow: hidden; background: var(--img-bg); }
.gv-verdict { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; background: var(--panel-2); border-radius: 0 8px 8px 0; }
.gv-faq { display: grid; gap: 8px; max-width: 760px; }
.gv-faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.gv-faq summary { font-weight: 600; cursor: pointer; } .gv-faq p { margin: 8px 0 0; line-height: 1.7; }
.gv-script { display: grid; gap: 14px; max-width: 760px; } .gv-script ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.gv-script p { margin: 4px 0 0; line-height: 1.7; } .gv-obj { padding: 8px 0; border-bottom: 1px dashed var(--line); } .gv-obj .q { font-weight: 600; }
.gv-quiz { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.gv-q { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; background: var(--panel); }
.gv-q legend { font-weight: 600; padding: 0 4px; }
.gv-quiz-result { border: 2px solid var(--accent); border-radius: 12px; padding: 14px; background: var(--accent-2); display: grid; gap: 8px; }
.gv-quiz-result p { margin: 0; } .gv-outcome { padding: 6px 0; } .gv-outcome p { margin: 2px 0 0; }
.gv-compare table { min-width: 640px; } .gv-compare th, .gv-compare td { vertical-align: top; font-size: 13px; }
.gv-compare thead th { min-width: 150px; } .gv-col { display: grid; gap: 4px; justify-items: start; } .gv-col .t { font-weight: 400; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gv-compare tr.fixed td { font-weight: 600; } .gv-compare tr.verdict td { background: var(--panel-2); }

@media (max-width: 1100px) {
  .guide-main { grid-template-columns: minmax(0, 1fr); }
  .guide-aside { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .gm-row { grid-template-columns: minmax(0, 1fr); }
  .gv-video { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .gv-phone { width: min(300px, 86vw); }
  .gv-card { width: min(270px, 78vw); }
  .guide-tools { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .gv-phone.playing .gv-shot-visual img, .gv-phone.playing .gv-chart .line, .spin, .gu.checking, .guide-steps .running .dot,
  .gv-phone.playing .gv-bars i, .gv-phone.playing .gv-bars li, .gv-phone.playing .gv-items > *, .gv-phone.playing .gv-parts > *,
  .gv-phone.playing .gv-chart .dip, .gv-phone.playing .gv-chart .now, .gv-phone.playing .gv-shot-cap { animation: none !important; }
}
/* ---------- 关注（/watch）：动态、意图、关注的商品；商品页“关注降价”；助手回答下面的意图 / 关注卡片 ---------- */
.topbar nav a[data-nav] { position: relative; }
.nav-badge { display: inline-block; min-width: 17px; height: 17px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--bad);
             color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; vertical-align: 1px; }
.watch-body { margin-top: 14px; }
.watch-body > .muted.small { margin: 0 0 12px; }
.segmented .count { color: var(--muted); font-weight: 500; }
.w-list { display: grid; gap: 10px; }
.w-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: start; background: var(--panel);
         border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.w-row.unseen { box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.w-thumb { width: 72px; height: 72px; background: var(--img-bg); border: 1px solid var(--line); border-radius: 8px; display: grid;
           place-items: center; overflow: hidden; }
.w-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.w-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.w-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.w-top a.pill:hover { text-decoration: none; filter: brightness(.97); }
.w-top .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.w-title { font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-price { display: flex; gap: 6px 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.w-price b { font-size: 15px; color: var(--price); font-variant-numeric: tabular-nums; }
.w-acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 128px; }
.w-acts .fb { display: flex; gap: 6px; }
.w-checks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; font-size: 12.5px; }
.w-checks li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 6px; align-items: baseline; }
.w-checks .pass .mark { color: var(--ok); font-weight: 700; } .w-checks .fail .mark { color: var(--bad); font-weight: 700; }
.w-settings { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 12.5px; margin-top: 6px; color: var(--text-2); }
.w-settings label { display: inline-flex; gap: 6px; align-items: center; }
.w-settings input[type="number"] { width: 88px; padding: 4px 8px; }
.w-settings select { padding: 4px 8px; }
.intent { margin-bottom: 14px; }
.intent-head { display: flex; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 8px; }
.intent h3 { margin: 0 0 4px; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.intent h4 { margin: 16px 0 8px; font-size: 13px; }
.intent-head p { margin: 0; }
.chip.must { border-color: var(--accent); color: var(--accent-text); background: var(--accent-2); white-space: normal; }
.intent-stats { margin: 8px 0 0; }
.icands { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.icand { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
         padding: 10px; background: var(--panel-2); }
.icand.short { background: var(--panel); border-color: var(--line-2); }
.icand .w-thumb { width: 64px; height: 64px; }
.icand > .btn { grid-column: 2; justify-self: start; }
.more-cands { margin-top: 12px; }
.more-cands > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.more-cands .icands { margin-top: 8px; }
.intent-bar { justify-content: space-between; margin: 0 0 12px; }
.empty-line { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.intent-form { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; margin: 12px 0; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field textarea { min-height: 64px; font-family: var(--font); font-size: 13px; }
.watch-pop { position: relative; }
.watch-pop > summary { list-style: none; cursor: pointer; }
.watch-pop > summary::-webkit-details-marker { display: none; }
.watch-pop > summary.on { color: var(--ok); border-color: var(--ok); }
.watch-pop .menu { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: min(320px, 86vw); display: grid; gap: 8px; padding: 12px;
                   background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.watch-pop .menu p { margin: 0; }
.buy-actions .watch-pop .menu .btn { width: auto; padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }
.turn-actions { display: grid; gap: 8px; margin-top: 10px; }
.act-card { border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--panel);
            display: grid; gap: 6px; font-size: 13px; }
.act-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.act-card p { margin: 0; }
.agent-intents { margin: 16px auto 4px; text-align: left; max-width: 560px; }
.agent-intents h3 { margin: 0 0 4px; }
.agent-intents .chips { margin-top: 6px; }
.mcard .mbtns { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) {
  .w-row { grid-template-columns: 56px minmax(0, 1fr); padding: 10px; }
  .w-thumb { width: 56px; height: 56px; }
  .w-acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .icands { grid-template-columns: minmax(0, 1fr); }
  .intent-head .row { width: 100%; }
}
@media (max-width: 760px) { .buy-actions .watch-pop { width: 100%; } .buy-actions .watch-pop > summary { width: 100%; } }

/* 卖家（/sellers、/sellers/{平台}/{账号}、/brands/{品牌}） */
.signal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.signal { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-sm); padding: 10px 12px; background: var(--panel); }
.signal.high { border-left-color: var(--bad); } .signal.medium { border-left-color: var(--warn); } .signal.low { border-left-color: var(--info); }
.signal p { margin: 6px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.signal .examples { list-style: none; margin: 6px 0 0; padding: 0; }
.seller-ref a { overflow-wrap: anywhere; }
.seller-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.bad-text { color: var(--bad); }
.pcard .seller-line { display: flex; gap: 6px; align-items: center; min-height: 20px; font-size: 12px; overflow: hidden; white-space: nowrap; }
.pcard .seller-line .name { overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }

.risk-bar button { white-space: nowrap; }
.risk-bar .count { margin-left: 4px; }
@media (max-width: 640px) {
  .risk-bar { display: flex; width: 100%; }
  .risk-bar button { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 2px; font-size: 12px; }
  .risk-bar button .count { font-size: 11.5px; margin-left: 0; }
}

/* 卖家卡片（/sellers）、卖家头部（详情）、卖家的商品小块 */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, hsl(var(--hue) 70% 58%), hsl(calc(var(--hue) + 30) 65% 46%)); }
.avatar.high { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--bad); }
.avatar.medium { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--warn); }
.scards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.scard { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 16px; display: flex; flex-direction: column; gap: 12px;
  min-width: 0; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: box-shadow .15s, border-color .15s; }
.scard:hover { box-shadow: 0 6px 20px rgba(15, 23, 42, .08); border-color: var(--line-2); }
.scard.high { background: linear-gradient(180deg, var(--bad-bg), var(--panel) 90px); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.scard.medium { background: linear-gradient(180deg, var(--warn-bg), var(--panel) 90px); }
.scard-top { display: flex; gap: 12px; align-items: flex-start; }
.scard-top .who { flex: 1; min-width: 0; }
.scard h2 { font-size: 16px; line-height: 1.3; margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard h2 a { color: var(--text); } .scard h2 a:hover { color: var(--accent); }
.scard .sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.scard .sub .plat { color: var(--text-2); font-weight: 600; }
.scard .sub .mono { overflow-wrap: anywhere; }
.scard-empty { border: 1px dashed var(--line-2); border-radius: 10px; padding: 18px; text-align: center; font-size: 12.5px; color: var(--muted); }
.scard-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.scard-foot .stats { display: flex; gap: 12px; font-size: 12.5px; color: var(--text-2); }
.scard-foot .stats b { color: var(--text); }
.scard-foot .more { margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
.brand-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.chip { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--panel-3); color: var(--text-2); }
.chip:hover { text-decoration: none; background: var(--accent-2); color: var(--accent-text); }
.chip .n { color: var(--muted); font-size: 11px; }
.ptiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ptiles.big { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.ptile { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow: hidden; color: var(--text); }
.ptile:hover { text-decoration: none; } .ptile:hover .pic { border-color: var(--accent); }
.ptile .pic { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; position: relative; transition: border-color .15s; }
.ptile .pic img { width: 88%; height: 88%; object-fit: contain; }
.ptile .pic.none { background: linear-gradient(135deg, var(--panel-2), var(--panel-3)); }
.ptile .pic .ph { font-size: 22px; font-weight: 700; color: var(--muted); opacity: .6; }
.ptile.big .pic .ph { font-size: 40px; }
.ptile .ratio { position: absolute; left: 4px; top: 4px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .9); color: #374151; border: 1px solid var(--line); }
.ptile .ratio.low { background: var(--bad); color: #fff; border-color: transparent; }
.ptile .ratio.high { background: var(--warn-bg); color: var(--warn); }
.ptile .meta { display: flex; flex-direction: column; gap: 2px; width: 100%; min-width: 0; overflow: hidden; font-size: 11.5px; }
.ptile .price { display: flex; gap: 6px; align-items: baseline; }
.ptile .price b { font-size: 13px; } .ptile .price s { font-size: 11.5px; }
.ptile .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.ptile.big .meta { font-size: 12.5px; } .ptile.big .price b { font-size: 15px; }
.ptile.big .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.seller-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); margin: 6px 0 16px; }
.seller-hero.high { background: linear-gradient(120deg, var(--bad-bg), var(--panel) 60%); }
.seller-hero.medium { background: linear-gradient(120deg, var(--warn-bg), var(--panel) 60%); }
.seller-hero .who { flex: 1; min-width: 220px; }
.seller-hero h1 { margin: 0 0 6px; font-size: 24px; overflow-wrap: anywhere; }
.seller-hero .sub { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 13px; }
.seller-hero .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.seller-hero .side .pill { font-size: 13px; padding: 4px 12px; }
@media (max-width: 640px) {
  .scards { grid-template-columns: 1fr; } .ptiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ptiles.big { grid-template-columns: repeat(2, minmax(0, 1fr)); } .seller-hero .side { align-items: flex-start; }
}
.signal .ptiles.examples { margin-top: 10px; max-width: 640px; }
.signal ul.examples { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ptile, .ptile:hover, .ptile * { text-decoration: none; }

/* ---------- 市场 /market ---------- */
.mk-hero { display: grid; gap: 18px; padding: 26px 28px; margin: 4px 0 18px; border-radius: 18px; border: 1px solid var(--line);
  background: radial-gradient(120% 140% at 0% 0%, var(--accent-2) 0%, var(--panel) 55%); box-shadow: var(--shadow); }
.mk-hero h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.02em; }
.mk-hero p { margin: 0; color: var(--text-2); font-size: 15px; max-width: 760px; }
.mk-hero .mk-hero-meta { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.mk-search input { width: 100%; font: inherit; font-size: 16px; padding: 13px 16px 13px 42px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%239aa1ad' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 14px center;
  color: var(--text); box-shadow: var(--shadow); }
.mk-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.mk-roots { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; }
.mk-root { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: inherit; cursor: pointer; scroll-snap-align: start; box-shadow: var(--shadow); text-align: left; }
.mk-root:hover { border-color: var(--line-2); }
.mk-root.on { border-color: var(--accent); background: var(--accent-2); }
.mk-root-img { width: 38px; height: 38px; border-radius: 50%; background: var(--img-bg); overflow: hidden; flex: 0 0 38px; display: grid; place-items: center; }
.mk-root-img img { width: 100%; height: 100%; object-fit: contain; }
.mk-root-text { display: flex; flex-direction: column; line-height: 1.25; }
.mk-root-text b { font-size: 13px; white-space: nowrap; }
.mk-root-text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.mk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 12px; }
.mk-head h2 { margin: 0; }

.mk-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.mk-card { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; min-width: 0; }
.mk-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.mk-card-media { position: relative; }
.mk-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mk-card-title { font-weight: 650; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-card-sub { font-size: 12px; color: var(--muted); }
.mk-card-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mk-card-stats b { color: var(--text); font-size: 14px; }
.mk-card-stats small { color: var(--muted); }
.mk-card-brands { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 2px; min-width: 0; }
.mk-stack { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: var(--panel-3); }
.mk-stack .b0 { background: var(--accent); } .mk-stack .b1 { background: #a5b4fc; } .mk-stack .b2 { background: #c7d2fe; }

.mk-mosaic { display: grid; gap: 2px; aspect-ratio: 4 / 3; background: var(--line); }
.mk-mosaic > span { background: var(--img-bg); display: grid; place-items: center; overflow: hidden; min-height: 0; }
.mk-mosaic img { width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.mk-mosaic.n4 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
.mk-mosaic.n4 > span:first-child { grid-row: 1 / 4; }
.mk-mosaic.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.mk-mosaic.n3 > span:first-child { grid-row: 1 / 3; }
.mk-mosaic.n2 { grid-template-columns: 1fr 1fr; }
.mk-mosaic.n1, .mk-mosaic.n0 { grid-template-columns: 1fr; }
.mk-noimg { background: var(--panel-3) !important; }
.mk-kind { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 999px;
  background: rgba(17, 24, 39, .72); color: #fff; backdrop-filter: blur(4px); }
.mk-kind.inline { position: static; }
.mk-kind.leaf { background: var(--accent); } .mk-kind.axis { background: #0891b2; } .mk-kind.tier { background: #059669; } .mk-kind.category { background: #475569; }
.mk-trend { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-card-media .mk-trend { position: absolute; right: 10px; top: 10px; padding: 3px 8px; border-radius: 999px; background: var(--panel); box-shadow: var(--shadow); }
.mk-trend.up { color: var(--ok); } .mk-trend.down { color: var(--bad); } .mk-trend.flat { color: var(--muted); }
.mk-card-media .mk-vshare { position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: 999px; background: var(--panel);
  box-shadow: var(--shadow); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }

.mk-detail-hero { display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); gap: 24px; padding: 18px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); margin: 6px 0 8px; }
.mk-detail-hero .mk-mosaic { border-radius: 12px; overflow: hidden; }
.mk-detail-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mk-detail-main h1 { font-size: 26px; margin: 4px 0 0; letter-spacing: -.02em; }
.mk-need { font-size: 15px; color: var(--text-2); margin: 0; }
.mk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.mk-stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.mk-stat .k { font-size: 12px; color: var(--muted); }
.mk-stat .v { font-size: 21px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.mk-stat .v.up { color: var(--ok); } .mk-stat .v.down { color: var(--bad); }
.mk-stat .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

.mk-children { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mk-child { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.mk-child:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.mk-child .mk-mosaic { border-radius: 10px; overflow: hidden; aspect-ratio: 1; }
.mk-child-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mk-child-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; min-width: 0; }
.mk-child-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mk-child-stats b { color: var(--text); }
.mk-q { font-weight: 600; } .mk-q.blue { color: var(--ok); } .mk-q.red { color: var(--bad); } .mk-q.growth { color: var(--warn); }
.mk-share { display: block; height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.mk-share > span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #818cf8); }

.mk-brands { display: flex; flex-direction: column; gap: 7px; }
.mk-brand-row { display: grid; grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr) 3.4em; gap: 10px; align-items: center; font-size: 13px; }
.mk-brand-row .num { text-align: right; }
.mk-hist { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 6px; }
.mk-hist-col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; }
.mk-hist-col > span { display: block; width: 100%; background: linear-gradient(180deg, #818cf8, var(--accent)); border-radius: 4px 4px 0 0; }
.mk-hist-axis { display: flex; justify-content: space-between; margin-top: 4px; font-variant-numeric: tabular-nums; }

.mk-prods { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.mk-prod { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  color: inherit; text-decoration: none; min-width: 0; }
.mk-prod:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow); }
.mk-prod-img { aspect-ratio: 1; border-radius: 8px; background: var(--img-bg); display: grid; place-items: center; overflow: hidden; margin-bottom: 4px; }
.mk-prod-img img { width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.mk-prod-title { font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.mk-prod-meta { font-size: 11.5px; color: var(--muted); }
.mk-prod-price b { font-size: 15px; } .mk-prod-price small { color: var(--muted); font-size: 11.5px; }
.mk-prod-sold { font-size: 11.5px; color: var(--muted); }

.mk-rel h3 { margin: 0 0 8px; }
.mk-rel-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mk-rel-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  color: inherit; text-decoration: none; min-width: 0; }
.mk-rel-card:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow); }
.mk-rel-img { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 8px; background: var(--img-bg); overflow: hidden; display: grid; place-items: center; }
.mk-rel-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.mk-rel-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.mk-rel-text small { color: var(--muted); font-size: 11.5px; }

.mk-basis { margin-top: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.mk-basis > summary { cursor: pointer; font-weight: 650; }
.mk-basis[open] > summary { margin-bottom: 12px; }
.mk-basis > * + * { margin-top: 12px; }
.mk-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mk-checks li { display: flex; gap: 10px; align-items: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mk-check-mark { flex: 0 0 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
  background: var(--panel-3); color: var(--muted); }
.mk-checks li.ok .mk-check-mark { background: var(--ok-bg); color: var(--ok); }
.mk-checks li.warn .mk-check-mark { background: var(--warn-bg); color: var(--warn); }
.mk-axes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.mk-axis { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

@media (max-width: 760px) {
  .mk-hero { padding: 18px; border-radius: 14px; }
  .mk-hero h1 { font-size: 24px; }
  .mk-detail-hero { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 14px; }
  .mk-detail-hero .mk-mosaic { aspect-ratio: 16 / 10; }
  .mk-detail-main h1 { font-size: 21px; }
  .mk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mk-card-body { padding: 10px; }
  .mk-card-title { font-size: 14px; }
  .mk-children, .mk-checks, .mk-axes, .mk-rel-list { grid-template-columns: minmax(0, 1fr); }
  .mk-prods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-head .segmented { overflow-x: auto; max-width: 100%; }
}

/* 网站可信度（Playground：components/sitecheck.js） */
.pg-ex-site { font-size: 24px; font-weight: 700; color: var(--accent-text); background: var(--accent-2); }
.pg-recent { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pg-recent .chip { cursor: pointer; font: inherit; font-size: 12px; }
.pg-recent .chip.risk-high { border-color: var(--bad); color: var(--bad); } .pg-recent .chip.risk-medium { border-color: var(--warn); }
.sc { display: flex; flex-direction: column; gap: 14px; }
.sc-steps { margin-bottom: 10px; }
.sc-steps .skipped .dot { background: var(--line-2); }
.sc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); border-left-width: 6px; background: var(--panel); box-shadow: var(--shadow); }
.sc-head.risk-high { border-left-color: var(--bad); background: linear-gradient(90deg, var(--bad-bg), var(--panel) 60%); }
.sc-head.risk-medium { border-left-color: var(--warn); background: linear-gradient(90deg, var(--warn-bg), var(--panel) 60%); }
.sc-head.risk-low, .sc-head.risk-none { border-left-color: var(--ok); }
.sc-head-main { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-head-side { flex: 0 1 260px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sc-label { font-size: 22px; font-weight: 700; margin-right: 4px; }
.sc-head.risk-high .sc-label { color: var(--bad); } .sc-head.risk-medium .sc-label { color: var(--warn); }
.sc-head.risk-low .sc-label, .sc-head.risk-none .sc-label { color: var(--ok); }
.sc-headline { margin: 0; font-size: 14px; color: var(--text-2); }
.sc-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.sc-site { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.sc-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.sc-card > h3 { margin: 0 0 10px; font-size: 16px; }
.sc-card h4 { margin: 14px 0 6px; font-size: 14px; }
.sc-card table.kv { width: 100%; font-size: 13px; }
.sc-card table.kv th { text-align: left; font-weight: 400; color: var(--muted); white-space: nowrap; padding: 3px 12px 3px 0; vertical-align: top; width: 1%; }
.sc-card table.kv td { padding: 3px 0; overflow-wrap: anywhere; }
.sc-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.sc-quote { margin: 6px 0 0; padding: 4px 10px; border-left: 3px solid var(--line-2); color: var(--text-2); font-size: 12.5px; font-style: italic; overflow-wrap: anywhere; }
.sc-examples li { margin-top: 4px; }
.sc-code { margin-left: 6px; font-size: 11.5px; background: var(--code); padding: 0 4px; border-radius: 4px; overflow-wrap: anywhere; }
.sc-plus { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.sc-list { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; overflow-wrap: anywhere; }
.sc-caption { caption-side: top; text-align: left; font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.sc-prices { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13px; }
.sc-prices th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); }
.sc-prices td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sc-prod { display: flex; gap: 8px; align-items: flex-start; }
.sc-prod img { width: 36px; height: 36px; object-fit: contain; flex: none; border-radius: 4px; background: var(--img-bg); }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.sc-item { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.sc-item:hover { border-color: var(--accent); text-decoration: none; }
.sc-item img, .sc-item .pg-noimg { width: 100%; height: 90px; object-fit: contain; background: var(--img-bg); border-radius: 4px; }
.sc-item-title { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) { .sc-head { padding: 12px; } .sc-label { font-size: 19px; } .sc-head-side { flex-basis: 100%; } }

/* ---------- 图像分析（Playground，components/vision.js） ---------- */
.vz { display: flex; flex-direction: column; gap: 16px; }
.vz-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.vz-stage { position: relative; width: 100%; border-radius: 10px; overflow: hidden; background: var(--img-bg); border: 1px solid var(--line); }
.vz-img, .vz-masks { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vz-masks { pointer-events: none; }
.vz-boxes { position: absolute; inset: 0; }
.vz-box { position: absolute; padding: 0; border: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent); border-radius: 5px; background: transparent; cursor: pointer; }
.vz-box span { position: absolute; left: -1.5px; top: -1.5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px 0 5px 0;
               background: var(--c); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.vz-box:hover, .vz-box.on { border: 2px solid var(--c); box-shadow: 0 0 0 1px rgba(255, 255, 255, .85); z-index: 2; }
.vz-toolbar { gap: 8px; }
.vz-summary { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
              padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.vz-steps { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; box-shadow: var(--shadow); }
.vz-steps .scroll-x { overflow-x: auto; }
.vz-cap { caption-side: top; text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 6px 0 2px; }
.vz-examples .btn.small { padding: 2px 6px; }
.vz-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vz-stat { background: var(--panel-2); border-radius: var(--radius-sm); padding: 8px 10px; min-width: 0; }
.vz-stat-v { font-size: 20px; font-weight: 700; line-height: 1.3; }
.vz-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vz-table th, .vz-table td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.vz-table thead th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.vz-table tbody th, .vz-table tfoot th { white-space: nowrap; font-weight: 650; }
.vz-table td.num, .vz-table th.num { text-align: right; white-space: nowrap; }
.vz-table tfoot td, .vz-table tfoot th { border-bottom: 0; }
.vz-gpu { gap: 8px; font-size: 12.5px; color: var(--text-2); }
.vz-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.vz-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.vz-est { background: var(--accent-2); color: var(--accent-text); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12.5px; }
.vz-est p { margin: 2px 0; }
.vz-list { display: flex; flex-direction: column; gap: 12px; }
.vz-card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 12px 14px;
           box-shadow: var(--shadow); scroll-margin-top: 80px; }
.vz-card.on { box-shadow: 0 0 0 2px var(--c), var(--shadow-lg); }
.vz-card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.vz-num { flex: none; min-width: 26px; height: 26px; border-radius: 7px; border: 0; background: var(--c); color: #fff; font-weight: 700; cursor: pointer; }
.vz-name { display: flex; flex-direction: column; min-width: 0; }
.vz-name > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr); gap: 12px; }
.vz-panel { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vz-panel-title { font-size: 12px; font-weight: 650; color: var(--muted); }
.vz-media { position: relative; display: grid; place-items: center; height: 220px; border-radius: var(--radius-sm); overflow: hidden;
            border: 1px solid var(--line);
            background: repeating-conic-gradient(#e9ebef 0 25%, #ffffff 0 50%) 0 0 / 16px 16px; }   /* 透明底：棋盘格 */
.vz-media.empty { background: var(--panel-2); }
.vz-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
.vz-3d { background: #ffffff; }
.vz-views { width: 100%; height: auto; }
.vz-viewer { width: 100%; height: 100%; --poster-color: transparent; background: #f6f7f9; }
.vz-panel figcaption { color: var(--text-2); overflow-wrap: anywhere; }
.vz-actions { margin-top: 6px; }
.vz-select { font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); color: var(--text); max-width: 100%; }
.vz-st.wait { color: var(--muted); } .vz-st.run { color: var(--info); } .vz-st.bad { color: var(--bad); } .vz-st.skip { color: var(--warn); }
@media (max-width: 1100px) { .vz-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .vz-panels { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vz-panels > .vz-panel:last-child { grid-column: 1 / -1; }
  .vz-media { height: 170px; }
}
/* ---------------------------------------------------------------------------
   导购内容 · 互动讲解（components/guide-explore.js）和 3D 展品（components/exhibit3d.js）
   --------------------------------------------------------------------------- */
.gx { --gx-pos: #16a34a; --gx-neg: #dc2626; --gx-mix: #d97706; display: flex; flex-direction: column; gap: 18px; }
.gx-hero { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 22px; align-items: center; padding: 22px;
  border-radius: 16px; background: linear-gradient(135deg, var(--accent-2), var(--panel) 70%); border: 1px solid var(--line); }
.gx-hero-img { width: 180px; height: 180px; object-fit: contain; background: var(--img-bg); border-radius: 12px; }
.gx-hero-txt { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-width: 0; }
.gx-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--accent-text); background: var(--panel); padding: 3px 10px; border-radius: 999px; }
.gx-title { font-size: 28px; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
.gx-title .gu { font: inherit; }
.gx-sub { font-size: 15px; color: var(--text-2); margin: 0; line-height: 1.6; }
.gx-hero-meta { max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-listen { margin-top: 4px; }
.gx-nav { position: sticky; top: 0; z-index: 3; display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px; background: var(--bg); }
.gx-nav a { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; font-size: 13px; padding: 5px 11px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text-2); text-decoration: none; }
.gx-nav a span { font-size: 11px; font-weight: 700; color: var(--muted); }
.gx-nav a:hover { border-color: var(--accent); color: var(--accent-text); }
.gx-ch { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; scroll-margin-top: 56px;
  display: flex; flex-direction: column; gap: 12px; transition: box-shadow .3s, border-color .3s; }
.gx-ch.live { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.gx-ch-head { display: flex; gap: 14px; align-items: flex-start; }
.gx-num { font-size: 26px; font-weight: 800; line-height: 1; color: var(--accent); opacity: .35; font-variant-numeric: tabular-nums; }
.gx-kind { font-size: 12px; color: var(--muted); font-weight: 600; }
.gx-h { margin: 2px 0 0; font-size: 20px; line-height: 1.3; }
.gx-h .gu { font: inherit; }
.gx-take { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.gx-tip { margin: 0; font-size: 14px; font-weight: 600; color: var(--accent-text); background: var(--accent-2); border-radius: 10px; padding: 9px 12px; }
.gx-widget { border-top: 1px dashed var(--line); padding-top: 14px; }
.gx-ev { border-bottom: 1px dotted var(--muted); cursor: help; }
.gx .ok-text, .gx .ok { color: var(--ok); } .gx .bad-text { color: var(--bad); }
.gx-big { font-size: 30px; font-weight: 800; line-height: 1.1; }
.gx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-chip { font: inherit; font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2); cursor: pointer; }
.gx-chip:hover, .gx-chip:focus-visible { border-color: var(--ok); }
.gx-w-tools { justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.gx-sl { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.gx-sl input[type=range] { width: 100%; accent-color: var(--accent); }
.gx-sl-l { color: var(--text-2); font-weight: 600; white-space: nowrap; }
.gx-sl-v { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 7em; text-align: right; }
.gx-sliders { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.gx-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }

/* 价格时间轴 */
.gx-when { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; }
.gx-w-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.gx-tl-box { position: relative; }
.gx-tl { width: 100%; height: auto; display: block; touch-action: pan-y; cursor: crosshair; overflow: visible; }
.gx-tl .line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: gx-draw 1.4s ease-out forwards; }
@keyframes gx-draw { to { stroke-dashoffset: 0; } }
.gx-tl .grid line { stroke: var(--line); } .gx-tl .grid text, .gx-tl .yr text { font-size: 11px; fill: var(--muted); }
.gx-tl .yr line { stroke: var(--line-2); stroke-dasharray: 2 4; }
.gx-tl .dip rect { fill: var(--ok); opacity: .1; } .gx-tl .dip.cut rect { opacity: .06; } .gx-tl .dip.hot rect { opacity: .28; }
.gx-tl .dip text { font-size: 10.5px; font-weight: 700; fill: var(--ok); }
.gx-tl .median line { stroke: var(--muted); stroke-dasharray: 5 4; } .gx-tl .median text { font-size: 11px; fill: var(--muted); }
.gx-tl .now circle { fill: var(--bad); } .gx-tl .now text { font-size: 12px; font-weight: 700; fill: var(--bad); }
.gx-tl .cross line { stroke: var(--text-2); stroke-width: 1; } .gx-tl .cross circle { fill: var(--panel); stroke: var(--accent); stroke-width: 2; }
.gx-tl-tip { position: absolute; top: 0; transform: translate(-50%, -105%); background: var(--text); color: var(--panel); padding: 6px 9px;
  border-radius: 8px; font-size: 12px; display: flex; flex-direction: column; gap: 1px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-lg); }
.gx-tl-tip .ok { color: #4ade80; } .gx-tl-tip .bad { color: #fca5a5; } .gx-tl-tip .muted { color: #cbd5e1; }
.gx-w-side { display: flex; flex-direction: column; gap: 16px; }
.gx-gauge-bar { position: relative; height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--ok-bg), var(--bad-bg)); border: 1px solid var(--line); }
.gx-gauge-bar i { position: absolute; inset: 0 auto 0 0; background: var(--ok); opacity: .35; border-radius: 999px; }
.gx-gauge-bar b { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; background: var(--bad); border-radius: 2px; }
.gx-gauge-txt { margin-top: 8px; font-size: 14px; } .gx-gauge-txt .gx-ev { font-weight: 800; font-size: 18px; }
.gx-wait { background: var(--ok-bg); border-radius: 12px; padding: 12px; color: var(--ok); } .gx-wait .small { color: var(--text-2); }

/* 报价与卖家 */
.gx-offers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) auto; gap: 8px 12px; }
.gx-offers li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding: 8px 10px;
  border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.gx-offers li.oos { opacity: .55; }
.gx-of-name { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-weight: 600; font-size: 13.5px; min-width: 0; }
.gx-of-bar { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.gx-of-bar i { display: block; height: 100%; border-radius: 999px; background: var(--muted); transition: width .5s; }
.gx-offers li.ok .gx-of-bar i { background: var(--ok); } .gx-offers li.bad .gx-of-bar i { background: var(--bad); } .gx-offers li.warn .gx-of-bar i { background: var(--warn); }
.gx-of-price { display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; font-variant-numeric: tabular-nums; }
.gx-of-diff { font-size: 12px; font-weight: 600; color: var(--bad); } .gx-of-diff.ok { color: var(--ok); }

/* 花费计算器 */
.gx-cost { display: flex; flex-direction: column; gap: 12px; }
.gx-cost-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.gx-kpi { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.gx-kpi b { font-size: 22px; font-variant-numeric: tabular-nums; }
.gx-packs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(60px, 1fr) auto; gap: 6px 10px; }
.gx-packs li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; font-size: 13px; }
.gx-pk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-pk-bar { height: 10px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.gx-pk-bar i { display: block; height: 100%; background: var(--muted); border-radius: 999px; transition: width .35s; }
.gx-packs li.me .gx-pk-bar i { background: var(--accent); } .gx-packs li.ok .gx-pk-bar i { background: var(--ok); } .gx-packs li.bad .gx-pk-bar i { background: var(--bad); opacity: .7; }
.gx-pk-v { display: flex; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gx-stack { display: flex; height: 22px; border-radius: 8px; overflow: hidden; gap: 2px; }
.gx-stack i { display: block; transition: flex-grow .35s; min-width: 2px; }
.gx-stack i.base, .gx-legend i.base { background: var(--accent); } .gx-stack i.c0, .gx-legend i.c0 { background: #f59e0b; } .gx-stack i.c1, .gx-legend i.c1 { background: #10b981; }
.gx-stack i.c2, .gx-legend i.c2 { background: #ec4899; } .gx-stack i.c3, .gx-legend i.c3 { background: #06b6d4; }
.gx-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; }
.gx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.gx-parts-cost { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gx-parts-cost li { display: flex; gap: 10px; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 8px; font-size: 13px; }
.gx-parts-cost img { width: 44px; height: 44px; object-fit: contain; background: var(--img-bg); border-radius: 6px; flex: none; }
.gx-once { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gx-once label.gx-chip { display: inline-flex; gap: 4px; align-items: center; } .gx-once label.gx-chip.on { border-color: var(--accent); background: var(--accent-2); }

/* 对比 */
.gx-compare { display: flex; flex-direction: column; gap: 12px; }
.gx-rank { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 26px 48px minmax(0, 1fr) auto 90px; gap: 6px 10px; }
.gx-rk { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding: 8px 10px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line); }
.gx-rk.me { border-color: var(--accent); background: var(--accent-2); }
.gx-rk-n { font-weight: 800; font-size: 16px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.gx-rk img, .gx-rk-noimg { width: 48px; height: 48px; object-fit: contain; background: var(--img-bg); border-radius: 8px; }
.gx-rk-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.gx-rk-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.gx-rk-m { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gx-rk-score { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.gx-rk-score i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .35s; }

/* 拆开看 / 3D */
.gx-inside { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 16px; }
.gx-3d { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.x3 { position: relative; border-radius: 14px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 20%, var(--panel) 0%, var(--panel-3) 100%); border: 1px solid var(--line); }
.x3-canvas { width: 100%; touch-action: none; } .x3-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.x3-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.gx-3d-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.gx-3d-tools .gx-sl { min-width: 220px; flex: 1; }
.gx-tour { display: flex; gap: 12px; align-items: flex-start; background: var(--panel-2); border-radius: 12px; padding: 10px 12px; }
.gx-tour:empty { display: none; }
.gx-tour-steps { display: flex; gap: 5px; flex: none; }
.gx-tour-step { font: inherit; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 700; color: var(--text-2); }
.gx-tour-step[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.gx-tour-text p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.6; }
.gx-3d-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gx-part-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 120px; }
.gx-part-card h4 { margin: 0; font-size: 16px; } .gx-part-card p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.6; }
.gx-check-tip { color: var(--accent-text); }
.gx-part-buy { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 8px; border-radius: 10px; background: var(--ok-bg); }
.gx-part-buy img { width: 44px; height: 44px; object-fit: contain; background: var(--img-bg); border-radius: 6px; }
.gx-part-list { display: flex; flex-direction: column; gap: 8px; }
.gx-pl-g { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.gx-pl-g > span { flex-basis: 100%; }
.gx-pl { font: inherit; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); cursor: pointer; }
.gx-pl.priced { border-color: var(--ok); }
.gx-pl[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.gx-pl-price { margin-left: 5px; font-weight: 700; color: var(--ok); } .gx-pl[aria-pressed="true"] .gx-pl-price { color: inherit; }
.gx-pgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gx-pgrid li { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.gx-pgrid li.consumable, .gx-pgrid li.wear { border-color: var(--warn); }
.gx-pgrid p { margin: 6px 0; }

/* 买家怎么说 */
.gx-reviews { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.gx-themes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gx-th { font: inherit; width: 100%; display: grid; grid-template-columns: 1fr minmax(110px, auto) 1fr; gap: 8px; align-items: center; background: none;
  border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; cursor: pointer; color: var(--text); }
.gx-th:hover, .gx-th[aria-pressed="true"] { background: var(--panel-2); border-color: var(--line); }
.gx-th-l { display: flex; justify-content: flex-end; } .gx-th-r { display: flex; }
.gx-th-l i, .gx-th-r i { display: block; height: 12px; border-radius: 999px; }
.gx-th.neg .gx-th-l i { background: var(--gx-neg); } .gx-th.pos .gx-th-r i { background: var(--gx-pos); }
.gx-th.mix i { background: var(--gx-mix); }
.gx-th-name { font-size: 13px; text-align: center; font-weight: 600; } .gx-th-name small { color: var(--muted); font-weight: 500; }
.gx-th-legend { display: flex; justify-content: space-between; margin-bottom: 4px; }
.gx-quotes { display: flex; flex-direction: column; gap: 8px; }
.gx-q { margin: 0; background: var(--panel-2); border-left: 3px solid var(--line-2); border-radius: 0 10px 10px 0; padding: 8px 12px; }
.gx-q p { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.gx-q:hover p, .gx-q:focus-within p { -webkit-line-clamp: unset; }
.gx-q .small { color: var(--star); }

/* 收尾 */
.gx-verdict { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gx-vd { border-radius: 14px; padding: 14px 16px; border: 1px solid var(--line); background: var(--panel); }
.gx-vd h4 { margin: 0 0 6px; font-size: 14px; } .gx-vd p { margin: 0; font-size: 14px; line-height: 1.6; }
.gx-vd.buy { border-top: 4px solid var(--ok); } .gx-vd.skip { border-top: 4px solid var(--warn); } .gx-vd.how { border-top: 4px solid var(--accent); }

/* 互动讲解放在 Playground 右栏时比视口窄得多：按讲解自己的宽度排版（container query） */
.gx { container-type: inline-size; container-name: gx; }
@container gx (max-width: 820px) {
  .gx-when { grid-template-columns: minmax(0, 1fr); }
  .gx-w-side { flex-direction: row; flex-wrap: wrap; } .gx-w-side > * { flex: 1 1 220px; }
  .gx-inside, .gx-reviews { grid-template-columns: minmax(0, 1fr); }
}
@container gx (max-width: 560px) {
  .gx-hero { grid-template-columns: 1fr; padding: 16px; gap: 12px; }
  .gx-hero-img { width: 120px; height: 120px; }
  .gx-title { font-size: 22px; }
  .gx-ch { padding: 16px 14px; }
  .gx-verdict { grid-template-columns: minmax(0, 1fr); }
  .gx-offers { grid-template-columns: minmax(0, 1fr) auto; } .gx-of-bar { display: none; }
  .gx-rank { grid-template-columns: 22px 40px minmax(0, 1fr) auto; } .gx-rk-score { display: none; }
  .gx-sl { grid-template-columns: 1fr auto; } .gx-sl input[type=range] { grid-column: 1 / -1; grid-row: 2; }
  .gx-packs { grid-template-columns: minmax(0, 1fr) auto; } .gx-pk-bar { display: none; }
}
@media (prefers-reduced-motion: reduce) { .gx-tl .line { animation: none; stroke-dasharray: none; } }
.sc-confirm { border-color: var(--accent); }
.sc-confirm.bad { border-color: var(--bad); }
.sc-conf-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sc-conf { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.sc-conf.bad { border-left-color: var(--bad); } .sc-conf.ok { border-left-color: var(--ok); }
.sc-conf-reply { display: flex; flex-direction: column; gap: 6px; }
.sc-reply { font-style: normal; white-space: pre-wrap; font-size: 13px; }
.sc-shot img { max-width: 100%; max-height: 560px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--img-bg); }
.sc-mail { white-space: pre-wrap; font-size: 12px; background: var(--code); padding: 8px; border-radius: 6px; overflow-wrap: anywhere; }
.sc-form, .sc-draft { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sc-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.sc-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sc-field input, .sc-field textarea, .sc-field select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--panel); color: var(--text); min-width: 0; }
.sc-field textarea { resize: vertical; }

/* ---------- 站内购买：结账面板（checkout.js）、订单（order-ui.js、/orders） ---------- */
dialog.sheet { width: min(560px, 100vw); max-height: min(92vh, 900px); padding: 0; border: 1px solid var(--line); border-radius: 18px;
               background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 17px; }
.sheet-body { padding: 16px 18px; overflow-y: auto; display: grid; gap: 16px; overscroll-behavior: contain; }
.sheet-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
              background: var(--panel-2); }
.co-total { display: grid; line-height: 1.25; margin-right: auto; }
.co-total b { font-size: 21px; font-variant-numeric: tabular-nums; color: var(--price); }
.co-timer { font-variant-numeric: tabular-nums; }
.btn.co-pay { padding: 11px 22px; font-size: 15px; font-weight: 650; border-radius: 12px; min-width: 168px; }
.co-item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; align-items: start; }
.co-item .o-thumb { width: 88px; height: 88px; }
.co-item-body { display: grid; gap: 6px; min-width: 0; }
.co-item-body .row b { font-size: 16px; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; margin-left: auto; }
.qty .btn { border: 0; border-radius: 0; width: 32px; height: 30px; padding: 0; font-size: 16px; }
.qty output { min-width: 30px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.co-sec { display: grid; gap: 8px; }
.co-sec h3 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.co-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.co-sec-head h2 { margin: 0; }
.co-choices { display: grid; gap: 6px; }
.co-choice { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer;
             font-size: 13px; color: var(--text-2); }
.co-choice.on { border-color: var(--accent); background: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent); }
.co-choice input { margin: 0; accent-color: var(--accent); }
.co-choice .pill { margin-left: 6px; }
.co-card { cursor: default; }
.co-card .pill { margin-left: auto; }
.card-chip { flex: none; width: 42px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-size: 9px; font-weight: 800; letter-spacing: .06em;
             color: #fff; background: linear-gradient(135deg, #312e81, #7c3aed); }
.co-note { margin: 0; padding: 9px 12px; border-radius: 10px; font-size: 13px; background: var(--info-bg); color: var(--info); }
.co-note.warn { background: var(--warn-bg); color: var(--warn); } .co-note.bad { background: var(--bad-bg); color: var(--bad); }
.co-eta { margin: 4px 0 0; font-size: 13px; }
.co-done { text-align: center; display: grid; gap: 6px; justify-items: center; padding: 18px 0 6px; }
.co-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; font-weight: 800; color: #fff;
            background: var(--ok); animation: co-pop .35s ease-out; }
.co-done-total { font-size: 18px; font-weight: 650; }
@keyframes co-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.addr-form .form-grid { margin: 0 0 6px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.addr-form input, .addr-form select { width: 100%; }
.o-thumb { width: 72px; height: 72px; background: var(--img-bg); border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.o-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.o-title { font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.o-source { margin: 0; display: flex; gap: 4px 8px; flex-wrap: wrap; align-items: center; color: var(--text-2); }
.o-money { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; margin: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.o-money dt { color: var(--text-2); } .o-money dd { margin: 0; padding-left: 16px; text-align: right; }
.o-money .total { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 700; font-size: 15px; color: var(--price); }
.o-steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 6px 0 2px; padding: 0; font-size: 12px; color: var(--muted); }
.o-steps li { display: grid; justify-items: center; gap: 4px; position: relative; text-align: center; }
.o-steps li::before { content: ""; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: var(--line-2); }
.o-steps li:first-child::before { display: none; }
.o-steps .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line-2); position: relative; z-index: 1; }
.o-steps li.done, .o-steps li.now { color: var(--text); }
.o-steps li.done .dot, .o-steps li.now .dot { background: var(--accent); border-color: var(--accent); }
.o-steps li.done::before, .o-steps li.now::before { background: var(--accent); }
.o-steps li.now { font-weight: 650; }
.o-steps li.now .dot { box-shadow: 0 0 0 4px var(--accent-2); }
.o-list { display: grid; gap: 10px; margin-top: 14px; }
.o-owner { margin: 6px 0 -6px 4px; }
.o-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: start; background: var(--panel);
          border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.act-card .o-card { box-shadow: none; padding: 0; border: 0; }
.o-body { min-width: 0; display: grid; gap: 4px; }
.o-top { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; }
.o-line { display: flex; gap: 4px 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.o-line b { font-size: 15px; color: var(--price); font-variant-numeric: tabular-nums; }
.o-acts { display: flex; flex-direction: column; gap: 6px; min-width: 92px; }
.o-detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.o-detail > .panel { display: grid; gap: 14px; align-content: start; }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.o-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 0; }
.o-timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; position: relative; font-size: 13px; }
.o-timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.o-timeline li:last-child::before { display: none; }
.o-timeline .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin-top: 4px; }
.o-timeline li + li .dot { background: var(--line-2); }
.o-settings { margin-top: 26px; align-items: start; }
.o-settings h2 { margin: 0 0 10px; }
.addr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.addr-list li { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px; }
.ops-panel { margin-top: 14px; display: grid; gap: 10px; border-left: 3px solid var(--warn); }
.ops-panel h2 { margin: 0; }
.ops-panel > .btn { justify-self: start; }
.o-source { gap: 4px 6px; }
.o-source > span + span.muted::before { content: "· "; }
.o-passed { margin: 0; line-height: 1.45; }
.ops-form { align-items: flex-end; }
.ops-form input, .ops-form select { min-width: 160px; }
.auto-buy { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.auto-buy select { padding: 4px 8px; }
@media (max-width: 640px) {
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 94vh; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  dialog.sheet[open] { animation: sheet-up .22s ease-out; }
  .sheet-body { padding: 14px 16px; }
  .sheet-foot { padding-left: 16px; padding-right: 16px; }
  .btn.co-pay { min-width: 0; flex: 1 1 auto; }
  .co-item { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
  .co-item .o-thumb { width: 64px; height: 64px; }
  .o-card { grid-template-columns: 56px minmax(0, 1fr); padding: 10px; }
  .o-card .o-thumb { width: 56px; height: 56px; }
  .o-acts { grid-column: 1 / -1; flex-direction: row; }
  .o-acts .btn { flex: 1; }
  .o-detail { grid-template-columns: minmax(0, 1fr); }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .co-check, dialog.sheet[open] { animation: none; } }

/* 业务品类 /verticals：每条映射规则一行（可展开看命中的细分类目） */
.vsec-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.vsec-head h2 { margin: 0; }
.vrules { display: grid; gap: 6px; }
.vrule { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.vrule > summary { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 12px; cursor: pointer; }
.vrule-path { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.vrule-n, .vrule-cov { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vrule-cov { color: var(--muted); font-size: 12px; }
.vrule-missing ul { margin: 4px 0 0; padding-left: 18px; columns: 2 260px; }
.vrule-body { padding: 0 12px 12px; }
