/* === LAYER 1: TOKENS (single source of truth) === */

/* ============================================================
   Design Tokens — Single Source of Truth
   2026-05-05 · ViewTrends 商机罗盘
   ----------------------------------------------------------------
   规则：
   1. 颜色/字号/间距/圆角/阴影只能引用本文件的 CSS 变量
   2. 禁止裸值（除非该值不在体系内，必须新增 token）
   3. 禁止 !important（如需覆盖，重写组件类）
   4. 中文 + 英文双语界面统一字体栈
   ============================================================ */

:root {
  /* ===== 色板（仅 7 色，禁增） ===== */
  --c-ink-900:  #0e2236;   /* 主文字 / 主操作 / brand */
  --c-ink-700:  #2c4156;   /* 次要文字 */
  --c-ink-500:  #5e7385;   /* 辅助文字 / placeholder */
  --c-ink-300:  #c5cdd6;   /* 分隔线 / 描边 */
  --c-ink-100:  #e7ebef;   /* hairline / 弱分隔 */
  --c-paper:    #f8f6f1;   /* 页背景（米白）*/
  --c-surface:  #ffffff;   /* 卡 / drawer / 弹层底色 */
  --c-accent:   #c4521f;   /* 唯一强调色（暖橙）*/
  --c-accent-soft: #f5e8df; /* accent 的浅底，用于 selected hover */
  --c-success:  #1f6e54;   /* 上升 / 正向（保留备用，本期不用）*/
  --c-danger:   #b1391f;   /* 危险操作 */

  /* ===== 字号阶梯（7 阶） ===== */
  --fs-meta:    11px;      /* eyebrow / label allcaps */
  --fs-xs:      12px;      /* secondary text */
  --fs-sm:      13px;      /* body small */
  --fs-md:      14px;      /* body default */
  --fs-lg:      16px;      /* emphasis */
  --fs-xl:      20px;      /* heading */
  --fs-display: 28px;      /* brand display */

  /* ===== 行高 ===== */
  --lh-tight:   1.15;
  --lh-base:    1.5;
  --lh-loose:   1.7;

  /* ===== 字重 ===== */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-bold:    700;

  /* ===== 字间距 ===== */
  --tracking-tight:  -0.01em;
  --tracking-normal: 0;
  --tracking-wide:   0.08em;
  --tracking-allcaps: 0.18em;

  /* ===== 间距（4 的倍数，6 阶，禁增） ===== */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* ===== 圆角（3 阶，禁增） ===== */
  --r-sharp: 2px;          /* 印刷感主体（按钮、输入框、卡片）*/
  --r-soft:  6px;          /* 内嵌选项 / 小元素 */
  --r-pill:  999px;        /* 仅徽章和状态点 */

  /* ===== 描边宽度 ===== */
  --bw-hair: 1px;
  --bw-edge: 1.5px;
  --bw-bold: 2px;

  /* ===== 阴影（4 阶，统一物理感）===== */
  --shadow-flat:  0 1px 0 rgba(14, 34, 54, 0.06);
  --shadow-edge:  2px 2px 0 var(--c-ink-900);   /* 印刷质感（按钮、卡片）*/
  --shadow-edge-accent: 2px 2px 0 var(--c-accent);
  --shadow-pop:   0 14px 32px -12px rgba(14, 34, 54, 0.22), 0 4px 10px -4px rgba(14, 34, 54, 0.08);
  --shadow-drawer: -24px 0 48px -16px rgba(14, 34, 54, 0.28), -8px 0 16px -8px rgba(14, 34, 54, 0.10);

  /* ===== 字体栈（CJK 友好，无 italic display）===== */
  --font-display: "Source Serif 4", "Source Serif Pro", "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body:    "Inter Tight", "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono:    "JetBrains Mono", "IBM Plex Mono", "SF Mono", ui-monospace, monospace;

  /* ===== 动效 ===== */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-instant: 80ms;
  --dur-fast:    140ms;
  --dur-base:    200ms;
  --dur-slow:    320ms;

  /* ===== 栅格（统一布局对齐） ===== */
  --grid-max:        1440px;          /* 内容区最大宽度 */
  --grid-gutter:     24px;            /* 列间距 */
  --grid-page-pad:   28px;            /* 页面左右安全边距 */
  --grid-page-pad-sm: 16px;           /* 移动端 */

  /* ===== 控件高度（统一交互高度） ===== */
  --h-control: 38px;                   /* 按钮 / 输入框 / chip 标准高度 */
  --h-control-lg: 44px;                /* 触控目标最小（移动端 / drawer 主按钮）*/
  --h-control-sm: 30px;                /* 紧凑型小 chip */

  /* ===== Z 层级（统一管理）===== */
  --z-sticky:  40;
  --z-overlay: 9000;
  --z-modal:   9100;
  --z-toast:   9500;
}

/* prefers-reduced-motion 兼容：动效全部退化为 0 */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-instant: 0ms;
    --dur-fast:    0ms;
    --dur-base:    0ms;
    --dur-slow:    0ms;
  }
}


/* === LAYER 2: COMPONENTS (atomic UI primitives) === */

/* ============================================================
   Components — 唯一组件实现
   2026-05-05 · 基于 tokens.css，禁止内嵌裸值
   ----------------------------------------------------------------
   组件清单（5 个原子）：
   1. .vt-input      — 输入框
   2. .vt-segmented  — 分段控件（L1 主导航）
   3. .vt-chip       — 紧凑 chip（L2 辅助 filter）
   4. .vt-facet      — facet 触发器 + dropdown（L3 一/二级类目）
   5. .vt-drawer     — drawer 抽屉
   6. .vt-option     — 列表选项（drawer 内 / dropdown 内通用）
   7. .vt-button     — 通用按钮（仅供 drawer 底部、卡片操作用）
   8. .vt-link       — text link（L4 「更多筛选」）
   ============================================================ */

/* ------------------------------------------------------------
   1. INPUT
   ------------------------------------------------------------ */
