/* ==========================================================================
   ECU Shop 全局样式（店面 + admin 共用；编辑器另见 editor.css）
   结构：:root tokens → 通用工具类 → admin 功能块（customer-usage/editor-ACL/…）
         → 全局基础（body/header/nav/.btn/表单/卡片）→ 店面各页 → account/order
         → footer/legal/contact → admin 表格/邮件/访问 → 响应式断点
           （统一 520 / 640 / 760 / 900 / 1180 五档 + 1024 logo 特例）
         → 首页 hero/value → SEO 目录页 → toast/动效偏好
   ========================================================================== */
:root {
  /* 暗色主题（默认） */
  --bg: #0f1115; --panel: #1a1e26; --line: #2a2f3a; --text: #e7e9ee;
  --muted: #9aa3b2; --brand: #612fff; --brand2: #8a63ff; --ok: #3ecf8e; --err: #ff6b6b;
  /* 别名：历史规则引用了这组变量名，保持可用 */
  --border: var(--line); --card: var(--panel); --accent: var(--brand); --accent-2: var(--brand2);
  /* 尺寸 token */
  --radius-card: 14px; --radius-btn: 9px; --radius-input: 8px;
  /* 层级 token（值取自令牌化之前的暗色配色：输入框 #0c0e13、弹层 #11141c 等） */
  --input-bg: #0c0e13;
  --text-2: #c7ccd6;
  --panel-2: #151922;
  --panel-3: #11141c;
  --deep: #080a0f;
  --shadow-card: 0 10px 30px rgba(0,0,0,.28);
  --shadow-color: rgba(0,0,0,.55);
  --dialog-radius: 18px; --dialog-overlay: rgba(7,10,18,.65);
  --dialog-shadow: 0 24px 80px rgba(0,0,0,.42); --warning: #e4b224;
  color-scheme: dark;
}
/* 亮色主题 */
html[data-theme="light"] {
  --bg: #f3f5f9; --panel: #fbfcfe; --line: #dde2ea; --text: #1b2230;
  --muted: #5d6b7f; --brand: #5a2be0; --brand2: #6f46e8; --ok: #159957; --err: #d64545;
  --input-bg: #eef1f6;
  --text-2: #3d4757;
  --panel-2: #eceff4;
  --panel-3: #f6f8fb;
  --deep: #e4e8ef;
  --shadow-card: 0 10px 26px rgba(27,34,48,.10);
  --shadow-color: rgba(27,34,48,.26);
  --dialog-overlay: rgba(27,34,48,.38);
  --dialog-shadow: 0 24px 80px rgba(27,34,48,.22); --warning: #8a6400;
  color-scheme: light;
}

/* 亮色主题下的半透明元素修正（深色用的白色半透明在亮底上不可见或太弱） */
html[data-theme="light"] .btn.ghost { background: rgba(27,34,48,.045); }
html[data-theme="light"] .btn.ghost:hover { background: rgba(90,43,224,.09); }
html[data-theme="light"] .skeleton { background: rgba(27,34,48,.09); }
html[data-theme="light"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); }
html[data-theme="light"] .card { background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 30%), var(--panel); }
html[data-theme="light"] .seo-admin-score,
html[data-theme="light"] .seo-admin-serp article { background: rgba(27,34,48,.035); border-color: var(--line); }
html[data-theme="light"] .notice { color: #8a6d00; background: rgba(255,193,7,.12); border-color: rgba(217,158,7,.35); }
html[data-theme="light"] .debug-notice-banner { color: #8a6d00; }
html[data-theme="light"] .status.warn { color: #8a6d00; }
html[data-theme="light"] .a2l-quarantine-help strong,
html[data-theme="light"] .a2l-state.is-quarantine { color: #8a6d00; }
html[data-theme="light"] .custom-workflow-step.complete { color: var(--ok); }
html[data-theme="light"] .seo-eyebrow { color: var(--brand); }
html[data-theme="light"] .site-select-menu { background: var(--panel); }
html[data-theme="light"] .category-menu-item:hover, html[data-theme="light"] .category-menu-item.active { background: rgba(90,43,224,.1); }
html[data-theme="light"] .category-menu { box-shadow: 0 18px 50px rgba(27,34,48,.16); }
html[data-theme="light"] .admin-action-item:hover, html[data-theme="light"] .admin-stat-card:hover { background: rgba(90,43,224,.06); }
html[data-theme="light"] .site-select-option:hover, html[data-theme="light"] .site-select-option:focus-visible { background: rgba(90,43,224,.08); }
html[data-theme="light"] .site-select-option.active { background: rgba(90,43,224,.13); }
html[data-theme="light"] .file-upload-surface:hover, html[data-theme="light"] .file-upload-control.dragging .file-upload-surface { background: rgba(90,43,224,.05); }
/* SEO 目录页的半透明深色区块在亮主题下改为实心亮面板 */
html[data-theme="light"] .seo-hero,
html[data-theme="light"] .seo-a2l-search { background: var(--panel); }

/* 通用工具类 */
.sr-only { 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; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.maxw-640 { max-width: 640px; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 300; padding: 9px 16px;
  border-radius: var(--radius-btn); background: var(--brand); color: #fff; text-decoration: none;
  font-size: 14px; transition: top .15s ease; }
.skip-link:focus-visible { top: 12px; outline: 2px solid var(--brand2); outline-offset: 2px; }

/* 客户使用记录 */
.customer-usage-view { margin-top: 12px; }
.customer-usage-filter-card { margin-bottom: 12px; }
.customer-usage-filter-card .admin-section-head h3 { margin: 0 0 4px; }
.customer-usage-filter-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 12px; align-items: end; margin-top: 16px;
}
.customer-usage-filter-grid > div { min-width: 0; }
.customer-usage-filter-grid label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.customer-usage-filter-grid input,
.customer-usage-filter-grid select { width: 100%; height: 38px; }
.customer-usage-query { height: 38px; }
.customer-usage-tabs { margin: 0 0 12px; }
.customer-usage-card { padding: 0; overflow: hidden; }
.customer-usage-card .table-wrap { overflow: auto; }
.customer-usage-table { width: 100%; min-width: 880px; margin: 0; }
.customer-usage-table th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.customer-usage-table td { vertical-align: middle; }
.customer-usage-table .usage-time,
.customer-usage-table .usage-ip { white-space: nowrap; color: var(--muted); }
.customer-usage-table .usage-email { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.customer-usage-table .usage-channel { min-width: 6.5em; white-space: nowrap; }
.shared-order-choices { display:flex; flex-wrap:wrap; gap:.45rem; margin:.5rem 0; }
.shared-order-choices label { display:inline-flex; align-items:center; gap:.4rem; padding:.35rem .75rem; border:1px solid var(--border); border-radius:6px; cursor:pointer; }
.shared-order-choices label:has(:checked) { border-color:var(--accent); background:var(--panel-2); }
.shared-order-choices input { width:1rem; height:1rem; margin:0; }
.shared-account-orders,.wo-import-fields { margin:.8rem 0; }
.wo-editor-grid,.wo-import-fields,.wo-usage-filters { display:grid; gap:.7rem; align-items:end; }
.wo-editor-grid,.wo-import-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
.wo-import-fields { grid-template-columns:repeat(2,minmax(0,1fr)) auto; }
.wo-editor-grid.wo-rules { grid-template-columns:repeat(3,minmax(0,1fr)); }
.wo-editor-grid label,.wo-import-fields label,.wo-usage-filters label { display:grid; gap:.3rem; min-width:0; }
.shared-orders-admin .editor-access-fieldset { min-width:0; }
.shared-orders-admin .grant-bulk { margin:.8rem 0; }
.wo-usage-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
.wo-usage-filters .btn { justify-self:end; }
.wo-usage-list { display:grid; gap:.3rem; }
.wo-scope-layout { display:grid; grid-template-columns:minmax(250px,.85fr) minmax(0,1.25fr); gap:1.15rem; margin:1.1rem 0; }
.wo-scope-layout section { min-width:0; }
.wo-scope-layout h4 { margin:0 0 .45rem; }
.wo-library-pane { border-right:1px solid var(--line); padding-right:1rem; }
.wo-scope-layout .grant-library-filter,.wo-scope-layout .grant-library-tools,.wo-methods { margin:.5rem 0; }
.wo-scope-layout .grant-library-filter { display:grid; grid-template-columns:minmax(0,1fr) minmax(6.5rem,35%); gap:.45rem; }
.wo-scope-layout .grant-library-filter :is(input,select) { width:100%; min-width:0; }
#edOrderPicker { margin-top: 14px; }
#edOrderPicker .grant-library-filter { display: flex; }
.wo-scope-layout .grant-template-list { height:15rem; overflow:auto; scrollbar-gutter:stable; }
.wo-scope-layout #edOrderTargets { height:10rem; }
.wo-scope-layout .wo-rules { grid-template-columns:repeat(2,minmax(0,1fr)); }
.wo-scope-layout .wo-rules label:last-child { grid-column:1/-1; }
.wo-methods { display:flex; flex-wrap:wrap; gap:.4rem; }
@media(max-width:820px) {
  .wo-scope-layout { grid-template-columns:1fr; }
  .wo-library-pane { border-right:0; padding:0 0 .6rem; border-bottom:1px solid var(--line); }
}
.wo-usage-list summary { cursor:pointer; }
.wo-account-detail { padding:.25rem .65rem .65rem; overflow:auto; }
@media (max-width: 680px) {
  .wo-editor-grid,.wo-editor-grid.wo-rules,.wo-import-fields,.wo-usage-filters { grid-template-columns:1fr; }
}
.customer-usage-action {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--brand) 46%, var(--line)); border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand2);
  font-size: 11px; white-space: nowrap;
}
.customer-usage-action.action-export_bin,
.customer-usage-action.action-export_csv,
.customer-usage-action.action-file_download {
  border-color: color-mix(in srgb, var(--ok) 46%, var(--line));
  background: color-mix(in srgb, var(--ok) 11%, transparent); color: var(--ok);
}
.customer-usage-pagination {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 14px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 88%, var(--bg));
}
.customer-usage-risk-note { margin: 14px; }
.customer-usage-export-count { display: block; color: var(--text); font-size: 17px; }
.customer-usage-export-count + small { display: block; margin-top: 2px; color: var(--muted); white-space: nowrap; }
.customer-usage-export-count.is-high { color: var(--err); }
.customer-usage-risk {
  display: inline-flex; padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); font-size: 11px;
}
.customer-usage-risk.is-high {
  background: color-mix(in srgb, var(--err) 16%, transparent); color: var(--err); font-weight: 700;
}
.customer-usage-risk-row { background: color-mix(in srgb, var(--err) 7%, transparent); }

@media (max-width: 1180px) {
  .customer-usage-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-usage-query { width: 100%; }
}

@media (max-width: 640px) {
  .customer-usage-filter-grid { grid-template-columns: 1fr; }
  .customer-usage-filter-card .admin-section-head { align-items: stretch; flex-direction: column; }
  .customer-usage-filter-card .admin-section-head .btn { width: 100%; }
  .customer-usage-pagination { justify-content: space-between; }
}

/* Editor access, quotas and family ACL */
.editor-access-view { display: grid; gap: 12px; }
.editor-access-scope-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.editor-access-scope-tabs .tab { min-width: 0; min-height: 44px; justify-content: center; border-radius: 8px; text-align: center; }
.editor-access-scope-panel { min-width: 0; display: grid; gap: 12px; }
.editor-access-scope-summary {
  margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-input);
  background: var(--panel-3); color: var(--text); font-size: 13px; font-weight: 650;
}
.editor-access-view .admin-section-head h3 { margin: 0 0 4px; }
.editor-access-fieldset {
  min-width: 0; margin: 14px 0; padding: 0; border: 0;
}
.editor-access-fieldset legend,
.editor-family-picker-label {
  display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px;
}
.editor-access-mode-options { display: flex; flex-wrap: wrap; gap: 8px; }
.editor-access-mode-options label,
.editor-family-check-grid label {
  display: inline-flex; align-items: center; gap: 7px; margin: 0; cursor: pointer;
}
.editor-access-mode-options label {
  min-height: 36px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 80%, var(--bg)); color: var(--text);
}
.editor-access-mode-options label:has(input:checked) {
  border-color: color-mix(in srgb, var(--brand) 70%, var(--line));
  background: color-mix(in srgb, var(--brand) 15%, var(--panel));
}
.editor-access-mode-options input,
.editor-family-check-grid input { width: auto; margin: 0; accent-color: var(--brand2); }
.editor-access-wide { margin: 14px 0; }
.editor-access-wide label,
.editor-quota-grid label,
.editor-acl-email-row label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.editor-access-wide textarea { width: 100%; resize: vertical; }
.editor-quota-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin: 14px 0;
}
.editor-quota-grid input,
.editor-acl-email-row input { width: 100%; height: 38px; }
.editor-access-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.editor-access-actions .editor-access-account-target { flex-basis: 100%; margin: 0; color: var(--text); font-weight: 650; overflow-wrap: anywhere; }
.editor-user-selector { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.4fr) auto; gap: 12px; align-items: end; margin: 18px 0; }
.editor-user-selector > div { min-width: 0; }
.editor-user-selector label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.editor-user-selector input, .editor-user-selector select { width: 100%; min-height: 42px; }
.editor-user-selector .btn { min-height: 42px; }
.editor-user-quota-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin: 18px 0 8px; }
.editor-user-quota-control { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.editor-user-quota-toggle { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.editor-user-quota-toggle input { flex: none; width: auto; margin: .16em 0 0; accent-color: var(--brand); }
.editor-user-quota-control input[type="number"] { width: 100%; min-height: 42px; }
.editor-user-quota-control .meta { margin: 0; }
@supports (grid-template-rows: subgrid) {
  .editor-quota-grid > div, .editor-user-quota-grid > .editor-user-quota-control {
    display: grid; grid-row: span 3; grid-template-rows: subgrid; min-width: 0; align-items: start;
  }
  .editor-quota-grid > div > label { margin-bottom: 0; }
  .editor-quota-grid > div > .meta { margin: 0; }
}
.editor-user-family-section { margin-top: 18px; }
.editor-user-summary { padding: 14px 16px; margin: 14px 0; border: 1px solid var(--line); border-radius: var(--radius-input); background: var(--panel-3); color: var(--text-2); font-size: 14px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.editor-user-summary[hidden] { display: none; }
.editor-user-overrides-section { margin-top: 20px; }
#editorUserControls:disabled { opacity: .65; }
.editor-acl-section { padding-top: 16px; border-top: 1px solid var(--line); }
.editor-acl-section:first-of-type { padding-top: 4px; border-top: 0; }
.editor-acl-section + .editor-acl-section { margin-top: 18px; }
.editor-acl-section h4 { margin: 0 0 10px; }
.editor-family-picker { margin-top: 12px; }
.editor-family-picker[hidden] { display: none; }
.editor-family-check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px;
}
.editor-family-check-grid label {
  min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
  background: color-mix(in srgb, var(--panel) 72%, var(--bg)); color: var(--text); font-size: 13px;
}
.editor-family-check-grid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-acl-email-row { max-width: 520px; margin-bottom: 12px; }
.editor-acl-overrides { display: grid; gap: 7px; }
.editor-acl-override {
  display: grid; grid-template-columns: minmax(220px, .8fr) minmax(240px, 1.5fr) auto;
  gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 76%, var(--bg));
}
.editor-acl-override-email { overflow: hidden; font-weight: 650; text-overflow: ellipsis; }
.editor-acl-override-families { color: var(--muted); font-size: 12px; }
.customer-usage-action.action-blocked {
  border-color: color-mix(in srgb, var(--err) 55%, var(--line));
  background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err);
}

@media (761px <= width <= 1100px) {
  .editor-quota-grid, .editor-user-quota-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .editor-quota-grid { grid-template-columns: 1fr; }
  .editor-user-selector { grid-template-columns: 1fr; }
  .editor-user-quota-grid { grid-template-columns: 1fr; }
  .editor-user-quota-control input[type="number"] { width: 100%; }
  .editor-acl-override { grid-template-columns: 1fr; }
  .editor-acl-override .btn { width: 100%; }
}

/* Editor operations dashboard */
.editor-dashboard-view { display: grid; gap: 12px; margin-top: 12px; }
.editor-dashboard-head h3 { margin: 0 0 4px; }
.editor-dashboard-range { flex: 0 0 auto; display: flex; align-items: end; gap: 8px; }
.editor-dashboard-range label { flex: 0 0 auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.editor-dashboard-range select { min-width: 120px; height: 36px; }
.editor-dashboard-range .site-select { flex: 0 0 180px; width: 180px; min-width: 180px; height: 36px; }
.editor-dashboard-range .site-select-trigger { min-height: 36px; justify-content: space-between; gap: 10px; padding-inline: 11px; }
.editor-dashboard-range .site-select-value { min-width: 0; flex: 1; overflow: visible; text-overflow: clip; white-space: nowrap; }
.editor-dashboard-range .btn { height: 36px; margin: 0; }
.editor-dashboard-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.editor-dashboard-cards .card { min-height: 112px; display: flex; flex-direction: column; justify-content: center; }
.editor-dashboard-cards span { color: var(--muted); font-size: 12px; }
.editor-dashboard-cards strong { margin-top: 7px; color: var(--text); font-size: 29px; font-variant-numeric: tabular-nums; }
.editor-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 12px; }
.dashboard-chart-card h4 { margin: 0 0 14px; color: var(--text); }
.dashboard-trend { min-height: 220px; overflow: hidden; }
.dashboard-trend svg { width: 100%; height: 220px; overflow: visible; }
.dashboard-axis { fill: none; stroke: var(--line); stroke-width: 1; }
.dashboard-trend-line { fill: none; stroke: var(--brand2); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.dashboard-trend-point { fill: var(--ok); stroke: var(--panel); stroke-width: 2; }
.dashboard-axis-label { fill: var(--muted); font-size: 10px; text-anchor: middle; }
.dashboard-bar-list, .dashboard-quota-list { display: grid; gap: 10px; }
.dashboard-bar-row > div { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.dashboard-bar-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.dashboard-bar-row strong { color: var(--muted); font-variant-numeric: tabular-nums; }
.dashboard-bar-row > i, .dashboard-quota-row > div { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: var(--line); }
.dashboard-bar-row > i::before, .dashboard-quota-row > div i { content: ''; display: block; width: var(--bar); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand2)); }
.dashboard-quota-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(160px, 1fr) minmax(100px, auto); align-items: center; gap: 12px; }
.dashboard-quota-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.dashboard-quota-row > strong { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dashboard-quota-row.is-exceeded > strong { color: var(--err); }
.dashboard-quota-row.is-exceeded > div i { background: var(--err); }

@media (max-width: 900px) {
  .editor-dashboard-cards, .editor-dashboard-grid { grid-template-columns: 1fr; }
  .editor-dashboard-range { align-items: stretch; flex-direction: column; }
  .editor-dashboard-range .site-select { flex-basis: auto; width: 100%; min-width: 0; }
  .dashboard-quota-row { grid-template-columns: 1fr; gap: 5px; }
  .dashboard-quota-row > strong { text-align: left; }
}

/* Admin A2L library */
#tab-editor { display: grid; grid-template-columns: 174px minmax(0, 1fr); align-items: start; gap: 16px; }
#tab-editor > [id^="editor-view-"] { grid-area: 1 / 2; min-width: 0; margin-top: 0 !important; }
.admin-editor-nav { position: sticky; top: 70px; display: grid; gap: 16px; padding: 17px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-input); }
#editorNavName { padding-inline: 8px; font-size: 15px; }
.admin-editor-shortcuts { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; }
.admin-editor-shortcuts a { padding: 4px 0; font-size: 13px; text-underline-offset: 3px; }
.editor-channel-grid :is(select, input[type="number"]) { width: 100%; min-width: 0; min-height: 42px; }
.editor-channel-control { display: grid; gap: 6px; }
.editor-channel-grid .meta { margin: 0; }
.grant-policy { margin: 18px 0 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.grant-policy h4, .grant-dialog h3 { margin: 0; }
.grant-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.grant-full-access, .grant-options label { display: flex; align-items: center; gap: 9px; }
.grant-policy input[type=checkbox], .grant-options input[type=checkbox] { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--brand2); }
.grant-rule-set { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-input); }
.grant-rule-set h5 { margin: 0 0 4px; font: inherit; font-weight: 650; overflow-wrap: anywhere; }
.grant-rule-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grant-rule-heading .btn { flex: none; min-height: 28px; padding: 3px 8px; font-size: 12px; }
.grant-rule { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 36px; border-top: 1px solid var(--line); }
.grant-rule > span { overflow-wrap: anywhere; }
.grant-rule button { padding: 4px 8px; min-height: 28px; font-size: 12px; }
.grant-bulk summary { width: fit-content; cursor: pointer; font-size: 13px; color: var(--brand2); }
.grant-bulk label { display: block; margin: 10px 0 5px; }
.grant-bulk textarea { width: 100%; resize: vertical; }
.grant-dialog { width: min(1020px, calc(100vw - 32px)); height: min(740px, calc(100dvh - 32px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px);
  padding: 0; overflow: hidden; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--dialog-radius); box-shadow: var(--dialog-shadow); }
