/* aitomall 站群平台样式。三端共用一套设计令牌，控制台和店铺只切换外壳。 */
:root {
  color-scheme: light;
  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: Georgia, "Songti SC", "Noto Serif SC", serif;
  --ink: #15202b;
  --ink-2: #334155;
  --muted: #5b6b7f;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff6ff;
  --navy: #0f1b2d;
  --navy-2: #15243a;
  --ok: #0f6b4f;
  --ok-soft: #e7f6ef;
  --warn: #9a5800;
  --warn-soft: #fff4df;
  --danger: #a51d16;
  --danger-soft: #fdecea;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --ring: rgba(37, 99, 235, .16);
  --shadow-xs: 0 1px 2px rgba(15, 27, 45, .04);
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .05);
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 12px 28px rgba(15, 27, 45, .06);
  --z-header: 20;
  --z-scrim: 30;
  --z-drawer: 40;
  --z-cookie: 50;
}

/* 控制台主题色变体：仅覆盖强调色 4 个令牌，中性色、语义色与品牌 Logo 不变。
   每套均通过 WCAG AA 实测（白字/主色 ≥5.1:1、链接/白底 ≥6.7:1、深字/浅底 ≥6.1:1）。
   :root 品牌蓝是默认；用户偏好由 data-theme 属性切换到下列变体。 */