.vt-input {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--h-control);
  padding: 0 var(--sp-3);
  background: var(--c-surface);
  border: var(--bw-edge) solid var(--c-ink-900);
  border-radius: var(--r-sharp);
  box-shadow: var(--shadow-edge);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  color: var(--c-ink-900);
  transition: box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.vt-input__icon {
  color: var(--c-accent);
  flex-shrink: 0;
}

.vt-input__field {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  color: inherit;
}

.vt-input__field::placeholder {
  color: var(--c-ink-500);
  font-weight: var(--fw-regular);
}

.vt-input:focus-within {
  border-color: var(--c-accent);
  box-shadow: var(--shadow-edge-accent);
  transform: translate(-1px, -1px);
}

/* ------------------------------------------------------------
   2. SEGMENTED CONTROL (L1 主导航)
   说明：HTML 里子按钮同时挂 .vt-segmented__btn .insight-chip
   （legacy class 给 JS 选择器用）；这里两个都认。
   ------------------------------------------------------------ */
.vt-segmented {
  display: inline-flex;
  height: var(--h-control);
  background: var(--c-surface);
  border: var(--bw-edge) solid var(--c-ink-900);
  border-radius: var(--r-sharp);
  box-shadow: var(--shadow-edge);
  overflow: hidden;
  padding: 0;
  gap: 0;
}

.vt-segmented .vt-segmented__btn,
.vt-segmented .insight-chip {
  all: unset;
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--sp-4);
  height: 100%;
  border-right: var(--bw-hair) solid var(--c-ink-300);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-ink-700);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.vt-segmented > :last-child {
  border-right: 0;
}

.vt-segmented .vt-segmented__btn:hover,
.vt-segmented .insight-chip:hover {
  background: var(--c-paper);
  color: var(--c-ink-900);
}

.vt-segmented .vt-segmented__btn[aria-pressed="true"],
.vt-segmented .vt-segmented__btn.is-active,
.vt-segmented .insight-chip.selected {
  background: var(--c-ink-900);
  color: var(--c-surface);
  font-weight: var(--fw-bold);
}

.vt-segmented .vt-segmented__btn[aria-pressed="true"]::after,
.vt-segmented .vt-segmented__btn.is-active::after,
.vt-segmented .insight-chip.selected::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 14px;
  height: 1.5px;
  background: var(--c-accent);
  transform: translateX(-50%);
}

/* ------------------------------------------------------------
   3. CHIP (L2 辅助 filter — 紧凑实线分段)
   说明：HTML 里 .vt-chip .insight-chip 双挂；toolbar-insight-bar 是容器钩。
   ------------------------------------------------------------ */
.toolbar-insight-bar {
  display: inline-flex;
  gap: 0;
  height: var(--h-control-sm);
  padding: 0;
  background: var(--c-surface);
  border: var(--bw-hair) solid var(--c-ink-300);
  border-radius: var(--r-sharp);
  box-shadow: none;
  overflow: hidden;
}

.vt-chip,
.toolbar-insight-bar .insight-chip {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  height: 100%;
  padding: 0 var(--sp-3);
  min-width: 58px;
  background: var(--c-surface);
  border: 0;
  border-right: var(--bw-hair) solid var(--c-ink-300);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--c-ink-500);
  letter-spacing: 0;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.toolbar-insight-bar .insight-chip:last-child {
  border-right: 0;
}

.vt-chip:hover,
.toolbar-insight-bar .insight-chip:hover {
  color: var(--c-ink-900);
  background: var(--c-paper);
}

.vt-chip[aria-pressed="true"],
.vt-chip.is-active,
.toolbar-insight-bar .insight-chip.selected {
  color: var(--c-surface);
  background: var(--c-ink-900);
  font-weight: var(--fw-bold);
}

.vt-chip:focus-visible,
.toolbar-insight-bar .insight-chip:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--c-accent);
}

/* ------------------------------------------------------------
   4. FACET (L3 一/二级类目触发器 — select-like)
   说明：JS 渲染时复用 legacy class .facet-toggle/.facet-name/.facet-state/
   .facet-arrow/.facet-panel 作为钩子；这里同时认 BEM 与 legacy class，
   不再依赖 style.css 里的旧装饰。
   ------------------------------------------------------------ */
.vt-facet {
  position: relative;
  display: inline-block;
}

#facetBar .vt-facet__trigger,
#facetBar .vt-facet > .facet-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: flex-start;
  height: var(--h-control-sm);
  min-width: 174px;
  padding: 0 var(--sp-3);
  background: var(--c-surface);
  border: var(--bw-hair) solid var(--c-ink-300);
  border-radius: var(--r-sharp);
  box-shadow: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

#facetBar .vt-facet__trigger:hover,
#facetBar .vt-facet > .facet-toggle:hover,
#facetBar .vt-facet.is-open .vt-facet__trigger,
#facetBar .vt-facet.is-open > .facet-toggle {
  background: var(--c-paper);
  border-color: var(--c-accent);
}

#facetBar .vt-facet__trigger:focus-visible,
#facetBar .vt-facet > .facet-toggle:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--c-accent-soft);
}

.vt-facet__label,
.vt-facet .facet-name {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-ink-500);
  white-space: nowrap;
}

.vt-facet__value,
.vt-facet .facet-state {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-ink-900);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vt-facet__value--empty,
.vt-facet .facet-state[data-empty="true"] {
  color: var(--c-ink-500);
  font-weight: var(--fw-regular);
  font-style: italic;
}

.vt-facet__caret,
.vt-facet .facet-arrow {
  margin-left: auto;
  font-size: 9px;
  color: var(--c-ink-500);
  transition: transform var(--dur-fast) var(--ease-out);
}

.vt-facet.is-open .vt-facet__caret,
.vt-facet.is-open .facet-arrow {
  transform: rotate(180deg);
  color: var(--c-accent);
}

.vt-facet__panel,
.vt-facet > .facet-panel {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 0;
  z-index: var(--z-sticky);
  min-width: 240px;
  max-width: 320px;
  padding: var(--sp-2);
  background: var(--c-surface);
  border: var(--bw-edge) solid var(--c-ink-900);
  border-radius: var(--r-sharp);
  box-shadow: var(--shadow-edge), var(--shadow-pop);
  display: none;
  max-height: 380px;
  overflow-y: auto;
  margin: 0;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  visibility: visible;
}