.grant-dialog[open] { display: flex; flex-direction: column; }
.grant-dialog::backdrop { background: var(--dialog-overlay); }
.grant-dialog-head, .grant-dialog-footer { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; }
.grant-dialog-head { border-bottom: 1px solid var(--line); }
.grant-dialog-head h3 { font-size: 20px; line-height: 1.35; }
.grant-dialog .meta { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.grant-dialog-head .meta { margin-top: 3px; overflow-wrap: anywhere; }
.grant-close { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 1px solid var(--line);
  border-radius: var(--radius-btn); background: var(--panel); color: var(--text-2); font-size: 23px; line-height: 1; cursor: pointer; }
.grant-close:hover { background: var(--panel-2); }
.grant-dialog :is(button, summary, input[type="radio"], input[type="checkbox"]):focus-visible { outline: 2px solid var(--brand2); outline-offset: 2px; }
.grant-dialog-footer { border-top: 1px solid var(--line); }
.grant-footer-summary { min-width: 0; display: grid; gap: 2px; font-size: 13px; }
.grant-footer-summary small { color: var(--muted); font-size: 12px; }
.grant-footer-summary strong:empty { display: none; }
.grant-footer-actions { display: flex; flex: none; gap: 8px; }
.grant-dialog-body { flex: 1 1 0; min-height: 0; overflow: hidden; display: grid; grid-template-columns: minmax(270px, 1fr) minmax(0, 1.35fr); grid-template-rows: minmax(0,1fr); }
.grant-picker-fields, .grant-picker-targets { min-width: 0; padding: 18px 20px 20px; overflow: auto; scrollbar-gutter: stable; overscroll-behavior: contain; }
.grant-picker-fields { background: var(--panel-3); border-inline-end: 1px solid var(--line); }
.grant-picker-targets fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.grant-dialog .grant-section-title { margin: 0; color: var(--text); font-size: 15px; font-weight: 650; }
.grant-field-head, .grant-list-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.grant-field-head { margin-bottom: 8px; }
.grant-template-list { max-height: min(300px, 34dvh); overflow: auto; overscroll-behavior: contain; margin-top: 9px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-input); }
.grant-template-list:empty, .grant-dialog .grant-status:empty, .grant-error:empty, .grant-dialog .grant-options:empty { display: none; }
.grant-template-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0;
  padding: 9px 11px; color: var(--text); font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line); }