[data-theme="indigo"] {
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef2ff;
  --ring: rgba(79, 70, 229, .16);
}
[data-theme="teal"] {
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #f0fdfa;
  --ring: rgba(15, 118, 110, .16);
}
[data-theme="vermilion"] {
  --accent: #c2410c;
  --accent-strong: #9a3412;
  --accent-soft: #fff7ed;
  --ring: rgba(194, 65, 12, .16);
}
[data-theme="violet"] {
  --accent: #7c3aed;
  --accent-strong: #6d28d9;
  --accent-soft: #f5f3ff;
  --ring: rgba(124, 58, 237, .16);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: rgba(37, 99, 235, .12);
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .45em; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 1.25rem + 1.1vw, 2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.center { text-align: center; }
.hide { display: none !important; }

/* === 可访问性基础 === */
.skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 100;
  transform: translateY(-160%); padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--navy); color: #fff; font-weight: 700; box-shadow: var(--shadow);
}
.skip-link:focus-visible { transform: translateY(0); outline: 3px solid #93c5fd; outline-offset: 2px; }
.design-preview-bar { position: sticky; top: 0; z-index: var(--z-cookie); padding: 8px 14px; text-align: center; font-size: 12px; color: #78350f; background: #fef3c7; border-bottom: 1px solid #fcd34d; }
.design-preview-bar a { color: inherit; font-weight: 700; text-decoration: underline; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:where(button, .btn, .input, .select, .textarea, .check) { touch-action: manipulation; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
  .btn[aria-busy="true"]::before { animation: none; border-right-color: currentColor; opacity: .5; }
}

/* === 按钮与表单 === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink); font: inherit; font-weight: 650;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #94a3b8; text-decoration: none; }
.btn:active { border-color: #64748b; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-primary:focus-visible { outline-color: #0b1220; outline-offset: 3px; }
.btn-danger:focus-visible { outline-color: var(--danger); }
.btn-danger { background: #fff; border-color: #f0c2bd; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #e7a9a3; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(15, 27, 45, .05); border-color: transparent; }
.btn-secondary { background: var(--panel-soft); border-color: var(--line); color: var(--ink-2); }
.btn-secondary:hover { background: #eef2f7; border-color: var(--line-strong); }
.btn-outline { background: transparent; }
.btn-outline:hover { background: var(--panel-soft); }
.btn-destructive { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-destructive:hover { background: #8f1711; border-color: #8f1711; }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-xs { min-height: 28px; padding: 0 9px; font-size: 12px; border-radius: var(--radius-xs); }
.btn .icon { width: 16px; height: 16px; flex: 0 0 auto; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: btn-spin .7s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
form[aria-busy="true"] { cursor: progress; }
.btn-icon {
  width: 40px; min-width: 40px; padding: 0; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong);
  border-radius: 10px; background: #fff; color: var(--ink); font: inherit;
}
.input::placeholder, .textarea::placeholder { color: #6b7a8e; opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: #94a3b8; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.field[data-invalid] > label { color: var(--danger); }
.field[data-invalid] .input, .field[data-invalid] .select, .field[data-invalid] .textarea { border-color: var(--danger); }
.field[data-invalid] .input:focus-visible, .field[data-invalid] .select:focus-visible, .field[data-invalid] .textarea:focus-visible {
  outline-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); border-color: var(--danger);
}
.field-hint { font-size: 12px; color: var(--muted); text-wrap: pretty; }
.field-error { display: flex; align-items: flex-start; gap: 5px; font-size: 12px; color: var(--danger); }
.textarea { min-height: 110px; resize: vertical; }
textarea[data-autogrow] { overflow-y: hidden; resize: none; }
select.select { background-color: #fff; color: var(--ink); }
.select, .shop-tools select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  padding-right: 36px;
}
[dir="rtl"] .select, [dir="rtl"] .shop-tools select {
  background-position: left 12px center;
  padding-right: 12px;
  padding-left: 36px;
}
.hint { font-size: 12px; color: var(--muted); text-wrap: pretty; }
input[type="date"], input[type="datetime-local"], input[type="time"] { padding-right: 40px; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .65; cursor: pointer; }
.order-title { font-variant-numeric: tabular-nums; }
.order-title-label { display: block; margin-bottom: 3px; font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: var(--muted); }
.order-title-value { display: block; max-width: 100%; font-size: inherit; white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 640px) { .order-title-value { font-size: 1.35rem; } }
.check { display: flex; align-items: flex-start; gap: 9px; min-height: 40px; padding: 8px 0; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; min-width: 0; }
.row-tight { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.form-submit { flex: 0 0 auto; display: flex; align-items: flex-end; margin-bottom: 14px; }
.form-submit .btn { min-width: 120px; }
@media (max-width: 640px) { .form-submit { width: 100%; } .form-submit .btn { width: 100%; } }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.site-card, .template-card { display: flex; flex-direction: column; }
.site-card .row-tight, .template-card .row-tight { margin-top: auto; padding-top: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 20px; }
.filters .input, .filters .select { width: auto; min-width: 160px; }
.filters label { display: grid; gap: 5px; font-size: 12px; font-weight: 650; color: var(--muted); }
.variant-table select { min-width: 96px; }
.variant-table input.input { min-width: 0; }
.variant-table input[name^="v_sku"] { min-width: 132px; }
.tabs:not(.tabs-ready) .tab-list { display: none; }
.tab-list { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; padding: 2px 0 0; -webkit-overflow-scrolling: touch; }
.tab-button { flex: 0 0 auto; min-height: 42px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }
.tab-button:hover { color: var(--ink); background: var(--panel-soft); }
.tab-button[aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }
.form-actions.form-actions-inline { position: static; justify-content: flex-start; border: 0; background: transparent; box-shadow: none; padding: 14px 0 max(14px, env(safe-area-inset-bottom)); }
.form-actions { position: sticky; bottom: 0; z-index: 10; justify-content: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px max(10px, env(safe-area-inset-bottom)); margin-top: 16px; }

/* === 卡片、表格、徽标 === */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.card + .card { margin-top: 16px; }
.grid-2 > .card + .card, .grid-3 > .card + .card, .grid-4 > .card + .card, .site-grid > .card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; -webkit-overflow-scrolling: touch; }
.table-wrap:focus-within { border-color: var(--line-strong); }
table.table { width: 100%; border-collapse: collapse; min-width: 640px; font-variant-numeric: tabular-nums; }
table.table th, table.table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.table th { font-size: 12px; color: var(--muted); background: var(--panel-soft); font-weight: 700; white-space: nowrap; }
table.table tbody tr:hover { background: #fbfcfe; }
table.table tr:last-child td { border-bottom: 0; }
table.table td { overflow-wrap: anywhere; }
table.table td.right { overflow-wrap: normal; }
table.table td.actions { white-space: nowrap; }
table.table td.actions form { display: inline-flex; gap: 6px; margin: 0; }
/* === 店铺买家账号 === */
.account-shell { max-width: 960px; margin: 34px auto; padding: 0 20px; }
.account-shell--narrow { max-width: 520px; }
.account-card { box-shadow: var(--shadow); }
.account-title { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.2rem); margin: 0; }
.account-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; }
.account-links a { font-weight: 650; }
.account-dashboard .card { margin: 0; }
@media (max-width: 640px) {
  .account-shell { margin: 18px auto; padding: 0 14px; }
  .account-dashboard { grid-template-columns: 1fr; }
}

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef3f9; color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn, .badge-warning { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: #e8f0ff; color: #1e40af; }
.badge-shipped { background: #e6f6f8; color: #0e6b75; }
.badge-success { background: var(--ok-soft); color: var(--ok); }
.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-refunding { background: #ffedd5; color: #9a3412; }
.badge-partial { background: #ffe4e6; color: #9f1239; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.badge svg { width: 12px; height: 12px; flex: 0 0 auto; }
.badge[hidden] { display: none; }
.badge-outline { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
kbd, .kbd {
  font-family: inherit; font-size: 10px; font-weight: 650; padding: 1px 5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  background: var(--panel-soft); color: var(--ink-2); white-space: nowrap;
}
.pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.template-preview { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; background: var(--panel-soft); }
.thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; background: #eef2f6; flex: 0 0 auto; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.empty-state { padding: 56px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--panel-soft); }
.empty-state h1, .empty-state h2 { color: var(--ink); }
.empty-state .btn { margin-top: 14px; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid; text-wrap: pretty; }
.flash-ok { background: var(--ok-soft); border-color: #bfe7d7; color: var(--ok); }
.flash-err { background: var(--danger-soft); border-color: #f5c6c2; color: var(--danger); }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.stat .num { font-size: clamp(21px, 4.2vw, 26px); font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .cap { font-size: 12px; color: var(--muted); font-weight: 650; }
.trend-chart { margin-top: 6px; }
.trend-bars { height: 96px; display: flex; align-items: flex-end; justify-content: space-between; gap: 5px; border-bottom: 1px solid var(--line); padding: 0 2px; }
.trend-bar { flex: 1 1 0; max-width: 30px; min-height: 2px; background: var(--line); border-radius: 4px 4px 0 0; }
.trend-bar.has-orders { background: var(--accent); }
.trend-axis { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid #d6e6ff; color: #1e3a5f; font-size: 13px; text-wrap: pretty; }
.notice-row { display: flex; align-items: flex-start; gap: 10px; }
.notice-icon { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.notice-warn { background: var(--warn-soft); border-color: #f3d39b; color: #7c4a03; }
.notice-danger { background: var(--danger-soft); border-color: #f5c6c2; color: var(--danger); }
.notice-ok { background: var(--ok-soft); border-color: #bfe7d7; color: var(--ok); }
.notice code, .notice .mono { overflow-wrap: anywhere; word-break: break-word; }

/* === 控制台外壳 === */
.console { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; background: var(--bg); }
.console-side {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--navy); color: #dbe6f3; padding: max(18px, env(safe-area-inset-top)) 14px 24px;
  padding-left: max(14px, env(safe-area-inset-left));
}
.console-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: #fff; font-weight: 750; }
.console-brand:hover { text-decoration: none; }
.console-brand img { width: 30px; height: 30px; }
.console-brand small { display: block; font-weight: 400; font-size: 11px; color: #9fb2c7; }
.console-nav { display: flex; flex-direction: column; gap: 3px; }
.console-nav a { color: #c2d2e4; padding: 10px 10px; border-radius: var(--radius-sm); font-size: 14px; min-height: 40px; display: flex; align-items: center; gap: 8px; }
.console-nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.console-nav a.on { background: rgba(37, 99, 235, .28); color: #fff; box-shadow: inset 3px 0 0 #93c5fd; }
.console-nav .nav-cap { font-size: 11px; color: #8fa6bf; margin: 14px 10px 4px; }
.console-site { background: rgba(255,255,255,.06); border-radius: 10px; padding: 10px 12px; margin: 8px 4px 14px; font-size: 12px; color: #a9bdd2; overflow-wrap: anywhere; }
.console-site strong { display: block; font-size: 14px; color: #fff; }
.console-main { flex: 1; min-width: 0; }
.console-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff;
  border-bottom: 1px solid var(--line); padding: 10px max(20px, env(safe-area-inset-right)) 10px 26px;
  position: sticky; top: 0; z-index: var(--z-header);
}
.console-top .who { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-top form { margin: 0; }
.console-top .who { flex: 1 1 auto; }
.console-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.console-page { padding: 14px 26px 48px; max-width: 1240px; margin: 0 auto; }
.breadcrumbs { display: flex; align-items: center; gap: 7px; max-width: 1240px; margin: 0 auto; padding: 7px 26px 0; font-size: 12px; color: var(--muted); overflow-x: auto; white-space: nowrap; }
.breadcrumbs a { color: var(--muted); min-height: 28px; display: inline-flex; align-items: center; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs span[aria-current="page"] { color: var(--ink); font-size: 13px; font-weight: 700; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
/* 面包屑已经承担页面标题；h1 只保留给辅助技术，避免重复占一行。 */
.console .page-head h1 {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: 13px; text-wrap: pretty; }
.menu-toggle { display: none; }
.side-close { display: none; }
.console-scrim { display: none; }

/* === 店铺外壳 === */
.shop { background: #fff; color: var(--ink); min-height: 100dvh; }
.shop-head { position: sticky; top: 0; z-index: var(--z-header); background: #fff; border-bottom: 1px solid var(--line); }
.shop-head-inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; }
.shop-brand { font-family: var(--font-display); font-size: 24px; font-weight: 650; color: var(--ink); display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-brand:hover { text-decoration: none; }
.shop-nav { display: flex; gap: 4px; margin-left: 6px; font-size: 14px; flex-wrap: wrap; }
.shop-nav a { color: var(--ink-2); padding: 8px 10px; border-radius: var(--radius-sm); min-height: 40px; display: inline-flex; align-items: center; }
.shop-nav a:hover { background: var(--panel-soft); text-decoration: none; color: var(--ink); }
.shop-nav a[aria-current="page"] { color: var(--ink); font-weight: 650; text-decoration: underline; text-underline-offset: 4px; }
.shop-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.shop-tools select { min-height: 38px; padding: 4px 8px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background-color: #fff; color: var(--ink); font: inherit; }
.shop-tools select { padding-right: 36px; }


.copy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 28px; padding: 0 8px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs); background: #fff; color: var(--muted);
  font: inherit; font-size: 12px; line-height: 1; cursor: pointer;
  vertical-align: middle; margin-inline-start: 8px;
}
.copy-btn:hover { color: var(--ink); border-color: #94a3b8; }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }

/* === 语言菜单 === */
.lang-menu { position: relative; }
.lang-menu > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink);
  font: inherit; font-size: 13px; cursor: pointer; user-select: none;
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover { border-color: #94a3b8; }
.lang-menu[open] > summary { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.lang-menu .icon { width: 15px; height: 15px; flex: none; color: var(--muted); }
.lang-menu .chevron { width: 12px; height: 12px; flex: none; color: var(--muted); transition: transform .15s ease; }
.lang-menu[open] .chevron { transform: rotate(180deg); }
.lang-menu-list {
  position: absolute; z-index: var(--z-cookie); top: calc(100% + 6px); inset-inline-end: 0;
  min-width: 172px; padding: 6px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 27, 45, .14);
}
.lang-menu-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-xs); color: var(--ink);
  font-size: 13px; text-decoration: none; white-space: nowrap;
}
.lang-menu-list a:hover { background: var(--panel-soft); }
.lang-menu-list a[aria-current="true"] { background: var(--accent-soft); font-weight: 600; }
.lang-menu-list a svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
[dir="rtl"] .shop-tools select { padding-right: 12px; padding-left: 36px; background-position: left 12px center; }
.shop-account { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; color: var(--ink-2); }
.shop-account:hover { color: var(--accent-strong); }
.shop-main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 72px; }
.shop-foot { border-top: 1px solid var(--line); background: var(--panel-soft); }
.shop-foot-inner { max-width: 1180px; margin: 0 auto; padding: 30px 20px max(48px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.shop-foot a { color: var(--ink-2); margin-right: 14px; display: inline-block; min-height: 32px; }

/* === 店铺页面 === */
.hero { padding: 60px 0 42px; }
.hero-split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero-full { text-align: center; padding: 76px 0 60px; }
.hero-compact { padding: 30px 0 24px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(2.1rem, 4.8vw, 3.5rem); line-height: 1.05; margin-bottom: 14px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 48ch; text-wrap: pretty; }
.hero-full p { margin-left: auto; margin-right: auto; }
.hero-full .row-tight { justify-content: center; }
body.has-cookie .shop-main { padding-bottom: 0; }
.hero-art { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); background: #f1f4f8; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-art img[src$="icon-light.svg"] { width: 42%; height: auto; opacity: .9; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 38px 0 16px; flex-wrap: wrap; }
.home-rich { margin-top: 24px; }
.home-rich .prose { margin-top: 0; }
.section-head h2 { font-family: var(--font-display); font-size: 26px; margin: 0; }
.grid-products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.grid-products.dense { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.grid-products.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
@media (min-width: 1101px) { .grid-products.home-products { grid-template-columns: repeat(var(--home-cols, 4), minmax(0, 1fr)); } }
.product-tile { display: flex; flex-direction: column; color: var(--ink); border-radius: var(--radius); min-width: 0; }
.product-tile:hover { text-decoration: none; }
.product-tile:hover .art { border-color: var(--line-strong); }
.product-tile .art { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: #f1f4f8; border: 1px solid var(--line); }
.product-tile .art img { width: 100%; height: 100%; object-fit: cover; }
.product-tile .name { margin: 10px 0 3px; font-weight: 650; font-size: 15px; line-height: 1.3; min-height: 2.6em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-tile .price { margin-top: auto; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.price-old { color: var(--muted); text-decoration: line-through; margin-left: 8px; font-size: 13px; }
.sale-flag { display: inline-block; background: #fff7ed; color: #9a3412; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 750; margin-left: 6px; }

.detail { display: grid; grid-template-columns: 1.05fr .95fr; gap: 42px; align-items: start; }
.gallery-main { aspect-ratio: 1 / 1; border-radius: var(--radius-lg); overflow: hidden; background: #f1f4f8; border: 1px solid var(--line); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 2px; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; flex: 0 0 auto; }
.gallery-thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.gallery-thumbs img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.detail h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); }
.detail .price { font-size: 22px; font-weight: 700; margin: 10px 0 18px; font-variant-numeric: tabular-nums; }
.prose { white-space: pre-line; color: var(--ink-2); max-width: 68ch; overflow-wrap: anywhere; }
/* 商品详情的 Markdown 富文本：结构化内容按块排版，保留图片和表格。 */
.prose-md { white-space: normal; }
.prose-md > :first-child { margin-top: 0; }
.prose-md > :last-child { margin-bottom: 0; }
.prose-md p { margin: 0 0 10px; }
.prose-md h2, .prose-md h3, .prose-md h4, .prose-md h5 { color: var(--ink); font-family: var(--font-display); line-height: 1.3; margin: 20px 0 8px; }
.prose-md h2 { font-size: 20px; }
.prose-md h3 { font-size: 17px; }
.prose-md h4, .prose-md h5 { font-size: 15px; }
.prose-md ul, .prose-md ol { margin: 0 0 10px; padding-left: 22px; }
.prose-md li { margin: 3px 0; }
.prose-md li > p { margin: 0; }
.prose-md blockquote { border-left: 3px solid var(--line-strong); color: var(--ink-2); margin: 12px 0; padding: 2px 0 2px 14px; }
.prose-md hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.prose-md img { display: block; width: auto; max-width: 100%; height: auto; margin: 14px 0; border-radius: var(--radius-sm); background: #f1f4f8; }
.prose-md table { border-collapse: collapse; margin: 14px 0; width: 100%; font-size: 14px; }
.prose-md th, .prose-md td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.prose-md th { background: var(--panel); font-weight: 650; color: var(--ink); }
.prose-md code { background: #eef1f5; border-radius: 4px; font-size: 90%; padding: 1px 4px; }
.prose-md pre { background: #eef1f5; border-radius: var(--radius-sm); margin: 12px 0; overflow-x: auto; padding: 12px 14px; }
.prose-md pre code { background: transparent; padding: 0; }
.prose-md a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.detail-rich { border-top: 1px solid var(--line); margin-top: 44px; padding-top: 26px; }
.detail-rich .section-head { margin: 0 0 14px; }
.detail-rich .prose-md { max-width: 820px; }
.buy-form { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; display: grid; gap: 12px; }
.buy-form .row > * { flex: 1 1 120px; }
.buy-form .btn { min-height: 50px; }

.cart-lines { display: grid; gap: 12px; }
.cart-line { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.cart-line img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; background: #f1f4f8; flex: 0 0 auto; }
.cart-line > div { min-width: 0; overflow-wrap: anywhere; }
.totals { margin-left: auto; width: min(360px, 100%); display: grid; gap: 8px; font-variant-numeric: tabular-nums; }
.totals .line { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.totals .line span:last-child { text-align: right; }
.totals .line.total { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 750; font-size: 17px; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 28px; align-items: start; }
.checkout-grid > .card + .card { margin-top: 0; }
.checkout-grid > .card:last-child { position: sticky; top: 88px; }
.order-box { background: var(--panel-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.track-form { max-width: 520px; }
.status-big { font-size: 22px; font-weight: 750; }

/* === 登录与注册 === */
.auth-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); background: var(--bg); }
.auth-card { width: min(460px, 100%); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 750; }
.auth-brand img { width: 34px; height: 34px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; text-wrap: pretty; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-top: 16px; flex-wrap: wrap; }
.auth-links a { min-height: 32px; display: inline-flex; align-items: center; }

/* === 店铺工具 === */
.shop-logo { height: 30px; width: auto; display: inline-block; }
.cookie-bar {
  position: fixed; z-index: 60; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  width: min(560px, calc(100% - 24px)); margin: 0; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 44px rgba(15, 27, 45, .16); font-size: 13px;
}
.cookie-bar span { text-wrap: pretty; }
.confirm-dialog { width: min(440px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(15, 27, 45, .52); }
.confirm-content { padding: 22px; }
.confirm-content h2 { margin: 0 0 8px; font-size: 19px; }
.confirm-content p { margin: 0; color: var(--muted); text-wrap: pretty; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* === 响应式 === */
@media (max-width: 1100px) {
  .grid-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-products.dense { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .console { display: block; }
  .console-side {
    position: fixed; inset: 0 auto 0 0; z-index: var(--z-drawer); width: min(300px, 86vw);
    transform: translateX(-100%); transition: transform 160ms ease-out; overflow-y: auto;
    height: 100dvh; box-shadow: var(--shadow); visibility: hidden;
  }
  .console-side.open { transform: translateX(0); visibility: visible; }
  .console-scrim { display: block; position: fixed; inset: 0; z-index: var(--z-scrim); background: rgba(15, 27, 45, .45); opacity: 0; pointer-events: none; transition: opacity 160ms ease-out; }
  .console-scrim.open { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: inline-flex; }
  .side-close { display: inline-flex; position: absolute; top: max(14px, env(safe-area-inset-top)); right: 12px; border-color: rgba(255,255,255,.2); color: #fff; background: transparent; }
  .console-top { padding: 10px 16px; }
  .console-actions { gap: 6px; }
  .lang-menu > summary { padding: 0 8px; }
  .console-page { padding: 12px 16px 44px; }
  .breadcrumbs { padding: 7px 16px 0; }
  .detail, .checkout-grid, .hero-split { grid-template-columns: 1fr; }
  .checkout-grid > .card:last-child { position: static; }
  .grid-products, .grid-products.wide, .grid-products.dense { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-head-inner { flex-wrap: wrap; gap: 8px 14px; }
  .shop-nav { order: 3; width: 100%; margin-left: 0; gap: 2px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .shop-nav a { white-space: nowrap; }
  .shop-tools { margin-left: auto; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-2 > *, .grid-3 > * { min-width: 0; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px; }
  .stat .num { font-size: 22px; }
  .page-head { align-items: flex-start; }
  .page-head .row-tight { width: 100%; }
  .page-head .row-tight .btn { flex: 1 1 auto; }
  .filters { align-items: stretch; }
  .filters .input, .filters .select, .filters label, .filters button { width: 100%; min-width: 0; }
  .filters .btn { min-height: 42px; }
  .shop-head-inner { padding: 10px 14px; }
  .shop-brand { font-size: 20px; }
  .shop-main { padding-left: 14px; padding-right: 14px; }
  .shop-main { padding-top: 18px; padding-bottom: 54px; }
  .hero { padding: 30px 0 24px; }
  .hero h1 { font-size: clamp(1.9rem, 9vw, 2.5rem); }
  .grid-products { gap: 12px; }
  .product-tile .name { font-size: 14px; }
  .product-tile .price { font-size: 13px; }
  .card { padding: 16px; }
  .console-page { padding: 10px 12px 36px; }
  .breadcrumbs { padding: 6px 12px 0; white-space: normal; flex-wrap: wrap; row-gap: 2px; }
  .page-head { margin-bottom: 10px; }
  .page-head h1 { font-size: 21px; }
  .shop-tools { gap: 6px; }
  .shop-tools select { min-height: 40px; }
  .shop-tools .lang-menu > summary { min-height: 40px; }
  .lang-menu .chevron { display: none; }
  .shop-account { max-width: 92px; font-size: 12px; }
  .cookie-bar { margin: 10px 14px 0; flex-direction: column; align-items: stretch; padding: 12px 14px; }
  .cookie-bar .btn { width: 100%; min-height: 42px; }
  body.has-cookie .shop-main { padding-bottom: 0; }
  .cart-line { align-items: flex-start; flex-wrap: wrap; }
  .cart-line > div:last-child { margin-left: 0 !important; width: 100%; text-align: right; }
  .buy-form .row { display: grid; grid-template-columns: 1fr; }
  .buy-form .row > * { width: 100%; flex: none; }
  .buy-form .field > .row-tight { flex-wrap: nowrap; }
  .buy-form #qtyInput { max-width: none !important; min-width: 0; flex: 1 1 auto; }
  .buy-form .btn-primary { width: 100%; }
  .detail { gap: 22px; }
  .totals { width: 100%; }
  .auth-card { padding: 22px; }
  .btn-sm { min-height: 40px; }
  .console-nav a { min-height: 44px; }
  .tab-list { flex-wrap: wrap; overflow-x: visible; }
  .tab-button { flex: 1 1 auto; padding: 0 10px; }
  .table-wrap { border-radius: var(--radius-sm); }
  .table-wrap.is-scrollable::after {
    content: "左右滑动查看完整表格 →"; display: block; padding: 7px 10px; font-size: 11px;
    color: var(--muted); background: var(--panel-soft); border-top: 1px solid var(--line);
  }
}
@media (max-width: 360px) {
  .tab-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  .tab-button { width: 100%; padding: 0 8px; }
}
@media (hover: none) {
  .btn:hover, .input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
}

/* === 平台官网首页 hp- ===
   官网首页自带独立页头页尾，不共用 shop_head / shop_foot。
   完全独立的 .hp- 前缀，不复用旧版 .lp- 结构；颜色只取 :root 令牌。 */
html:has(.hp-body) { scroll-behavior: smooth; scroll-padding-top: 84px; }
.hp-body { background: var(--panel); }
.hp { color: var(--ink); font-size: 15px; line-height: 1.65; }
.hp :where(h1, h2, h3, p, ul, ol, dl, dd, dt) { margin: 0; }
.hp :where(ul, ol) { padding: 0; list-style: none; }
.hp :where(a) { text-decoration: none; }
.hp :where(h1, h2, h3) { line-height: 1.22; text-wrap: balance; }
.hp :where(p) { text-wrap: pretty; }
.hp-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hp a:focus-visible, .hp button:focus-visible, .hp input:focus-visible + * { outline: 2px solid var(--accent); outline-offset: 2px; }

/* === 基础排版 === */
.hp-eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--accent-strong);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.hp-eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--accent); }
.hp-h1 { font-size: clamp(2.5rem, 4.6vw, 3.9rem); font-weight: 750; line-height: 1.12;
  margin: 20px 0 22px; letter-spacing: -.01em; }
.hp-hl { color: var(--accent-strong); }
.hp-h2 { font-size: clamp(1.65rem, 2.6vw, 2.1rem); font-weight: 700; margin: 12px 0 0; }
.hp-lead { color: var(--muted); font-size: 16px; line-height: 1.75; max-width: 56ch; }

/* === 页头 === */
.hp-header { position: sticky; top: 0; z-index: var(--z-header);
  background: var(--panel); border-bottom: 1px solid var(--line); }
.hp-header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.hp-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px;
  font-weight: 700; color: var(--ink); white-space: nowrap; }
.hp-brand img { width: 30px; height: 30px; }
.hp-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; min-width: 0; }
.hp-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 11px;
  font-size: 14px; color: var(--ink-2); white-space: nowrap; border-bottom: 2px solid transparent; }
.hp-nav a:hover { color: var(--accent-strong); }
.hp-nav a[aria-current="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.hp-header-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.hp-text-link { display: inline-flex; align-items: center; min-height: 40px;
  font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.hp-text-link:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 4px; }
.hp-text-link--strong { color: var(--accent-strong); font-weight: 650; }
.hp-progress { height: 2px; background: transparent; }
.hp-progress-bar { display: block; width: 0; height: 100%; background: var(--accent); }

/* === 按钮 === */
.hp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; font-weight: 650;
  cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.hp-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.hp-btn:active { transform: translateY(1px); }
.hp-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.hp-btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.hp-btn-ghost { background: var(--panel); color: var(--ink-2); }
.hp-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* === 首屏：文案 + 站群切换台 === */
.hp-hero { position: relative; overflow: hidden; background: var(--panel);
  border-bottom: 1px solid var(--line); }
.hp-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--accent-soft) 1px, transparent 1px);
  background-size: 100% 32px; opacity: .5;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%); }
.hp-hero-grid { position: relative; display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 64px;
  align-items: center; padding-top: 84px; padding-bottom: 88px; }
.hp-hero-copy { min-width: 0; }
.hp-hero-lead { max-width: 46ch; }
.hp-hero-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 28px 0 34px; }
.hp-hero-facts { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; }
.hp-hero-facts li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.hp-hero-facts strong { font-size: 13px; color: var(--ink); }
.hp-hero-facts span { font-size: 13px; color: var(--muted); }

/* 站群切换台：radio 驱动，无 JS 也能切换 */
.hp-stage { min-width: 0; }
.hp-stage-radio { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hp-stage-window { border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.hp-stage-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--panel-soft); border-bottom: 1px solid var(--line); }
.hp-stage-dots { display: inline-flex; gap: 5px; }
.hp-stage-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.hp-stage-title { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.hp-stage-tag { margin-left: auto; font-size: 11px; color: var(--accent-strong);
  background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; }
.hp-stage-hint { padding: 14px 18px 4px; font-size: 12px; color: var(--muted); }
.hp-stage-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; padding: 10px 18px 14px; }
.hp-stage-tab { display: flex; align-items: center; gap: 8px; min-height: 46px;
  padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink-2); font-size: 13px; cursor: pointer;
  transition: border-color .16s ease, background .16s ease; }
.hp-stage-tab:hover { border-color: var(--line-strong); }
.hp-stage-tab small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.hp-tab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.hp-panel { display: none; margin: 0 18px 4px; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-soft); }
#hp-site-a:checked ~ .hp-stage-window .hp-panel-a,
#hp-site-b:checked ~ .hp-stage-window .hp-panel-b,
#hp-site-c:checked ~ .hp-stage-window .hp-panel-c { display: block; }
#hp-site-a:checked ~ .hp-stage-window .hp-stage-tab[for="hp-site-a"],
#hp-site-b:checked ~ .hp-stage-window .hp-stage-tab[for="hp-site-b"],
#hp-site-c:checked ~ .hp-stage-window .hp-stage-tab[for="hp-site-c"] {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
#hp-site-a:checked ~ .hp-stage-window .hp-stage-tab[for="hp-site-a"] .hp-tab-dot,
#hp-site-b:checked ~ .hp-stage-window .hp-stage-tab[for="hp-site-b"] .hp-tab-dot,
#hp-site-c:checked ~ .hp-stage-window .hp-stage-tab[for="hp-site-c"] .hp-tab-dot { background: var(--accent); }
#hp-site-a:focus-visible ~ .hp-stage-window .hp-stage-tab[for="hp-site-a"],
#hp-site-b:focus-visible ~ .hp-stage-window .hp-stage-tab[for="hp-site-b"],
#hp-site-c:focus-visible ~ .hp-stage-window .hp-stage-tab[for="hp-site-c"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp-panel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.hp-panel-head strong { font-size: 16px; color: var(--ink); }
.hp-panel-domain { font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.hp-panel-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 16px 0; }
.hp-panel-facts div { min-width: 0; }
.hp-panel-facts dt { font-size: 11px; color: var(--muted); }
.hp-panel-facts dd { font-size: 14px; color: var(--ink); font-weight: 650; margin-top: 2px; }
.hp-panel-action { border-left: 3px solid var(--accent); background: var(--panel);
  border-radius: var(--radius-sm); padding: 12px 14px; }
.hp-action-label { font-size: 11px; font-weight: 700; color: var(--accent-strong); }
.hp-panel-action p { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin: 6px 0 10px; }
.hp-action-confirm { display: inline-block; font-size: 12px; font-weight: 650;
  color: var(--accent-strong); background: var(--accent-soft);
  border: 1px solid var(--accent); border-radius: 7px; padding: 4px 10px; }
.hp-stage-note { padding: 10px 18px 16px; font-size: 11px; color: var(--muted); }

/* === 章节骨架 === */
.hp-section { padding: 84px 0; border-top: 1px solid var(--line); }
.hp-section--soft { background: var(--bg); }
.hp-section-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; flex-wrap: wrap; margin-bottom: 36px; }

/* === 对比：传统做法 vs aitomall === */
.hp-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.hp-compare-col { border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 26px 26px 28px; }
.hp-compare-col--accent { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.hp-compare-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 16px; }
.hp-compare-col--accent .hp-compare-label { color: var(--accent-strong); }
.hp-compare-col ul { display: grid; gap: 12px; }
.hp-compare-col li { position: relative; padding-left: 18px; font-size: 14px;
  line-height: 1.6; color: var(--ink-2); }
.hp-compare-col li::before { content: ""; position: absolute; left: 0; top: .6em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.hp-compare-col--accent li::before { background: var(--accent); }
.hp-compare-col--accent li { color: var(--ink); }

/* === 能力链路：四段轨道 === */
.hp-lane { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.hp-lane-step { position: relative; padding: 26px 22px 28px; border-left: 1px solid var(--line); min-width: 0; }
.hp-lane-step:first-child { border-left: 0; }
.hp-lane-num { display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--accent);
  color: var(--accent-strong); background: var(--accent-soft);
  font-size: 12px; font-weight: 700; margin-bottom: 16px; }
.hp-lane-step h3 { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.hp-lane-step ul { display: grid; gap: 10px; }
.hp-lane-step li { padding-left: 13px; position: relative; font-size: 13px;
  line-height: 1.6; color: var(--muted); }
.hp-lane-step li::before { content: ""; position: absolute; left: 0; top: .6em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }

/* === AI 边界矩阵 === */
.hp-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); -webkit-overflow-scrolling: touch; }
.hp-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.hp-table th, .hp-table td { padding: 15px 18px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.hp-table thead th { background: var(--panel-soft); color: var(--muted);
  font-size: 12px; font-weight: 700; white-space: nowrap; }
.hp-table tbody th { color: var(--ink); font-weight: 700; white-space: nowrap; }
.hp-table tbody td { color: var(--ink-2); }
.hp-table tbody tr:last-child th, .hp-table tbody tr:last-child td { border-bottom: 0; }
.hp-note { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  margin-top: 18px; padding: 18px 22px; border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--panel); }
.hp-note strong { font-size: 15px; color: var(--ink); white-space: nowrap; }
.hp-note span { font-size: 13px; color: var(--muted); max-width: 80ch; }

/* === 创建流程 === */
.hp-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.hp-flow-step { position: relative; padding: 30px 26px 8px 0; }
.hp-flow-step + .hp-flow-step { padding-left: 26px; border-left: 1px solid var(--line); }
.hp-flow-num { display: inline-block; font-size: 13px; font-weight: 700;
  color: var(--accent-strong); margin-bottom: 12px; }
.hp-flow-step h3 { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.hp-flow-step p { font-size: 14px; color: var(--muted); max-width: 34ch; }
.hp-flow-out { display: inline-block; margin-top: 14px; padding-top: 8px;
  border-top: 1px solid var(--line); font-size: 12px; font-weight: 650; color: var(--accent-strong); }

/* === 能力边界 === */
.hp-boundaries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.hp-boundaries > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); }
.hp-boundaries > div:nth-child(odd) { border-right: 1px solid var(--line); }
.hp-boundaries > div:nth-last-child(-n+2) { border-bottom: 0; }
.hp-boundaries dt { font-size: 13px; font-weight: 700; color: var(--ink); }
.hp-boundaries dd { font-size: 13px; line-height: 1.6; color: var(--muted); }

/* === 结尾行动 === */
.hp-cta-section { background: var(--panel); }
.hp-cta { display: flex; align-items: center; justify-content: space-between; gap: 32px;
  flex-wrap: wrap; padding: 42px 46px; border: 1px solid var(--accent);
  border-radius: var(--radius-lg); background: var(--accent-soft); }
.hp-cta .hp-lead { color: var(--ink-2); margin-top: 10px; }
.hp-cta-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* === 页脚与移动行动条 === */
.hp-foot { border-top: 1px solid var(--line); background: var(--panel); }
.hp-foot-inner { display: grid; gap: 18px; padding: 34px 20px 40px; }
.hp-foot-brand { display: flex; align-items: flex-start; gap: 12px; }
.hp-foot-brand img { flex: 0 0 auto; }
.hp-foot-brand strong { font-size: 16px; color: var(--ink); }
.hp-foot-brand p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.hp-foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.hp-foot-links a { display: inline-flex; align-items: center; min-height: 32px;
  font-size: 13px; color: var(--ink-2); }
.hp-foot-links a:hover { color: var(--accent-strong); }
.hp-foot-links a[aria-current="true"] { color: var(--accent-strong); font-weight: 650; }
.hp-foot-note { font-size: 12px; color: var(--muted); max-width: 86ch; line-height: 1.7;
  padding-top: 16px; border-top: 1px solid var(--line); }
.hp-mobile-bar { display: none; position: fixed; left: 0; right: 0; bottom: 0;
  z-index: var(--z-header); background: var(--panel); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.hp-mobile-bar .hp-btn { width: 100%; }

/* === 响应式 === */
@media (max-width: 1100px) {
  .hp-nav { gap: 0; }
  .hp-nav a { padding: 0 8px; font-size: 13px; }
  .hp-header-inner { gap: 16px; }
  .hp-hero-grid { gap: 36px; }
  .hp-lane { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-lane-step:nth-child(3) { border-left: 0; }
  .hp-lane-step:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 960px) {
  .hp-hero-grid { grid-template-columns: 1fr; gap: 40px; padding-top: 60px; padding-bottom: 64px; }
  .hp-hl { display: block; }
  .hp-table { min-width: 640px; }
}
@media (max-width: 820px) {
  html:has(.hp-body) { scroll-padding-top: 116px; }
  .hp-header-inner { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 10px; }
  .hp-nav { order: 3; width: 100%; margin: 6px 0 0; gap: 0; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .hp-nav::-webkit-scrollbar { display: none; }
  .hp-nav a { flex: 0 0 auto; min-height: 40px; }
  .hp-header-actions { margin-left: auto; }
  .hp-flow { grid-template-columns: 1fr; }
  .hp-flow-step { padding: 24px 0; }
  .hp-flow-step + .hp-flow-step { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .hp-wrap { padding: 0 14px; }
  .hp-header-inner { padding-top: 8px; }
  .hp-brand { font-size: 17px; }
  .hp-brand img { width: 26px; height: 26px; }
  .hp-header-actions { gap: 8px; }
  .hp-header-actions .hp-text-link { font-size: 13px; }
  .hp-header-actions .hp-btn { min-height: 38px; padding: 0 14px; font-size: 13px; }
  .hp-nav a { min-height: 38px; padding: 0 10px; font-size: 13px; }
  .hp-h1 { font-size: 34px; }
  .hp-lead { font-size: 16px; }
  .hp-hero-actions { gap: 14px; }
  .hp-hero-actions .hp-btn { flex: 1 1 auto; }
  .hp-hero-facts li { grid-template-columns: 1fr; gap: 2px; }
  .hp-section { padding: 56px 0; }
  .hp-stage-tabs { gap: 5px; padding: 10px 12px 12px; }
  .hp-stage-tab { flex-direction: column; align-items: flex-start; gap: 3px; padding: 7px 8px; }
  .hp-panel { margin: 0 12px 4px; padding: 14px; }
  .hp-panel-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-compare, .hp-lane, .hp-boundaries { grid-template-columns: 1fr; }
  .hp-compare-col--accent { box-shadow: inset 3px 0 0 var(--accent); }
  .hp-lane-step, .hp-lane-step:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .hp-lane-step:first-child { border-top: 0; }
  .hp-boundaries > div { grid-template-columns: 1fr; gap: 4px; }
  .hp-boundaries > div:nth-child(odd) { border-right: 0; }
  .hp-boundaries > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .hp-note { padding: 16px 18px; }
  .hp-cta { padding: 30px 20px; }
  .hp-cta-actions .hp-btn { flex: 1 1 100%; }
  .hp-mobile-bar { display: block; }
  .hp-foot { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .hp-header-actions .hp-text-link { display: none; }
  .hp-h1 { font-size: 30px; }
}
@media (hover: none) {
  .hp-btn:hover, .hp-stage-tab:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.hp-body) { scroll-behavior: auto; }
  .hp-btn:hover { transform: none; }
  .hp-btn:active { transform: none; }
}

/* === AI 工作区 ===
   参考 shadcn/ui 的组合方式：卡片、字段、徽标、空状态和确认对话框。
   只用服务端模板和原生 CSS，不引入前端框架。 */
.ai-page { max-width: 1240px; }
/* AI 工作台占满控制台主区宽度；platform_ai 等其它 ai-page 仍用通用限宽 */
.console-page.ai-workbench-page { width: 100%; max-width: none; }
/* AI 工作台主区固定为视口高度，面板在内部滚动，避免整页长滚动 */
.console-main.console-main--workbench { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.console-main.console-main--workbench .console-page.ai-workbench-page { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ai-head { margin-bottom: 12px; }
.ai-head .sub { max-width: 62ch; }
.ai-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
/* 站点切换胶囊条：右栏下线后常驻显示（对话与各面板都按站点取值） */
.ai-site-switch {
  display: flex; gap: 6px; margin: 0 0 10px; padding-bottom: 2px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.ai-site-switch::-webkit-scrollbar { display: none; }
.ai-site-switch a {
  flex: 0 0 auto; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 12px;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.ai-site-switch a.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
.ai-site-switch a:hover { text-decoration: none; border-color: var(--line-strong); }
.ai-site-switch a.on:hover { border-color: var(--accent); }
.ai-chat {
  display: flex; flex-direction: column; height: min(72vh, 780px); padding: 0;
  overflow: hidden; border-radius: 14px; box-shadow: var(--shadow-sm);
}
.ai-chat.ai-chat-has-questions { height: min(86vh, 860px); }
/* AJAX 切换会话时的加载态：只降不透明度、拦截重复点击，不改变布局 */
.ai-chat.ai-chat-loading { opacity: .55; transition: opacity .15s ease; }
.ai-chat.ai-chat-loading * { pointer-events: none; }
/* AJAX 切换会话后把焦点交给对话区容器（仅用于读屏/键盘定位），不画焦点环 */
.ai-chat:focus { outline: none; }
.ai-chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfcfe);
}
.ai-chat-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ai-chat-title .ai-avatar { width: 32px; height: 32px; }
.ai-chat-title strong { display: block; font-size: 14px; line-height: 1.3; }
.ai-chat-title .ai-scope { margin-top: 2px; }
.ai-scope {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink-2); font-size: 11px; max-width: 230px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-scope-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.ai-thread {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth;
  display: flex; flex-direction: column; gap: 18px; padding: 22px; background: #fbfcfe;
}
.ai-msg { display: flex; align-items: flex-start; gap: 10px; max-width: 780px; }
.ai-msg-user { flex-direction: row-reverse; margin-left: auto; }
.ai-avatar {
  width: 30px; height: 30px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--accent-strong);
}
.ai-avatar svg { width: 16px; height: 16px; }
.ai-msg-user .ai-avatar { background: var(--accent); border-color: var(--accent); color: #fff; }
.ai-msg-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ai-msg-user .ai-msg-body { align-items: flex-end; }
.ai-msg-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.ai-msg-meta time { font-variant-numeric: tabular-nums; }
.ai-msg-user .ai-msg-meta { flex-direction: row-reverse; }
.ai-bubble {
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px;
  background: #fff; color: var(--ink); font-size: 14px; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--shadow-xs);
}
.ai-msg-user .ai-bubble {
  background: var(--accent); border-color: var(--accent); color: #fff;
  border-radius: 14px 14px 4px 14px; box-shadow: none;
}
.ai-bubble.ai-markdown { white-space: normal; }
.ai-markdown > :first-child { margin-top: 0; }
.ai-markdown > :last-child { margin-bottom: 0; }
.ai-markdown p { margin: 0 0 8px; }
.ai-markdown ul, .ai-markdown ol { margin: 4px 0 8px; padding-left: 22px; }
.ai-markdown li { margin: 2px 0; }
.ai-markdown li > p { margin: 0; }
.ai-markdown strong, .ai-markdown b { font-weight: 700; }
.ai-markdown em, .ai-markdown i { font-style: italic; }
.ai-markdown code {
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--panel-soft); color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em;
}
.ai-markdown pre {
  margin: 8px 0; padding: 10px 12px; overflow-x: auto;
  border-radius: 9px; background: #0f172a; color: #e2e8f0;
  font-size: 12.5px; line-height: 1.6;
}
.ai-markdown pre code { padding: 0; border: 0; background: transparent; color: inherit; font-size: inherit; }
.ai-markdown blockquote {
  margin: 8px 0; padding: 2px 0 2px 10px;
  border-left: 3px solid var(--line-strong); color: var(--muted);
}
.ai-markdown a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.ai-markdown h1, .ai-markdown h2, .ai-markdown h3, .ai-markdown h4 {
  margin: 10px 0 6px; line-height: 1.35;
}
.ai-markdown h1 { font-size: 18px; }
.ai-markdown h2 { font-size: 16px; }
.ai-markdown h3 { font-size: 15px; }
.ai-markdown h4 { font-size: 14px; }
.ai-markdown hr { margin: 10px 0; border: 0; border-top: 1px solid var(--line); }
.ai-markdown table {
  display: block; max-width: 100%; margin: 8px 0; overflow-x: auto;
  border-collapse: collapse; font-size: 13px;
}
.ai-markdown th, .ai-markdown td {
  padding: 6px 8px; border: 1px solid var(--line); text-align: left; white-space: nowrap;
}
.ai-markdown th { background: var(--panel-soft); font-weight: 650; }
.ai-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin: auto 0; padding: 18px 8px 6px; text-align: center;
}
.ai-empty-icon {
  display: flex; align-items: center; justify-content: center; width: 62px; height: 62px;
  border: 1px solid #e2eaf4; border-radius: 18px; color: var(--accent-strong);
  background: #fff; box-shadow: 0 10px 30px rgba(15, 27, 45, .07);
}
.ai-empty-icon svg { width: 27px; height: 27px; }
.ai-empty h2 {
  margin: 2px 0 0; font-family: var(--font-display); font-size: clamp(27px, 3vw, 34px);
  font-weight: 600; line-height: 1.1; letter-spacing: -.03em;
}
.ai-empty p { max-width: 50ch; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; text-wrap: pretty; }
.ai-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(620px, 100%); margin-top: 18px; }
.ai-suggestion {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px;
  border: 1px solid #e7edf5; border-radius: 12px; background: #fff;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .16s ease-out, box-shadow .16s ease-out, transform .16s ease-out;
}
.ai-suggestion:hover { border-color: #d6e2f1; background: #fff; box-shadow: 0 8px 24px rgba(15, 27, 45, .06); transform: translateY(-1px); }
.ai-suggestion:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-suggestion-icon { color: var(--accent-strong); margin-top: 2px; flex: 0 0 auto; }
.ai-suggestion-icon svg { width: 16px; height: 16px; }
.ai-suggestion-text { display: block; min-width: 0; }
.ai-suggestion-text strong { display: block; font-size: 13px; line-height: 1.4; }
.ai-suggestion-text > span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.ai-suggestion-arrow { margin-left: auto; color: var(--line-strong); flex: 0 0 auto; transition: transform .16s ease-out, color .16s ease-out; }
.ai-suggestion:hover .ai-suggestion-arrow { color: var(--accent); transform: translateX(3px); }
.ai-suggestion-arrow svg { width: 14px; height: 14px; }
.ai-followups { display: grid; gap: 8px; margin-top: 2px; }
.ai-followups-label { padding-left: 40px; color: var(--muted); font-size: 11px; font-weight: 650; }
.ai-followups-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-left: 40px; }
.ai-followup {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink-2); font: inherit; text-align: left; cursor: pointer;
}
.ai-followup:hover { border-color: #b9ccf2; background: #fdfefe; }
.ai-followup:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-followup-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-followup-label { color: var(--ink-2); font-size: 12px; font-weight: 650; line-height: 1.4; }
.ai-followup-hint { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.ai-followup-arrow { margin-left: auto; color: var(--line-strong); flex: 0 0 auto; }
.ai-followup-arrow svg { width: 13px; height: 13px; }
/* AI 询问卡：选项、补充回答和跳过都放在一张卡片里，不和危险操作混用。 */
.ai-questions { min-width: 0; }
.ai-question-card {
  overflow: hidden; border: 1px solid #c9d8f4; border-radius: 13px; background: #f8fbff;
  box-shadow: var(--shadow-xs);
}
.ai-question-head {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid #dbe7f8;
}
.ai-question-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  flex: 0 0 auto; border-radius: 9px; background: #e7efff; color: var(--accent-strong);
}
.ai-question-icon svg { width: 16px; height: 16px; }
.ai-question-copy { display: grid; gap: 2px; min-width: 0; }
.ai-question-copy strong { color: var(--ink); font-size: 13px; line-height: 1.4; }
.ai-question-copy span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.ai-question-form { display: grid; gap: 14px; padding: 13px 14px 14px; }
.ai-ask-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.ai-ask-question {
  display: block; margin: 0 0 8px; padding: 0; color: var(--ink-2);
  font-size: 13px; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere;
}
.ai-ask-header {
  display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 999px;
  background: #e7efff; color: var(--accent-strong); font-size: 10.5px; font-weight: 600;
  vertical-align: 1px;
}
.ai-ask-hint { margin-left: 6px; color: var(--muted); font-size: 10.5px; font-weight: 400; }
.ai-ask-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.ai-ask-option {
  position: relative; display: flex; align-items: flex-start; gap: 8px; min-width: 0;
  min-height: 44px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.ai-ask-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ai-ask-option:hover { border-color: #b9ccf2; }
.ai-ask-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.ai-ask-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-ask-option-copy { display: grid; gap: 2px; min-width: 0; }
.ai-ask-option-label { color: var(--ink-2); font-size: 13px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.ai-ask-option:has(input:checked) .ai-ask-option-label::after { content: " ✓"; color: var(--accent-strong); }
.ai-ask-option-desc { color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.ai-ask-other { display: block; margin-top: 7px; }
.ai-ask-other input {
  width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 13px;
}
.ai-ask-other input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ai-question-error { margin: 0; }
.ai-question-error[hidden] { display: none; }
.ai-question-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-question-note { color: var(--muted); font-size: 10.5px; }
.ai-question-buttons { display: flex; align-items: center; gap: 6px; }
.ai-question-form[aria-busy="true"] .ai-ask-option { opacity: .65; }
.ai-question-form[aria-busy="true"] .ai-ask-other { opacity: .65; }

.ai-actions { display: grid; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fff; }
.ai-actions-head { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.ai-actions-head svg { width: 15px; height: 15px; color: #b45309; }
.ai-action {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid #fde68a; border-radius: 11px; background: #fffbeb;
}
.ai-action-icon {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 9px; background: #fef3c7; color: #b45309;
}
.ai-action-icon svg { width: 15px; height: 15px; }
.ai-action-body { min-width: 0; display: flex; align-items: center; gap: 10px; }
.ai-action-copy { min-width: 0; display: grid; gap: 2px; }
.ai-action-body strong { font-size: 13px; overflow-wrap: anywhere; }
.ai-action-body span { color: #8a6a2f; font-size: 11px; }
.ai-action-thumb {
  width: 56px; height: 56px; flex: 0 0 auto; object-fit: cover;
  border: 1px solid #f4d58d; border-radius: 9px; background: #fff;
}
.ai-action-buttons { display: flex; align-items: center; gap: 6px; }
.ai-action-buttons form { margin: 0; }
.ai-composer { padding: 14px 18px 16px; border-top: 1px solid var(--line); background: #fff; }
.ai-composer-box {
  padding: 8px 8px 8px 12px; border: 1px solid var(--line-strong); border-radius: 14px;
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.ai-composer-box:focus-within { border-color: #8fb0ee; box-shadow: 0 0 0 4px rgba(37, 99, 235, .10); }
.ai-textarea {
  display: block; width: 100%; min-height: 44px; max-height: 180px; padding: 4px 2px 8px;
  border: 0; outline: 0; box-shadow: none; resize: none; background: transparent;
  color: var(--ink); font: inherit; font-size: 14px; line-height: 1.6;
}
.ai-textarea::placeholder { color: #7c8ba0; opacity: 1; }
.ai-textarea:focus-visible { outline: 0; }
.ai-composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-kbd-hint { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.ai-kbd-hint span { color: var(--line-strong); }
.ai-send { min-height: 34px; padding: 0 13px; }
.ai-composer-error { margin-bottom: 10px; }

/* === 输入栏上下文选择器（技能 / 站点 / 商品 / 资料）===
   原生 details 保证无 JS 可展开；向上弹出避免被输入栏裁切。浅色主题 + WCAG AA。 */
.ai-ctx-bar { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.ai-ctx { position: relative; }
.ai-ctx-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink-2); font-size: 12px; font-weight: 600;
  cursor: pointer; list-style: none; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.ai-ctx-chip::-webkit-details-marker { display: none; }
.ai-ctx-chip > svg { width: 14px; height: 14px; color: var(--accent); flex: 0 0 auto; }
.ai-ctx-chip:hover { background: var(--panel-soft); border-color: var(--line-strong); color: var(--ink); }
.ai-ctx-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-ctx[open] .ai-ctx-chip { background: var(--accent-soft); border-color: #bfd4f7; color: var(--accent-strong); }
.ai-ctx-pop {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 25;
  display: grid; gap: 2px; width: max-content; min-width: 190px; max-width: min(320px, calc(100vw - 40px));
  max-height: 280px; overflow-y: auto; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  box-shadow: var(--shadow); color: var(--ink); cursor: default;
}
.ai-ctx-pop-head {
  padding: 5px 8px 6px; color: var(--muted); font-size: 10.5px; font-weight: 750;
  letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--line);
  margin-bottom: 3px;
}
.ai-ctx-option {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px;
  padding: 6px 8px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
}
.ai-ctx-option > svg { width: 15px; height: 15px; color: var(--accent); flex: 0 0 auto; opacity: .85; }
.ai-ctx-option-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-ctx-option small { color: var(--muted); font-size: 10.5px; flex: 0 0 auto; }
.ai-ctx-option:hover, .ai-ctx-option:focus-visible { background: var(--accent-soft); color: var(--accent-strong); outline: none; }
.ai-ctx-option:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
/* B3：/ 键盘导航高亮，与 hover / focus-visible 同色，守住浅色主题与 WCAG 对比度。 */
.ai-ctx-option.is-active, .ai-ctx-option.is-active:hover {
  background: var(--accent-soft); color: var(--accent-strong);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.ai-ctx-empty { margin: 0; padding: 12px 8px; color: var(--muted); font-size: 12px; text-align: center; }
/* 分组、搜索与「先站点后商品」两步：hidden 优先于 flex/grid，避免筛选后仍占位。 */
.ai-ctx-pop-wide { min-width: 240px; max-width: min(340px, calc(100vw - 40px)); max-height: min(420px, calc(100vh - 40px)); }
.ai-ctx [hidden] { display: none !important; }
.ai-ctx-search { display: block; padding: 4px 6px 6px; }
.ai-ctx-search-input {
  display: block; width: 100%; min-height: 30px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft);
  color: var(--ink); font: inherit; font-size: 12px;
}
.ai-ctx-search-input::placeholder { color: var(--muted); opacity: 1; }
.ai-ctx-search-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.ai-ctx-groups, .ai-ctx-step, .ai-ctx-group, .ai-ctx-options { display: grid; gap: 2px; }
.ai-ctx-group { padding: 2px 0 4px; }
.ai-ctx-group-title {
  margin: 4px 8px 2px; color: var(--muted); font-size: 10.5px;
  font-weight: 750; letter-spacing: .03em;
}
.ai-ctx-step-title { margin: 2px 8px 4px; color: var(--muted); font-size: 11px; }
.ai-ctx-step-bar {
  display: flex; align-items: center; gap: 8px; padding: 2px 6px 6px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.ai-ctx-back {
  border: 0; background: transparent; color: var(--accent-strong);
  font: inherit; font-size: 11.5px; font-weight: 650;
  cursor: pointer; padding: 3px 5px; border-radius: 6px; white-space: nowrap;
}
.ai-ctx-back:hover, .ai-ctx-back:focus-visible { background: var(--accent-soft); outline: none; }
.ai-ctx-back:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.ai-ctx-step-bar strong {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-2); font-size: 11.5px; font-weight: 650;
}
.ai-ctx-option.is-current { box-shadow: inset 2px 0 0 var(--accent); }
.ai-ctx-option.is-current .ai-ctx-option-main { font-weight: 700; color: var(--accent-strong); }
.ai-composer-error { margin-bottom: 10px; }
.ai-composer-error[hidden] { display: none; }
.ai-msg-pending .ai-bubble { opacity: .65; }
.ai-typing { display: flex; align-items: center; gap: 9px; padding: 2px 0 2px 40px; color: var(--muted); font-size: 12px; }
.ai-typing-dots { display: inline-flex; align-items: center; gap: 3px; }
.ai-typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: ai-typing 1.2s infinite ease-in-out; }
.ai-typing-dots i:nth-child(2) { animation-delay: .15s; }
.ai-typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-typing {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}
.ai-aside { display: grid; gap: 12px; align-self: start; }
.ai-side-card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-xs); }
.ai-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ai-side-head h2 { margin: 0; color: var(--ink-2); font-size: 12px; font-weight: 750; letter-spacing: .02em; }
.ai-side-head a { font-size: 12px; }
.ai-site-list { display: grid; gap: 2px; }
.ai-site {
  display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  min-height: 38px; padding: 8px 9px; border: 1px solid transparent; border-radius: 9px;
  color: var(--ink-2);
}
.ai-site:hover { background: var(--panel-soft); text-decoration: none; }
.ai-site.on { background: var(--accent-soft); border-color: #d6e6ff; color: var(--accent-strong); }
.ai-site-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.ai-site-dot.all { background: var(--accent); }
.ai-site-dot.published { background: #10b981; }
.ai-site-dot.draft { background: #f59e0b; }
.ai-site-dot.paused { background: #6366f1; }
.ai-site-dot.closed { background: #94a3b8; }
.ai-site-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.ai-site-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.ai-quota { display: grid; gap: 6px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.ai-quota-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.ai-quota-row strong { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ai-meter { height: 6px; overflow: hidden; border-radius: 999px; background: #eef2f7; }
.ai-meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.ai-quick { display: grid; gap: 2px; }
.ai-quick button, .ai-quick a {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--ink-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.ai-quick button:hover, .ai-quick a:hover { background: var(--panel-soft); border-color: var(--line); text-decoration: none; }
.ai-quick svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--muted); }
.ai-quick .arrow { margin-left: auto; color: var(--line-strong); }
.ai-history-jump { display: none; }
#platformHistory { scroll-margin-top: 80px; }
#platformHistory:target .ai-side-card {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.ai-conv-list { display: grid; gap: 2px; }
.ai-conv { display: flex; align-items: center; gap: 4px; border-radius: 9px; }
.ai-conv.on { background: var(--accent-soft); }
.ai-conv-link { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 7px 9px; border-radius: 9px; color: var(--ink-2); }
.ai-conv-link:hover { background: var(--panel-soft); text-decoration: none; }
.ai-conv.on .ai-conv-link:hover { background: transparent; }
.ai-conv-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 12.5px; font-weight: 650; line-height: 1.4; }
.ai-conv.on .ai-conv-title { color: var(--accent-strong); }
.ai-conv-time { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.ai-conv-menu { position: relative; flex: 0 0 auto; }
.ai-conv-menu summary {
  display: flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 16px; list-style: none;
}
.ai-conv-menu summary::-webkit-details-marker { display: none; }
.ai-conv-menu summary:hover, .ai-conv-menu[open] summary { background: var(--panel-soft); color: var(--ink); }
.ai-conv-pop {
  position: absolute; right: 0; top: 30px; z-index: 30; display: grid; gap: 6px; width: 230px;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow);
}
.ai-conv-pop form { display: flex; gap: 6px; margin: 0; }
.ai-conv-pop .input { min-height: 30px; padding: 4px 8px; border-radius: 7px; font-size: 12px; }
.ai-conv-pop .btn { flex: 0 0 auto; }
.ai-conv-pop form:last-child .btn { width: 100%; color: var(--danger); }
.ai-status { display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.ai-status + p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.ai-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ai-stat {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-xs);
}
.ai-stat-icon {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); flex: 0 0 auto;
}
.ai-stat-icon svg { width: 17px; height: 17px; }
.ai-stat-label { color: var(--muted); font-size: 11px; font-weight: 600; }
.ai-stat-value { font-size: 19px; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ai-stat-value small { margin-left: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.ai-shop { max-width: 900px; margin: 0 auto; }
.ai-shop-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.ai-shop-head h1 { margin: 6px 0 0; font-family: var(--font-display); }
.ai-shop-head p { max-width: 58ch; margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.ai-shop .ai-chat { height: min(64vh, 700px); }
.ai-shop .ai-suggestions { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.ai-shop .ai-suggestion { padding: 10px; }
.ai-shop .ai-suggestion strong { font-size: 12px; }
.ai-shop .ai-composer { padding: 12px 14px 14px; }
@media (max-width: 1100px) {
  .ai-workspace { grid-template-columns: 1fr; }
  .ai-history-jump { display: inline-flex; }
  .ai-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-aside > :first-child { grid-column: span 2; }
}
@media (max-width: 760px) {
  .ai-chat { height: auto; }
  .ai-chat.ai-chat-has-questions { height: auto; }
  .ai-thread { max-height: 58vh; padding: 16px; }
  .ai-suggestions, .ai-shop .ai-suggestions { grid-template-columns: 1fr; }
  .ai-aside { grid-template-columns: 1fr; }
  .ai-aside > :first-child { grid-column: auto; }
  .ai-action { grid-template-columns: 1fr; }
  .ai-action-icon { display: none; }
  .ai-question-head { padding: 11px 12px; }
  .ai-question-form { padding: 12px; }
  .ai-ask-options { grid-template-columns: 1fr; }
  .ai-question-actions { align-items: flex-end; }
  .ai-action-buttons { justify-content: flex-end; }
  .ai-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ai-stat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; }
  .ai-stat-icon { width: 28px; height: 28px; border-radius: 8px; }
  .ai-stat-icon svg { width: 15px; height: 15px; }
  .ai-stat-label { font-size: 10px; }
  .ai-stat-value { font-size: 16px; }
  .ai-kbd-hint { display: none; }
  .ai-ctx-chip { padding: 4px 8px; font-size: 11.5px; }
  .ai-ctx-pop { min-width: 170px; }
  .ai-ctx-pop-wide { min-width: 170px; }
  .ai-chat-head .small.muted.nowrap { display: none; }
  .ai-msg { max-width: 100%; }
  .ai-followups-grid { grid-template-columns: 1fr; padding-left: 0; }
  .ai-followups-label { padding-left: 0; }
}
@media (max-width: 640px) {
  .ai-head { margin-bottom: 12px; }
  .ai-chat-head { padding: 11px 14px; }
  .ai-thread { padding: 14px; gap: 14px; max-height: 54vh; }
  .ai-bubble { font-size: 13.5px; }
  .ai-actions { padding: 10px 14px; }
  .ai-composer { padding: 10px 14px 12px; }
  .ai-side-card { padding: 13px; }
  .ai-shop-head { align-items: flex-start; }
}

/* === AI 工作台两栏：功能导航 + 主区（右侧上下文栏已下线） === */
.ai-workbench-nav.ai-workspace { grid-template-columns: 320px minmax(0, 1fr); align-items: stretch; }
.ai-workbench-main { min-width: 0; }
.ai-workbench-main [data-tab-panel][hidden] { display: none !important; }
.aw-nav {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 12px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-xs);
}
.aw-nav-brand {
  display: flex; align-items: center; gap: 8px; padding: 2px 6px 12px;
  color: var(--ink-2); font-size: 12px; font-weight: 750; letter-spacing: .02em;
}
.aw-nav-logo { display: inline-flex; color: var(--accent); }
.aw-nav-logo svg { width: 17px; height: 17px; }
.aw-nav-list { display: grid; gap: 3px; }
.aw-nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 40px;
  padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; text-align: left;
}
.aw-nav-item > svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: .8; }
.aw-nav-item > span:nth-child(2) { flex: 1; min-width: 0; }
.aw-nav-item:hover { background: var(--panel-soft); color: var(--ink); }
.aw-nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.aw-nav-item[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-strong); border-color: rgba(37, 99, 235, .12); }
.aw-nav-item[aria-selected="true"] > svg { opacity: 1; }
.aw-nav-count {
  min-width: 20px; padding: 0 5px; border-radius: 20px; background: var(--bg);
  color: var(--muted); font-size: 10.5px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.aw-nav-item[aria-selected="true"] .aw-nav-count { background: #fff; color: var(--accent-strong); }
.aw-nav-foot {
  display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 9px 8px 2px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px;
}
.aw-nav-foot-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
/* 功能导航下方的常驻会话任务列表：关联商户、站点、状态与时间 */
.aw-nav-sessions {
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.aw-nav-sessions-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 4px; color: var(--ink-2); font-size: 11px; font-weight: 750;
}
.aw-session-list {
  display: grid; gap: 6px; margin: 0; padding: 0 2px 2px 0; list-style: none;
  max-height: 52vh; min-height: 0; overflow-y: auto;
}
.aw-session {
  display: grid; gap: 5px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: inherit; text-decoration: none;
}
.aw-session:hover { background: var(--panel-soft); border-color: var(--line-strong); }
.aw-session:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.aw-session.on { background: var(--accent-soft); border-color: rgba(37, 99, 235, .28); }
.aw-session-top { display: flex; align-items: center; gap: 6px; min-width: 0; padding-right: 20px; }
.aw-session-title {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-2); font-size: 12px; font-weight: 650;
}
.aw-session-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.aw-session-dot.is-pending { background: var(--warn); }
.aw-session-dot.is-done { background: var(--ok); }
.aw-session-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 10px; }
.aw-session-status { color: var(--accent-strong); font-weight: 600; }
/* 会话行内操作（重命名 / 删除）：⋯ 浮在卡片右上角，菜单在卡片下方就地展开
   （不用绝对定位浮层，否则会被 .aw-tree / .aw-session-list 的滚动容器裁剪）。 */
.aw-session-item { position: relative; min-width: 0; }
.aw-session-menu > summary {
  position: absolute; top: 4px; right: 4px; z-index: 1; list-style: none;
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer;
}
.aw-session-menu > summary::-webkit-details-marker { display: none; }
.aw-session-menu > summary:hover, .aw-session-menu[open] > summary { background: var(--panel-soft); color: var(--ink); }
.aw-session-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.aw-session-menu-body {
  display: grid; gap: 6px; margin-top: 6px; padding: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.aw-session-menu-body form { display: flex; gap: 6px; margin: 0; }
.aw-session-menu-body .input { min-height: 30px; padding: 4px 8px; border-radius: 7px; font-size: 12px; }
.aw-session-menu-body .btn { flex: 0 0 auto; }
.aw-session-menu-body form:last-child .btn { width: 100%; color: var(--danger); }
/* 树形会话任务：全局 + 各站点分组，点分组标题展开其下会话（原生 details，无 JS 也可用） */
.aw-tree {
  display: grid; gap: 6px; min-height: 0; max-height: 52vh; overflow-y: auto;
  padding-right: 2px; overscroll-behavior: contain;
}
.aw-tree-node { min-width: 0; }
.aw-tree-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel-soft); color: var(--ink-2); font-size: 11.5px; font-weight: 700;
  cursor: pointer; list-style: none;
}
.aw-tree-summary::-webkit-details-marker { display: none; }
.aw-tree-summary:hover { border-color: var(--line-strong); }
.aw-tree-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.aw-tree-label {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 折叠箭头：闭合朝右、展开朝下，纯 CSS，不额外增加标签 */
.aw-tree-label::before {
  content: ""; width: 5px; height: 5px; flex: 0 0 auto;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s ease;
}
.aw-tree-node[open] > .aw-tree-summary .aw-tree-label::before { transform: rotate(45deg); }
.aw-tree-count {
  flex: 0 0 auto; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--muted); font-size: 10px; font-weight: 700;
}
.aw-tree .aw-session-list {
  max-height: none; overflow: visible; margin: 6px 0 2px; padding-left: 8px;
  border-left: 1px solid var(--line);
}
.aw-nav-sessions-empty {
  padding: 14px 8px; border: 1px dashed var(--line-strong); border-radius: 10px;
  background: var(--panel-soft); color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center;
}
.aw-panel {
  display: flex; flex-direction: column; gap: 14px; min-height: min(72vh, 780px); padding: 18px;
  border-radius: 14px; box-shadow: var(--shadow-sm);
}
.aw-panel[hidden] { display: none; }
.aw-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.aw-panel-head h2 { margin: 0; font-size: 15px; color: var(--ink); }
.aw-panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.aw-demo-tag {
  flex: 0 0 auto; padding: 3px 9px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--panel-soft); color: var(--muted); font-size: 11px; font-weight: 600;
}
.aw-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.aw-list-item {
  display: flex; align-items: center; gap: 11px; padding: 12px 13px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
}
.aw-item-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); flex: 0 0 auto;
}
.aw-item-icon svg { width: 16px; height: 16px; }
.aw-item-body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.aw-item-body strong { color: var(--ink-2); font-size: 12.5px; font-weight: 650; line-height: 1.4; }
.aw-item-body span { color: var(--muted); font-size: 11px; }
.aw-item-body .aw-badge { justify-self: start; }
.aw-badge {
  flex: 0 0 auto; padding: 2px 8px; border-radius: 20px; background: var(--bg);
  color: var(--muted); font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.aw-badge-ok { background: var(--ok-soft); color: var(--ok); }
.aw-badge-run { background: var(--warn-soft); color: var(--warn); }
.aw-switch { position: relative; width: 32px; height: 18px; border-radius: 20px; background: var(--line-strong); flex: 0 0 auto; }
.aw-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.aw-switch-on { background: var(--accent); }
.aw-switch-on::after { left: 16px; }
.aw-panel-foot {
  display: flex; align-items: center; gap: 7px; margin-top: auto; padding: 10px 12px;
  border-radius: 10px; background: var(--panel-soft); color: var(--muted); font-size: 11.5px;
}
.aw-panel-foot svg { width: 14px; height: 14px; color: var(--accent); flex: 0 0 auto; }
.aw-empty { padding: 24px 12px; border: 1px dashed var(--line-strong); border-radius: 11px; background: var(--panel-soft); color: var(--muted); font-size: 12px; text-align: center; }
.aw-form-toggle { position: relative; flex: 0 0 auto; }
.aw-form-toggle > summary { list-style: none; cursor: pointer; }
.aw-form-toggle > summary::-webkit-details-marker { display: none; }
.aw-edit-link { color: var(--accent-strong); font-size: 11.5px; cursor: pointer; }
.aw-edit-link:hover { text-decoration: underline; }
.aw-form {
  display: grid; gap: 10px; margin-top: 10px; padding: 14px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft);
}
.aw-list-item.aw-list-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.aw-list-item .aw-form-toggle { width: 100%; }
.aw-list-item .aw-form { background: #fff; }
.aw-list-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.aw-list-top .aw-item-body { flex: 1; min-width: 120px; }
.aw-list-top form { margin: 0; }
.aw-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.aw-form .field { display: grid; gap: 4px; margin: 0; }
.aw-form .field > span { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.aw-form .input { width: 100%; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 12.5px; }
.aw-form textarea.input { resize: vertical; line-height: 1.5; }
.aw-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.aw-check { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.aw-form-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

/* === AI 工作台技能（B2）：「技能」Tab 管理表单与只读分区 === */
.ask-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ask-form-grid .field { display: grid; gap: 4px; margin: 0; }
.ask-form-grid .field > span { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.ask-form-grid .input { width: 100%; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 12.5px; }
.ask-form-grid textarea.input { resize: vertical; line-height: 1.5; }
.aw-form-inline { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.aw-form-inline .field { display: grid; gap: 4px; margin: 0; min-width: 120px; }
.aw-form-inline .field > span { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.aw-form-inline .input { width: 100%; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }
.aw-skill-section { margin-top: 18px; }
.aw-skill-section-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--ink); }
.ask-fallback-hint { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); }
/* B4 / AC-11：首屏内联技能超 300 KB 时的降级提示（/ 面板与技能 Tab 共用） */
.ask-truncated-hint { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; line-height: 1.5; }
.ai-ctx-pop .ask-truncated-hint { margin: 8px 6px 2px; }
.ai-ctx-pop-hint { margin: 8px 6px 2px; color: var(--muted); font-size: 11px; line-height: 1.5; }
@media (max-width: 1100px) {
  .ai-workbench-nav.ai-workspace { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
}
@media (max-width: 760px) {
  .ai-workbench-nav.ai-workspace { grid-template-columns: 1fr; }
  .aw-nav { flex-direction: column; padding: 10px; }
  .aw-nav-brand { padding-bottom: 8px; }
  .aw-nav-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .aw-nav-item { flex-direction: column; justify-content: center; gap: 3px; min-height: 58px; padding: 6px 4px; font-size: 11px; text-align: center; }
  .aw-nav-item > span:nth-child(2) { flex: none; }
  .aw-nav-count, .aw-nav-foot { display: none; }
  .aw-nav-sessions-head .aw-nav-count { display: inline-block; }
  .aw-nav-sessions { margin-top: 8px; }
  .aw-session-list { max-height: 200px; }
  .aw-panel { min-height: 0; padding: 14px; }
  .aw-panel-head { flex-wrap: wrap; }
  .aw-form-row, .ask-form-grid { grid-template-columns: 1fr; }
  .aw-form-toggle { width: 100%; }
}
@media (max-width: 460px) {
  .aw-nav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* === 控制台侧边栏分组与图标 === */
.console-nav a svg { width: 16px; height: 16px; flex: none; opacity: .78; }
.console-nav a.on svg, .console-nav a:hover svg { opacity: 1; }
.console-nav .nav-cap { margin: 14px 10px 4px; font-weight: 650; letter-spacing: .02em; }
.console-nav .nav-cap:first-child { margin-top: 2px; }
.console-site { display: flex; flex-direction: column; gap: 6px; }
.console-site-name { color: #fff; }
.console-site-name:hover { text-decoration: none; }
.console-site-name strong { display: block; font-size: 14px; }
.console-site .site-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #a9bdd2; }
.console-site .site-state::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.18);
}
.console-site .site-state-live::before { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.2); }
.console-site-link {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  color: #93c5fd; margin-top: 2px;
}
.console-site-link svg { width: 13px; height: 13px; }
.console-site-link:hover { color: #bfdbfe; text-decoration: none; }

/* 侧栏余额：靠右显示，金额用强调色 */
.console-nav .nav-amount {
  margin-left: auto; font-size: 12px; font-weight: 650;
  color: #bfdbfe; background: rgba(37, 99, 235, .22);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.console-nav a.on .nav-amount { background: rgba(255,255,255,.18); color: #fff; }

/* === 公共模块：幻灯片 mod-slider ===
   跨 shop/dtc 两套模板共用；横向 scroll-snap，无第三方依赖。 */
.mod-slider { margin: 24px 0; }
.mod-slider .section-head { margin: 0 0 10px; }
.mod-slider-track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius); scrollbar-width: thin;
}
.mod-slider-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mod-slide {
  position: relative; flex: 0 0 100%; scroll-snap-align: center;
  border-radius: var(--radius); overflow: hidden; background: var(--panel-soft, #f7f9fc);
  border: 1px solid var(--line);
}
.mod-slide-link, .mod-slide-img { display: block; width: 100%; }
.mod-slide img { display: block; width: 100%; height: auto; aspect-ratio: 12 / 5; object-fit: cover; }
.mod-slide-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.mod-slide-caption {
  position: absolute; left: 16px; bottom: 16px; max-width: calc(100% - 32px);
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: rgba(21, 32, 43, .72); color: #fff; font-size: 15px; font-weight: 600;
}
.mod-slider-nav {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px;
}
.mod-slider-nav button {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center;
}
.mod-slider-nav button:hover { border-color: var(--accent); color: var(--accent); }
.mod-slider-nav button svg { width: 16px; height: 16px; }
@media (min-width: 760px) {
  .mod-slide { flex-basis: calc(50% - 6px); }
}
@media (prefers-reduced-motion: reduce) {
  .mod-slider-track { scroll-behavior: auto; }
}

/* === 站点文章：多语言 Markdown 编辑器 === */
.md-lang { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.md-lang:first-of-type { border-top: 0; margin-top: 0; }
.md-lang h3 { font-size: 14px; margin: 0 0 12px; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.md-toolbar .btn { min-height: 32px; padding: 0 10px; font-size: 12px; }
.md-input { min-height: 300px; line-height: 1.6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.md-preview-host { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); }
.md-preview-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted);
}
.md-bytes { font-variant-numeric: tabular-nums; }
.md-bytes-warn { color: var(--danger); font-weight: 700; }
.md-preview { padding: 14px 16px; min-height: 80px; max-height: 420px; overflow-y: auto; }
.md-toolbar[hidden], .md-preview-host[hidden] { display: none; }
.article-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; margin-right: 8px; vertical-align: middle; }
.article-card { display: grid; gap: 6px; }
.article-card-cover { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; }
.article-cover { width: 100%; max-height: 380px; object-fit: cover; border-radius: 12px; margin: 0 0 18px; }

/* === 访问统计 === */
.traffic-page { min-width: 0; }
.traffic-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.traffic-ranges, .traffic-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.traffic-ranges a, .traffic-tabs a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.traffic-ranges a.on, .traffic-tabs a.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.traffic-ranges a:hover, .traffic-tabs a:hover { border-color: var(--accent); color: var(--accent); }
.traffic-ranges a.on:hover, .traffic-tabs a.on:hover { color: #fff; }
.traffic-custom { flex: 0 1 auto; }
.traffic-custom .input { max-width: 150px; }
.traffic-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.traffic-card { min-width: 0; overflow: hidden; }
.traffic-card .cap { white-space: normal; overflow-wrap: anywhere; }
.traffic-card .num { font-size: clamp(20px, 2.2vw, 28px); overflow-wrap: anywhere; }
.traffic-spark { display: block; width: 100%; height: 26px; margin-top: 8px; }
.traffic-spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.traffic-chart { width: 100%; overflow: hidden; }
.traffic-chart svg { display: block; width: 100%; height: auto; min-height: 180px; }
.traffic-grid { stroke: var(--line); stroke-width: 1; }
.traffic-line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.traffic-line.line-1 { stroke: var(--accent); }
.traffic-line.line-2 { stroke: #38a169; }
.traffic-line.line-3 { stroke: #d69e2e; }
.traffic-line.line-4 { stroke: #805ad5; }
.traffic-axis { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.traffic-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.traffic-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.traffic-legend-item i, .traffic-tabs i { width: 14px; height: 3px; border-radius: 2px; background: var(--accent); display: inline-block; }
.traffic-legend-item i.line-1 { background: var(--accent); }
.traffic-legend-item i.line-2 { background: #38a169; }
.traffic-legend-item i.line-3 { background: #d69e2e; }
.traffic-legend-item i.line-4 { background: #805ad5; }
.traffic-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.traffic-rank-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.traffic-rank-item:last-child { border-bottom: 0; }
.traffic-rank-name { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.traffic-rank-name.mono { font-family: var(--mono); font-size: 12px; }
.traffic-rank-value { flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.traffic-rank-value b { font-size: 16px; }
.traffic-rank-value small { color: var(--muted); font-size: 11px; }
.traffic-rank-value small.traffic-engine, .traffic-engine { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.traffic-source > details { width: 100%; }
.traffic-source summary { list-style: none; cursor: pointer; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.traffic-source summary::-webkit-details-marker { display: none; }
.traffic-source summary::after { content: "+"; color: var(--muted); margin-left: 6px; }
.traffic-source details[open] summary::after { content: "−"; }
.traffic-source-detail { margin: 8px 0 4px 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.traffic-source-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12px; min-width: 0; }
.traffic-source-row span:first-child { overflow-wrap: anywhere; }
.traffic-source-row span:last-child { white-space: nowrap; color: var(--muted); }
.traffic-more { margin-top: 10px; }
.traffic-more summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.traffic-empty { padding: 18px 0; color: var(--muted); text-align: center; font-size: 13px; }
.traffic-empty-main { margin: 0 0 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); }
.traffic-subhead { margin: 16px 0 4px; font-size: 13px; color: var(--muted); }
.traffic-funnel { display: grid; gap: 10px; }
.traffic-funnel-row { display: grid; grid-template-columns: minmax(100px, 160px) minmax(0, 1fr) minmax(90px, auto); align-items: center; gap: 10px; }
.traffic-funnel-label { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.traffic-funnel-track { height: 18px; border-radius: 5px; background: var(--surface-2, #eef1f5); overflow: hidden; }
.traffic-funnel-track span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), #6a9bff); min-width: 2px; }
.traffic-funnel-value { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; justify-content: flex-end; }
.traffic-funnel-value small { color: var(--muted); font-size: 11px; }
.traffic-order-amount { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 4px; font-size: 12px; }
.traffic-order-amount div { display: flex; justify-content: space-between; gap: 10px; }
.traffic-order-amount span { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .traffic-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .traffic-cards { grid-template-columns: minmax(0, 1fr); }
  .traffic-toolbar { align-items: stretch; }
  .traffic-custom { width: 100%; }
  .traffic-custom .input { flex: 1 1 0; max-width: none; min-width: 0; }
  .traffic-funnel-row { grid-template-columns: minmax(84px, 120px) minmax(0, 1fr) minmax(72px, auto); gap: 6px; }
  .traffic-funnel-label { font-size: 12px; }
  .traffic-chart svg { min-height: 150px; }
}

/* 运营数据：四条趋势折线两列排布，窄屏单列 */
.analytics-charts { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.analytics-chart { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.analytics-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.analytics-chart-head b { color: inherit; font-size: 15px; }
.analytics-chart .traffic-spark { height: 56px; margin-top: 6px; }
@media (max-width: 720px) { .analytics-charts { grid-template-columns: 1fr; } }

/* === 设计品味：AI 工作台的层级、留白与反馈 === */
.ai-workbench-page .page-head { margin-bottom: 18px; }
.ai-workbench-page .page-head .sub { max-width: 64ch; color: var(--muted); }
.ai-workbench-nav.ai-workspace { gap: 24px; }
.ai-workbench-main { min-width: 0; }
.aw-nav { padding: 4px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.aw-nav-brand { padding: 4px 8px 16px; color: var(--ink); font-size: 12.5px; letter-spacing: .01em; }
.aw-nav-item { min-height: 44px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); font-size: 13px; font-weight: 600; transition: background .16s ease-out, color .16s ease-out, box-shadow .16s ease-out, transform .12s ease-out; }
.aw-nav-item[aria-selected="true"] { background: #fff; border-color: transparent; color: var(--ink); box-shadow: var(--shadow-sm), inset 3px 0 0 var(--accent); }
.aw-nav-sessions { margin-top: 16px; padding-top: 16px; border-top-color: #e8edf3; }
.aw-session { padding: 10px 8px; border-color: transparent; border-radius: 10px; background: transparent; transition: background .16s ease-out, box-shadow .16s ease-out; }
.aw-session:hover, .aw-session.on { border-color: transparent; background: #fff; box-shadow: var(--shadow-xs); }
.ai-chat { border: 0; border-radius: 18px; box-shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 18px 44px rgba(15, 27, 45, .07); }
.ai-chat-head { padding: 16px 20px; background: #fff; border-bottom-color: #edf1f5; }
.ai-chat-title strong { font-size: 15px; letter-spacing: -.01em; }
.ai-thread { padding: 24px; gap: 22px; background: #f8fafc; }
.ai-bubble { padding: 12px 15px; border-color: transparent; border-radius: 16px 16px 16px 5px; box-shadow: 0 1px 2px rgba(15, 27, 45, .045); font-size: 14.5px; line-height: 1.65; }
.ai-msg-user .ai-bubble { background: var(--accent-strong); border-color: transparent; border-radius: 16px 16px 5px 16px; }
.ai-msg-meta { font-size: 12px; }
.ai-suggestions { gap: 10px; }
.ai-suggestion, .ai-followup { border-color: transparent; background: #fff; box-shadow: var(--shadow-xs); transition: background .16s ease-out, box-shadow .16s ease-out, transform .12s ease-out; }
.ai-suggestion:hover, .ai-followup:hover { border-color: transparent; background: #fff; box-shadow: var(--shadow-sm); }
.ai-suggestion-text strong { font-size: 13.5px; }
.ai-suggestion-text > span, .ai-followup-hint { font-size: 12px; }
.ai-site-switch a { min-height: 34px; font-size: 13px; border-color: transparent; background: #eef2f7; transition: background .16s ease-out, transform .12s ease-out; }
.ai-site-switch a:hover { border-color: transparent; background: #e6edf6; }
.ai-site-switch a.on { background: var(--accent-strong); box-shadow: 0 2px 6px rgba(37, 99, 235, .18); }
.ai-composer { padding: 16px 20px 18px; }
.ai-composer-box { border-color: #dfe6ee; border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 27, 45, .03); }
.ai-textarea { font-size: 15px; line-height: 1.65; }
.console-nav .nav-amount { color: #e8f0ff; background: rgba(37, 99, 235, .38); }
.btn, .ai-send, .ai-site-switch a, .aw-nav-item, .ai-suggestion, .ai-followup { transition-timing-function: cubic-bezier(.23, 1, .32, 1); }
.btn:active, .ai-send:active, .ai-site-switch a:active, .aw-nav-item:active, .ai-suggestion:active, .ai-followup:active { transform: scale(.97); }
@media (max-width: 640px) {
  .ai-workbench-nav.ai-workspace { gap: 14px; }
  .ai-thread { padding: 16px; gap: 16px; }
  .ai-chat { border-radius: 14px; }
  .ai-chat-head { padding: 13px 14px; }
  .ai-composer { padding: 12px 14px 14px; }
  .ai-bubble { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active, .ai-send:active, .ai-site-switch a:active, .aw-nav-item:active, .ai-suggestion:active, .ai-followup:active { transform: none; }
}

/* 工作台首屏标题：面包屑之外给页面一个清楚的主标题 */
.console .ai-workbench-page .page-head { align-items: flex-end; margin-bottom: 14px; }
.console .ai-workbench-page .page-head h1 {
  position: static !important; width: auto !important; height: auto !important;
  clip: auto !important; overflow: visible !important; margin: 0 !important;
  padding: 0 !important; border: 0 !important; white-space: normal !important;
  font-family: var(--font-display); font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 600; line-height: 1.08; letter-spacing: -.035em; color: var(--ink);
}
.console .ai-workbench-page .page-head .sub {
  margin-top: 7px; max-width: 62ch; color: var(--muted); font-size: 14px; line-height: 1.55;
}
.ai-workbench-page .ai-site-switch { margin-bottom: 16px; }
.ai-workbench-page .aw-nav-sessions-head { font-size: 12px; letter-spacing: .01em; }
.ai-workbench-page .aw-session-title { font-size: 12.5px; line-height: 1.35; }
.ai-workbench-page .aw-session-foot { font-size: 11px; }
@media (max-width: 640px) {
  .cookie-bar { width: calc(100% - 20px); padding: 11px 12px; font-size: 12.5px; }
  .console .ai-workbench-page .page-head h1 { font-size: 27px; }
  .console .ai-workbench-page .page-head .sub { font-size: 13px; }
}

/* 移动端把工作台功能导航收成一行可横滑的标签，避免两列大格子把对话挤到首屏之外 */
@media (max-width: 760px) {
  .aw-nav { padding: 0; }
  .aw-nav-brand { display: none; }
  .aw-nav-list {
    display: flex; gap: 6px; padding: 2px 0 6px; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .aw-nav-list::-webkit-scrollbar { display: none; }
  .aw-nav-item {
    flex: 0 0 auto; flex-direction: row; width: auto; min-height: 38px;
    padding: 0 12px; border-radius: 999px; background: #eef2f7;
    gap: 6px; font-size: 12.5px; white-space: nowrap;
  }
  .aw-nav-item > span:nth-child(2) { flex: none; }
  .aw-nav-item > svg { width: 14px; height: 14px; }
  .aw-nav-item[aria-selected="true"] { background: var(--ink); color: #fff; box-shadow: none; }
  .aw-nav-sessions { margin-top: 10px; padding-top: 10px; }
}

/* 会话任务：桌面始终展开，手机默认收起，避免把对话挤到首屏之外 */
.aw-sessions-collapse > summary { list-style: none; cursor: pointer; }
.aw-sessions-collapse > summary::-webkit-details-marker { display: none; }
.aw-sessions-collapse > summary::after {
  content: ""; width: 7px; height: 7px; margin-left: auto;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); opacity: .55; transition: transform .16s ease-out;
}
.aw-sessions-collapse[open] > summary::after { transform: rotate(225deg); }
@media (min-width: 761px) {
  .aw-sessions-collapse > summary { cursor: pointer; }
  .aw-sessions-collapse > summary::after { display: block; }
}

/* 工作台两栏的 grid 子项必须允许收缩，否则长会话标题会把对话区撑出 390px */
.ai-workbench-nav > * { min-width: 0; }
.ai-workbench-nav .aw-nav { min-width: 0; width: 100%; }
.ai-workbench-nav .aw-nav-sessions, .ai-workbench-nav .aw-sessions-collapse { min-width: 0; }


/* 固定 Cookie 条出现时给页脚留出安全距离，避免遮住政策链接和版权行 */
body.has-cookie .shop-foot-inner { padding-bottom: max(132px, calc(96px + env(safe-area-inset-bottom))); }
body.has-cookie .dtc-foot-bottom { padding-bottom: max(120px, calc(84px + env(safe-area-inset-bottom))); }
@media (max-width: 640px) {
  body.has-cookie .shop-foot-inner { padding-bottom: max(150px, calc(112px + env(safe-area-inset-bottom))); }
  body.has-cookie .dtc-foot-bottom { padding-bottom: max(140px, calc(104px + env(safe-area-inset-bottom))); }
}

/* === 公共模块：跑马灯 marquee ===
   纯 CSS 连续横向滚动；列表复制一份实现无缝循环，悬停暂停，减少动态效果时静止。 */
.mod-marquee { margin: 24px 0; overflow: hidden; }
.mod-marquee .section-head { margin: 0 0 10px; }
.mod-marquee-viewport { overflow: hidden; }
.mod-marquee-track {
  display: flex; width: max-content; gap: 14px;
  animation: mod-marquee-scroll var(--marquee-speed, 30s) linear infinite;
}
.mod-marquee-track:hover { animation-play-state: paused; }
.mod-marquee-item { flex: 0 0 clamp(180px, 24vw, 320px); margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--panel-soft); }
.mod-marquee-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@keyframes mod-marquee-scroll { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 7px)); } }
@media (prefers-reduced-motion: reduce) { .mod-marquee-track { animation: none; overflow-x: auto; } }

/* === 首屏 cover：真实图片铺满，文案叠在深色遮罩上 === */
.hero-cover { position: relative; min-height: clamp(420px, 58vw, 620px); display: grid; align-items: center; overflow: hidden; padding: 0; background: var(--navy); }
.hero-cover-media { position: absolute; inset: 0; }
.hero-cover-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-cover-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(20 6 6 / 88%) 0%, rgb(20 6 6 / 58%) 48%, rgb(20 6 6 / 18%) 100%); }
.hero-cover-content { position: relative; z-index: 1; width: min(1180px, calc(100% - 40px)); margin: 0 auto; color: #f6e6c8; }
.hero-cover h1 { color: inherit; font-size: clamp(2.4rem, 5vw, 4.6rem); letter-spacing: -.03em; }
.hero-cover p { color: rgb(246 230 200 / 82%); }
.hero-cover .btn { border-color: rgb(246 230 200 / 38%); color: #f6e6c8; background: rgb(20 6 6 / 20%); }
.hero-cover .btn-primary { background: #7a1f1f; border-color: #7a1f1f; color: #fff; }
@media (max-width: 640px) { .hero-cover { min-height: 440px; } .hero-cover-content { width: calc(100% - 32px); } }

/* 区块自带文字色时，片段里显式写死的标题/正文色要让位给区块主题 */
.mod-shell[data-custom-text] :where(h1, h2, h3, h4, p, .prose, .section-head, .home-rich) { color: inherit; }
.mod-shell[data-custom-text] .prose { color: inherit; }

/* 移动端品牌名不截断；Cookie 条收紧为一行操作，减少遮挡 */
@media (max-width: 640px) {
  .shop-brand { max-width: 58vw; font-size: 19px; }
  .cookie-bar { flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; }
  .cookie-bar span { flex: 1 1 auto; min-width: 0; font-size: 12px; line-height: 1.45; }
  .cookie-bar .btn { width: auto; flex: 0 0 auto; min-height: 36px; padding: 0 12px; white-space: nowrap; }
}
.mod-marquee-item { display: block; flex: 0 0 clamp(180px, 24vw, 320px); margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--panel-soft); }

/* === 页头品牌栏颜色覆盖 ===
   默认保持白底；设计令牌设置 --header-bg / --header-ink 时，品牌、导航和工具一起换色。 */
.shop-head { background: var(--header-bg, #fff); border-bottom-color: var(--header-line, var(--line)); }
.shop-brand { color: var(--header-ink, var(--ink)); }
.shop-nav a { color: var(--header-muted, var(--ink-2)); }
.shop-nav a:hover { background: color-mix(in srgb, var(--header-ink, var(--ink)) 8%, transparent); color: var(--header-ink, var(--ink)); }
.shop-nav a[aria-current="page"] { color: var(--header-ink, var(--ink)); }
.shop-account { color: var(--header-ink, var(--ink)); }
.shop-head .shop-tools select,
.shop-head .lang-menu > summary { background-color: var(--header-bg, #fff); color: var(--header-ink, var(--ink)); border-color: color-mix(in srgb, var(--header-ink, var(--ink)) 24%, transparent); }

/* 手机端导航改为换行而不是横向隐藏，所有品类入口都能直接看到 */
@media (max-width: 640px) {
  .shop-nav { flex-wrap: wrap; overflow: visible; row-gap: 0; }
  .shop-nav a { padding: 7px 8px; font-size: 13px; }
}

/* === 版心统一：区块背景铺满视口，内容仍对齐 1180px ===
   解决深色首屏/跑马灯/品牌区被 .shop-main 的 max-width 裁成窄盒、
   与全宽页头形成白色边条的问题。 */
.shop-main { max-width: none; padding: 28px 0 72px; }
.shop-main > .mod-shell { width: 100%; }
.shop-main > .mod-shell > * { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; box-sizing: border-box; }
.shop-main > :not(.mod-shell) { max-width: 1180px; margin-inline: auto; padding-inline: 20px; box-sizing: border-box; }
.shop-main > .mod-shell > .hero-cover { max-width: none; padding-inline: 0; }
.shop-main > .mod-shell > .hero-cover .hero-cover-content { max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
.shop-main:has(> .mod-shell > .hero-cover) { padding-top: 0; }
.shop-main > .mod-shell > .mod-marquee { max-width: 1180px; padding-inline: 20px; }
.shop-main > .mod-shell > .mod-marquee .mod-marquee-track { margin-inline: 0; }
@media (max-width: 640px) {
  .shop-main { padding-bottom: 56px; }
  .shop-main > .mod-shell > *,
  .shop-main > :not(.mod-shell) { padding-inline: 16px; }
  .shop-main > .mod-shell > .hero-cover { padding-inline: 0; }
  .shop-main > .mod-shell > .mod-marquee { padding-inline: 16px; }
}

/* === 页脚：品牌块 + 政策/版权区，背景与页头同源可覆盖 === */
.shop-foot {
  border-top: 1px solid var(--footer-line, var(--line));
  background: var(--footer-bg, var(--panel-soft));
  color: var(--footer-text, var(--muted));
}
.shop-foot-inner {
  max-width: 1180px; margin: 0 auto; padding: 44px 20px max(48px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: minmax(220px, .85fr) minmax(0, 1.65fr);
  gap: 40px; align-items: start; font-size: 13px;
}
.shop-foot-brand a {
  display: inline-block; color: var(--footer-text, var(--ink));
  font-family: var(--font-display); font-size: 25px; font-weight: 600;
  letter-spacing: .01em; line-height: 1.2;
}
.shop-foot-brand a:hover { text-decoration: none; opacity: .86; }
.shop-foot-brand p { max-width: 32ch; margin: 10px 0 0; color: var(--footer-text, var(--muted)); font-size: 12.5px; line-height: 1.6; }
.shop-foot-region { display: grid; gap: 18px; min-width: 0; }
.shop-foot .mod-policy-links { display: flex; flex-wrap: wrap; gap: 7px 18px; }
.shop-foot a { margin-right: 0; color: var(--footer-text, var(--ink-2)); min-height: 28px; }
.shop-foot a:hover { color: var(--footer-text, var(--ink)); text-decoration: underline; text-underline-offset: 3px; }
.shop-foot .mod-copyright { color: var(--footer-text, var(--muted)); font-size: 12px; }
.shop-foot-note { padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--footer-text, var(--muted)) 18%, transparent); color: var(--footer-text, var(--muted)); font-size: 11.5px; opacity: .82; }
@media (max-width: 640px) {
  .shop-foot-inner { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .shop-foot-brand a { font-size: 22px; }
  .shop-foot-brand p { max-width: 46ch; }
}
.shop-foot .mod-payment-icons { display: flex; align-items: center; gap: 8px; color: var(--footer-text, var(--muted)); }
.shop-foot .mod-payment-icons .icon { width: 42px; height: 28px; padding: 5px 7px; border: 1px solid color-mix(in srgb, var(--footer-text, var(--muted)) 28%, transparent); border-radius: 6px; box-sizing: border-box; }
.grid-products { margin: 0; padding: 0; list-style: none; }

/* 页头底部分隔线跟随页头主题：浅色页头是浅灰，深色页头不再出现刺明白线 */
.shop-head { border-bottom-color: var(--header-line, color-mix(in srgb, var(--header-ink, var(--ink)) 22%, var(--header-bg, #fff))); }

/* 深色内容区与页脚之间保留呼吸空间，并用低对比金色分隔，不再出现刺眼白线 */
.shop-foot {
  border-top-color: color-mix(in srgb, var(--footer-text, var(--muted)) 22%, transparent);
}
.shop-foot-inner { padding-top: 58px; }

/* 结算表单与深色页脚之间保留独立留白；Cookie 条在场时也不贴边 */
.checkout-grid { margin-bottom: 56px; }
@media (max-width: 640px) { .checkout-grid { margin-bottom: 44px; } }

/* 所有内容页在 Cookie 条存在时也保留统一的底部留白；
   首页深色首屏与深色页脚连续，不插入白色断层。 */
body.has-cookie .shop-main { padding-bottom: 56px; }
body.has-cookie .shop-main:has(> .mod-shell > .hero-cover) { padding-bottom: 0; }
.checkout-grid { margin-bottom: 0; }
@media (max-width: 640px) {
  body.has-cookie .shop-main { padding-bottom: 44px; }
  body.has-cookie .shop-main:has(> .mod-shell > .hero-cover) { padding-bottom: 0; }
  .checkout-grid { margin-bottom: 0; }
}

/* 跑马灯：两组同宽轨道 + 固定卡片尺寸，避免图片加载时轨道宽度变化导致闪烁 */
.mod-marquee-track { gap: 0; will-change: transform; transform: translate3d(0, 0, 0); backface-visibility: hidden; }
.mod-marquee-group { display: flex; flex: 0 0 auto; gap: 14px; padding-inline-end: 14px; }
.mod-marquee-item { flex: 0 0 clamp(180px, 24vw, 320px); width: clamp(180px, 24vw, 320px); aspect-ratio: 4 / 3; }
.mod-marquee-item img { width: 100%; height: 100%; display: block; object-fit: cover; }
@keyframes mod-marquee-scroll { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }

/* === 商品评价 === */
.product-reviews { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 28px; }
.reviews-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.reviews-heading h2 { font-family: var(--font-display); font-size: 28px; margin: 0; }
.reviews-overview { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; padding: 24px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.reviews-score { display: flex; align-items: baseline; gap: 6px; padding-right: 26px; border-right: 1px solid var(--line); }
.reviews-score strong { font-family: var(--font-display); font-size: 58px; font-weight: 500; line-height: .9; letter-spacing: -.04em; }
.reviews-score span { color: var(--muted); font-size: 13px; }
.reviews-overview-main { display: grid; align-content: center; gap: 14px; min-width: 0; }
.reviews-stars-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.review-stars { --rating: 0; position: relative; display: inline-block; color: var(--line-strong); font-size: 14px; letter-spacing: 1.5px; line-height: 1; white-space: nowrap; vertical-align: middle; }
.review-stars::before { content: "★★★★★"; }
.review-stars::after { content: "★★★★★"; position: absolute; inset: 0; width: calc(var(--rating) * 20%); overflow: hidden; color: var(--accent); white-space: nowrap; }
.review-stars--lg { font-size: 19px; letter-spacing: 2px; }
.reviews-count { color: var(--muted); font-size: 13px; }
.reviews-distribution { display: grid; gap: 6px; max-width: 420px; }
.review-dist-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) 26px; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.review-dist-label, .review-dist-count { font-variant-numeric: tabular-nums; }
.review-dist-count { text-align: right; }
.review-dist-track { display: block; height: 6px; overflow: hidden; border-radius: 999px; background: var(--panel-soft); }
.review-dist-track > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.reviews-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 38px 20px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--panel) 0%, color-mix(in srgb, var(--accent) 7%, var(--panel)) 100%); text-align: center; }
.reviews-empty-stars { color: var(--line-strong); font-size: 18px; letter-spacing: 4px; line-height: 1; }
.reviews-empty-title { margin: 2px 0 8px; color: var(--ink-2); font-family: var(--font-display); font-size: 19px; }
.reviews-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.review-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.review-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.review-card-author { display: grid; gap: 2px; min-width: 0; }
.review-card-author strong { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.review-card-author time { color: var(--muted); font-size: 11px; }
.review-card-rating { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.review-rating-number { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.review-rating-number span { font-size: 10px; }
.review-comment { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.review-photos { display: flex; flex-wrap: wrap; gap: 7px; }
.review-photo { display: block; width: 76px; height: 76px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); }
.review-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.review-photo:hover img { transform: scale(1.04); }
.review-write { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.review-write-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; color: var(--ink); font-weight: 700; cursor: pointer; list-style: none; }
.review-write-summary::-webkit-details-marker { display: none; }
.review-write-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-size: 22px; font-weight: 300; line-height: 1; transition: transform .2s ease; }
.review-write[open] .review-write-icon { transform: rotate(45deg); }
.review-form { padding: 20px 22px 22px; border-top: 1px solid var(--line); }
.review-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.review-form .field { margin-bottom: 14px; }
.review-rating-field { grid-column: 1 / -1; min-width: 0; margin: 0 0 14px; padding: 0; border: 0; }
.review-rating-field legend { margin-bottom: 8px; color: var(--ink-2); font-size: 13px; font-weight: 650; }
.review-rating-options { display: flex; flex-wrap: wrap; gap: 7px; }
.review-rating-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.review-rating-options label { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 48px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--muted); font-size: 17px; cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease; }
.review-rating-options label:hover { border-color: var(--line-strong); color: var(--ink-2); }
.review-rating-options label:active { transform: scale(.97); }
.review-rating-options input:checked + label { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); color: var(--accent-strong); }
.review-rating-options input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.review-rating-label { font-size: 11px; font-variant-numeric: tabular-nums; }
.review-comment-field { grid-column: 1 / -1; }
.review-form-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-form-foot .btn { min-width: 120px; }
@media (max-width: 720px) {
  .reviews-heading { align-items: flex-start; }
  .reviews-overview { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .reviews-score { padding: 0 0 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .reviews-score strong { font-size: 46px; }
  .reviews-grid { grid-template-columns: 1fr; }
  .review-form-grid { grid-template-columns: 1fr; }
  .review-form .field, .review-comment-field { grid-column: auto; }
  .review-form-foot .btn { width: 100%; }
  .review-write-summary { padding: 16px 18px; }
  .review-form { padding: 18px; }
}

.reviews-overview--compact { grid-template-columns: 120px minmax(0, 1fr); }
.reviews-overview--compact .reviews-score strong { font-size: 44px; }
.reviews-module-title { grid-column: 1 / -1; margin: 0; color: var(--ink); font-family: var(--font-display); font-size: 20px; }
@media (max-width: 720px) {
  .reviews-overview--compact { grid-template-columns: 1fr; }
  .reviews-overview--compact .reviews-score { padding-bottom: 10px; }
}