.vt-facet.is-open .vt-facet__panel,
.vt-facet.is-open > .facet-panel {
  display: block;
}

/* facet 禁用态（无可选项时） */
.vt-facet.is-disabled .vt-facet__trigger,
.vt-facet.is-disabled > .facet-toggle,
.vt-facet.facet-disabled .vt-facet__trigger,
.vt-facet.facet-disabled > .facet-toggle {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* facet panel 内的搜索工具条 */
.vt-facet .facet-tools {
  padding: 0 0 var(--sp-2);
  position: sticky;
  top: 0;
  background: var(--c-surface);
  z-index: 1;
}

.vt-facet .facet-search {
  width: 100%;
  height: var(--h-control-sm);
  padding: 0 var(--sp-3);
  border: var(--bw-hair) solid var(--c-ink-300);
  border-radius: var(--r-sharp);
  background: var(--c-paper);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--c-ink-900);
  outline: 0;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.vt-facet .facet-search:focus {
  border-color: var(--c-accent);
}

/* facet panel 内空状态 / 分隔线 */
.vt-facet .facet-empty {
  padding: var(--sp-3);
  color: var(--c-ink-500);
  font-size: var(--fs-xs);
  text-align: center;
}

.vt-facet .facet-divider {
  height: 1px;
  background: var(--c-ink-100);
  margin: var(--sp-1) 0;
}

.vt-facet .facet-options {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  margin: 0;
}

.facet-option-hidden {
  display: none !important;
}

/* ------------------------------------------------------------
   5. OPTION (统一的单选/多选项 — 圆点 checkbox)
   说明：JS 渲染时使用 legacy class .facet-option / .facet-option-name /
   .facet-option-count；这里同时认 BEM 与 legacy class。
   旧 input[type=checkbox] 依然存在但隐藏（圆点由 ::before 提供）。
   ------------------------------------------------------------ */
.vt-option,
.facet-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border: 0;
  border-radius: var(--r-soft);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--c-ink-900);
  text-align: left;
  width: 100%;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.vt-option:hover,
.facet-option:hover {
  background: var(--c-paper);
  color: var(--c-accent);
}

.vt-option::before,
.facet-option::before {
  content: "";
  width: 14px;
  height: 14px;
  border: var(--bw-edge) solid var(--c-ink-900);
  border-radius: 50%;
  background: var(--c-surface);
  box-shadow: inset 0 0 0 0 var(--c-accent);
  transition: box-shadow var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}

.vt-option[aria-pressed="true"],
.vt-option.is-selected,
.facet-option.selected,
.facet-option[aria-pressed="true"] {
  color: var(--c-accent);
  font-weight: var(--fw-bold);
}

.vt-option[aria-pressed="true"]::before,
.vt-option.is-selected::before,
.facet-option.selected::before,
.facet-option[aria-pressed="true"]::before {
  border-color: var(--c-accent);
  box-shadow: inset 0 0 0 4px var(--c-accent);
}

.vt-option__count,
.facet-option-count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-ink-500);
  font-variant-numeric: tabular-nums;
}

.facet-option-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* 隐藏 JS 渲染输出的 <input type="checkbox">（圆点由 ::before 提供）*/
.facet-option > input[type="checkbox"],
.facet-option > input[type="radio"] {
  display: none;
}

/* facet-option-bar 旧进度条装饰，统一隐藏（drawer / 主条都不需要）*/
.facet-option-bar {
  display: none;
}

/* ------------------------------------------------------------
   6. LINK (L4 「更多筛选」 — text link 形态)
   ------------------------------------------------------------ */
.vt-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: var(--h-control);
  padding: 0 var(--sp-2);
  background: transparent;
  border: 0;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-ink-900);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color var(--dur-fast) var(--ease-out);
  position: relative;
}

.vt-link::after {
  content: "";
  position: absolute;
  left: var(--sp-2);
  right: var(--sp-2);
  bottom: 8px;
  height: 1px;
  background: var(--c-ink-900);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-base) var(--ease-out);
}

.vt-link:hover,
.vt-link[aria-expanded="true"] {
  color: var(--c-accent);
}

.vt-link:hover::after,
.vt-link[aria-expanded="true"]::after {
  background: var(--c-accent);
  transform: scaleX(1);
}

.vt-link__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: var(--sp-1);
  background: var(--c-accent);
  color: var(--c-surface);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-bold);
  line-height: 1;
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   7. BUTTON (drawer 底部主操作)
   ------------------------------------------------------------ */
.vt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--h-control-lg);
  padding: 0 var(--sp-4);
  background: var(--c-surface);
  color: var(--c-ink-900);
  border: var(--bw-edge) solid var(--c-ink-900);
  border-radius: var(--r-sharp);
  box-shadow: var(--shadow-edge);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.vt-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--c-ink-900);
}

.vt-button:active {
  transform: translate(0, 0);
  box-shadow: 1px 1px 0 var(--c-ink-900);
}

.vt-button--primary {
  background: var(--c-accent);
  color: var(--c-surface);
  border-color: var(--c-ink-900);
}

.vt-button--primary:hover {
  background: #aa4519;
}

.vt-button--ghost {
  background: transparent;
  border-color: var(--c-ink-300);
  box-shadow: none;
  color: var(--c-ink-700);
}

.vt-button--ghost:hover {
  background: var(--c-paper);
  border-color: var(--c-ink-900);
  color: var(--c-ink-900);
  box-shadow: var(--shadow-edge);
}

/* ------------------------------------------------------------
   8. DRAWER (右侧抽屉)
   ------------------------------------------------------------ */
.vt-drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(14, 34, 54, 0.22);
  backdrop-filter: blur(2px);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}

.vt-drawer-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.vt-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 92vw);
  height: 100vh;
  background: var(--c-surface);
  border-left: var(--bw-edge) solid var(--c-ink-900);
  box-shadow: var(--shadow-drawer);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
}

.vt-drawer.is-open {
  transform: translateX(0);
}

.vt-drawer__head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
  border-bottom: var(--bw-hair) solid var(--c-ink-100);
  background: var(--c-paper);
}

