/* 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;
}

* { 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-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; }
[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: 26px 20px max(40px, 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 {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  max-width: 1180px; margin: 12px auto 0; padding: 10px 14px; background: var(--accent-soft);
  border: 1px solid #d6e6ff; border-radius: var(--radius); 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-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: 1fr; }
  .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-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-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-mobile-sites { display: none; }
@media (max-width: 1100px) {
  .ai-mobile-sites {
    display: flex; gap: 6px; margin: 0 0 10px; padding-bottom: 2px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .ai-mobile-sites::-webkit-scrollbar { display: none; }
  .ai-mobile-sites 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-mobile-sites a.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
  .ai-mobile-sites a:hover { text-decoration: none; border-color: var(--line-strong); }
  .ai-mobile-sites 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); }
.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: 10px;
  margin: auto 0; padding: 22px 8px 8px; text-align: center;
}
.ai-empty-icon {
  display: flex; align-items: center; justify-content: center; width: 56px; height: 56px;
  border: 1px solid #cfe1fb; border-radius: 16px; color: var(--accent-strong);
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .10);
}
.ai-empty-icon svg { width: 26px; height: 26px; }
.ai-empty h2 { margin: 2px 0 0; font-size: 18px; }
.ai-empty p { max-width: 52ch; margin: 0; color: var(--muted); font-size: 13px; }
.ai-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: min(580px, 100%); margin-top: 12px; }
.ai-suggestion {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.ai-suggestion:hover { border-color: #b9ccf2; background: #fdfefe; }
.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; }
.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-note { margin-top: 8px; color: var(--muted); font-size: 11px; }
.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; }
#merchantHistory, #platformHistory { scroll-margin-top: 80px; }
#merchantHistory:target .ai-side-card, #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-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; }
}

/* === 控制台侧边栏分组与图标 === */
.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; }