.grant-template-row:last-child { border-bottom: 0; }
.grant-template-row:hover { background: var(--panel-3); }
.grant-template-row:has(:checked) { background: color-mix(in srgb, var(--brand) 9%, var(--panel)); box-shadow: inset 3px 0 var(--brand2); }
.grant-template-row span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.grant-template-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.grant-template-row input { flex: none; margin: 0; }
.grant-library-filter, .grant-library-tools { display: flex; align-items: center; gap: 8px; }
.grant-library-filter input { min-width: 0; flex: 1; }
.grant-library-filter .btn { max-width: 45%; min-width: 0; padding: 7px 10px; font-size: 13px; overflow-wrap: anywhere; }
.grant-library-filter .btn::after { content: '▾'; }
.grant-library-filter .btn[aria-expanded="true"]::after { content: '▴'; }
.grant-brands { display: grid; grid-template-columns: repeat(auto-fill,minmax(76px,1fr)); gap: 4px; max-height: 146px; overflow: auto; margin: 7px 0; }
.grant-brands button { min-width: 0; padding: 6px; color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; overflow-wrap: anywhere; }
.grant-brands button[aria-pressed="true"], .grant-text-action[aria-pressed="true"] { color: var(--brand2); border-color: var(--brand2); }
.grant-library-tools { justify-content: space-between; flex-wrap: wrap; margin-top: 10px; }
.grant-library-tools input:indeterminate { background: var(--brand); border-color: var(--brand2); }
.grant-library-tools input:indeterminate::after { left: 3px; top: 7px; width: 9px; height: 0; border: 0; border-top: 2px solid #fff; opacity: 1; transform: none; }
.grant-text-action { padding: 3px 6px; font: inherit; font-size: 12px; color: var(--text-2); background: transparent; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.grant-dialog .grant-replace { display: flex; margin-top: 12px; }
.grant-dialog .grant-replace input { flex: none; }
.grant-method { flex-wrap: wrap; }
.grant-order { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 13px; }
.grant-order label, #edGrantItemLabel, #edGrantPasteLabel { display: block; margin: 0 0 5px; font-size: 13px; font-weight: 600; }
.grant-dialog .grant-status, .grant-dialog .grant-error, #edGrantPasteHint, #edGrantPasteSummary:not(:empty) { margin: 7px 0; }
.grant-dialog .grant-error { color: var(--err); }
.grant-empty-state { min-height: 120px; display: grid; align-items: center; padding: 18px; margin: 12px 0 0;
  border: 1px dashed var(--line); border-radius: var(--radius-input); text-align: center; color: var(--muted); font-size: 14px; }
.grant-current-template { margin: 4px 0 12px; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.grant-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.grant-kinds label { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; margin: 0; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-input); font-size: 13px; color: var(--text-2); cursor: pointer; }
.grant-kinds label:has(:checked) { border-color: var(--brand2); background: color-mix(in srgb, var(--brand) 9%, var(--panel)); color: var(--text); }
.grant-kinds input { margin: 0; }
.grant-method { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin: 12px 0; }
.grant-method button { padding: 6px 1px; border: 0; border-bottom: 2px solid transparent; cursor: pointer; color: var(--muted); background: transparent; font: inherit; font-size: 13px; }
.grant-method button[aria-pressed="true"] { border-bottom-color: var(--brand2); color: var(--brand2); font-weight: 650; }
.grant-page-selection { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 13px; cursor: pointer; }
.grant-page-selection input { width: 17px; height: 17px; margin: 0; }
.grant-list-tools:has(#edGrantPageSelection:not([hidden])) { margin: 9px 0 5px; }
.grant-selection { margin: 8px 0 0; font-size: 12px; }
.grant-selection summary { width: fit-content; color: var(--brand2); cursor: pointer; }
.grant-selection ul { display: flex; flex-wrap: wrap; gap: 5px; max-height: 90px; overflow: auto; margin: 6px 0; padding: 0; list-style: none; }
.grant-selection li { max-width: 100%; }
.grant-selection li button { max-width: 100%; padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-3); color: var(--text-2); overflow-wrap: anywhere; cursor: pointer; font: inherit; }
.grant-selection .btn { min-height: 26px; padding: 3px 8px; font-size: 12px; }
#edGrantPasteInput { width: 100%; resize: vertical; font-family: ui-monospace, monospace; }
.grant-missing { max-height: 96px; overflow: auto; margin: 5px 0 8px; padding-inline-start: 22px; font-size: 12px; overflow-wrap: anywhere; }
#edGrantOmitMissing { padding: 4px 8px; min-height: 28px; font-size: 12px; }
.grant-options { max-height: 240px; overflow: auto; margin-top: 7px; }
.grant-options label { justify-content: flex-start; min-height: 36px; margin: 0; padding: 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.grant-options label:has(input:checked) { background: color-mix(in srgb, var(--brand) 10%, var(--panel)); }
.grant-options label span { min-width: 0; overflow-wrap: anywhere; }
.grant-options label small { display: block; color: var(--muted); font-size: 11px; }
.grant-dialog .grant-options { max-height: min(235px, 27dvh); margin: 0; border: 1px solid var(--line); border-radius: var(--radius-input); }
.grant-dialog .grant-options label { min-height: 38px; padding: 6px 10px; }
.grant-dialog .grant-options label:last-child { border-bottom: 0; }
.grant-dialog .grant-options label:has(:disabled) { color: var(--muted); cursor: default; }
.grant-pager { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 5px 0; }
.grant-pager .btn { padding: 3px 8px; min-height: 28px; font-size: 12px; }
@media (max-width: 640px) {
  .grant-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
  .grant-dialog-body { display: block; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .grant-dialog-head, .grant-dialog-footer { padding: 12px 14px; gap: 8px; }
  .grant-picker-fields, .grant-picker-targets { padding: 12px 14px; overflow: visible; }
  .grant-picker-fields { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .grant-template-list { max-height: 145px; }
  .grant-order { margin-top: 10px; padding-top: 9px; }
  .grant-empty-state { min-height: 70px; }
  .grant-dialog-footer { align-items: stretch; flex-direction: column; }
  .grant-footer-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .grant-footer-actions .btn { min-width: 0; padding: 8px 6px; font-size: 13px; }
  .grant-options { max-height: 185px; }
}
.admin-editor-subtabs, .editor-nav-group { display: grid; gap: 3px; min-width: 0; }
.admin-editor-subtabs { gap: 14px; }
.editor-nav-group + .editor-nav-group { border-top: 1px solid var(--line); padding-top: 13px; }
.editor-nav-group > strong { color: var(--muted); font-size: 12px; padding: 0 8px 4px; }
.editor-nav-group :is(.tab, a) { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-width: 0; min-height: 36px; margin: 0; padding: 6px 9px; text-align: start; font: inherit; font-size: 13px; line-height: 1.4; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-2); text-decoration: none; white-space: normal; cursor: pointer; box-shadow: none; }
.editor-nav-group :is(.tab, a):hover { background: var(--panel-2); }
.editor-nav-group [aria-current="page"] { color: var(--brand2); font-weight: 700; border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); background: color-mix(in srgb, var(--brand) 9%, var(--panel)); }
.admin-editor-nav .tab.active:not([aria-current="page"]) { border-color: transparent; background: transparent; color: var(--text-2); box-shadow: none; }
.admin-editor-nav .editor-nav-group [aria-current="page"] { color: var(--brand2); background: color-mix(in srgb, var(--brand) 11%, var(--panel)); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: inset 3px 0 var(--brand2); }
.editor-account-sections { display: flex; gap: 4px; flex-wrap: wrap; margin: 18px 0; border-bottom: 1px solid var(--line); }
.editor-account-sections button { appearance: none; color: var(--text-2); background: transparent; padding: 7px 11px; border: 0; border-bottom: 2px solid transparent; font: inherit; cursor: pointer; min-height: 35px; }
.editor-account-sections [aria-selected="true"] { color: var(--brand2); border-bottom-color: var(--brand2); font-weight: 650; }
#editorSecurityFields { min-inline-size: 0; margin-top: 0; }
#edAccountGrants .grant-policy { margin: 0 0 14px; padding: 0; border: 0; }
.grant-catalog-tools, .editor-project-tools { display: grid; align-items: end; gap: 10px; margin-top: 14px; }
.grant-catalog-tools { grid-template-columns: minmax(0,2fr) repeat(2,minmax(0,1fr)); }
.editor-project-tools { grid-template-columns: minmax(0, 380px) minmax(90px,145px) auto; margin-bottom: 12px; }
.editor-project-tools select { width: 100%; min-height: 35px; }
.editor-project-toggle { border: 0; background: none; font: inherit; color: var(--brand2); text-align: start; cursor: pointer; overflow-wrap: anywhere; }
.editor-project-toggle::before { content: '▸'; padding-inline-end: 5px; }
.editor-project-toggle[aria-expanded="true"]::before { content: '▾'; }
.editor-project-record td > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,160px),1fr)); gap: 12px; padding: 7px; background: var(--panel-2); }
.editor-project-record dl { margin: 5px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; }
.editor-project-record dd { margin: 0; overflow-wrap: anywhere; }
.editor-project-record dt { color: var(--muted); }
.grant-catalog-tools label, .editor-project-tools label { display: grid; gap: 4px; min-width: 0; font-size: 12px; color: var(--muted); }
.grant-catalog-tools :is(input, select), .editor-project-tools input { width: 100%; min-width: 0; min-height: 35px; }
.grant-catalog-count { margin: 9px 0 6px; }
.grant-catalog-count:empty { display: none; }
.grant-pending-scope { display: inline-block; margin: 4px 0; padding: 2px 7px; border: 1px solid color-mix(in srgb, var(--brand2) 32%, var(--line)); border-radius: 4px; color: var(--brand2); }
#editorSecurityFields > .editor-access-actions { position: sticky; bottom: 0; z-index: 1; padding: 8px 0; border-top: 1px solid var(--line); background: var(--panel); }
.grant-rules { display: grid; gap: 0; margin: 0 0 8px; }
.grant-template-rule { min-width: 0; border-bottom: 1px solid var(--line); }
.grant-template-rule:first-child { border-top: 1px solid var(--line); }
.grant-template-rule > summary { display: grid; grid-template-columns: 10px minmax(0,1fr) auto auto; align-items: center; column-gap: 9px; min-height: 42px; padding: 7px 5px; cursor: pointer; }
.grant-template-rule > summary::-webkit-details-marker { display: none; }
.grant-template-rule > summary::before { content: ''; inline-size: 6px; block-size: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
.grant-template-rule[open] > summary::before { transform: rotate(45deg); }
.grant-template-rule[open] > summary, .grant-template-rule > summary:hover { background: var(--panel-2); }
.grant-template-rule > summary strong { overflow-wrap: anywhere; font-size: 13px; }
.grant-template-rule > summary small { color: var(--muted); font-size: 12px; }
.grant-whole-badge { font-size: 11px; color: var(--brand2); background: color-mix(in srgb, var(--brand) 8%, var(--panel)); border-radius: 4px; padding: 2px 6px; }
.grant-template-detail { display: grid; gap: 6px; padding: 6px 8px 10px 18px; }
.grant-template-pages { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 8px 0; }
.grant-template-pages .btn { min-height: 28px; padding: 3px 9px; font-size: 12px; }
.editor-coverage { margin: 12px 0; border-top: 1px solid var(--line); padding-top: 8px; }
.editor-coverage summary, .usage-event-detail summary { cursor: pointer; color: var(--brand2); }
#edSecReads { overflow-x: auto; } #edSecReads td:first-child { overflow-wrap: anywhere; }
.usage-event-detail { margin-top: 4px; font-size: 12px; }
.usage-event-detail dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 3px 9px; }
.usage-event-detail dt, .event-subline { color: var(--muted); }
.usage-event-detail dd { margin: 0; overflow-wrap: anywhere; }
.event-subline { display: block; margin-top: 3px; font-size: 11px; }
@media (min-width: 901px) {
  .customer-usage-filter-grid { grid-template-columns: minmax(175px,1.5fr) repeat(3,minmax(100px,1fr)); grid-template-areas: "email channel category action" "from to . query"; }
  .customer-usage-filter-grid > div:has(#customerUsageEmail) { grid-area: email; }
  .customer-usage-filter-grid > div:has(#customerUsageChannel) { grid-area: channel; }
  .customer-usage-filter-grid > div:has(#customerUsageCategory) { grid-area: category; }
  .customer-usage-filter-grid > div:has(#customerUsageAction) { grid-area: action; }
  .customer-usage-filter-grid > div:has(#customerUsageFrom) { grid-area: from; }
  .customer-usage-filter-grid > div:has(#customerUsageTo) { grid-area: to; }
  .customer-usage-filter-grid .customer-usage-query { grid-area: query; justify-self: end; min-width: 90px; }
  .customer-usage-filter-grid.usage-account-only { grid-template-columns: minmax(190px,350px) auto; grid-template-areas: "email query"; }
}
@media (min-width: 901px) { #editorAccessScopes { display: none; } }
.a2l-admin-view { display: grid; gap: 12px; }
.a2l-module-controls { display: flex; justify-content: flex-end; gap: 7px; }
.a2l-module-controls .btn { min-height: 32px; margin: 0; padding: 5px 10px; font-size: 11px; }
.a2l-module { padding: 0; overflow: hidden; }
.a2l-module > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 11px 16px;
  background: color-mix(in srgb, var(--panel) 90%, var(--bg)); cursor: pointer; list-style: none; user-select: none;
}
.a2l-module > summary::-webkit-details-marker { display: none; }
.a2l-module > summary::after {
  content: "⌄"; display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px;
  border: 1px solid var(--line); border-radius: 50%; color: var(--brand2); font-size: 18px; line-height: 1;
  transform: rotate(-90deg); transition: transform .16s ease;
}
.a2l-module[open] > summary::after { transform: rotate(0); }
.a2l-module[open] > summary { border-bottom: 1px solid var(--line); }
.a2l-module > summary > span { display: grid; gap: 3px; min-width: 0; }
.a2l-module > summary strong { color: var(--text); font-size: 14px; }
.a2l-module > summary small {
  overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap;
}
.a2l-module-body { padding: 14px 16px; }
.a2l-library-browser > .a2l-module-body { padding: 0; }
.a2l-library-head h3 { margin: 0 0 4px; }
.a2l-upload-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.a2l-upload-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; margin: 0; cursor: pointer; }
.a2l-quarantine-help {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin-top: 14px; padding: 10px 12px;
  border: 1px solid rgba(255,184,77,.34); border-radius: 7px; background: rgba(255,184,77,.07); font-size: 12px;
}
.a2l-quarantine-help strong { color: #ffbd5b; }
.a2l-quarantine-help span { color: var(--muted); line-height: 1.55; }
.a2l-import-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.a2l-import-progress-track {
  width: min(360px, 48vw); height: 7px; overflow: hidden;
  border-radius: 999px; background: color-mix(in srgb, var(--line) 75%, var(--bg));
}
.a2l-import-progress-track span {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  transition: width .2s ease;
}
.a2l-import-progress.is-processing .a2l-import-progress-track span {
  width: 38%; animation: a2l-progress 1.15s ease-in-out infinite;
}
@keyframes a2l-progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.a2l-report-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.a2l-report-card {
  display: grid; gap: 7px; min-width: 0; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 7px; background: color-mix(in srgb, var(--panel) 86%, var(--bg));
}
.a2l-report-card span { color: var(--muted); font-size: 12px; }
.a2l-report-card strong { overflow: hidden; color: var(--text); font-size: 21px; text-overflow: ellipsis; }
.a2l-category-manager h3 { margin: 0 0 4px; }
.a2l-category-tools { display: grid; grid-template-columns: minmax(240px, 420px) minmax(0, 1fr); align-items: center; gap: 12px; }
.a2l-category-tools input { width: 100%; height: 38px; }
.a2l-category-tools .meta { margin: 0; line-height: 1.5; }
.a2l-category-add {
  display: grid; grid-template-columns: minmax(150px, .8fr) repeat(3, minmax(150px, 1fr)) auto auto;
  align-items: end; gap: 8px; margin-top: 12px;
}
.a2l-category-add input { height: 38px; }
.a2l-category-add .btn { min-height: 38px; margin: 0; }
.a2l-category-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 8px; margin-top: 12px; }
.a2l-category-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 9px 12px;
  padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: color-mix(in srgb, var(--panel) 86%, var(--bg));
}
.a2l-category-row.is-disabled { opacity: .76; }
.a2l-category-row input { width: 100%; min-width: 0; height: 34px; }
.a2l-category-key { display: grid; gap: 4px; min-width: 0; }
.a2l-category-key label, .a2l-category-labels label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.a2l-category-labels {
  display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px;
}
.a2l-category-meta { display: grid; min-width: 78px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.a2l-category-actions { display: flex; grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.a2l-category-actions .btn { min-height: 30px; margin: 0; padding: 4px 7px; font-size: 10px; }
.a2l-library-browser { padding: 0; overflow: hidden; }
.a2l-library-toolbar {
  display: grid; grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) auto auto auto auto;
  gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line);
}
.a2l-library-toolbar input[type="search"],
.a2l-library-toolbar select { width: 100%; height: 38px; }
.a2l-filter-check {
  display: inline-flex; align-items: center; gap: 7px; margin: 0;
  color: var(--muted); font-size: 13px; white-space: nowrap;
}
.a2l-filter-check input { width: 16px; height: 16px; margin: 0; }
.a2l-family-fold-actions { display: flex; justify-content: flex-end; gap: 6px; }
.a2l-family-fold-actions .btn { min-height: 32px; margin: 0; padding: 5px 8px; font-size: 10px; }
.a2l-file-status { display: block; min-height: 0; padding: 0 14px; }
.a2l-file-status:not(:empty) { padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.a2l-family-tree { min-height: 150px; }
.a2l-family-group { border-bottom: 1px solid var(--line); }
.a2l-family-group:last-child { border-bottom: 0; }
.a2l-family-group summary {
  display: flex; align-items: center; gap: 9px; padding: 12px 16px;
  background: color-mix(in srgb, var(--panel) 88%, var(--bg)); cursor: pointer;
  font-weight: 700; user-select: none;
}
.a2l-family-group summary small { color: var(--muted); font-size: 10px; font-weight: 400; }
.a2l-family-group summary::marker { color: var(--brand2); }
.a2l-family-count {
  min-width: 24px; padding: 2px 7px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); font-size: 11px; text-align: center;
}
.a2l-family-table-wrap { overflow: auto; }
.a2l-family-table { width: 100%; min-width: 1120px; margin: 0; }
.a2l-family-table th { color: var(--muted); font-size: 11px; text-transform: none; }
.a2l-family-table td { vertical-align: middle; }
.a2l-name-cell { max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a2l-state {
  display: inline-flex; padding: 3px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--line) 65%, transparent); color: var(--muted); font-size: 11px;
}
.a2l-state.is-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.a2l-state.is-error { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.a2l-state.is-quarantine { background: rgba(255, 184, 77, .14); color: #ffb84d; }
.a2l-state.is-disabled { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.a2l-state.is-enabled { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.a2l-error-detail { display: block; max-width: 420px; margin-top: 4px; overflow: hidden; color: var(--err); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.a2l-alternative-detail { display: block; max-width: 420px; margin-top: 3px; overflow: hidden; color: var(--ok); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.a2l-alternative-actions { display: flex; max-width: 420px; flex-wrap: wrap; gap: 4px; margin-top: 4px; white-space: normal; }
.a2l-alternative-actions button {
  max-width: 100%; padding: 2px 6px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--line));
  border-radius: 5px; background: color-mix(in srgb, var(--ok) 9%, transparent); color: var(--ok);
  font: inherit; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.a2l-alternative-actions button:hover { background: color-mix(in srgb, var(--ok) 17%, transparent); }
.a2l-row-actions { display: flex; gap: 6px; white-space: nowrap; }
.a2l-row-actions .btn { padding: 6px 9px; font-size: 12px; }
.a2l-edit-row td { padding: 12px 16px; background: color-mix(in srgb, var(--brand) 5%, var(--bg)); }
.a2l-edit-grid {
  display: grid; grid-template-columns: minmax(150px, .7fr) minmax(220px, 1fr) minmax(280px, 1.5fr) auto;
  gap: 10px; align-items: end;
}
.a2l-edit-grid label { display: grid; gap: 5px; margin: 0; color: var(--muted); font-size: 11px; }
.a2l-edit-grid input, .a2l-edit-grid select, .a2l-edit-grid textarea { width: 100%; min-height: 38px; }
.a2l-edit-grid textarea { height: 38px; resize: vertical; }
.a2l-edit-actions { display: flex; gap: 6px; }
.a2l-tree-empty { padding: 34px 16px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  #tab-editor { grid-template-columns: minmax(0,1fr); }
  #tab-editor > [id^="editor-view-"] { grid-area: 2 / 1; }
  .admin-editor-nav { position: static; gap: 8px; }
  .admin-editor-subtabs { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .editor-nav-group { align-content: start; }
  .editor-nav-group + .editor-nav-group { border: 0; padding-top: 0; }
  .a2l-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a2l-library-toolbar { grid-template-columns: 1fr 1fr; }
  .a2l-edit-grid { grid-template-columns: 1fr 1fr; }
  .a2l-category-tools, .a2l-category-add { grid-template-columns: 1fr 1fr; }
  .a2l-category-manager .admin-section-head { align-items: stretch; flex-direction: column; }
}

@media (max-width: 640px) {
  .admin-editor-subtabs { gap: 5px; }
  .editor-nav-group :is(.tab, a) { padding: 5px; font-size: 12px; }
  .grant-catalog-tools { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grant-catalog-tools label:first-child { grid-column: 1 / -1; }
  .grant-template-rule > summary { grid-template-columns: 9px minmax(0,1fr) auto; }
  .grant-template-rule > summary small { grid-column: 2; }
  .grant-template-rule > summary .grant-whole-badge { grid-column: 3; grid-row: 1 / 3; }
  .a2l-library-head .admin-section-head { align-items: stretch; flex-direction: column; }
  .a2l-upload-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .a2l-upload-actions .btn { width: 100%; text-align: center; }
  .a2l-import-progress { align-items: stretch; flex-direction: column; }
  .a2l-import-progress-track { width: 100%; }
  .a2l-report-grid, .a2l-library-toolbar, .a2l-edit-grid, .a2l-category-tools, .a2l-category-add, .a2l-category-list { grid-template-columns: 1fr; }
  .a2l-quarantine-help { grid-template-columns: 1fr; }
  .a2l-category-row { grid-template-columns: 1fr; }
  .a2l-category-labels { grid-template-columns: 1fr; }
  .a2l-category-actions { justify-content: stretch; }
  .a2l-category-actions .btn { flex: 1; }
  .a2l-edit-actions .btn { flex: 1; }
}

[hidden] { display: none !important; }

/* Product detail image viewer */
.product-page main { width: min(1240px, 100%); max-width: 1240px; }
.product-page .detail-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 34px; }
.product-page .detail-img { height: 420px; object-fit: contain; border-radius: 8px; }
.product-page .gallery-stage { display: grid; place-items: center; height: 420px; border-radius: 8px; cursor: zoom-in;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .04); }
html[data-theme="light"] .product-page .gallery-stage {
  box-shadow: 0 14px 32px rgba(27, 34, 48, .12), inset 0 1px 0 rgba(255, 255, 255, .6); }
.product-page .gallery-stage:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.product-page .gallery-stage .detail-img { height: 100%; }
.gallery-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none;
  touch-action: none; will-change: transform; transform-origin: center center; transition: transform .16s ease; cursor: zoom-in; }
.gallery-image.is-zoomed { cursor: grab; }
.gallery-image.is-panning { cursor: grabbing; transition: none; }
.product-page .gallery-nav { z-index: 3; display: grid; place-items: center; width: 44px; height: 52px; padding: 0;
  border-color: rgba(255,255,255,.24); background: rgba(12,14,19,.84); color: #fff; font-family: Arial, sans-serif;
  font-size: 34px; line-height: 1; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.product-page .gallery-nav:hover, .product-page .gallery-nav:focus-visible { border-color: var(--brand); background: rgba(97,47,255,.92); }
.gallery-open { position: absolute; top: 10px; right: 10px; z-index: 4; display: grid; place-items: center; width: 40px; height: 40px;
  padding: 0; border: 1px solid rgba(255,255,255,.24); border-radius: 8px; background: rgba(12,14,19,.84); color: #fff;
  font-family: Arial, sans-serif; font-size: 22px; line-height: 1; cursor: pointer; }
.gallery-open:hover, .gallery-open:focus-visible { border-color: var(--brand); background: rgba(97,47,255,.92); }
.product-page .gallery-tools { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; }
.gallery-tool-button { display: grid; place-items: center; width: 46px; height: 42px; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; background: var(--input-bg); color: var(--text); font-family: Arial, sans-serif; font-size: 22px; line-height: 1; cursor: pointer; }
.gallery-tool-button:hover, .gallery-tool-button:focus-visible { border-color: var(--brand); color: #fff; }
html[data-theme="light"] .gallery-tool-button:hover, html[data-theme="light"] .gallery-tool-button:focus-visible { color: var(--brand); }
.gallery-zoom-value { width: 76px; font-size: 14px; }
.gallery-fullscreen-button { margin-left: auto; }
.gallery-lightbox { position: fixed; inset: 0; z-index: 240; display: none; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 18px 72px 20px; background: rgba(3,5,9,.96); color: #fff; }
.gallery-lightbox.show { display: grid; }
.gallery-lightbox-head { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  min-height: 46px; color: #c9cfda; font-size: 14px; }
.gallery-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px; background: rgba(26,30,39,.9); color: #fff; font-family: Arial, sans-serif; font-size: 30px; line-height: 1; cursor: pointer; }
.gallery-close:hover, .gallery-close:focus-visible { border-color: var(--brand); background: var(--brand); }
.gallery-lightbox-stage { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; width: 100%; overflow: hidden; }
.gallery-lightbox-stage .gallery-image { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.product-page .gallery-lightbox-nav { position: fixed; z-index: 244; }
.product-page .gallery-lightbox-nav.prev { left: 18px; }
.product-page .gallery-lightbox-nav.next { right: 18px; }
.gallery-lightbox-tools { position: relative; z-index: 245; padding-top: 12px; }
.gallery-lightbox-tools .gallery-tool-button { border-color: rgba(255,255,255,.24); background: rgba(26,30,39,.94); }
body.gallery-viewer-open { overflow: hidden; }

@media (max-width: 760px) {
  .product-page .detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .product-page .detail-img, .product-page .gallery-stage { height: 300px; }
  .gallery-lightbox { padding: 10px 12px 16px; }
  .product-page .gallery-lightbox-nav { width: 40px; height: 48px; font-size: 30px; }
  .product-page .gallery-lightbox-nav.prev { left: 8px; }
  .product-page .gallery-lightbox-nav.next { right: 8px; }
  .gallery-lightbox-head { padding-left: 4px; }
  .gallery-lightbox-tools { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5; }
a { color: var(--brand2); }
.debug-notice-banner { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 34px; padding: 7px 44px; background: rgba(255,193,7,.12);
  border-bottom: 1px solid rgba(255,193,7,.28); color: #e5bd4d; font-size: 13px; text-align: center; }
.debug-notice-banner button { position: absolute; right: 14px; width: 24px; height: 24px; border: 1px solid rgba(255,193,7,.32);
  border-radius: 999px; background: transparent; color: #e5bd4d; cursor: pointer; line-height: 18px; }
.debug-notice-banner button:hover { background: rgba(255,193,7,.12); }
.debug-notice-modal { position: fixed; inset: 0; z-index: 260; display: none; align-items: center; justify-content: center;
  padding: 18px; background: var(--dialog-overlay); backdrop-filter: blur(4px); }
.debug-notice-modal.show { display: flex; }
.debug-notice-card { width: min(460px, 100%); border: 1px solid var(--line); border-radius: var(--dialog-radius);
  background: var(--panel); box-shadow: var(--dialog-shadow); padding: 24px; }
.debug-notice-card h2 { margin: 0 0 10px; font-size: 20px; }
.debug-notice-card p { margin: 0 0 18px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.dialog-open { overflow: hidden; }
.site-dialog-layer { position: fixed; inset: 0; z-index: 240; display: none; align-items: center; justify-content: center;
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0;
  padding: 24px; background: transparent; color: var(--text); }
.site-dialog-layer::backdrop, .site-modal::backdrop { background: var(--dialog-overlay); backdrop-filter: blur(4px); }
.site-dialog-layer.show { display: flex; }
.site-dialog-panel { width: min(500px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: auto;
  border: 1px solid var(--line); border-radius: var(--dialog-radius); background: var(--panel); box-shadow: var(--dialog-shadow);
  padding: 24px; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; }
.site-dialog-mark { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand2); font-weight: 800; font-size: 20px; }
.site-dialog-panel[data-tone="success"] .site-dialog-mark { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); }
.site-dialog-panel[data-tone="danger"] .site-dialog-mark { border-color: color-mix(in srgb, var(--err) 30%, transparent); background: color-mix(in srgb, var(--err) 10%, transparent); color: var(--err); }
.site-dialog-panel[data-tone="warning"] .site-dialog-mark { border-color: color-mix(in srgb, var(--warning) 30%, transparent); background: color-mix(in srgb, var(--warning) 10%, transparent); color: var(--warning); }
.site-dialog-content { min-width: 0; }
.site-dialog-content h2 { margin: 2px 0 10px; font-size: 19px; line-height: 1.4; overflow-wrap: anywhere; }
.site-dialog-content p { margin: 0; max-height: min(420px, 50dvh); overflow-y: auto; overscroll-behavior: contain;
  color: var(--text-2); font-size: 14px; line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }
.site-dialog-content textarea { display: none; width: 100%; margin-top: 14px; resize: vertical; min-height: 92px; }
.site-dialog-actions, .site-dialog-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.site-dialog-actions { grid-column: 1 / -1; }
.site-dialog-actions .btn, .site-dialog-footer .btn { width: auto; min-width: 96px; min-height: 42px; padding: 10px 18px; border-radius: var(--radius-btn); }
.site-dialog-actions .btn:focus-visible, .site-dialog-content textarea:focus-visible {
  outline: 2px solid var(--brand2); outline-offset: 2px; }
.site-modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  border: 1px solid var(--line); border-radius: var(--dialog-radius); padding: 0;
  background: var(--panel); color: var(--text); box-shadow: var(--dialog-shadow); }
.site-modal-body { padding: 24px; }
.site-modal h3 { margin: 0 0 10px; font-size: 19px; }
.site-modal p { line-height: 1.75; }
@media (max-width: 520px) {
  .site-dialog-layer { align-items: flex-end; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .site-dialog-panel { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 20px; }
  .site-modal-body { padding: 20px; }
  .site-dialog-actions, .site-dialog-footer { display: grid; grid-template-columns: 1fr 1fr; }
  .site-dialog-actions .btn, .site-dialog-footer .btn { width: 100%; min-width: 0; }
  .site-dialog-panel[data-kind="alert"] .site-dialog-actions [data-dialog-confirm] { grid-column: 1 / -1; }
}
header { border-bottom: 1px solid var(--line); padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
header .logo { font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.logo-lockup { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.logo-mark { width: 34px; height: 34px; display: block; flex: none; }
.logo-wm { display: flex; flex-direction: column; line-height: 1; }
.logo-wm-1 { font-weight: 800; font-size: 18px; letter-spacing: .4px; color: var(--text); white-space: nowrap; }
.logo-wm-accent { background: linear-gradient(90deg, var(--brand), var(--brand2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.logo-wm-admin { color: var(--muted); font-weight: 600; }
.logo-wm-2 { font-size: 9px; font-weight: 600; letter-spacing: 2.4px; color: var(--muted); text-transform: uppercase; margin-top: 5px; white-space: nowrap; }
@media (max-width: 1024px) { .logo-wm-2 { display: none; } .logo-wm-store { display: none; } }
@media (max-width: 640px) { .logo-mark { width: 30px; height: 30px; } .logo-wm { display: none; } }
header nav a { margin-left: 18px; color: var(--muted); text-decoration: none; font-size: 14px; }
header nav a:hover { color: var(--text); }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.cart-count { display: none; min-width: 18px; height: 18px; align-items: center; justify-content: center;
  padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; }
.message-count { background: var(--err); }
.lang-switch { margin-left: 18px; display: inline-flex; gap: 2px; vertical-align: middle;
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch a, .lang-switch button { margin: 0 !important; padding: 8px 12px; font-size: 13px; cursor: pointer;
  color: var(--muted); user-select: none; display: inline-flex; align-items: center; min-height: 36px; box-sizing: border-box;
  background: transparent; border: 0; font-family: inherit; text-decoration: none; }
.lang-switch a.active, .lang-switch button.active { background: var(--brand); color: #fff; }
.lang-switch a:hover:not(.active), .lang-switch button:hover:not(.active) { background: var(--panel); color: var(--text); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  margin-left: 14px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; vertical-align: middle;
  transition: color .15s ease, background .15s ease; }
.theme-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.theme-toggle:focus-visible { outline: 2px solid rgba(138,99,255,.55); outline-offset: 2px; }
/* 移动端导航：汉堡按钮 + 折叠面板（nav.js 注入 .nav-toggle 并给 header 加 .nav-collapsible） */
.nav-toggle { display: none; width: 40px; height: 40px; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: var(--radius-btn); background: transparent;
  color: var(--text); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle:hover { border-color: var(--brand2); }
.nav-toggle:focus-visible { outline: 2px solid rgba(138,99,255,.55); outline-offset: 2px; }
.nav-toggle svg { width: 20px; height: 20px; display: block; }
@media (max-width: 760px) {
  header.nav-collapsible { flex-wrap: wrap; }
  header.nav-collapsible .logo { order: 1; }
  header.nav-collapsible .nav-toggle { display: inline-flex; order: 2; margin-left: auto; }
  header.nav-collapsible nav { display: none; order: 3; flex-basis: 100%; flex-direction: column; padding-top: 12px; position: relative; }
  header.nav-collapsible nav.nav-open { display: flex; }
  header.nav-collapsible nav a { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 15px; }
  header.nav-collapsible nav a:hover { background: var(--panel); }
  header.nav-collapsible nav .lang-switch { margin: 10px 0 2px; align-self: flex-start; }
  header.nav-collapsible nav .theme-toggle { position: absolute; right: 2px; bottom: 4px; margin: 0; }
}
main { max-width: 1000px; margin: 0 auto; padding: 24px; }
.store-page main { width: min(1480px, 100%); max-width: 1480px; }
.cart-page main { width: min(1240px, 100%); max-width: 1240px; }
body.admin-page main { width: min(1680px, calc(100vw - 48px)); max-width: 1680px; }
body.admin-page #panel { width: 100%; }
body.admin-page .tabs { flex-wrap: wrap; }
/* 后台 tab 分组（经营/内容/沟通/系统）：桌面端优先一排显示。admin.html 的 fitAdminTabs 按实际宽度逐级加类：
   is-row 一排 → is-compact 隐藏分组小标题并收紧分隔 → is-dense 字号/内边距再收紧 → 都放不下才折行 */
.admin-tabs-grouped { gap: 10px 12px; align-items: center; }
.admin-tabs-grouped .tab { padding: 8px 13px; white-space: nowrap; }
.admin-tab-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding-left: 12px; border-left: 1px solid var(--line); }
.admin-tab-group:first-child { padding-left: 0; border-left: 0; }
.admin-tab-group-label { flex: none; margin-right: 2px; color: var(--muted); font-size: 11px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
body.admin-page .admin-tabs-grouped.is-row { flex-wrap: nowrap; }
.admin-tabs-grouped.is-row .admin-tab-group { flex: none; flex-wrap: nowrap; }
.admin-tabs-grouped.is-compact { gap: 10px; }
.admin-tabs-grouped.is-compact .admin-tab-group { gap: 5px; padding-left: 10px; }
.admin-tabs-grouped.is-compact .admin-tab-group-label { display: none; }
.admin-tabs-grouped.is-dense .tab { padding: 8px 11px; font-size: 13px; }
@media (max-width: 760px) {
  .admin-tab-group { flex: none; flex-wrap: nowrap; }
  .admin-tab-group-label { display: none; }
}
/* EOL 内嵌页 */
.eol-frame-wrap { margin: -8px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--bg); }
.eol-frame-wrap iframe { display: block; width: 100%; height: calc(100vh - 210px); min-height: 420px; border: 0; }  /* 实际高度由 admin.html fitEolFrame() 按视口剩余空间设定 */
body.admin-eol-active > footer { display: none; }
body.admin-eol-active main { padding-bottom: 0; }
@media (max-width: 760px) {
  body.admin-page .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px;
    -webkit-overflow-scrolling: touch; }
  body.admin-page .tabs .tab { flex: none; white-space: nowrap; }
}
body.admin-page .card { min-width: 0; }
h1 { font-size: 22px; letter-spacing: -.01em; } h2 { font-size: 18px; margin-top: 32px; letter-spacing: -.01em; }
.tabs { display: flex; gap: 8px; margin: 16px 0; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.tab.active { background: linear-gradient(135deg, var(--brand) 0%, #7a4bff 100%); color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px rgba(97,47,255,.3); }
.tab:hover:not(.active) { border-color: var(--brand2); color: var(--text); }
.admin-tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px;
  padding: 0 5px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.admin-tab-badge--muted { background: #353b48; color: #cbd0da; }
.admin-tab-badge[hidden] { display: none; }
.tab.active .admin-tab-badge { background: #fff; color: var(--brand); }
.admin-row-new-badge { display: inline-flex; align-items: center; justify-content: center; margin-left: 7px; min-width: 18px; height: 18px;
  padding: 0 6px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; vertical-align: middle; }
.search-box { width: 100%; max-width: 420px; margin: 0 0 18px; padding: 11px 14px;
  background: var(--input-bg); color: var(--text); border: 1px solid var(--line); border-radius: 999px; font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease; }
.search-box:focus { border-color: rgba(138,99,255,.72); box-shadow: 0 0 0 3px rgba(97,47,255,.16); outline: 0; }
.overview-strip { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 12px 14px; margin: 0 0 14px; }
.overview-cats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.overview-cats span { color: var(--muted); font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; }
.category-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.category-chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.category-chip span { color: inherit; opacity: .75; margin-left: 4px; }
.category-chip.active { background: linear-gradient(135deg, var(--brand) 0%, #7a4bff 100%); color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px rgba(97,47,255,.3); }
.category-chip:hover:not(.active) { border-color: var(--brand2); color: var(--text); }
.category-menu-wrap { position: relative; }
.category-menu-wrap summary { list-style: none; }
.category-menu-wrap summary::-webkit-details-marker { display: none; }
.category-menu-btn::after { content: " ▾"; }
.category-menu { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; min-width: 300px;
  max-height: 360px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.category-menu-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center;
  width: calc(100% - var(--depth, 0) * 14px); margin-left: calc(var(--depth, 0) * 14px); }
.category-menu-row.has-children { grid-template-columns: minmax(0, 1fr) 34px; }
.category-menu-row.is-root { margin-top: 3px; border-top: 1px solid var(--line); }
.category-menu-row.is-root:first-child { margin-top: 0; border-top: 0; }
.category-menu-item { display: flex; width: 100%; margin: 0;
  justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 7px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; font-size: 13px; }
.category-menu-item:hover, .category-menu-item.active { background: rgba(97,47,255,.16); }
.category-menu-row.is-child { position: relative; }
.category-menu-row.is-child::before { content: ""; position: absolute; left: -7px; top: -8px; bottom: 50%; border-left: 1px solid var(--line); }
.category-menu-toggle { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel-3); color: var(--muted); cursor: pointer; }
.category-menu-toggle:hover, .category-menu-toggle:focus-visible { border-color: var(--brand2); color: var(--brand2); background: rgba(97,47,255,.14); }
.category-menu-toggle span { display: block; font-size: 22px; line-height: 1; transition: transform .15s ease; }
.category-menu-toggle.expanded span { transform: rotate(90deg); }
.category-menu-label { display: flex; min-width: 0; align-items: center; gap: 8px; }
.category-menu-root-mark { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 2px; background: var(--brand2); }
.category-menu-branch { flex: 0 0 auto; color: var(--muted); font-size: 15px; }
.category-menu-copy { min-width: 0; }
.category-menu-copy strong, .category-menu-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-menu-copy strong { color: var(--text); font-size: 13px; }
.category-menu-copy small { margin-top: 1px; color: var(--muted); font-size: 10px; font-weight: 400; }
.category-menu-count { flex: 0 0 auto; min-width: 24px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.currency-select { margin: -2px 0 12px; max-width: 150px; padding: 7px 9px; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.store-page .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.store-page .grid > .card { min-width: 0; padding: 15px; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0) 30%), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px; }
/* 网格里的卡片：撑满等高，价格+按钮钉到底部对齐 */
.grid > .card { display: flex; flex-direction: column; height: 100%;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.grid > .card:hover { transform: translateY(-2px); border-color: rgba(138,99,255,.38); box-shadow: var(--shadow-card); }
.card-footer { margin-top: auto; }
.card-footer .price { margin-bottom: 10px; }
/* 店面商品卡：标题两行截断、meta 行距压缩、分类 pill、价格与货币选择器同行 */
.store-page .grid > .card h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  min-height: calc(1.35em * 2);
}
.store-page .grid > .card .meta { margin: 1px 0; line-height: 1.4; }
/* 第 3 个 meta 行是分类（renderProducts 固定输出 车型/ECU/分类 三行） */
.store-page .grid > .card > .meta:nth-of-type(3) {
  align-self: flex-start;
  margin-top: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 12px; }
.price-row .price { margin: 0; font-size: 18px; white-space: nowrap; }
.price-row .currency-select { flex: none; max-width: 112px; margin: 0; padding: 6px 8px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.card-actions .btn { flex: 1 1 120px; }
.admin-action-center { margin-bottom: 16px; }
.admin-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.admin-section-head h3 { margin: 0 0 4px; }
.admin-section-head p { margin: 0; }
.btn.admin-refresh-btn { flex: 0 0 auto; width: auto; min-width: 72px; padding: 8px 12px; }
.admin-action-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 9px; margin-top: 14px; }
.admin-action-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg);
  color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.admin-action-item:hover { border-color: var(--brand); background: rgba(97,47,255,.08); }
.admin-action-count { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px;
  padding: 0 7px; border-radius: 999px; background: rgba(255,107,107,.16); color: var(--err); font-weight: 700; }
.admin-action-item strong, .admin-action-item small { display: block; }
.admin-action-item small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.admin-action-arrow { color: var(--muted); font-size: 24px; line-height: 1; }
.admin-action-empty { padding: 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--ok); text-align: center; }
.admin-stat-card { width: 100%; min-height: 112px; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.admin-stat-card:hover { border-color: var(--brand); background: rgba(97,47,255,.08); }
.admin-stat-value { display: block; margin: 8px 0 6px; font-size: 22px; line-height: 1.18; overflow-wrap: anywhere; }
.admin-order-link { padding: 0; border: 0; background: transparent; color: var(--brand2); font: inherit; font-weight: 700; cursor: pointer; }
.admin-order-link:hover { text-decoration: underline; }
.thumb { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: 10px;
  margin-bottom: 12px; background: var(--input-bg); border: 1px solid var(--line); }
.thumb.placeholder { display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: var(--muted); }
.plink { text-decoration: none; color: inherit; display: block; }
.plink:hover h3 { color: var(--brand2); }
.plink .thumb { transition: border-color .15s; }
.plink:hover .thumb { border-color: var(--brand); }
/* 详情页 */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.detail-img { width: 100%; height: 340px; object-fit: cover; border-radius: 14px;
  background: var(--input-bg); border: 1px solid var(--line); }
.detail-img.placeholder { display: flex; align-items: center; justify-content: center; font-size: 90px; color: var(--muted); }
.product-gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery-stage { position: relative; height: 340px; overflow: hidden; border-radius: 14px; background: var(--input-bg); border: 1px solid var(--line); }
.gallery-stage .detail-img { height: 100%; border: 0; border-radius: 0; transition: transform .18s ease; transform-origin: center center; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 44px;
  border: 1px solid var(--line); border-radius: 8px; background: rgba(12,14,19,.78); color: var(--text);
  font-size: 26px; cursor: pointer; }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-nav:hover { border-color: var(--brand); color: #fff; }
.gallery-tools { display: flex; gap: 8px; }
.gallery-tools .btn { width: auto; min-width: 54px; padding: 7px 12px; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.gallery-thumbs button { border: 1px solid var(--line); border-radius: 8px; padding: 0; height: 54px;
  overflow: hidden; background: var(--input-bg); cursor: pointer; }
.gallery-thumbs button.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
table.spec { width: 100%; margin-top: 14px; }
table.spec th { color: var(--muted); font-weight: 400; width: 90px; }
table.spec th, table.spec td { padding: 10px 12px; }
/* 奇偶行条纹（--panel-2 双色交替） */
table.spec tr:nth-child(even) th, table.spec tr:nth-child(even) td { background: var(--panel-2); }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.meta { color: var(--muted); font-size: 13px; margin: 2px 0; }
.mods { margin: 10px 0; padding: 0; list-style: none; font-size: 13px; }
.product-kind-line { margin-top: 4px; }
.stock-ok { color: var(--ok); font-weight: 600; }
.stock-out { color: var(--err); font-weight: 600; }
.product-tags { display: inline-flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 2px; }
.product-tag { padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-3); color: var(--muted); font-size: 11px; line-height: 1.5; }
.cart-physical-note { margin: 10px 0 0; }
.mods li::before { content: "✓ "; color: var(--ok); }
.price { font-size: 20px; font-weight: 700; margin: 10px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; padding: 11px 18px; border: 0; border-radius: var(--radius-btn);
  background: linear-gradient(135deg, var(--brand) 0%, #7a4bff 100%);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; text-align: center;
  text-decoration: none; line-height: 1.4;
  box-shadow: 0 4px 14px rgba(97,47,255,.28);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, background .15s ease; }
.btn-block { width: 100%; }
.btn:hover { filter: brightness(1.12); box-shadow: 0 6px 20px rgba(97,47,255,.38); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.ghost { background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text);
  box-shadow: none; font-weight: 500; }
.btn.ghost:hover { border-color: var(--brand2); background: rgba(97,47,255,.1); filter: none;
  box-shadow: none; transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
/* 键盘焦点环：覆盖主要可交互元素 */
.btn:focus-visible, .tab:focus-visible, .category-chip:focus-visible, .category-menu-item:focus-visible,
.category-menu-toggle:focus-visible, .cart-qty button:focus-visible, .lang-switch a:focus-visible,
.lang-switch button:focus-visible,
header nav a:focus-visible, .gallery-nav:focus-visible, .gallery-open:focus-visible,
.gallery-tool-button:focus-visible, .card-actions a:focus-visible {
  outline: 2px solid rgba(138,99,255,.55); outline-offset: 2px;
}
/* 按钮加载态（防重复提交） */
.btn.is-loading { opacity: .65; pointer-events: none; }
.btn.is-loading::after { content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 8px;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: btn-spin .7s linear infinite; vertical-align: -2px; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
button, input, select, textarea { font-family: inherit; }
input, select, textarea { width: 100%; padding: 10px; background: var(--input-bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-input); font-size: 14px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus, textarea:focus { border-color: rgba(138,99,255,.72);
  box-shadow: 0 0 0 3px rgba(97,47,255,.16); outline: 0; }
input[type="checkbox"], input[type="radio"] { transition: none; box-shadow: none; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--brand2); }
input, textarea, select, button { accent-color: var(--brand2); }
select { appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 11px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="search"] { appearance: none; -webkit-appearance: none; }
input[type="search"]::-webkit-search-cancel-button { appearance: none; width: 15px; height: 15px; cursor: pointer;
  background: linear-gradient(45deg, transparent 44%, var(--muted) 45% 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, var(--muted) 45% 55%, transparent 56%); }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; }
input[type="checkbox"], input[type="radio"] { appearance: none; -webkit-appearance: none; position: relative;
  width: 17px; height: 17px; padding: 0; border: 1px solid var(--line); border-radius: 4px;
  background: var(--input-bg); vertical-align: middle; cursor: pointer; }
input[type="checkbox"]:checked, input[type="radio"]:checked { border-color: var(--brand2); background: var(--brand); }
input[type="checkbox"]::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; opacity: 0; transform: rotate(45deg); }
input[type="checkbox"]:checked::after { opacity: 1; }
input[type="radio"] { border-radius: 50%; }
input[type="radio"]::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fff; opacity: 0; }
input[type="radio"]:checked::after { opacity: 1; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid rgba(138,99,255,.55); outline-offset: 2px; }
.site-select { position: relative; width: 100%; min-width: 0; }
.site-select--currency { max-width: 150px; margin: -2px 0 12px; }
.site-select-native { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important;
  margin: 0 !important; padding: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }
.site-select-trigger { width: 100%; min-height: 42px; padding: 9px 12px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg);
  color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.site-select-trigger:hover, .site-select.open .site-select-trigger { border-color: rgba(138,99,255,.72); background: rgba(97,47,255,.07); }
.site-select-trigger:focus-visible { outline: 2px solid rgba(138,99,255,.55); outline-offset: 2px; }
.site-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-select-chevron { width: 8px; height: 8px; flex: 0 0 8px; margin: -4px 2px 0 0; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease, margin .15s ease; }
.site-select.open .site-select-chevron { margin-top: 4px; transform: rotate(225deg); }
.site-select.disabled { opacity: .58; }
.site-select.disabled .site-select-trigger { cursor: not-allowed; }
.site-select.invalid .site-select-trigger { border-color: rgba(255,107,107,.65); }
.site-select-menu { position: absolute; z-index: 160; top: calc(100% + 6px); left: 0; right: 0; max-height: min(320px, 48vh);
  overflow-y: auto; overscroll-behavior: contain; padding: 6px; border: 1px solid rgba(138,99,255,.5); border-radius: 8px;
  background: var(--panel-3); box-shadow: 0 18px 44px rgba(0,0,0,.52); }
.site-select.open-up .site-select-menu { top: auto; bottom: calc(100% + 6px); }
.site-select-menu[hidden] { display: none; }
.site-select-option { width: 100%; min-height: 40px; padding: 8px 10px; display: grid; grid-template-columns: 18px minmax(0, 1fr);
  align-items: center; gap: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit;
  font-size: 13px; text-align: left; cursor: pointer; }
.site-select-option:hover, .site-select-option:focus-visible { outline: 0; background: rgba(97,47,255,.12); }
.site-select-option.active { background: rgba(97,47,255,.2); box-shadow: inset 2px 0 var(--brand2); }
.site-select-option:disabled { opacity: .45; cursor: not-allowed; }
.site-select-check { color: transparent; font-weight: 800; }
.site-select-option.active .site-select-check { color: var(--brand2); }
.site-select-option-copy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-select-group { padding: 9px 10px 5px 36px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
* { scrollbar-width: thin; scrollbar-color: #5f47a8 var(--input-bg); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--input-bg); border-radius: 8px; }
*::-webkit-scrollbar-thumb { min-width: 36px; min-height: 36px; border: 2px solid var(--input-bg);
  border-radius: 8px; background: #4f4380; }
*::-webkit-scrollbar-thumb:hover { background: #6d50d6; }
*::-webkit-scrollbar-corner { background: var(--input-bg); }
input[type="file"] { height: 52px; padding: 0 12px 0 0; overflow: hidden; color: var(--muted); cursor: pointer; line-height: 50px; }
input[type="file"]::file-selector-button { height: 50px; margin: 0 12px 0 0; padding: 0 17px; border: 0;
  border-right: 1px solid rgba(138,99,255,.45); border-radius: 7px 0 0 7px; background: rgba(97,47,255,.2);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s ease, border-color .15s ease; }
input[type="file"]:hover { border-color: rgba(138,99,255,.7); }
input[type="file"]:hover::file-selector-button { background: var(--brand); border-color: var(--brand2); color: #fff; }
input[type="file"]:focus-visible { outline: 2px solid rgba(138,99,255,.55); outline-offset: 2px; }
.file-upload-control { position: relative; margin-top: 4px; }
.file-upload-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: 0 !important; opacity: 0; overflow: hidden; pointer-events: none; }
.file-upload-surface { min-height: 112px; margin: 0; padding: 18px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center; border: 1px dashed rgba(138,99,255,.58);
  border-radius: 8px; background: var(--input-bg); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.file-upload-title { display: inline-flex; min-width: 156px; min-height: 38px; padding: 8px 16px; align-items: center;
  justify-content: center; border: 1px solid rgba(138,99,255,.5); border-radius: 7px; background: rgba(97,47,255,.18);
  color: var(--text); font-size: 14px; font-weight: 700; }
.file-upload-summary { max-width: 100%; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.file-upload-surface:hover, .file-upload-control.dragging .file-upload-surface { border-color: var(--brand2); background: rgba(97,47,255,.08); }
.file-upload-surface:hover .file-upload-title, .file-upload-control.dragging .file-upload-title { background: var(--brand); border-color: var(--brand2); color: #fff; }
.file-upload-native:focus-visible + .file-upload-surface { outline: 2px solid rgba(138,99,255,.55); outline-offset: 2px; }
.file-upload-control.has-files .file-upload-surface { border-style: solid; background: rgba(97,47,255,.06); }
textarea { min-height: 70px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-bg { position: fixed; inset: 0; background: var(--dialog-overlay); backdrop-filter: blur(4px); display: none;
  align-items: flex-start; justify-content: center; overflow-y: auto; padding: 12px 16px; z-index: 200; }
.modal-bg.show { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--dialog-radius); box-shadow: var(--dialog-shadow);
  padding: 24px; width: 100%; max-width: 460px; }
/* 结账弹窗：PayPal 按钮组高度固定（每个 45px），弹窗随内容自适应，不再撑满整屏 */
.checkout-modal { max-width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  display: flex; flex-direction: column; overflow: hidden; }
.checkout-modal h3 { flex: 0 0 auto; }
.checkout-modal #coAmount, .checkout-modal #coStatus, .checkout-modal #coClose { flex: 0 0 auto; }
.checkout-dropin { margin-top: 14px; flex: 0 1 auto; min-height: 0; padding: 2px 0 0;
  overflow-y: auto; overscroll-behavior: contain; }
.checkout-dropin:empty { display: none; }
.status { margin-top: 14px; padding: 12px; border-radius: 8px; font-size: 14px; display: none; }
.status.ok { background: rgba(62,207,142,.12); color: var(--ok); display: block; }
.status.warn { background: rgba(228,178,36,.12); color: #e4b224; display: block; }
.status.err { background: rgba(255,107,107,.12); color: var(--err); display: block; }
.notice { background: rgba(255,193,7,.08); border: 1px solid rgba(255,193,7,.25);
  color: #e0b64a; font-size: 12px; padding: 10px 12px; border-radius: 8px; margin: 16px 0; }
/* 实物业务线：配送说明是信息而不是警告，用中性色和调校文件的免责提示区分开 */
.notice.info { background: rgba(97,47,255,.07); border-color: rgba(97,47,255,.25); color: var(--text); }
html[data-theme="light"] .notice.info { background: rgba(97,47,255,.06); border-color: rgba(97,47,255,.22); color: #3b3f4a; }
.shop-trust { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin: -6px 0 16px; font-size: 12px; color: var(--muted); }
.shop-trust a { color: var(--brand2); text-decoration: none; border-bottom: 1px dashed rgba(122,75,255,.45); }
.shop-trust a:hover { color: var(--brand); border-bottom-color: currentColor; }
.shop-empty { grid-column: 1 / -1; padding: 18px 0; font-size: 14px; }
.shop-more { margin: -4px 0 12px; font-size: 13px; }
.shop-more-link { color: var(--brand2); font-weight: 600; text-decoration: none; }
.shop-more-link:hover { color: var(--brand); }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 6px; border-radius: 999px; background: var(--line); color: inherit;
  font-size: 11px; font-weight: 700; line-height: 1; }
.tab.active .tab-count { background: rgba(255,255,255,.22); color: #fff; }
@media (max-width: 640px) {
  .shop-tabs { flex-wrap: wrap; }
  .shop-tabs .tab { padding: 8px 12px; font-size: 13px; }
}
.cart-box { border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  padding: 14px; margin: 0 0 18px; }
.cart-empty { color: var(--muted); font-size: 13px; }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.cart-lines, .download-list { display: flex; width: 100%; max-width: 100%; min-width: 0; flex-direction: column; gap: 10px; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) 138px 86px; align-items: center; gap: 18px;
  min-height: 76px; border-top: 1px solid var(--line); padding: 12px 0; }
.download-item {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(136px, 150px);
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.download-item-copy { min-width: 0; }
.download-file-name { overflow-wrap: anywhere; word-break: break-word; }
.download-item-action { justify-self: end; max-width: 100%; }
.cart-item-info { min-width: 0; }
.cart-item-info strong { display: block; overflow-wrap: anywhere; }
.cart-qty { display: grid; grid-template-columns: 44px 36px 44px; align-items: center; justify-content: center; gap: 5px; }
.cart-qty span { text-align: center; font-variant-numeric: tabular-nums; }
.cart-qty button { width: 44px; height: 44px; padding: 0; border-radius: 8px; border: 1px solid var(--line);
  background: var(--input-bg); color: var(--text); cursor: pointer; }
.cart-qty button:hover { border-color: var(--brand2); background: rgba(97,47,255,.12); }
.cart-qty-placeholder { width: 138px; color: var(--muted); text-align: center; }
.cart-remove { width: 86px; min-height: 38px; padding: 7px 10px; justify-self: end; }
.cart-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.cart-actions .btn { width: auto; min-width: 126px; }
.download-item .btn { width: 100%; min-width: 0; text-decoration: none; white-space: nowrap; }
.download-item strong { word-break: break-word; }
.payment-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.payment-health-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #667085;
  border-radius: 6px;
  background: var(--input-bg);
}
.payment-health-card span,
.payment-health-card small { color: var(--muted); }
.payment-health-card strong { font-size: 20px; line-height: 1.2; }
.payment-health-card.healthy { border-left-color: var(--green); }
.payment-health-card.warning { border-left-color: #d9a300; }
.payment-health-card.danger { border-left-color: var(--red); }
.payment-health-card small { line-height: 1.45; }
.chat-log { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 82%; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  background: var(--input-bg); white-space: normal; word-break: break-word; }
.chat-msg.customer { align-self: flex-start; }
.chat-msg.admin { align-self: flex-end; background: rgba(97,47,255,.14); border-color: rgba(138,99,255,.35); }
.ticket-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px;
  background: var(--input-bg); cursor: pointer; }
.ticket-item:hover { border-color: var(--brand); }
.ticket-item.unread { border-color: rgba(138,99,255,.65); background: rgba(97,47,255,.1); }
.ticket-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ticket-unread-badge { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; }
.admin-ticket-toolbar { margin-bottom: 18px; }
.admin-ticket-filter-grid { display: grid; grid-template-columns: minmax(280px, 1.35fr) minmax(220px, .65fr); gap: 12px; margin-top: 14px; }
.admin-ticket-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.admin-ticket-summary button { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--input-bg); color: var(--muted); text-align: left; font: inherit; cursor: pointer; }
.admin-ticket-summary button:hover, .admin-ticket-summary button.active { border-color: rgba(138,99,255,.65); background: rgba(97,47,255,.1); color: var(--text); }
.admin-ticket-summary span, .admin-ticket-summary strong { display: block; }
.admin-ticket-summary span { font-size: 12px; }
.admin-ticket-summary strong { margin-top: 2px; color: var(--text); font-size: 20px; line-height: 1.15; }
.admin-ticket-layout { display: grid; grid-template-columns: minmax(320px, .78fr) minmax(0, 1.45fr); gap: 18px; align-items: stretch; }
.admin-ticket-panel { min-width: 0; min-height: 610px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.admin-ticket-panel-head { min-height: 68px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.admin-ticket-panel-head h3 { margin: 0 0 2px; font-size: 16px; }
.admin-ticket-list { height: 600px; padding: 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.admin-ticket-list .ticket-item { display: block; width: 100%; margin: 0 0 8px; color: var(--text); text-align: left; font: inherit; }
.ticket-item.active { border-color: var(--brand2); background: rgba(97,47,255,.14); box-shadow: inset 3px 0 0 var(--brand2); }
.ticket-item-subject { margin-top: 7px; font-weight: 700; overflow-wrap: anywhere; }
.ticket-item-customer, .ticket-item-preview { margin-top: 4px; }
.ticket-item-preview { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ticket-status-label { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; background: #344052; color: #d7dce5; font-size: 11px; }
.ticket-status-label.waiting { background: rgba(122,90,0,.72); color: #ffe5a0; }
.ticket-status-label.closed { background: rgba(91,32,32,.82); color: #ffc1c1; }
.admin-ticket-conversation { position: relative; }
.ticket-empty-state { min-height: 610px; display: grid; place-content: center; gap: 6px; padding: 28px; color: var(--muted); text-align: center; }
.ticket-empty-state strong { color: var(--text); font-size: 17px; }
.admin-ticket-detail-head { min-height: 84px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); }
.admin-ticket-detail-head h3 { margin: 0; overflow-wrap: anywhere; }
.admin-ticket-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-ticket-head-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.admin-ticket-head-actions .btn { width: auto; min-width: 92px; padding: 8px 12px; }
.btn.danger-outline { border-color: rgba(255,107,107,.4); color: var(--err); }
.btn.danger-outline:hover { border-color: var(--err); background: rgba(255,107,107,.1); }
.admin-ticket-customer-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, 1.05fr); border-bottom: 1px solid var(--line); background: var(--input-bg); }
.admin-ticket-customer-grid > div { min-width: 0; padding: 11px 14px; border-right: 1px solid var(--line); }
.admin-ticket-customer-grid > div:last-child { border-right: 0; }
.admin-ticket-customer-grid span, .admin-ticket-customer-grid strong { display: block; }
.admin-ticket-customer-grid span { color: var(--muted); font-size: 11px; }
.admin-ticket-customer-grid strong { margin-top: 3px; font-size: 12px; overflow-wrap: anywhere; }
.ticket-order-link { padding: 0; border: 0; background: transparent; color: var(--brand2); font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.ticket-order-link:hover { text-decoration: underline; }
.admin-ticket-messages { height: 330px; margin: 0; padding: 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.admin-ticket-messages .chat-msg { max-width: min(82%, 620px); }
.admin-ticket-reply { padding: 14px 18px 18px; border-top: 1px solid var(--line); background: var(--panel-2); }
.admin-ticket-reply > label { margin-top: 0; }
.admin-ticket-reply textarea { min-height: 94px; }
.admin-ticket-reply-actions { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(150px, .3fr); gap: 10px; align-items: end; }
.admin-ticket-reply-actions label { margin-top: 8px; }
.admin-ticket-reply-actions .btn { min-height: 42px; }
.admin-refund-reason-custom { margin-top: 8px; }
.table-wrap { width: 100%; overflow-x: auto; padding-bottom: 4px; scrollbar-gutter: stable; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 720px; }
.admin-order-wrap { margin-top: 8px; padding-bottom: 6px; scrollbar-color: #35304a var(--input-bg); }
.admin-order-wrap::-webkit-scrollbar { height: 8px; }
.admin-order-wrap::-webkit-scrollbar-thumb { background: #35304a; border-width: 2px; }
.admin-order-wrap::-webkit-scrollbar-thumb:hover { background: #46406a; }
#orderListView { max-width: 1280px; margin: 0 auto; }
#orderDetailView { max-width: 1120px; margin: 0 auto; }
.admin-order-table { min-width: 980px; table-layout: fixed; }
.admin-order-table th:nth-child(1) { width: 195px; }
.admin-order-table th:nth-child(2) { width: 230px; }
.admin-order-table th:nth-child(3) { width: 240px; }
.admin-order-table th:nth-child(4) { width: 130px; }
.admin-order-table th:nth-child(5) { width: 130px; }
.admin-order-table th:nth-child(6) { width: 170px; }
.admin-order-table th:nth-child(7) { width: 120px; }
.admin-order-table th, .admin-order-table td { padding: 10px 12px; }
.admin-order-table td { vertical-align: top; overflow-wrap: anywhere; }
.admin-order-number { display: inline-block; white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-order-table .badge { display: inline-flex; white-space: nowrap; }
.admin-order-table tr.active-row td { background: rgba(97,47,255,.08); }
.admin-order-title strong, .admin-order-title span { display: block; }
.admin-custom-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); }
.admin-custom-form .full { grid-column: 1 / -1; }
.admin-custom-form label { margin: 0; font-size: 12px; }
.admin-custom-form input, .admin-custom-form select, .admin-custom-form textarea { margin: 0; }
.admin-custom-form textarea { min-height: 66px; }
.admin-custom-form .btn { padding: 8px 10px; }
.admin-original-link { display: inline-flex; align-items: center; justify-content: center; min-height: 32px;
  border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.admin-order-layout { display: block; }
.admin-order-detail-panel { width: 100%; max-width: none; margin: 0 auto; padding: 22px; }
.admin-order-detail-panel.empty { color: var(--muted); }
.admin-order-detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.admin-order-detail-head h3 { margin: 0; }
.admin-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.admin-detail-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-detail-grid div { border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); padding: 11px; min-width: 0; }
.admin-detail-grid span { display: block; color: var(--muted); font-size: 12px; }
.admin-detail-grid strong { display: block; margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; word-break: break-word; }
.admin-order-actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.admin-order-actions-row .btn { width: auto; padding: 8px 12px; }
.admin-negotiation-box { border: 1px solid rgba(255,193,7,.28); border-radius: 8px; background: rgba(255,193,7,.08); padding: 10px; margin: 10px 0; }
.admin-negotiation-box p { margin: 5px 0 0; color: var(--text-2); font-size: 13px; white-space: pre-wrap; }
.custom-workflow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.custom-workflow-step { min-width: 0; padding: 10px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); color: var(--muted); text-align: center; }
.custom-workflow-step span { display: grid; place-items: center; width: 24px; height: 24px; margin: 0 auto 6px; border-radius: 50%; background: #272d39; color: #cbd0da; font-size: 11px; font-weight: 800; }
.custom-workflow-step strong { display: block; font-size: 12px; line-height: 1.35; }
.custom-workflow-step.complete { border-color: rgba(42,158,94,.32); color: #a5d8ba; }
.custom-workflow-step.complete span { background: #237a4a; color: #fff; }
.custom-workflow-step.current { border-color: var(--brand); background: rgba(97,47,255,.15); color: #fff; box-shadow: 0 8px 20px rgba(97,47,255,.14); }
.custom-workflow-step.current span { background: var(--brand); color: #fff; }
.custom-order-source { display: flex; justify-content: flex-start; margin: 10px 0 14px; }
.admin-custom-step-card { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--panel) 76%, transparent); }
.admin-custom-step-card.current { border-color: rgba(97,47,255,.5); }
.admin-custom-step-card.complete { border-color: rgba(42,158,94,.28); }
.admin-custom-step-card.attention { border-color: rgba(255,193,7,.38); }
.admin-step-locked { padding: 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; }
@media (max-width: 760px) {
  .custom-workflow { grid-template-columns: 1fr; }
  .custom-workflow-step { display: flex; align-items: center; gap: 9px; text-align: left; }
  .custom-workflow-step span { flex: 0 0 24px; margin: 0; }
}
.admin-payment-box { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--input-bg); padding: 14px; }
.admin-payment-box.danger-box { border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.07); }
.admin-payment-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.admin-payment-head h3 { margin: 0; }
.admin-refund-form { display: grid; grid-template-columns: minmax(160px, .6fr) minmax(220px, 1fr); gap: 10px; align-items: end;
  margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-refund-form label { margin-top: 0; }
.admin-refund-form .checkline { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 0; }
.admin-refund-form .checkline input { width: auto; }
.admin-refund-form .full { grid-column: 1 / -1; }
.btn.danger { background: #b33a3a; }
.btn.danger:hover { background: #d24c4c; }
.compact-table table { min-width: 620px; }
.payment-event-table { min-width: 980px; table-layout: fixed; }
.payment-event-table th:nth-child(1) { width: 210px; }
.payment-event-table th:nth-child(2) { width: 230px; }
.payment-event-table th:nth-child(3) { width: 260px; }
.payment-event-table th:nth-child(4) { width: 120px; }
.payment-event-table th:nth-child(6) { width: 120px; }
.payment-event-table td { vertical-align: top; overflow-wrap: anywhere; }
.payment-event-unread td { background: rgba(255,107,107,.05); }
.event-result { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.event-result + .event-result { margin-left: 5px; }
.event-result.ok { color: var(--ok); border-color: rgba(62,207,142,.45); background: rgba(62,207,142,.1); }
.event-result.err { color: var(--err); border-color: rgba(255,107,107,.45); background: rgba(255,107,107,.1); }
.event-result.muted { color: var(--muted); }
.admin-status-hint { border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); padding: 10px; }
.admin-status-hint span { display: block; color: var(--muted); font-size: 12px; }
.admin-status-hint strong { display: block; margin-top: 3px; }
.admin-status-hint p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.admin-live-hint { text-align: right; margin: -6px 0 10px; }
.admin-mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 14px; }
.admin-mini-stats div { border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); padding: 10px; }
.admin-mini-stats strong { display: block; font-size: 20px; line-height: 1.1; }
.admin-mini-stats span { color: var(--muted); font-size: 12px; }
.admin-product-tools { padding: 14px; margin-bottom: 18px; }
.admin-product-subtabs { margin: 10px 0 14px; }
.admin-product-list-toolbar { padding: 14px; margin-bottom: 18px; }
.admin-new-product-btn { width: auto; padding: 9px 16px; white-space: nowrap; }
.admin-product-filter-grid { display: grid; grid-template-columns: minmax(260px, 1.3fr) minmax(150px, .5fr) minmax(200px, .65fr) auto;
  gap: 10px; align-items: end; }
.admin-product-filter-grid label { margin-top: 0; }
.admin-product-reset { width: auto; min-width: 82px; }
.admin-product-groups { display: grid; gap: 20px; }
.admin-product-group { min-width: 0; }
.admin-product-group-head { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 10px; padding: 0 2px 9px; border-bottom: 1px solid var(--line); }
.admin-product-group-head h3 { margin: 0; font-size: 16px; }
.admin-product-group-head .meta { white-space: nowrap; }
.admin-product-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.admin-product-card { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.admin-product-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
.admin-product-card-actions .btn { padding: 7px; flex: 1; }
.admin-product-empty { padding: 36px 18px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; }
.product-price-note { margin: 8px 0 16px; }
.admin-product-editor { width: 100%; margin: 20px 0 24px; }
.admin-product-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.admin-product-editor-head h3 { margin: 0 0 3px; font-size: 18px; }
.product-editor-close { width: auto; min-width: 104px; padding: 8px 12px; }
.product-editor-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 16px; align-items: start; }
.product-editor-section { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.product-editor-section h4 { margin: 0 0 10px; font-size: 15px; }
.product-editor-section textarea { min-height: 92px; }
.product-assets-section { position: sticky; top: 14px; }
.product-checkline { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.product-checkline input { width: auto; flex: 0 0 auto; }
.product-asset-divider { height: 1px; margin: 16px 0 4px; background: var(--line); }
.product-active-check { margin-top: 16px; padding: 10px; border: 1px solid rgba(62,207,142,.28); border-radius: 8px; background: rgba(62,207,142,.06); }
.product-translation-section { margin-top: 16px; }
.product-translate-btn { width: auto; padding: 8px 13px; white-space: nowrap; }
.product-translation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 14px; border-top: 1px solid var(--line); }
.product-language-column { min-width: 0; padding: 14px 16px 0 0; }
.product-language-column + .product-language-column { padding: 14px 0 0 16px; border-left: 1px solid var(--line); }
.product-language-column > strong { display: block; color: var(--muted); font-size: 13px; }
.product-editor-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.product-editor-actions .btn { width: auto; min-width: 130px; }
.admin-tools-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.admin-tools-head h3 { margin: 0 0 2px; }
.category-form-row { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .9fr) auto; gap: 10px; align-items: end; }
.category-form-row label { margin-top: 0; }
.category-picker { position: relative; min-width: 0; }
.category-picker-trigger { width: 100%; min-height: 42px; padding: 9px 12px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg);
  color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.category-picker-trigger:hover, .category-picker.open .category-picker-trigger { border-color: rgba(138,99,255,.72); background: rgba(97,47,255,.07); }
.category-picker-trigger:focus-visible { outline: 2px solid rgba(138,99,255,.55); outline-offset: 2px; }
.category-picker-trigger [data-category-picker-label] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-picker-chevron { width: 8px; height: 8px; flex: 0 0 8px; margin: -4px 2px 0 0; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); color: transparent; font-size: 0; transform: rotate(45deg); transition: transform .15s ease, margin .15s ease; }
.category-picker.open .category-picker-chevron { margin-top: 4px; transform: rotate(225deg); }
.category-picker-menu { position: absolute; z-index: 80; top: calc(100% + 6px); left: 0; right: 0; max-height: 340px;
  overflow-y: auto; padding: 6px; border: 1px solid rgba(138,99,255,.48); border-radius: 8px; background: var(--panel-3);
  box-shadow: 0 18px 40px rgba(0,0,0,.42); }
.category-picker-menu[hidden] { display: none; }
.category-picker-toolbar { position: sticky; top: -6px; z-index: 2; min-height: 38px; margin: -6px -6px 5px; padding: 7px 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); background: var(--panel-3); }
.category-picker-toolbar > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.category-picker-toolbar > div { display: inline-flex; gap: 5px; }
.category-picker-toolbar button { width: auto; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--input-bg); color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.category-picker-toolbar button:hover, .category-picker-toolbar button:focus-visible { border-color: var(--brand2); color: var(--text); outline: 0; }
.category-picker-option-row { width: calc(100% - var(--level, 0) * 18px); margin-left: calc(var(--level, 0) * 18px);
  display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; border-radius: 6px; }
.category-picker-option-row.active { background: rgba(97,47,255,.1); }
.category-picker-option-row .category-picker-option { padding-left: 4px; }
.category-picker-node-toggle, .category-picker-node-spacer { width: 28px; height: 34px; }
.category-picker-node-toggle { display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer; }
.category-picker-node-toggle:hover, .category-picker-node-toggle:focus-visible { border-color: rgba(138,99,255,.55); color: var(--text); background: rgba(97,47,255,.12); outline: 0; }
.category-picker-node-toggle span { display: block; font-size: 21px; line-height: 1; transition: transform .15s ease; }
.category-picker-node-toggle.expanded span { transform: rotate(90deg); }
.category-picker-option { width: 100%; min-height: 46px; padding: 7px 10px 7px calc(10px + var(--level, 0) * 18px);
  display: flex; align-items: center; gap: 9px; border: 0; border-radius: 6px; background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; }
.category-picker-option:hover, .category-picker-option.active { background: rgba(97,47,255,.17); }
.category-picker-option.active { box-shadow: inset 2px 0 var(--brand2); }
.category-picker-branch { width: 13px; flex: 0 0 13px; color: rgba(160,145,210,.8); text-align: center; }
.category-picker-option-copy { min-width: 0; }
.category-picker-option strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.category-picker-option small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.category-tree-actions { display: inline-flex; align-items: center; gap: 8px; }
.category-tree-actions .btn { width: auto; padding: 7px 11px; font-size: 12px; white-space: nowrap; }
.category-admin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.category-tree-node { margin-left: calc(var(--depth, 0) * 22px); }
.category-children { margin: 7px 0 0 12px; padding-left: 14px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.category-admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 46px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); padding: 8px 10px; }
.category-admin-row { cursor: default; }
.category-admin-row:hover { border-color: rgba(138,99,255,.62); }
.category-admin-row.selected-parent { border-color: var(--brand2); box-shadow: inset 3px 0 var(--brand2); }
.category-admin-row.has-children { border-color: rgba(138,99,255,.45); background: rgba(97,47,255,.08); }
.category-tree-toggle, .category-tree-toggle-spacer { width: 30px; height: 30px; flex: 0 0 30px; }
.category-tree-toggle { display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer; }
.category-tree-toggle:hover { color: var(--text); border-color: rgba(138,99,255,.7); background: rgba(97,47,255,.12); }
.category-tree-toggle:focus-visible { outline: 2px solid rgba(138,99,255,.55); outline-offset: 2px; }
.category-tree-toggle span { display: block; font-size: 22px; line-height: 1; transform: rotate(0deg); transition: transform .15s ease; }
.category-admin-row.expanded .category-tree-toggle span { transform: rotate(90deg); }
.category-main { min-width: 0; flex: 1 1 auto; border-radius: 5px; cursor: pointer; }
.category-main:focus-visible { outline: 2px solid rgba(138,99,255,.55); outline-offset: 3px; }
.category-side { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.category-admin-row strong { display: block; font-size: 14px; line-height: 1.2; }
.category-admin-row .meta { display: block; font-size: 11px; margin-top: 3px; }
.category-admin-row .btn { width: auto; padding: 5px 9px; font-size: 12px; flex: 0 0 auto; }
.btn.danger-lite { color: var(--err); }
.asset-manager { margin-top: 8px; }
.asset-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.admin-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-top: 8px; }
.admin-image-tile { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); }
.asset-image-frame { position: relative; }
.admin-image-tile img { display: block; width: 100%; height: 86px; object-fit: cover; background: var(--deep); }
.sortable-image-tile { cursor: grab; transition: border-color .15s ease, opacity .15s ease, transform .15s ease; }
.sortable-image-tile:hover { border-color: rgba(138,99,255,.72); }
.sortable-image-tile.is-dragging { opacity: .48; cursor: grabbing; transform: scale(.98); }
.asset-cover-badge { position: absolute; left: 6px; top: 6px; z-index: 1; padding: 3px 6px; border-radius: 5px;
  background: rgba(18,92,58,.94); color: #dff8e9; font-size: 10px; font-weight: 700; }
.asset-drag-handle { position: absolute; right: 6px; top: 6px; z-index: 1; display: grid; place-items: center;
  width: 26px; height: 26px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px;
  background: rgba(8,10,15,.84); color: var(--text-2); font-size: 15px; line-height: 1; cursor: grab; }
.asset-name { min-height: 34px; padding: 6px 8px; color: var(--muted); font-size: 11px; line-height: 1.35; word-break: break-all; }
.asset-mini-btn { width: auto; padding: 5px 9px; font-size: 12px; }
.admin-image-tile .asset-mini-btn { width: calc(100% - 12px); margin: 0 6px 6px; }
.asset-sort-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 0 6px 6px; }
.asset-sort-button { min-height: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-3);
  color: var(--text); cursor: pointer; font: 15px/1 inherit; }
.asset-sort-button:hover:not(:disabled) { border-color: var(--brand2); background: rgba(97,47,255,.14); }
.asset-sort-button:disabled { color: #4f5664; cursor: default; }
.admin-file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); }
.admin-file-row strong { display: block; max-width: 100%; word-break: break-all; font-size: 13px; }
.admin-file-list { display: grid; gap: 8px; margin-top: 8px; }
.product-upload-progress { margin-top: 14px; padding: 13px; border: 1px solid rgba(138,99,255,.4);
  border-radius: 8px; background: rgba(97,47,255,.07); }
.product-upload-progress[hidden] { display: none; }
.product-upload-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.product-upload-progress-head strong, .product-upload-progress-head .meta { display: block; }
.product-upload-progress-head .meta { margin-top: 3px; }
.upload-cancel-button { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel-3); color: var(--text); cursor: pointer; font: 20px/1 inherit; }
.upload-cancel-button:hover { border-color: var(--err); color: var(--err); }
.product-upload-progress-track { height: 8px; margin-top: 11px; overflow: hidden; border-radius: 4px; background: var(--deep); }
.product-upload-progress-track span { display: block; width: 0; height: 100%; background: var(--brand); transition: width .12s linear; }
.admin-file-list .admin-file-row { margin-top: 0; }
.admin-mail-subtabs { margin: 4px 0 16px; }
.admin-mail-subtabs .tab { min-width: 168px; justify-content: center; }
.admin-mail-view { min-width: 0; }
.admin-mail-toolbar { margin-bottom: 12px; padding-top: 14px; padding-bottom: 14px; }
.admin-mail-panel-head { margin-bottom: 14px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.admin-mail-panel-head h3, .admin-mail-compose-head h3 { margin: 0 0 4px; }
.admin-mail-panel-head p, .admin-mail-compose-head p { margin: 0; }
.admin-mail-toolbar-row { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px); gap: 10px; align-items: end; }
.admin-mail-toolbar-row label { margin: 0 0 5px; }
.admin-mail-toolbar-meta { min-height: 20px; margin-top: 10px; }
.admin-mail-toolbar-meta .status { margin-top: 8px; }
.admin-campaign-card { padding: 0; overflow: hidden; }
.admin-mail-compose-head { padding: 18px 20px 16px; border-bottom: 1px solid var(--line); }
.admin-campaign-layout { display: grid; grid-template-columns: minmax(330px, .78fr) minmax(0, 1.22fr); align-items: stretch; }
.admin-campaign-recipients, .admin-campaign-composer { min-width: 0; padding: 20px; }
.admin-campaign-recipients { border-right: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 48%, transparent); }
.admin-campaign-section-head { display: flex; min-height: 40px; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-campaign-section-head h4 { margin: 0 0 4px; color: var(--text); font-size: 16px; }
.admin-campaign-section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.admin-campaign-section-head .btn { width: auto; min-width: 64px; padding: 7px 10px; }
.admin-campaign-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 15px 0 0; padding: 0; border: 0; }
.admin-campaign-modes .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.admin-campaign-mode { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); color: var(--text); cursor: pointer; }
.admin-campaign-mode.active { border-color: rgba(138,99,255,.75); background: rgba(97,47,255,.1); }
.admin-campaign-mode input { flex: 0 0 auto; margin: 2px 0 0; }
.admin-campaign-mode span, .admin-campaign-mode strong, .admin-campaign-mode small { display: block; }
.admin-campaign-mode small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.admin-customer-picker { margin-top: 10px; }
.admin-customer-picker-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.admin-customer-picker-toolbar .btn { width: auto; min-width: 64px; padding-right: 10px; padding-left: 10px; }
.admin-customer-picker .meta { margin-top: 8px; }
.admin-customer-picker-list { height: 324px; margin-top: 9px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); }
.admin-customer-picker-row { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.admin-customer-picker-row:last-child { border-bottom: 0; }
.admin-customer-picker-row:hover { background: rgba(97,47,255,.08); }
.admin-customer-picker-row input { flex: 0 0 auto; margin: 2px 0 0; }
.admin-customer-picker-row span, .admin-customer-picker-row strong, .admin-customer-picker-row small { display: block; min-width: 0; }
.admin-customer-picker-row strong { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; }
.admin-customer-picker-row small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.admin-campaign-composer > label { margin-top: 15px; }
.admin-campaign-card textarea { min-height: 276px; }
.admin-campaign-note { display: flex; gap: 8px; margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(62,207,142,.2); border-radius: 8px;
  background: rgba(62,207,142,.06); color: #9ed8be; font-size: 12px; line-height: 1.55; }
.admin-campaign-note > span:first-child { flex: 0 0 auto; color: var(--ok); font-weight: 800; }
.admin-campaign-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.admin-campaign-actions .btn { width: auto; min-width: 150px; }
.admin-mail-layout { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.28fr); gap: 16px; align-items: start; }
.admin-mail-list, .admin-mail-detail { min-width: 0; min-height: 560px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.admin-mail-list { max-height: 720px; overflow-y: auto; }
.admin-mail-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 9px; width: 100%; padding: 12px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.admin-mail-row:hover, .admin-mail-row.active { background: rgba(97,47,255,.09); }
.admin-mail-row.active { box-shadow: inset 3px 0 var(--brand); }
.admin-mail-row.unread .admin-mail-subject, .admin-mail-row.unread .admin-mail-sender { font-weight: 700; color: #fff; }
.admin-mail-dot { width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: transparent; }
.admin-mail-row.unread .admin-mail-dot { background: var(--brand2); box-shadow: 0 0 0 3px rgba(138,99,255,.12); }
.admin-mail-copy { min-width: 0; }
.admin-mail-sender, .admin-mail-subject { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-mail-sender { font-size: 13px; }
.admin-mail-subject { margin-top: 3px; color: var(--text-2); font-size: 12px; }
.admin-mail-date { color: var(--muted); font-size: 11px; white-space: nowrap; }
.admin-mail-detail { padding: 18px; overflow-wrap: anywhere; }
.admin-mail-empty { display: flex; min-height: 180px; align-items: center; justify-content: center; padding: 24px; color: var(--muted); text-align: center; }
.admin-mail-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.admin-mail-detail-head h3 { margin: 0 0 8px; font-size: 18px; }
.admin-mail-addresses { color: var(--muted); font-size: 12px; line-height: 1.6; }
.admin-mail-body { min-height: 180px; margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); }
.admin-mail-body pre { margin: 0; color: var(--text-2); font: 13px/1.65 inherit; white-space: pre-wrap; word-break: break-word; }
.admin-mail-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.admin-mail-attachment { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; }
.admin-mail-reply { padding-top: 14px; border-top: 1px solid var(--line); }
.admin-mail-reply textarea { min-height: 120px; }
.admin-mail-reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.admin-mail-reply-actions .btn { width: auto; min-width: 120px; }

/* ── 邮件中心 · IM 会话布局 ── */
.admin-conv-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%;
  padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text);
  text-align: left; font: inherit; cursor: pointer; }
.admin-conv-row:hover, .admin-conv-row.active { background: rgba(97,47,255,.09); }
.admin-conv-row.active { box-shadow: inset 3px 0 var(--brand); }
.admin-conv-avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 auto;
  border-radius: 50%; background: linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%); color: #fff; font-size: 15px; font-weight: 700; }
.admin-conv-copy { min-width: 0; }
.admin-conv-name, .admin-conv-subject { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-conv-name { font-size: 13px; font-weight: 600; }
.admin-conv-subject { margin-top: 2px; color: var(--muted); font-size: 12px; }
.admin-conv-row.unread .admin-conv-name, .admin-conv-row.unread .admin-conv-subject { font-weight: 700; color: var(--text); }
.admin-conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.admin-conv-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.admin-mail-detail.chat { padding: 0; }
.admin-mail-chat { display: flex; flex-direction: column; height: 720px; min-height: 560px; max-height: calc(100vh - 140px); }
.admin-mail-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.admin-mail-chat-peer { min-width: 0; }
.admin-mail-chat-peer strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.admin-mail-chat-peer .meta { display: block; margin-top: 2px; }
.admin-mail-chat-log { flex: 1 1 auto; margin-top: 0; padding: 16px 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.admin-mail-chat-log .chat-msg { max-width: min(78%, 640px); }
.admin-mail-chat-subject { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.admin-mail-chat-text { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.6; }
/* 引用折叠（Gmail 式） */
.admin-mail-quote-toggle { margin-top: 7px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.admin-mail-quote-toggle:hover { color: var(--text); border-color: var(--brand2); }
.admin-mail-quote { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--line); border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--panel-2) 70%, transparent); color: var(--muted); font-size: 12px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.admin-mail-chat-time { margin-top: 6px; color: var(--muted); font-size: 11px; }
.chat-msg.admin .admin-mail-chat-time { text-align: right; }
.admin-mail-chat-reply { padding: 12px 18px 14px; border-top: 1px solid var(--line); background: var(--panel-2); }
.admin-mail-chat-reply textarea { min-height: 72px; max-height: 160px; resize: vertical; }
.admin-mail-chat-reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.admin-mail-chat-reply-actions .btn { width: auto; min-width: 110px; }
.admin-mail-chat-reply .status { margin-top: 6px; }
.admin-visit-toolbar { margin-bottom: 14px; }
.visit-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.visit-toolbar-actions .btn { width: auto; min-width: 96px; }
.admin-visit-filter-grid { display: grid; grid-template-columns: minmax(320px, 1.4fr) minmax(220px, .6fr); gap: 14px; }
.visit-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 14px;
  overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); }
.visit-summary-item { min-width: 0; padding: 14px 16px; border-right: 1px solid var(--line); }
.visit-summary-item:last-child { border-right: 0; }
.visit-summary-item span, .visit-summary-item strong, .visit-summary-item small { display: block; }
.visit-summary-item span { color: var(--muted); font-size: 12px; }
.visit-summary-item strong { margin: 5px 0 2px; color: var(--text); font-size: 24px; line-height: 1.1; }
.visit-summary-item small { color: var(--muted); font-size: 11px; }
.visit-insight-grid { display: grid; grid-template-columns: minmax(560px, 1.2fr) minmax(460px, .8fr); gap: 14px; align-items: start; }
.visit-insight-grid > .card { margin: 0; }
.visit-panel { padding: 0; overflow: hidden; }
.visit-panel-toggle { width: 100%; min-height: 78px; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 18px; padding: 16px 18px; border: 0; border-radius: 0; background: transparent;
  color: var(--text); text-align: left; cursor: pointer; transition: background-color .16s ease; }
.visit-panel-toggle:hover { background: var(--panel-2); }
.visit-panel-toggle:focus-visible { outline: 2px solid #8b68f6; outline-offset: -3px; }
.visit-panel-heading { display: block; min-width: 0; }
.visit-panel-heading strong, .visit-panel-heading small { display: block; }
.visit-panel-heading strong { margin-bottom: 5px; font-size: 16px; }
.visit-panel-heading small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
.visit-panel-state { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.visit-panel-chevron { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line);
  border-radius: 7px; color: var(--brand2); font-size: 20px; line-height: 1; transition: transform .18s ease, border-color .18s ease; }
.visit-panel.expanded .visit-panel-chevron { transform: rotate(180deg); border-color: #6546b5; }
.visit-panel-body { padding: 14px 18px 18px; border-top: 1px solid var(--line); background: var(--panel-2); }
.visit-location-table { min-width: 640px; table-layout: fixed; }
.visit-location-table th:nth-child(1) { width: 210px; }
.visit-location-table th:nth-child(2), .visit-location-table th:nth-child(3) { width: 80px; }
.visit-location-table td .meta { display: block; margin-top: 3px; }
.visit-ranking-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 16px; }
.visit-ranking-columns h4 { margin: 0 0 10px; font-size: 13px; }
.visit-ranking-list { display: grid; gap: 10px; }
.visit-ranking-item > div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.visit-ranking-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit-ranking-track { display: block; height: 5px; margin-top: 5px; overflow: hidden; border-radius: 3px; background: var(--deep); }
.visit-ranking-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.admin-visit-table-card { margin-top: 14px; }
.visit-ip-table { min-width: 1120px; table-layout: fixed; }
.visit-ip-table th:nth-child(1) { width: 220px; }
.visit-ip-table th:nth-child(2) { width: 170px; }
.visit-ip-table th:nth-child(3) { width: 70px; }
.visit-ip-table th:nth-child(4) { width: 210px; }
.visit-ip-table th:nth-child(5) { width: 270px; }
.visit-ip-table th, .visit-detail-table th { position: relative; }
.visit-ip-table td, .visit-detail-table td { overflow-wrap: anywhere; vertical-align: top; }
.visit-ip-table td .meta, .visit-detail-table td .meta { display: block; margin-top: 3px; line-height: 1.45; }
.visit-detail-table { min-width: 1080px; table-layout: fixed; }
.visit-detail-table th:nth-child(1) { width: 160px; }
.visit-detail-table th:nth-child(2) { width: 220px; }
.visit-detail-table th:nth-child(3) { width: 150px; }
.visit-detail-table th:nth-child(4) { width: 220px; }
.admin-storage-overview, .admin-storage-filters { margin-bottom: 16px; }
.storage-disk-alert { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .7fr) auto;
  align-items: center; gap: 16px; margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--input-bg); }
.storage-disk-alert.warning { border-color: #8a6500; background: rgba(122,90,0,.12); }
.storage-disk-alert.critical { border-color: #8a3030; background: rgba(91,32,32,.16); }
.storage-disk-copy strong, .storage-disk-copy span { display: block; }
.storage-disk-copy span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.storage-disk-meter { height: 9px; overflow: hidden; border-radius: 5px; background: var(--deep); }
.storage-disk-meter span { display: block; height: 100%; border-radius: inherit; background: #2ba86d; }
.storage-disk-alert.warning .storage-disk-meter span { background: #d7a512; }
.storage-disk-alert.critical .storage-disk-meter span { background: var(--err); }
.storage-disk-percent { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.storage-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 1px;
  overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.storage-summary-item { min-width: 0; padding: 12px 14px; background: var(--input-bg); }
.storage-summary-item strong, .storage-summary-item span, .storage-summary-item small { display: block; }
.storage-summary-item strong { font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.storage-summary-item span, .storage-summary-item small { color: var(--muted); font-size: 11px; }
.storage-summary-item strong { margin: 4px 0; }
.storage-directory-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.storage-directory-strip > div { min-width: 0; padding: 9px 11px; border-left: 3px solid rgba(138,99,255,.6); background: var(--input-bg); }
.storage-directory-strip strong, .storage-directory-strip span, .storage-directory-strip small { display: block; }
.storage-directory-strip span, .storage-directory-strip small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.storage-directory-strip strong { margin: 3px 0; }
.storage-editor-usage { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.storage-editor-head strong, .storage-editor-head span { display: block; }
.storage-editor-head span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.storage-editor-directory-strip { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.storage-editor-directory-strip > div { border-left-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--input-bg)); }
.storage-filter-grid { display: grid; grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(135px, .32fr)) auto;
  align-items: end; gap: 12px; margin-top: 12px; }
.storage-filter-grid label { margin-top: 0; }
.storage-reset-btn { width: auto; min-height: 44px; white-space: nowrap; }
.admin-storage-content { display: grid; grid-template-columns: minmax(270px, .32fr) minmax(700px, 1fr);
  gap: 16px; align-items: start; }
.storage-ranking-panel { position: sticky; top: 16px; }
.storage-ranking-list { display: grid; gap: 11px; margin-top: 14px; }
.storage-ranking-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.storage-rank-number { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line);
  border-radius: 5px; color: var(--muted); font-size: 10px; }
.storage-ranking-copy { min-width: 0; }
.storage-ranking-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.storage-ranking-row > span:last-child { color: var(--muted); font-size: 11px; white-space: nowrap; }
.storage-ranking-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.storage-ranking-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.storage-ranking-head span { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.storage-ranking-bar { height: 5px; margin-top: 6px; overflow: hidden; border-radius: 3px; background: var(--input-bg); }
.storage-ranking-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.storage-file-table { min-width: 1120px; table-layout: fixed; }
.storage-file-table th:nth-child(1) { width: 230px; }
.storage-file-table th:nth-child(2) { width: 130px; }
.storage-file-table th:nth-child(3) { width: 105px; }
.storage-file-table th:nth-child(4) { width: 250px; }
.storage-file-table th:nth-child(5) { width: 145px; }
.storage-file-table th:nth-child(6) { width: 85px; }
.storage-file-table th:nth-child(7) { width: 135px; }
.admin-order-table th, .storage-file-table th { position: relative; }
.table-column-resizer { position: absolute; top: 0; right: -5px; z-index: 3; width: 10px; height: 100%;
  cursor: col-resize; touch-action: none; user-select: none; }
.table-column-resizer::after { content: ""; position: absolute; top: 18%; bottom: 18%; left: 4px; width: 2px;
  border-radius: 1px; background: transparent; transition: background .15s; }
.table-column-resizer:hover::after, .table-column-resizer:active::after { background: var(--brand); }
.table-column-resizing, .table-column-resizing * { cursor: col-resize !important; user-select: none !important; }
.storage-file-name, .storage-file-stored-name, .storage-stored-name { display: block; overflow-wrap: anywhere; }
.storage-file-name { color: var(--text); font-weight: 700; }
.storage-file-stored-name { margin-top: 3px; color: var(--muted); font-size: 11px; }
.storage-state { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px;
  background: #344052; color: #fff; font-size: 11px; white-space: nowrap; }
.storage-state.orphan { background: #5b2020; }
.storage-state.missing { background: #7a5a00; }
.storage-reference-list { display: grid; gap: 4px; }
.storage-reference-link { width: fit-content; max-width: 100%; padding: 0; border: 0; background: none; color: #a98cff;
  text-align: left; font: 12px/1.4 inherit; cursor: pointer; overflow-wrap: anywhere; }
.storage-reference-link span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.storage-reference-link:hover { color: var(--brand2); text-decoration: underline; }
.storage-file-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.storage-file-actions .btn { width: auto; min-width: 58px; padding: 6px 8px; font-size: 11px; }
.storage-protected-reason { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.account-page main { width: min(1160px, 100%); padding-top: 34px; padding-bottom: 48px; }
.account-page main > h1 { margin: 0; }
.account-page #userBox { max-width: 1080px; margin: 0 auto; }
.account-order-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.account-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 26px; }
.account-subnav .tab { display: inline-flex; align-items: center; gap: 7px; }
.account-panel { max-width: 1080px; margin: 0 auto; }
.account-profile-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.account-mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.account-mini-card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text);
  padding: 14px; text-align: left; cursor: pointer; font: inherit; }
.account-mini-card:hover { border-color: var(--brand); background: rgba(97,47,255,.08); }
.account-mini-grid strong { display: block; font-size: 22px; line-height: 1.1; }
.account-mini-grid span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.order-filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.order-filter-tabs .tab { margin: 0; }
/* 订单状态与流程状态使用同一套菜单结构、角标与选中态。 */
.admin-filter-group { display: flex; align-items: baseline; gap: 12px; margin: 10px 0; }
.admin-filter-group .order-filter-tabs { flex: 1 1 auto; margin: 0; }
.admin-filter-label { flex: 0 0 auto; min-width: 74px; font-size: 12px; color: var(--muted);
  padding-top: 6px; letter-spacing: .3px; }
.admin-order-status-group { align-items: center; margin: 12px 0 18px; padding: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--panel) 66%, transparent); }
.admin-order-status-group .admin-filter-label { min-width: 86px; padding: 0 10px 0 4px; border-right: 1px solid var(--line);
  color: var(--text); font-weight: 650; }
.admin-order-status-tabs { flex-wrap: nowrap; min-width: 0; overflow-x: auto; padding-bottom: 1px; scrollbar-width: thin; }
.admin-order-status-tabs .tab { flex: 0 0 auto; min-height: 38px; justify-content: center; }
.admin-order-status-tabs .tab[aria-selected="true"] { box-shadow: 0 8px 20px rgba(97,47,255,.18); }
.admin-order-flow-group { margin-top: -8px; }
@media (max-width: 760px) {
  .admin-filter-group { flex-direction: column; gap: 6px; }
  .admin-filter-label { min-width: 0; padding-top: 0; }
  .admin-order-status-group { align-items: stretch; padding: 10px; }
  .admin-order-status-group .admin-filter-label { width: 100%; padding: 0 2px 9px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-order-status-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; overflow: visible; }
  .admin-order-status-tabs .tab { min-width: 0; padding: 8px 10px; }
  .admin-order-status-tabs [data-admin-order-filter="ALL"] { grid-column: 1 / -1; }
  .admin-order-flow-group { margin-top: -4px; }
}
.account-orders-heading { margin-bottom: 14px; }
.account-orders-heading .meta { margin-top: 5px; }
.account-order-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) auto; align-items: end; gap: 18px;
  padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.account-order-search { margin: 0; }
.account-order-search span, .account-control-label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.account-order-search input { min-height: 42px; }
.account-order-filter-group { min-width: max-content; }
.account-orders-empty { padding: 34px 18px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; }
.account-orders-empty strong { color: var(--text); font-size: 15px; }
.account-orders-empty p { margin: 6px 0 0; font-size: 13px; }
.admin-order-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr); gap: 12px;
  max-width: 900px; margin-bottom: 8px; }
.admin-order-toolbar label { margin-top: 0; }
.admin-order-result-meta { margin-bottom: 10px; }
.account-order-card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 18px; }
.account-order-card.account-order-focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(97,47,255,.24); }
.order-page .order-status-main { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding-top: 34px; }
.order-back-link { display: inline-flex; align-items: center; min-height: 38px; margin-bottom: 18px; color: var(--muted);
  text-decoration: none; }
.order-back-link:hover { color: var(--text); }
.order-page-heading { margin-bottom: 16px; }
.order-page-heading h1 { margin: 0 0 6px; }
.order-status-card { max-width: 560px; padding: 22px; }
.order-status-card.has-order { max-width: none; padding: 28px; }
.order-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.order-detail-head h2 { margin: 5px 0 5px; font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
.order-detail-head .badge { flex: 0 0 auto; margin-top: 2px; padding: 5px 10px; }
.order-detail-kicker { color: #b7a7ff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 22px;
  overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.order-summary-grid > div { min-width: 0; padding: 14px; background: var(--input-bg); }
.order-summary-grid span, .order-info-grid span, .order-current-state span, .order-notes > span,
.order-admin-message > span { display: block; color: var(--muted); font-size: 12px; }
.order-summary-grid strong, .order-info-grid strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.order-progress { display: grid; grid-template-columns: repeat(var(--order-steps, 4), minmax(0, 1fr)); margin: 28px 0 22px; }
.order-progress-step { position: relative; display: grid; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
.order-progress-step::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.order-progress-step:first-child::before { display: none; }
.order-progress-step span { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--panel); font-size: 12px; }
.order-progress-step strong { font-size: 12px; }
.order-progress-step.done { color: var(--text); }
.order-progress-step.done::before, .order-progress-step.done span { border-color: var(--brand); background: var(--brand); color: #fff; }
.order-progress-step.done::before { background: var(--brand); }
.order-progress-step.current span { border-color: var(--brand); color: var(--brand2); box-shadow: 0 0 0 3px rgba(97,47,255,.16); }
.order-current-state { display: grid; grid-template-columns: minmax(130px, .25fr) minmax(0, 1fr) auto; align-items: center;
  gap: 18px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.order-current-state strong { display: block; margin-top: 4px; }
.order-current-state p { margin: 0; color: var(--text-2); line-height: 1.55; }
.order-current-state .meta { text-align: right; }
.order-detail-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); gap: 28px; margin-top: 26px; }
.order-detail-section { min-width: 0; }
.order-detail-section h3 { margin: 0 0 14px; font-size: 17px; }
.order-content-item { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.order-content-item strong, .order-content-item span { display: block; overflow-wrap: anywhere; }
.order-content-item div > span, .order-content-item > span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.order-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; border-top: 1px solid var(--line); }
.order-shipment { margin: 12px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-3); }
.order-shipment > .meta { margin: 0 0 8px; }
.order-shipment .order-info-grid { margin: 0; }
.order-info-grid > div { min-width: 0; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--line); }
.order-notes, .order-admin-message { margin-top: 14px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.order-notes p, .order-admin-message p { margin: 6px 0 0; color: var(--text-2); line-height: 1.6; white-space: pre-wrap; }
.order-delivery-section .download-list { margin-top: 10px; }
.order-delivery-section .account-order-actions { margin-top: 16px; }
.order-detail-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.order-detail-footer .btn { width: auto; min-width: 150px; text-decoration: none; }
.provider-activity { margin-top: 24px; border: 1px solid var(--line); background: var(--input-bg); }
.provider-activity summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px;
  cursor: pointer; list-style: none; font-weight: 700; }
.provider-activity summary::-webkit-details-marker { display: none; }
.provider-activity summary::after { content: '\2304'; color: var(--muted); font-size: 18px; line-height: 1; transform: rotate(0deg); }
.provider-activity[open] summary::after { transform: rotate(180deg); }
.provider-activity-summary { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
.provider-activity-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.provider-activity-grid > div { min-width: 0; padding: 13px 16px; border-right: 1px solid var(--line); }
.provider-activity-grid > div:last-child { border-right: 0; }
.provider-activity-grid span, .provider-refund-list span { display: block; color: var(--muted); font-size: 12px; }
.provider-activity-grid strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.provider-refund-list { display: grid; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.provider-refund-list > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.provider-activity > .meta { margin: 0; padding: 0 16px 14px; }
.account-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.account-order-head strong { display: block; font-size: 15px; }
.account-order-head .badge { white-space: nowrap; }
.account-order-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.account-order-grid div { border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); padding: 9px; min-width: 0; }
.account-order-grid span { display: block; color: var(--muted); font-size: 12px; }
.account-order-grid strong { display: block; margin-top: 3px; font-size: 13px; word-break: break-word; }
.account-order-detail { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.account-order-detail span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--muted); font-size: 12px; }
.account-note { margin-top: 10px; border: 1px solid rgba(138,99,255,.32); border-radius: 8px; background: rgba(97,47,255,.08); padding: 10px; }
.account-note strong { font-size: 13px; }
.account-note p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; white-space: pre-wrap; }
.account-order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.account-order-actions .btn { width: auto; min-width: 120px; padding: 8px 12px; text-decoration: none; }
.account-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 0; }
.account-section-head h2 { margin: 0; }
.account-section-head .btn { width: auto; padding: 7px 12px; }
.notification-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 18px; }
.notification-item { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); padding: 12px; color: inherit; text-decoration: none; }
.notification-item.unread { border-color: rgba(138,99,255,.55); background: rgba(97,47,255,.08); }
.notification-item strong { display: block; font-size: 14px; }
.notification-item p { margin: 4px 0; color: var(--text-2); font-size: 13px; }
.quote-negotiate-form { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--input-bg); padding: 12px; }
.refund-request-form { max-width: 560px; }
.refund-request-note { border-color: rgba(55,194,255,.35); background: rgba(55,194,255,.07); }
.refund-eligibility-note { margin-top: 10px; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px;
  padding: 34px 24px 30px; margin-top: 56px; text-align: center; }
/* 主行（tagline）提一层级；次级信息保持 muted 12px */
footer > div:first-child { color: var(--text-2); font-size: 13px; line-height: 1.6; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }
/* 链接行：flex 排布，HTML 里的「·」文本节点成为独立分隔项，随 gap 均匀散开 */
.foot-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px 14px; margin-top: 12px; color: color-mix(in srgb, var(--muted) 55%, transparent); }
.foot-links a { padding: 2px 0; }
.admin-login-card { width: min(430px, 100%); margin: 0 auto; }
.admin-current-user { display: inline-flex; align-items: center; min-height: 34px; margin-left: 18px; color: var(--muted); font-size: 12px; }
.admin-header-logout { min-height: 34px; margin-left: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: transparent; color: var(--text); cursor: pointer; }
.admin-header-logout:hover { border-color: var(--brand); }
.admin-system-subtabs { margin: 4px 0 16px; }
.admin-ops-card { margin-top: 16px; }
.admin-ops-card:first-child { margin-top: 0; }
/* 后台 PayPal 配置页 */
.pay-settings-card { max-width: none; }
/* 状态概览：5 张小卡片一排，窄屏折行时最后一张撑满剩余列 */
.pay-health-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.pay-health-grid > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 80%, var(--bg)); }
.pay-health-grid span, .pay-health-grid small { display: block; color: var(--muted); }
.pay-health-grid span { font-size: 12px; }
.pay-health-grid strong { display: block; margin: 6px 0 4px; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.pay-health-grid small { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.pay-settings-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.pay-settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.pay-settings-heading h4 { margin: 0 0 4px; font-size: 16px; }
.pay-settings-heading p { margin: 0; }
/* 表单：两列，标签在输入框上方，不再套一层灰底方框 */
.pay-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.pay-form-grid > div { min-width: 0; }
.pay-form-grid label { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.pay-form-grid input, .pay-form-grid select { margin: 0; }
.pay-form-grid .admin-form-wide { grid-column: 1 / -1; }
.pay-form-hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pay-production-warning { margin: 14px 0 0; }
.pay-endpoint-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.pay-endpoint-row input[readonly] { color: var(--text-2); background: var(--input-bg); cursor: text; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.pay-endpoint-row .btn { min-width: 86px; }
/* 连接测试结果：单列清单，一行一个检查项 */
.pay-test-results { display: grid; gap: 8px; margin-top: 12px; }
.pay-test-results > .meta { padding: 12px 14px; border: 1px dashed var(--line); border-radius: 8px; }
.pay-test-item { display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: start; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel) 80%, var(--bg)); }
.pay-test-item > span { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--muted); }
.pay-test-item.ok > span { background: #2bd99f; box-shadow: 0 0 0 3px rgba(43,217,159,.14); }
.pay-test-item.warn > span { background: #e4b224; box-shadow: 0 0 0 3px rgba(228,178,36,.14); }
.pay-test-item.err > span { background: #ff6b6b; box-shadow: 0 0 0 3px rgba(255,107,107,.14); }
.pay-test-item > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.pay-test-item strong { font-size: 14px; }
.pay-test-item small { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.pay-settings-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.pay-settings-actions .btn { min-width: 132px; }
.pay-settings-card .status { margin-top: 12px; }
@media (max-width: 1180px) {
  .pay-health-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pay-health-grid > div:last-child:nth-child(3n + 2) { grid-column: span 2; }
}
.admin-ops-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)) auto; align-items: end; gap: 12px; }
.admin-ops-filter-grid label { margin-top: 0; }
.admin-ops-filter-grid > .btn { width: auto; min-height: 44px; }
.admin-create-grid { grid-template-columns: repeat(5, minmax(140px, 1fr)) auto; }
.admin-detail-grid.compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-detail-grid.compact label { margin-top: 0; }
.admin-form-wide { grid-column: 1 / -1; }
.admin-form-submit { width: auto; min-width: 190px; margin-top: 16px; }
.admin-inline-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--text); }
.admin-inline-check input { width: 18px; height: 18px; margin: 0; }
.admin-admin-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-top: 16px; }
.admin-user-card { margin: 0; }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.admin-row-actions .btn { width: auto; min-width: 96px; padding: 8px 12px; text-decoration: none; text-align: center; }
.admin-row-actions.compact { margin-top: 0; }
.admin-row-actions.compact .btn { min-width: 58px; padding: 6px 8px; font-size: 11px; }
/* 筛选标签 + 操作按钮同一行：标签靠左，按钮靠右，尺寸与标签统一 */
.admin-filter-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; }
.admin-filter-toolbar .order-filter-tabs { flex: 1 1 auto; }
.admin-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.admin-filter-actions .btn { width: auto; min-width: 0; padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.admin-audit-list { display: grid; gap: 10px; margin-top: 12px; }
.admin-audit-item { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); }
.admin-audit-item p { margin: 7px 0; color: var(--text-2); }
.admin-audit-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-audit-target { margin-top: 6px; color: var(--text-2); overflow-wrap: anywhere; }
.admin-audit-item details { margin-top: 8px; }
.admin-audit-item summary { color: var(--muted); cursor: pointer; }
.admin-audit-item pre { max-height: 320px; margin: 8px 0 0; padding: 10px; overflow: auto; border: 1px solid var(--line);
  border-radius: 7px; background: var(--deep); color: var(--text-2); font: 11px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.finance-diagnostic-resolved { border-color: rgba(86,185,129,.3); opacity: .78; }
.storage-state.resolved { background: rgba(42,126,82,.72); color: #d8f7e5; }
.finance-resolution-meta { margin-top: 8px; color: #8fcda9; }
.finance-diagnostic-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.finance-diagnostic-actions .btn { width: auto; min-width: 104px; padding: 7px 11px; }
.test-data-reset-card { border-color: rgba(255,107,107,.38); }
.test-data-warning { margin-top: 16px; line-height: 1.75; }
.test-data-reset-card .btn.danger:disabled { opacity: .45; cursor: not-allowed; }
.admin-ops-summary { margin-top: 16px; }
.admin-ops-summary .card { margin: 0; }
.finance-table th:nth-child(1) { width: 260px; }
.finance-table th:nth-child(2) { min-width: 220px; }
.finance-table td { overflow-wrap: anywhere; }
.business-identity-line { margin: 10px auto 0; color: var(--muted); font-size: 12px; }
.contact-main { width: min(1100px, 100%); }
.contact-heading { max-width: 760px; margin-bottom: 28px; }
.contact-heading h1 { margin-bottom: 8px; }
.contact-heading p { margin: 0; color: var(--text-2); line-height: 1.7; }
.contact-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact-action { display: flex; min-height: 190px; flex-direction: column; justify-content: space-between; gap: 20px;
  padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.contact-action h2 { margin: 0 0 8px; font-size: 18px; }
.contact-action p { margin: 0; color: var(--muted); line-height: 1.6; }
.contact-action .btn { width: fit-content; min-width: 170px; text-decoration: none; text-align: center; }
.contact-channel { border-color: #47327d; }
.contact-channel .btn { border-color: #6041ad; background: #171324; }
.contact-channel .btn:hover { border-color: #8a68eb; background: #211936; }
.contact-business { margin-top: 26px; padding: 22px 0; border-top: 1px solid var(--line); }
.contact-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.contact-section-head h2 { margin: 0; font-size: 20px; }
.contact-business-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 34px; margin: 16px 0 0; }
.contact-business-grid > div { display: grid; grid-template-columns: minmax(120px, .42fr) minmax(0, 1fr); gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-business-grid dt { color: var(--muted); }
.contact-business-grid dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.contact-business-grid a { color: #a98cff; text-decoration: none; }
.contact-business-grid a:hover { text-decoration: underline; }
/* 法律/合规页面排版 */
.legal { max-width: 760px; margin: 0 auto; }
.legal h1 { font-size: 24px; }
.legal h2 { font-size: 17px; margin-top: 26px; }
.legal p, .legal li { color: var(--text-2); font-size: 14px; line-height: 1.7; }
.legal ul { padding-left: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.b-SUBMITTED { background:#344052; } .b-QUOTE_READY { background:#5b3a9e; }
.b-NEGOTIATING { background:#7a5a00; } .b-QUOTE_ACCEPTED { background:#225d73; }
.b-PENDING {
  background: #8f4c00;
  color: #fff3d6;
  border: 1px solid #f59e0b;
  box-shadow: 0 0 0 1px rgba(245,158,11,.14), 0 3px 10px rgba(245,158,11,.16);
  font-weight: 700;
}
.b-PROCESSING { background:#7a5a00; }
.b-DELIVERED { background:#125c3a; } .b-PAID { background:#125c3a; }
.b-PENDING_REVIEW, .b-REVIEW_REQUIRED, .b-DISPUTED { background:#7a5a00; }
.b-REFUND_REQUESTED, .b-REFUND_PENDING { background:#5b3a9e; }
.b-PARTIALLY_REFUNDED { background:#225d73; }
.b-REFUNDED { background:#334052; }
.b-CANCELLED, .b-FAILED, .b-CLOSED { background:#5b2020; }
/* 状态徽章底色均为深色饱和色，双主题统一白字（亮主题下默认深文字会看不清） */
.b-SUBMITTED, .b-QUOTE_READY, .b-NEGOTIATING, .b-QUOTE_ACCEPTED, .b-PROCESSING,
.b-DELIVERED, .b-PAID, .b-PENDING_REVIEW, .b-REVIEW_REQUIRED, .b-DISPUTED,
.b-REFUND_REQUESTED, .b-REFUND_PENDING, .b-PARTIALLY_REFUNDED, .b-REFUNDED,
.b-CANCELLED, .b-FAILED, .b-CLOSED { color: #fff; }
@media (max-width: 1180px) {
  body.admin-page main { width: 100%; max-width: none; }
  .visit-insight-grid { grid-template-columns: 1fr; }
  .visit-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .visit-summary-item:nth-child(3) { border-right: 0; }
  .visit-summary-item:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .product-editor-grid { grid-template-columns: 1fr; }
  .product-assets-section { position: static; }
  .admin-mail-layout { grid-template-columns: minmax(270px, .75fr) minmax(0, 1.25fr); }
  .storage-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .storage-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .storage-reset-btn { width: 100%; }
  .admin-storage-content { grid-template-columns: 1fr; }
  .storage-ranking-panel { position: static; }
  .admin-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-ticket-layout { grid-template-columns: minmax(290px, .72fr) minmax(0, 1.28fr); }
  .admin-ticket-customer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-ticket-customer-grid > div:nth-child(2) { border-right: 0; }
  .admin-ticket-customer-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .admin-campaign-layout { grid-template-columns: 1fr; }
  .admin-campaign-recipients { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-customer-picker-list { height: 250px; }
  .payment-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-current-state { grid-template-columns: 1fr; gap: 10px; }
  .order-current-state .meta { text-align: left; }
  .order-detail-layout { grid-template-columns: 1fr; gap: 22px; }
  .provider-activity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .provider-activity-grid > div:nth-child(2) { border-right: 0; }
  .provider-activity-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .admin-ticket-layout { grid-template-columns: 1fr; }
  .admin-ticket-panel { min-height: 0; }
  .admin-ticket-list { height: auto; min-height: 180px; max-height: 340px; }
  .ticket-empty-state { min-height: 280px; }
  .admin-ticket-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.notice.danger { margin-bottom: 14px; border-color: rgba(255,107,107,.4); background: rgba(255,107,107,.1); color: #ffc1c1; }
@media (max-width: 640px) {
  .payment-health-grid { grid-template-columns: 1fr; }
  .debug-notice-banner { justify-content: flex-start; padding: 8px 42px 8px 14px; text-align: left; }
  body.admin-page main { padding: 16px; }
  .row2 { grid-template-columns: 1fr; }
  header:not(.nav-collapsible) { flex-wrap: wrap; gap: 8px 12px; }
  header:not(.nav-collapsible) nav a, header:not(.nav-collapsible) .lang-switch { margin-left: 0; }
  .overview-strip { align-items: flex-start; flex-direction: column; }
  .overview-cats { justify-content: flex-start; }
  .admin-tools-head, .category-form-row { display: flex; flex-direction: column; align-items: stretch; }
  .category-tree-actions { width: 100%; }
  .category-tree-actions .btn { flex: 1 1 0; }
  .category-picker-menu { max-height: 280px; }
  .admin-product-filter-grid { grid-template-columns: 1fr; }
  .admin-new-product-btn, .admin-product-reset { width: 100%; }
  .admin-product-group-grid { grid-template-columns: 1fr; }
  .admin-product-group-head { align-items: flex-start; }
  .admin-product-editor-head { align-items: stretch; flex-direction: column; }
  .product-editor-close { width: 100%; }
  .product-translation-grid { grid-template-columns: 1fr; }
  .product-language-column, .product-language-column + .product-language-column { padding: 14px 0 0; border-left: 0; }
  .product-language-column + .product-language-column { margin-top: 14px; border-top: 1px solid var(--line); }
  .product-editor-actions { display: grid; grid-template-columns: 1fr; }
  .product-editor-actions .btn { width: 100%; }
  .admin-mail-subtabs { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-mail-subtabs .tab { min-width: 0; justify-content: center; }
  .admin-mail-toolbar-row, .admin-campaign-modes, .admin-mail-layout { grid-template-columns: 1fr; }
  .admin-customer-picker-toolbar { grid-template-columns: 1fr; }
  .admin-customer-picker-toolbar .btn { width: 100%; }
  .admin-campaign-actions { align-items: stretch; flex-direction: column; }
  .admin-campaign-actions .btn { width: 100%; }
  .admin-campaign-recipients, .admin-campaign-composer { padding: 16px; }
  .admin-campaign-card textarea { min-height: 220px; }
  .admin-mail-list { min-height: 0; max-height: 360px; }
  .admin-mail-chat { height: 560px; min-height: 480px; max-height: none; }
  .admin-mail-detail { min-height: 420px; padding: 14px; }
  .admin-mail-detail-head, .admin-mail-reply-actions { align-items: stretch; flex-direction: column; }
  .admin-mail-reply-actions .btn { width: 100%; }
  .storage-disk-alert { grid-template-columns: 1fr; }
  .storage-disk-percent { text-align: left; }
  .storage-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .storage-directory-strip, .storage-filter-grid { grid-template-columns: 1fr; }
  .admin-section-head { align-items: stretch; flex-direction: column; }
  .btn.admin-refresh-btn { width: 100%; }
  .visit-toolbar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .visit-toolbar-actions .admin-refresh-btn { grid-column: 1 / -1; }
  .visit-toolbar-actions .btn { width: 100%; min-width: 0; }
  .admin-visit-filter-grid { grid-template-columns: 1fr; }
  .visit-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visit-summary-item, .visit-summary-item:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .visit-summary-item:nth-child(even) { border-right: 0; }
  .visit-summary-item:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .visit-ranking-columns { grid-template-columns: 1fr; }
  .visit-panel-toggle { min-height: 72px; padding: 14px; }
  .visit-panel-state > span:first-child { display: none; }
  .visit-panel-body { padding: 10px 14px 14px; }
  .admin-action-list { grid-template-columns: 1fr; }
  .admin-order-toolbar { grid-template-columns: 1fr; }
  .admin-ticket-filter-grid, .admin-ticket-reply-actions { grid-template-columns: 1fr; }
  .admin-ticket-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-ticket-detail-head, .admin-ticket-head-actions { align-items: stretch; flex-direction: column; }
  .admin-ticket-head-actions .btn { width: 100%; }
  .admin-ticket-customer-grid { grid-template-columns: 1fr; }
  .admin-ticket-customer-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-ticket-customer-grid > div:last-child { border-bottom: 0; }
  .admin-ticket-messages { height: 390px; padding: 14px; }
  .admin-ticket-messages .chat-msg { max-width: 92%; }
  .admin-ops-filter-grid, .admin-create-grid, .admin-detail-grid.compact { grid-template-columns: 1fr; }
  .pay-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-health-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .pay-form-grid { grid-template-columns: 1fr; }
  .pay-settings-actions { flex-direction: column; align-items: stretch; }
  .admin-form-wide { grid-column: auto; }
  .admin-ops-filter-grid > .btn, .admin-form-submit { width: 100%; }
  .admin-admin-list { grid-template-columns: 1fr; }
  .admin-row-actions { display: grid; grid-template-columns: 1fr; }
  .admin-filter-actions { width: 100%; margin-left: 0; }
  .admin-filter-actions .btn { flex: 1; }
  .admin-row-actions .btn { width: 100%; }
  .contact-actions, .contact-business-grid { grid-template-columns: 1fr; }
  .contact-action .btn { width: 100%; }
  .contact-business-grid > div { grid-template-columns: 1fr; gap: 4px; }
  .admin-tools-head .btn, .category-form-row .btn { width: 100% !important; }
  .category-tree-node { margin-left: calc(var(--depth, 0) * 12px); }
  .category-admin-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; }
  .category-side { grid-column: 2; width: 100%; justify-content: space-between; }
  .admin-file-row, .asset-preview-head { align-items: stretch; flex-direction: column; }
  .admin-detail-grid { grid-template-columns: 1fr; }
  .admin-detail-grid.compact { grid-template-columns: 1fr; }
  .account-profile-card { align-items: stretch; flex-direction: column; }
  .account-profile-card .btn { width: 100% !important; }
  .account-mini-grid { grid-template-columns: 1fr 1fr; }
  .account-section-head { align-items: stretch; flex-direction: column; }
  .account-section-head .btn { width: 100%; }
  .account-order-toolbar { grid-template-columns: 1fr; align-items: stretch; gap: 14px; padding: 14px; }
  .account-order-filter-group { min-width: 0; }
  .order-filter-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-filter-tabs .tab { justify-content: center; padding: 8px 10px; }
  .notification-item { align-items: flex-start; flex-direction: column; }
  .account-order-head { flex-direction: column; }
  .account-order-grid { grid-template-columns: 1fr; }
  .account-order-actions .btn { width: 100%; }
  .order-page .order-status-main { width: calc(100% - 24px); padding-top: 20px; }
  .order-page .order-status-main,
  .order-status-card,
  .order-status-card.has-order,
  .order-detail-layout,
  .order-detail-section { max-width: 100%; min-width: 0; }
  .order-back-link { margin-bottom: 12px; }
  .order-status-card, .order-status-card.has-order { padding: 18px; }
  .order-detail-head { flex-direction: column; gap: 10px; }
  .order-detail-head h2 { font-size: 20px; }
  .order-summary-grid { grid-template-columns: 1fr; }
  .order-progress { margin: 22px 0 18px; }
  .order-progress-step { gap: 6px; }
  .order-progress-step strong { font-size: 11px; }
  .order-info-grid { grid-template-columns: 1fr; }
  .order-content-item { align-items: flex-start; flex-direction: column; }
  .order-detail-footer { display: grid; grid-template-columns: 1fr; }
  .order-detail-footer .btn { width: 100%; }
  .cart-head { align-items: stretch; flex-direction: column; }
  .download-item { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .download-item-action { justify-self: stretch; }
  .cart-line { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .cart-item-info { grid-column: 1 / -1; }
  .cart-qty { justify-content: start; }
  .cart-qty-placeholder { width: auto; text-align: left; }
  .cart-remove { width: 92px; }
  .cart-actions { display: grid; grid-template-columns: 1fr; }
  .download-item .btn, .cart-actions .btn, .asset-mini-btn { width: 100%; }
}

/* 后台宽数据表：≤640px 转为卡片式列表（td 通过 data-label 显示字段名） */
@media (max-width: 640px) {
  .admin-order-table, .payment-event-table, .storage-file-table,
  .visit-location-table, .visit-ip-table, .visit-detail-table,
  .a2l-family-table, .customer-usage-table,
  #tab-customers .table-wrap table { min-width: 0; width: 100% !important; }
  .admin-order-table thead, .payment-event-table thead, .storage-file-table thead,
  .visit-location-table thead, .visit-ip-table thead, .visit-detail-table thead,
  .a2l-family-table thead, .customer-usage-table thead,
  #tab-customers .table-wrap table thead { display: none; }
  .admin-order-table tbody, .payment-event-table tbody, .storage-file-table tbody,
  .visit-location-table tbody, .visit-ip-table tbody, .visit-detail-table tbody,
  .a2l-family-table tbody, .customer-usage-table tbody,
  #tab-customers .table-wrap table tbody { display: block; }
  .admin-order-table tr, .payment-event-table tr, .storage-file-table tr,
  .visit-location-table tr, .visit-ip-table tr, .visit-detail-table tr,
  .a2l-family-table tr, .customer-usage-table tr,
  #tab-customers .table-wrap table tr {
    display: block; margin: 0 0 12px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg);
  }
  .a2l-family-table tr[hidden] { display: none; }
  .admin-order-table td, .payment-event-table td, .storage-file-table td,
  .visit-location-table td, .visit-ip-table td, .visit-detail-table td,
  .a2l-family-table td, .customer-usage-table td,
  #tab-customers .table-wrap table td { display: block; padding: 6px 0; border: 0; }
  .admin-order-table td[data-label]::before, .payment-event-table td[data-label]::before,
  .storage-file-table td[data-label]::before, .visit-location-table td[data-label]::before,
  .visit-ip-table td[data-label]::before, .visit-detail-table td[data-label]::before,
  .a2l-family-table td[data-label]::before, .customer-usage-table td[data-label]::before,
  #tab-customers .table-wrap table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    color: var(--muted); font-size: 11px;
  }
  .a2l-row-actions { flex-wrap: wrap; white-space: normal; }
}

/* Homepage editor launch */
/* 顶部标题区：左边 h1 + 标签页，右边编辑器入口卡，占用标题右侧原本空着的位置 */
.shop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
}
.shop-head-main { flex: 1 1 560px; min-width: 0; }
.shop-head-main h1 { margin: 0 0 12px; }
.shop-head .shop-tabs { margin: 0; }

/* 桌面编辑器试用公告和安装包入口。 */
.editor-launch-card {
  display: flex;
  flex: 0 1 440px;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(138, 99, 255, .34);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(97, 47, 255, .18), rgba(75, 213, 255, .06)), #12151f;
}
.editor-launch-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.editor-launch-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 9px;
}
.editor-launch-copy h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0;
}
.editor-launch-trial {
  border-radius: 4px;
  padding: 2px 6px;
  background: rgba(138, 99, 255, .22);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.editor-launch-copy > p {
  margin: 0;
  color: #cbd1dc;
  font-size: 12.5px;
  line-height: 1.5;
}
.editor-launch-download {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.editor-launch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.editor-launch-actions .btn {
  flex: 1 1 auto;
  width: auto;
  min-height: 34px;
  max-width: 100%;
  padding: 6px 12px;
  font-size: 13.5px;
  line-height: 1.35;
  white-space: normal;
  text-align: center;
  text-decoration: none;
}
.editor-launch-platform {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  color: var(--muted);
  font-size: 12px;
}
.editor-launch-platform a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.editor-launch-primary { box-shadow: 0 6px 16px rgba(97, 47, 255, .28); }
html[data-theme="light"] .editor-launch-card {
  border-color: rgba(90, 43, 224, .24);
  background: linear-gradient(135deg, rgba(122, 75, 255, .12), rgba(75, 163, 255, .08)), #f5f2ff;
}
html[data-theme="light"] .editor-launch-copy > p { color: var(--text-2); }
html[data-theme="light"] .editor-launch-trial { background: rgba(90, 43, 224, .13); }
@media (max-width: 1100px) {
  /* 右侧放不下时换到标签页下面，横向铺成一条 */
  .editor-launch-card {
    flex: 1 1 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
  }
  .editor-launch-copy { flex: 1 1 380px; }
  .editor-launch-download { margin-left: auto; }
  .editor-launch-actions .btn { flex: none; }
}
@media (max-width: 640px) {
  .editor-launch-card { padding: 12px 14px; }
  .editor-launch-download { width: 100%; margin-left: 0; }
  .editor-launch-actions .btn { flex: 1 1 auto; }
}

/* Public SEO catalog pages */
.seo-catalog-page main { max-width: 1280px; }
.seo-breadcrumb { margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.seo-breadcrumb a { color: var(--muted); text-decoration: none; }
.seo-breadcrumb a:hover { color: var(--text); }
.seo-hero { padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, rgba(108,46,255,.14), rgba(19,24,35,.72)); margin-bottom: 24px; }
.seo-hero h1 { max-width: 900px; margin: 4px 0 12px; }
.seo-hero p { max-width: 900px; line-height: 1.7; }
.seo-eyebrow { color: #9b7cff; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.seo-a2l-search { margin: 0 0 22px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(19,24,35,.72); }
.seo-a2l-search > label { display: block; margin-bottom: 9px; color: var(--text); font-size: 14px; font-weight: 800; }
.seo-a2l-search-control { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 5px 6px 5px 14px; border: 1px solid rgba(155,124,255,.38); border-radius: 11px; background: var(--input-bg); }
.seo-a2l-search-control:focus-within { border-color: #8f6cff; box-shadow: 0 0 0 3px rgba(108,46,255,.13); }
.seo-a2l-search-control > span { color: #9b7cff; font-size: 25px; line-height: 1; }
.seo-a2l-search-control input { width: 100%; min-width: 0; padding: 11px 3px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.seo-a2l-search-control input::placeholder { color: #6f7787; }
.seo-a2l-search-control .btn { width: auto; min-width: 72px; padding: 9px 13px; }
.seo-a2l-search > .meta { margin: 9px 2px 0; }
.seo-a2l-search-empty { margin-bottom: 22px; text-align: center; }
.seo-a2l-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.seo-a2l-card { display: flex; flex-direction: column; align-items: stretch; }
.seo-a2l-card h2 { font-size: 18px; line-height: 1.45; margin: 0 0 14px; }
.seo-a2l-card h2 a { color: var(--text); text-decoration: none; }
.seo-a2l-card h2 a:hover { color: #9b7cff; }
.seo-a2l-card dl, .seo-a2l-detail dl { display: grid; gap: 0; margin: 0 0 18px; }
.seo-a2l-card dl div, .seo-a2l-detail dl div { display: grid; grid-template-columns: minmax(130px,.7fr) minmax(0,1.3fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.seo-a2l-card dt, .seo-a2l-detail dt { color: var(--muted); }
.seo-a2l-card dd, .seo-a2l-detail dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.seo-a2l-card code, .seo-a2l-detail code { white-space: normal; color: #bba7ff; }
.seo-detail-link { align-self: flex-start; margin-top: auto; text-decoration: none; }
.seo-a2l-detail { max-width: 960px; margin: 0 auto; }
.seo-a2l-detail h1 { font-size: clamp(26px,4vw,42px); line-height: 1.25; overflow-wrap: anywhere; }
.seo-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.seo-tags span { padding: 5px 10px; border-radius: 999px; background: rgba(108,46,255,.14); color: #bba7ff; }
.seo-language-switch a { text-decoration: none; }
.seo-product-summary h1 { font-size: clamp(25px,3vw,38px); line-height: 1.25; }
@media (max-width: 760px) {
  .seo-hero { padding: 20px; }
  .seo-a2l-search { padding: 14px; }
  .seo-a2l-search-control { grid-template-columns: auto minmax(0,1fr); }
  .seo-a2l-search-control .btn { grid-column: 1 / -1; width: 100%; }
  .seo-a2l-grid { grid-template-columns: 1fr; }
  .seo-a2l-card dl div, .seo-a2l-detail dl div { grid-template-columns: 1fr; gap: 5px; }
}

/* Automated technical-family SEO pages and internal links */
.seo-family-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 28px; }
.seo-parts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 28px; }
.seo-part-card h2 { margin: 10px 0 8px; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.seo-part-card h2 a { color: var(--text); text-decoration: none; }
.seo-part-card h2 a:hover { color: #9b7cff; }
.seo-part-card .price { margin: 10px 0 6px; }
.seo-part-card a { color: var(--brand2); text-decoration: none; }
.seo-parts-policy ul { margin: 10px 0 14px; padding-left: 20px; line-height: 1.7; }
.seo-parts-policy li { margin-bottom: 6px; }
.seo-parts-policy a { color: var(--brand2); text-decoration: none; }
.seo-family-item h2 { margin: 5px 0 10px; font-size: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.seo-family-item h2 a { color: var(--text); text-decoration: none; }
.seo-family-item h2 a:hover { color: #9b7cff; }
.seo-family-item p:last-child { color: var(--muted); line-height: 1.6; }
.seo-aliases { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.seo-aliases span { color: var(--muted); font-size: 13px; }
.seo-aliases code { padding: 6px 9px; border: 1px solid rgba(155,124,255,.22); border-radius: 8px; background: rgba(108,46,255,.09); color: #c9bbff; }
.seo-related { max-width: 960px; margin: 24px auto 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--panel) 70%, transparent); }
.seo-related h2 { margin: 0 0 14px; font-size: 20px; }
/* 相关文件：自适应多列网格，长标题两列排布而不是一行一个 */
.seo-related-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 8px; }
.seo-related-links a { display: flex; align-items: baseline; gap: 9px; padding: 9px 12px; font-size: 13px; line-height: 1.5;
  border: 1px solid rgba(155,124,255,.22); border-radius: 10px; background: rgba(108,46,255,.09); color: #c9bbff;
  text-decoration: none; overflow-wrap: anywhere; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.seo-related-links a::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand2); align-self: center; }
.seo-related-links a[data-related-kind="family"]::before { background: var(--ok); }
.seo-related-links a[data-related-kind="a2l"]::before { background: #4f9cff; }
.seo-related-links a:hover { border-color: #8f6cff; color: #fff; background: rgba(108,46,255,.16); }

/* Admin SEO preview */
.seo-admin-preview { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel) 55%, transparent); }
.seo-admin-score { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; background: rgba(255,255,255,.025); text-align: center; }
.seo-admin-score strong { font-size: 34px; line-height: 1; }
.seo-admin-score span { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.seo-admin-score.is-good strong, .a2l-seo-score.is-good strong { color: #35d49a; }
.seo-admin-score.is-warning strong, .a2l-seo-score.is-warning strong { color: #ffba55; }
.seo-admin-score.is-poor strong, .a2l-seo-score.is-poor strong { color: #ff7078; }
.seo-admin-details { min-width: 0; display: grid; gap: 12px; }
.seo-admin-line { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: start; }
.seo-admin-line b { color: var(--muted); font-size: 12px; }
.seo-admin-line span, .a2l-seo-content p { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.seo-admin-line code, .a2l-seo-content code { padding: 3px 7px; border-radius: 6px; background: rgba(108,46,255,.12); color: #c7b7ff; font-size: 11px; }
.seo-admin-serp { display: grid; gap: 8px; }
.seo-admin-serp article { display: grid; gap: 3px; padding: 10px 12px; border-left: 3px solid #6c2eff; border-radius: 7px; background: rgba(255,255,255,.025); }
.seo-admin-serp article small, .seo-admin-serp article span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.seo-admin-serp article a { color: #9cbcff; font-size: 14px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
.seo-admin-issues { padding: 10px 12px; border-radius: 8px; background: rgba(255,100,110,.08); color: #ff9da4; }
.seo-admin-issues.is-clear { background: rgba(53,212,154,.08); color: #70dfb7; }
.seo-admin-issues ul { margin: 7px 0 0 18px; padding: 0; }
.seo-admin-issues span { display: inline-block; margin-left: 8px; }
.a2l-seo-preview { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; margin-top: 14px; padding: 13px; border: 1px solid rgba(155,124,255,.22); border-radius: 11px; background: color-mix(in srgb, var(--panel) 55%, transparent); }
.a2l-seo-score { display: flex; flex-direction: column; justify-content: center; align-items: center; border-right: 1px solid var(--line); }
.a2l-seo-score strong { font-size: 28px; }
.a2l-seo-score span { color: var(--muted); font-size: 10px; }
.a2l-seo-content { min-width: 0; display: grid; gap: 8px; }
.a2l-seo-content p b { margin-right: 4px; color: var(--muted); }
.a2l-seo-issues span { padding: 2px 6px; border-radius: 5px; background: rgba(255,100,110,.08); color: #ff9da4; font-size: 11px; }
.a2l-seo-clear { color: #70dfb7; }
@media (max-width: 760px) {
  .seo-family-grid { grid-template-columns: 1fr; }
  .seo-admin-preview, .a2l-seo-preview { grid-template-columns: 1fr; }
  .seo-admin-line { grid-template-columns: 1fr; gap: 5px; }
  .a2l-seo-score { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
}


.seo-a2l-guide,
.seo-family-introduction {
  margin-top: 22px;
  line-height: 1.72;
}
.seo-a2l-guide h2,
.seo-family-introduction h2 {
  margin-top: 26px;
}
.seo-a2l-guide h2:first-child,
.seo-family-introduction h2:first-child {
  margin-top: 0;
}
.seo-a2l-guide ol {
  display: grid;
  gap: 10px;
  padding-left: 24px;
}
.seo-faq {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.seo-faq > h2 {
  margin-bottom: 4px;
}
.seo-faq details {
  padding: 16px 18px;
}
.seo-faq summary {
  cursor: pointer;
  font-weight: 700;
}
.seo-faq details p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

/* 购物车行：小屏折叠为单列 */
@media (max-width: 640px) {
  .cart-line { grid-template-columns: 1fr; gap: 10px; }
  .cart-qty { justify-content: start; }
  .cart-qty-placeholder { width: auto; text-align: left; }
  .cart-remove { justify-self: start; width: auto; }
  .download-item { grid-template-columns: 1fr; }
  .download-item-action { justify-self: start; }
}

/* 骨架屏加载占位（首屏数据返回前渲染，JS 拿到数据后整体替换） */
.skeleton { position: relative; overflow: hidden; background: rgba(255,255,255,.055); border-radius: 6px; }
.skeleton::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  animation: skeleton-sweep 1.4s ease infinite; }
@keyframes skeleton-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skeleton-card { display: flex; flex-direction: column; gap: 10px; padding: 15px;
  border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--panel); }
.skeleton-card .sk-thumb { aspect-ratio: 4 / 3; height: auto; border-radius: 10px; }
.skeleton-line { height: 13px; }
.sk-w40 { width: 40%; } .sk-w60 { width: 60%; } .sk-w80 { width: 80%; }
.skeleton-btn { height: 38px; border-radius: var(--radius-btn); }

/* 轻量 toast 通知 */
.toast-layer { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 250; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 12px 18px; max-width: calc(100vw - 32px); border-radius: var(--radius-card); border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; box-shadow: var(--dialog-shadow);
  opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok, .toast.success { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.toast.err, .toast.danger { border-color: color-mix(in srgb, var(--err) 45%, transparent); color: var(--err); }
.toast.warning { border-color: color-mix(in srgb, var(--warning) 45%, transparent); color: var(--warning); }
/* 小屏上 toast 上移，避免盖住底部抽屉式弹窗的操作按钮 */
@media (max-width: 520px) {
  .toast-layer { bottom: max(96px, env(safe-area-inset-bottom)); }
}

/* 动敏用户：禁用动画与过渡 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto !important; }
}

/* 桌面端按 90% 缩放显示（用户偏好密度：同屏显示更多内容）；窄屏/移动端不缩放 */
@media (min-width: 761px) {
  body.store-page, body.product-page, body.cart-page, body.account-page,
  body.contact-page, body.order-page, body.legal-page, body.editor-page,
  body.admin-page {
    zoom: 0.9;
  }
}