.vt-drawer__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--c-ink-900);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  margin: 0;
}

.vt-drawer__subtitle {
  margin-top: var(--sp-1);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-allcaps);
  text-transform: uppercase;
  color: var(--c-ink-500);
}

.vt-drawer__close {
  background: transparent;
  border: 0;
  padding: var(--sp-1) var(--sp-2);
  cursor: pointer;
  color: var(--c-ink-500);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease-out);
}

.vt-drawer__close:hover {
  color: var(--c-accent);
}

.vt-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2) var(--sp-5) var(--sp-5);
}

.vt-drawer__body::-webkit-scrollbar {
  width: 6px;
}

.vt-drawer__body::-webkit-scrollbar-thumb {
  background: var(--c-ink-300);
  border-radius: var(--r-pill);
}

.vt-drawer__foot {
  flex-shrink: 0;
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  background: var(--c-paper);
  border-top: var(--bw-hair) solid var(--c-ink-100);
}

.vt-drawer__foot .vt-button {
  flex: 1;
}

/* ------------------------------------------------------------
   9. DRAWER SECTION (drawer body 内每个 facet section)
   ------------------------------------------------------------ */
.vt-drawer-section {
  padding: var(--sp-3) 0;
  border-bottom: var(--bw-hair) solid var(--c-ink-100);
}

.vt-drawer-section:last-child {
  border-bottom: 0;
}

.vt-drawer-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0 var(--sp-3);
}

.vt-drawer-section__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--c-ink-900);
  letter-spacing: var(--tracking-tight);
}

.vt-drawer-section__count {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-allcaps);
  text-transform: uppercase;
  color: var(--c-ink-500);
  font-variant-numeric: tabular-nums;
}

.vt-drawer-section__count strong {
  color: var(--c-accent);
  font-weight: var(--fw-bold);
}

.vt-drawer-section__search {
  margin-bottom: var(--sp-2);
}

.vt-drawer-section__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  /* 不限制 max-height，不开自身 overflow——避免嵌套滚动容器，
     让 .vt-drawer__body 成为 drawer 内唯一的滚动接收者，
     一次 wheel 事件可翻整个 drawer 内容。 */
}

.vt-drawer-section__list--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-1);
}

/* ------------------------------------------------------------
   10. TOPBAR LAYOUT (顶栏容器)
   ------------------------------------------------------------ */
.vt-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--c-paper);
  border-bottom: var(--bw-hair) solid var(--c-ink-300);
  transition: background var(--dur-fast) var(--ease-out);
}

.vt-topbar__inner {
  max-width: var(--grid-max);
  margin: 0 auto;
  padding: var(--sp-4) var(--grid-page-pad);
  transition: padding var(--dur-base) var(--ease-out);
}

/* compact mode：滚动 >80px 时由 JS 在 body 上加 .vt-topbar-compact
   - 完全隐藏 brand-row（含 logo + 标题 + meta 数据条）
   - controls-row 收紧 padding
   - 顶栏总高 ~120px → ~52px，把视觉空间留给卡片网格 */
body.vt-topbar-compact .vt-topbar__inner {
  padding-top: var(--sp-2);
  padding-bottom: var(--sp-2);
}

body.vt-topbar-compact .vt-topbar__brand-row {
  display: none;
}

body.vt-topbar-compact .vt-topbar__controls-row {
  padding: 0;
}

@media (prefers-reduced-motion: reduce) {
  .vt-topbar,
  .vt-topbar__inner {
    transition: none;
  }
}

/* 顶栏第 1 行：brand + meta */
.vt-topbar__brand-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: var(--bw-hair) solid var(--c-ink-100);
}

.vt-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.vt-brand__mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.vt-brand__name {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  color: var(--c-ink-900);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

.vt-brand__sub {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-allcaps);
  text-transform: uppercase;
  color: var(--c-ink-500);
}

.vt-meta {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-ink-500);
  font-variant-numeric: tabular-nums;
}

.vt-meta__num {
  color: var(--c-ink-900);
  font-weight: var(--fw-bold);
  margin-right: 4px;
}

.vt-meta__num--accent {
  color: var(--c-accent);
}

.vt-meta__sep {
  color: var(--c-ink-300);
}

/* 顶栏第 2 行：搜索独占 */
.vt-topbar__search-row {
  padding: var(--sp-3) 0 var(--sp-3);
}

.vt-topbar__search-row .vt-input {
  width: 100%;
  max-width: 480px;
}

/* 顶栏第 3 行：控件群（segmented + chips + facets + link） */
.vt-topbar__controls-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.vt-topbar__group {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.vt-topbar__group--push {
  margin-left: auto;
}

.vt-topbar__divider {
  width: 1px;
  height: 24px;
  background: var(--c-ink-300);
  align-self: center;
}

/* 移动端 */
@media (max-width: 768px) {
  .vt-topbar__inner {
    padding: var(--sp-3) var(--grid-page-pad-sm);
  }
  .vt-topbar__brand-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }
  .vt-brand__name {
    font-size: 22px;
  }
  .vt-topbar__controls-row {
    gap: var(--sp-2);
  }
  .vt-drawer {
    width: 100vw;
  }
}


/* === LAYER 3: LEGACY STYLE (cards, modules, PDF, drawer host) === */

/* ============================================================
   style.css — Layer 3 · v2 卡片布局 + PDF print
   2026-05-05 完整重写（白名单基线，~750 行替代旧 5555 行）
   ----------------------------------------------------------------
   原则：
   1. tokens.css 是颜色/字号/间距/圆角真相源
   2. components.css 是按钮/chip/segmented/facet/drawer/option 真相源
   3. style.css 只管：reset + 卡片布局（.module-card-simple/.module-card）+ PDF print
   4. 禁止 !important（除 print/a11y 外）
   5. 全部规则在 body.vt-app 下，避免污染 PDF 渲染管线
   ============================================================ */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.vt-app {
  font-family: var(--font-body);
  color: var(--c-ink-900);
  background: var(--c-paper);
  line-height: var(--lh-base);
  font-size: var(--fs-md);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* [hidden] 强于子组件 display 设置 */
body.vt-app [hidden] {
  display: none !important;
}

/* ============================================================
   主区域容器
   ============================================================ */

body.vt-app .main {
  width: 100%;
  min-height: 60vh;
}

body.vt-app .module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
  max-width: var(--grid-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--grid-page-pad);
}

body.vt-app .module-grid.simple-mode {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

@media (max-width: 768px) {
  body.vt-app .module-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    padding: var(--sp-4) var(--grid-page-pad-sm);
    gap: var(--sp-2);
  }
}

/* ============================================================
   卡片：.module-card-simple（默认收起态）
   DOM:
     <article.module-card-simple>
       <div.simple-card-link>
         <div.simple-image-wrap.product-image>
           <span.simple-rank-badge>Top1</span>
           <img />
         </div>
         <div.simple-body>
           <div.simple-brand>NIKE</div>
           <div.simple-model>Air Force 1</div>
           <div.simple-foot>
             <span.simple-foot-tags>...</span>
             <span.simple-trend-mini>...</span>
           </div>
         </div>
       </div>
     </article>
   ============================================================ */

body.vt-app .module-card-simple {
  contain: layout paint;
  position: relative;
  background: var(--c-surface);
  border: var(--bw-hair) solid var(--c-ink-100);
  border-radius: var(--r-soft);
  box-shadow: var(--shadow-flat);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

body.vt-app .module-card-simple:hover {
  border-color: var(--c-ink-300);
  box-shadow: var(--shadow-pop);
  transform: translateY(-1px);
}

body.vt-app .module-card-simple.is-detail-pending {
  cursor: progress;
  border-color: var(--c-accent);
  box-shadow: var(--shadow-pop);
}

body.vt-app .module-card-simple.is-detail-pending::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-accent), transparent);
  pointer-events: none;
  transform: translateX(-100%);
  animation: vt-detail-pending 900ms var(--ease-out) infinite;
}

body.vt-app .simple-card-link {
  display: block;
  cursor: pointer;
}

body.vt-app .simple-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--c-paper-shade, #f0ece2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.vt-app .simple-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 排名徽章：mono 数字小贴片 */
body.vt-app .simple-rank-badge {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 2;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  color: var(--c-ink-900);
  background: var(--c-surface);
  border: var(--bw-hair) solid var(--c-ink-300);
  border-radius: var(--r-sharp);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  line-height: 1;
}

body.vt-app .simple-body {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
}

body.vt-app .simple-brand {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-allcaps);
  text-transform: uppercase;
  color: var(--c-ink-500);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.vt-app .simple-model {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-ink-900);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: var(--sp-2);
}

body.vt-app .simple-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
  font-size: 11px;
  color: var(--c-ink-700);
}

body.vt-app .simple-foot-tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* 卡片底部 hot/trend tag — 用 lucide SVG 替换 🔥 / ↑↑ emoji
   JS 渲染：<span class="simple-tag tag-hot" title="热度">🔥</span>
   策略：font-size:0 隐藏字符 + ::before mask-image 画图标 */
body.vt-app .simple-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  background: transparent;
  font-size: 0;
  position: relative;
  flex-shrink: 0;
}

body.vt-app .simple-tag.tag-hot::before,
body.vt-app .simple-tag.tag-trend::before,
body.vt-app .simple-tag.tag-new::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--c-accent);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 13px 13px;
  mask-size: 13px 13px;
}

body.vt-app .simple-tag.tag-hot::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/></svg>");
}

body.vt-app .simple-tag.tag-trend::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='22 7 13.5 15.5 8.5 10.5 2 17'/><polyline points='16 7 22 7 22 13'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='22 7 13.5 15.5 8.5 10.5 2 17'/><polyline points='16 7 22 7 22 13'/></svg>");
}

body.vt-app .simple-tag.tag-new::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 6v6l4 2'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 6v6l4 2'/></svg>");
}

/* mini sparkline 趋势条 */
body.vt-app .simple-trend-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

body.vt-app .simple-trend-spark {
  display: inline-flex;
  align-items: center;
}

body.vt-app .simple-trend-spark svg {
  display: block;
  width: 56px;
  height: 16px;
}

body.vt-app .simple-trend-spark svg path,
body.vt-app .simple-trend-spark svg polyline {
  stroke: var(--c-ink-700);
  fill: none;
  stroke-width: 1.2;
}

body.vt-app .simple-trend-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-medium);
  color: var(--c-ink-700);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* skeleton 加载占位 */
body.vt-app .module-card-simple.skeleton {
  pointer-events: none;
}

body.vt-app .module-card-simple.skeleton .simple-image-wrap,
body.vt-app .module-card-simple.skeleton .simple-brand,
body.vt-app .module-card-simple.skeleton .simple-model {
  background: linear-gradient(90deg, var(--c-ink-100), var(--c-paper-shade, #f0ece2), var(--c-ink-100));
  background-size: 200% 100%;
  animation: vt-skel 1.4s var(--ease-in-out) infinite;
}

body.vt-app .module-card-simple.skeleton .simple-brand {
  height: 10px;
  margin-bottom: 6px;
  border-radius: var(--r-sharp);
}

body.vt-app .module-card-simple.skeleton .simple-model {
  height: 14px;
  margin-bottom: 8px;
  border-radius: var(--r-sharp);
}

@keyframes vt-skel {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes vt-detail-pending {
  100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  body.vt-app .module-card-simple.skeleton * {
    animation: none;
  }

  body.vt-app .module-card-simple.is-detail-pending::after {
    animation: none;
    transform: none;
    opacity: 0.7;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-group(*) {
  animation-duration: 260ms;
  animation-timing-function: var(--ease-out);
}

/* ============================================================
   卡片展开态：.module-card.simple-inline-expanded
   DOM 结构见 interaction.js renderCardExpanded()
   ============================================================ */

body.vt-app .module-card.simple-inline-expanded {
  contain: layout paint;
  grid-column: 1 / -1;
  background: var(--c-surface);
  border: var(--bw-hair) solid var(--c-ink-300);
  border-radius: var(--r-soft);
  box-shadow: var(--shadow-pop);
  padding: var(--sp-4);
  margin: var(--sp-2) 0;
}

body.vt-app .exp-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}

body.vt-app .exp-head-left {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: var(--sp-3);
}

body.vt-app .exp-image {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: var(--r-sharp);
  background: var(--c-paper-shade, #f0ece2);
  overflow: hidden;
}

body.vt-app .exp-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.vt-app .exp-titles {
  min-width: 0;
}

body.vt-app .exp-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--c-ink-900);
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
  margin: var(--sp-1) 0 var(--sp-2);
}

body.vt-app .exp-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

body.vt-app .exp-meta-item {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-ink-500);
  font-variant-numeric: tabular-nums;
}

body.vt-app .exp-head-right {
  width: 280px;
  flex-shrink: 0;
}

/* trend bars：5 列垂直柱状图（一年前 / 半年前 / 上月 / 上周 / 本周）
   DOM:
     <div.exp-trend-bars>
       <div.trend-bar-col>
         <div.trend-bar-value>123</div>
         <div.trend-bar-track><div.trend-bar-fill style="height:60%"/></div>
         <div.trend-bar-label>本周</div>
       </div>
       ...
     </div>
   每列 vertical flex（数字 / 柱体 / 标签），柱体从底向上填充。 */
body.vt-app .exp-trend-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-2);
  height: 110px;
  padding: 0 var(--sp-2);
}

body.vt-app .trend-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 1;
  min-width: 0;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--c-ink-500);
  font-variant-numeric: tabular-nums;
}

body.vt-app .trend-bar-value {
  font-size: 10px;
  font-weight: var(--fw-medium);
  color: var(--c-ink-900);
  line-height: 1;
  white-space: nowrap;
}

body.vt-app .trend-bar-track {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: var(--c-ink-100);
  border-radius: var(--r-sharp);
  overflow: hidden;
}

body.vt-app .trend-bar-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, var(--c-accent) 0%, #a44017 100%);
  border-radius: var(--r-sharp);
  transition: height var(--dur-base) var(--ease-out);
}

/* 最后一列（本周）高亮：用更深色调 */
body.vt-app .trend-bar-col:last-child .trend-bar-fill {
  background: linear-gradient(180deg, var(--c-ink-900) 0%, var(--c-ink-700) 100%);
}

body.vt-app .trend-bar-col:last-child .trend-bar-value,
body.vt-app .trend-bar-col:last-child .trend-bar-label {
  color: var(--c-ink-900);
  font-weight: var(--fw-bold);
}

body.vt-app .trend-bar-label {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--c-ink-500);
  white-space: nowrap;
  line-height: 1;
}

/* exp-queries: query chip 群（点击跳 Google Shopping） */
body.vt-app .exp-queries {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, minmax(0, auto));
  grid-auto-columns: minmax(180px, 240px);
  gap: var(--sp-1);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--sp-1);
  margin-bottom: var(--sp-3);
}

/* qchip: 两行 chip — 主行（语言徽章 + query + 周搜量） / 副行（intent 中文小字） */
body.vt-app .qchip {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 6px 8px;
  border: var(--bw-hair) solid var(--c-ink-300);
  border-radius: var(--r-sharp);
  background: var(--c-surface);
  font-family: var(--font-body);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  max-width: 100%;
  scroll-snap-align: start;
}

body.vt-app .qchip:hover {
  border-color: var(--c-accent);
}

body.vt-app .qchip:hover .qchip-q {
  color: var(--c-accent);
}

/* 主行：徽章 / query / 周搜量 同行 */
body.vt-app .qchip-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* query 主体：粗体 ink-900 主色 + serif display 字体强调"原始 query" */
body.vt-app .qchip-q {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--c-ink-900);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* 周搜量：mono 数字 */
body.vt-app .qchip-cnt {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--c-ink-500);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* 副行：intent 中文小字（明显次于主行）*/
body.vt-app .qchip-zh {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: var(--fw-regular);
  color: var(--c-ink-500);
  font-style: italic;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  padding-left: 2px;
}

/* 语言徽章：1 字中文，墨蓝底白字小方块 */
body.vt-app .qchip-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: var(--c-surface);
  background: var(--c-ink-700);
  border-radius: var(--r-sharp);
  line-height: 1;
}

/* topQuery 高亮：暖橙边 + 米白底 + 第一行多一个 "TOP" 标记效果 */
body.vt-app .qchip-top {
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
  box-shadow: 1.5px 1.5px 0 var(--c-ink-900);
}

body.vt-app .qchip-top .qchip-q {
  color: var(--c-ink-900);
}

body.vt-app .qchip-top .qchip-lang {
  background: var(--c-accent);
}

body.vt-app .qchip-top .qchip-cnt {
  color: var(--c-ink-700);
  font-weight: var(--fw-bold);
}

/* exp-products: 商品卡 grid */
body.vt-app .exp-products {
  contain: content;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, minmax(0, auto));
  grid-auto-columns: minmax(120px, 148px);
  gap: var(--sp-2);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--sp-1);
}

body.vt-app .exp-products-sentinel {
  min-width: 132px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-ink-400);
  font-size: var(--fs-xs);
  border: var(--bw-hair) dashed var(--c-ink-200);
  border-radius: var(--r-soft);
  background: var(--c-ink-50);
}

body.vt-app .serper-supplement-btn {
  float: right;
  border: var(--bw-hair) solid var(--c-ink-200);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-ink-700);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  padding: var(--sp-1) var(--sp-3);
  cursor: pointer;
}

body.vt-app .serper-supplement-btn:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

body.vt-app .serper-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: rgba(17, 24, 39, 0.42);
}

body.vt-app .serper-preview-modal {
  width: min(1120px, 96vw);
  max-height: 90vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: var(--c-surface);
  border-radius: var(--r-soft);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

body.vt-app .serper-preview-head,
body.vt-app .serper-preview-toolbar,
body.vt-app .serper-preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--bw-hair) solid var(--c-ink-100);
}

body.vt-app .serper-preview-foot {
  justify-content: flex-end;
  border-top: var(--bw-hair) solid var(--c-ink-100);
  border-bottom: 0;
}

body.vt-app .serper-query-modal {
  width: min(640px, 94vw);
  grid-template-rows: auto auto auto;
}

body.vt-app .serper-query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-2);
  padding: var(--sp-4);
}

body.vt-app .serper-query-input {
  min-width: 0;
  border: var(--bw-hair) solid var(--c-ink-200);
  border-radius: var(--r-soft);
  padding: var(--sp-2) var(--sp-3);
  font: inherit;
}

body.vt-app .serper-query-submit,
body.vt-app .serper-preview-close,
body.vt-app .serper-preview-select-all,
body.vt-app .serper-preview-select-none,
body.vt-app .serper-preview-cancel,
body.vt-app .serper-preview-confirm {
  border: var(--bw-hair) solid var(--c-ink-200);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  padding: var(--sp-1) var(--sp-3);
  cursor: pointer;
}

body.vt-app .serper-preview-status {
  padding: 0 var(--sp-4) var(--sp-4);
  color: var(--c-ink-500);
  font-size: var(--fs-sm);
}

body.vt-app .serper-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: var(--sp-3);
  padding: var(--sp-4);
  overflow: auto;
}

body.vt-app .serper-preview-card {
  display: grid;
  gap: var(--sp-2);
  border: var(--bw-hair) solid var(--c-ink-100);
  border-radius: var(--r-soft);
  padding: var(--sp-2);
  cursor: pointer;
}

body.vt-app .serper-preview-img {
  aspect-ratio: 1;
  background: var(--c-ink-50);
  border-radius: var(--r-sharp);
  overflow: hidden;
}

body.vt-app .serper-preview-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body.vt-app .serper-preview-title-main {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--c-ink-900);
}

body.vt-app .serper-preview-card .serper-preview-title-main {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.vt-app .serper-preview-sub {
  font-size: var(--fs-xs);
  color: var(--c-ink-500);
}

body.vt-app .exp-products-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  color: var(--c-ink-500);
  font-size: var(--fs-sm);
}

body.vt-app .prod-card {
  position: relative;
  display: block;
  scroll-snap-align: start;
  background: var(--c-surface);
  border: var(--bw-hair) solid var(--c-ink-100);
  border-radius: var(--r-soft);
  overflow: hidden;
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

body.vt-app .prod-card:hover {
  border-color: var(--c-ink-300);
  transform: translateY(-1px);
}

body.vt-app .prod-card.is-selectable {
  cursor: pointer;
}

body.vt-app .prod-card.is-selected {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-accent) 28%, transparent);
}

body.vt-app .prod-select-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--bw-hair) solid var(--c-ink-900);
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-accent);
  font-size: 12px;
  font-weight: var(--fw-bold);
}

body.vt-app .prod-card.is-selected .prod-select-mark {
  background: var(--c-ink-900);
  color: var(--c-surface);
}

body.vt-app .prod-source {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  padding: 1px 4px;
  background: var(--c-surface);
  border: var(--bw-hair) solid var(--c-ink-300);
  border-radius: var(--r-sharp);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--c-ink-500);
}

body.vt-app .prod-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--c-paper-shade, #f0ece2);
  overflow: hidden;
}

body.vt-app .prod-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.vt-app .prod-title {
  padding: var(--sp-1) var(--sp-2);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--c-ink-900);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.vt-app .prod-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-2) var(--sp-2);
  font-size: 10px;
  color: var(--c-ink-700);
}

body.vt-app .prod-rating {
  font-family: var(--font-mono);
  color: var(--c-accent);
  font-variant-numeric: tabular-nums;
}

body.vt-app .prod-rating-count {
  color: var(--c-ink-500);
  margin-left: 2px;
}

body.vt-app .prod-price {
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  color: var(--c-ink-900);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   底部加载提示 / sentinel / startup retry
   ============================================================ */

body.vt-app .load-hint {
  text-align: center;
  padding: var(--sp-4) var(--grid-page-pad);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-ink-500);
  letter-spacing: var(--tracking-wide);
}

body.vt-app .load-hint.loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: var(--sp-2);
  border: 1.5px solid var(--c-ink-300);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  vertical-align: -2px;
  animation: vt-spin 800ms linear infinite;
}

@keyframes vt-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  body.vt-app .load-hint.loading::before {
    animation: none;
  }
}

body.vt-app .sentinel {
  height: 1px;
}

body.vt-app .startup-retry-wrap {
  text-align: center;
  padding: var(--sp-5) var(--grid-page-pad);
}

body.vt-app .startup-retry-wrap .btn {
  display: inline-flex;
  align-items: center;
  height: var(--h-control-lg);
  padding: 0 var(--sp-4);
  border: var(--bw-edge) solid var(--c-ink-900);
  border-radius: var(--r-sharp);
  background: var(--c-surface);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

body.vt-app .empty-state {
  text-align: center;
  padding: var(--sp-7) var(--grid-page-pad);
  color: var(--c-ink-500);
  font-size: var(--fs-md);
}

/* ============================================================
   floating top button / trend hover tooltip
   ============================================================ */

body.vt-app .floating-top-btn {
  position: fixed;
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: var(--z-sticky);
  width: 44px;
  height: 44px;
  border: var(--bw-edge) solid var(--c-ink-900);
  border-radius: 50%;
  background: var(--c-surface);
  box-shadow: var(--shadow-pop);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: var(--c-ink-900);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}

body.vt-app .floating-top-btn:hover {
  transform: translateY(-2px);
}

body.vt-app .trend-hover-tooltip {
  position: fixed;
  z-index: var(--z-toast);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-ink-900);
  color: var(--c-surface);
  border-radius: var(--r-sharp);
  font-family: var(--font-mono);
  font-size: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

body.vt-app .trend-hover-tooltip[aria-hidden="false"] {
  opacity: 1;
}

/* ============================================================
   v2 暂未实现的旧元素（避免误显）
   ============================================================ */

body.vt-app #toolbarPanel,
body.vt-app .selected-bar,
body.vt-app .print-meta,
body.vt-app .selection-toolbar,
body.vt-app #sidebarPanel,
body.vt-app #downloadPdfBtn,
body.vt-app #clearAllBtn {
  display: none;
}

body.vt-app .edit-modal.hidden {
  display: none;
}

body.vt-app .edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
}

body.vt-app .edit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 24, 0.42);
}

body.vt-app .edit-modal-content {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  background: var(--c-surface);
  border: var(--bw-edge) solid var(--c-ink-900);
  border-radius: var(--r-soft);
  box-shadow: 4px 4px 0 var(--c-ink-900);
}

body.vt-app .edit-modal-head,
body.vt-app .edit-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-bottom: var(--bw-hair) solid var(--c-ink-200);
}

body.vt-app .edit-modal-foot {
  justify-content: flex-end;
  border-top: var(--bw-hair) solid var(--c-ink-200);
  border-bottom: 0;
}

body.vt-app .edit-modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--c-ink-900);
}

body.vt-app .edit-modal-close {
  border: 0;
  background: transparent;
  color: var(--c-ink-700);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

body.vt-app .edit-modal-body {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-3);
}

body.vt-app .edit-modal-summary {
  padding: var(--sp-2);
  background: var(--c-paper);
  border: var(--bw-hair) solid var(--c-ink-200);
  border-radius: var(--r-sharp);
  color: var(--c-ink-700);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

body.vt-app .edit-modal-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-2);
}

body.vt-app .edit-modal-row[hidden] {
  display: none;
}

body.vt-app .edit-modal-row label {
  color: var(--c-ink-700);
  font-size: var(--fs-sm);
}

body.vt-app .edit-modal-row input,
body.vt-app .edit-modal-row select {
  min-width: 0;
  height: var(--h-control-sm);
  padding: 0 var(--sp-2);
  border: var(--bw-hair) solid var(--c-ink-300);
  border-radius: var(--r-sharp);
  background: var(--c-surface);
  color: var(--c-ink-900);
  font: inherit;
}

body.vt-app #editProductCategorySelect {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.vt-app #editProductCategoryRecommendBtn {
  grid-column: 2;
  justify-self: start;
}

body.vt-app .edit-modal-status {
  min-height: 18px;
  color: var(--c-ink-500);
  font-size: var(--fs-sm);
}

body.vt-app .edit-modal-status.error {
  color: var(--c-danger);
}

body.vt-app .edit-modal-status.ok {
  color: var(--c-success, #2f6f4e);
}

body.vt-app .edit-modal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--h-control-sm);
  padding: 0 var(--sp-3);
  border: var(--bw-hair) solid var(--c-ink-900);
  border-radius: var(--r-sharp);
  background: var(--c-surface);
  color: var(--c-ink-900);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

body.vt-app .edit-modal .btn.primary {
  background: var(--c-ink-900);
  color: var(--c-surface);
}

body.vt-app .edit-modal .btn.danger {
  border-color: var(--c-danger);
  background: var(--c-danger);
  color: var(--c-surface);
}

body.vt-app .edit-modal .btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

body.vt-app .prod-card.is-edit-target,
body.vt-app .qchip.is-edit-target {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  body.vt-app .edit-modal-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  body.vt-app .edit-modal-foot {
    flex-wrap: wrap;
  }
}

/* ============================================================
   PDF print 模式（保留：下载 PDF 时仍要正确排版）
   ============================================================ */

@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html,
  body {
    background: #fff !important;
  }

  body.vt-app .vt-topbar,
  body.vt-app .floating-top-btn,
  body.vt-app .load-hint,
  body.vt-app .sentinel,
  body.vt-app .startup-retry-wrap,
  body.vt-app .vt-drawer,
  body.vt-app .vt-drawer-scrim {
    display: none !important;
  }

  body.vt-app .module-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6mm;
    padding: 8mm;
    max-width: none;
  }

  body.vt-app .module-card-simple {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    border: 0.5pt solid #c5cdd6;
  }

  body.vt-app .module-card-simple:hover {
    transform: none;
    box-shadow: none;
  }

  body.vt-app .simple-image-wrap img {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}


body.vt-app .qchip-brand,
body.vt-app .qchip-series {
  flex-shrink: 0;
  max-width: 96px;
  padding: 1px 4px;
  border: var(--bw-hair) solid var(--c-ink-200);
  border-radius: var(--r-sharp);
  color: var(--c-ink-700);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.vt-app .qchip-category {
  color: var(--c-ink-500);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 2px;
}

body.vt-app .query-category-editor,
body.vt-app .query-relabel-editor {
  display: grid;
  gap: var(--sp-2);
  min-width: 0;
}

body.vt-app .query-category-label,
body.vt-app .query-relabel-preview {
  padding: var(--sp-2);
  border: var(--bw-hair) solid var(--c-ink-200);
  border-radius: var(--r-sharp);
  background: var(--c-paper);
  color: var(--c-ink-700);
  font-size: var(--fs-sm);
}

body.vt-app .query-category-candidates {
  display: grid;
  gap: 6px;
}

body.vt-app .query-category-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border: var(--bw-hair) solid var(--c-ink-200);
  border-radius: var(--r-sharp);
  font-size: var(--fs-sm);
}

body.vt-app .query-category-option.is-primary {
  border-color: var(--c-accent);
  background: var(--c-paper);
}

body.vt-app .query-relabel-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 0;
  border-bottom: var(--bw-hair) solid var(--c-ink-200);
}

body.vt-app .query-relabel-row:last-child {
  border-bottom: 0;
}

body.vt-app .product-selection-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border: var(--bw-hair) solid var(--c-accent);
  border-radius: var(--r-sharp);
  background: var(--c-paper);
  color: var(--c-ink-700);
  font-size: var(--fs-sm);
}

body.vt-app .product-selection-toolbar button {
  min-height: var(--h-control-sm);
  padding: 0 var(--sp-2);
  border: var(--bw-hair) solid var(--c-ink-900);
  border-radius: var(--r-sharp);
  background: var(--c-surface);
  color: var(--c-ink-900);
  font-size: var(--fs-sm);
}

body.vt-app .product-selection-toolbar .product-selection-delete {
  border-color: var(--c-danger);
  background: var(--c-danger);
  color: var(--c-surface);
}
