:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg0: #070b12;
  --bg1: #0d1522;
  --bg-end: #0a101a;
  --panel: rgba(12, 20, 34, 0.78);
  --panel-solid: #101a2b;
  --line: rgba(94, 234, 212, 0.18);
  --line-strong: rgba(94, 234, 212, 0.35);
  --ink: #e8f2ff;
  --muted: #8ea0b8;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --warn: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(7, 11, 18, 0.72);
  --input-bg: rgba(8, 14, 24, 0.92);
  --input-bg-soft: #0a1320;
  --surface: rgba(16, 26, 43, 0.7);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --picker-bg: #0c1524;
  --modal-bg: #0f1724;
  --figure-bg: #071018;
  --grid-line: rgba(148, 163, 184, 0.06);
  --glow-a: rgba(45, 212, 191, 0.16);
  --glow-b: rgba(56, 189, 248, 0.12);
  --mask-drawer: rgba(2, 6, 12, 0.55);
  --font: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans", sans-serif;
  --radius: 16px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg0: #f3f6fa;
  --bg1: #e9eef5;
  --bg-end: #e4ebf3;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --line: rgba(20, 48, 72, 0.12);
  --line-strong: rgba(13, 148, 136, 0.4);
  --ink: #142033;
  --muted: #5a6b7e;
  --accent: #0f9d8a;
  --accent-2: #0284c7;
  --warn: #d97706;
  --danger: #e11d48;
  --shadow: 0 14px 36px rgba(20, 48, 72, 0.1);
  --header-bg: rgba(255, 255, 255, 0.78);
  --input-bg: #ffffff;
  --input-bg-soft: #f7fafc;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-soft: rgba(20, 48, 72, 0.04);
  --picker-bg: #ffffff;
  --modal-bg: #ffffff;
  --figure-bg: #eef3f8;
  --grid-line: rgba(20, 48, 72, 0.06);
  --glow-a: rgba(15, 157, 138, 0.1);
  --glow-b: rgba(2, 132, 199, 0.08);
  --mask-drawer: rgba(15, 30, 50, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg0);
  transition: background 0.25s ease, color 0.2s ease;
}
a { color: var(--accent); text-decoration: none; }
.wrap { width: min(1240px, calc(100% - 2rem)); margin: 0 auto; }

/* —— 实验室场景底图 + 科技蒙版 —— */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-photo {
  position: absolute;
  inset: -2%;
  background:
    url("/static/img/bg/lab-active.jpg") center 42% / cover no-repeat;
  filter: saturate(0.82) contrast(1.08) brightness(0.38);
  transform: scale(1.03);
  animation: bg-drift 36s ease-in-out infinite alternate;
}
[data-theme="light"] .bg-photo {
  background-image: url("/static/img/bg/lab-active.jpg");
  background-position: center 38%;
  filter: saturate(0.72) brightness(1.05) contrast(1.02);
}
.bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(165deg, rgba(5, 10, 18, 0.78) 0%, rgba(7, 14, 24, 0.55) 38%, rgba(6, 12, 20, 0.88) 100%),
    radial-gradient(ellipse 90% 55% at 12% -5%, var(--glow-a), transparent 55%),
    radial-gradient(ellipse 70% 50% at 92% 8%, var(--glow-b), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(2, 6, 12, 0.55), transparent 60%);
}
[data-theme="light"] .bg-veil {
  background:
    linear-gradient(165deg, rgba(243, 246, 250, 0.82) 0%, rgba(233, 238, 245, 0.72) 45%, rgba(228, 235, 243, 0.9) 100%),
    radial-gradient(ellipse 80% 50% at 10% 0%, var(--glow-a), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, var(--glow-b), transparent 50%);
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, black 20%, transparent 78%);
  opacity: 0.9;
}
@keyframes bg-drift {
  from { transform: scale(1.03) translate3d(0, 0, 0); }
  to { transform: scale(1.07) translate3d(-1.2%, -0.8%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-photo { animation: none; }
}

.site-header, main, .site-footer { position: relative; z-index: 1; }

.site-header {
  position: sticky; top: 0; z-index: 200;
  backdrop-filter: blur(18px) saturate(1.15);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: visible;
}
.header-dna {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    url("/static/img/bg/header-dna.jpg") center 45% / cover no-repeat;
  opacity: 0.28;
  filter: saturate(1.15) contrast(1.1) brightness(0.75);
  mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%);
}
[data-theme="light"] .header-dna {
  opacity: 0.22;
  filter: saturate(0.9) contrast(1.05) brightness(1.15);
}
.header-ornaments {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ornament {
  position: absolute;
  color: rgba(45, 212, 191, 0.55);
  width: 2.6rem;
  height: 2.6rem;
  opacity: 0.7;
}
[data-theme="light"] .ornament {
  color: rgba(13, 148, 136, 0.45);
  opacity: 0.55;
}
.ornament-dna { top: 0.35rem; left: 18%; width: 2.2rem; height: 2.2rem; animation: ornament-float 9s ease-in-out infinite; }
.ornament-flask { top: 0.55rem; right: 22%; width: 2rem; height: 2rem; color: rgba(56, 189, 248, 0.5); animation: ornament-float 11s ease-in-out infinite 0.8s; }
.ornament-pipette { bottom: 0.2rem; left: 42%; width: 1.85rem; height: 1.85rem; color: rgba(167, 139, 250, 0.45); animation: ornament-float 10s ease-in-out infinite 1.4s; }
.ornament-molecule { top: 0.4rem; right: 8%; width: 2.35rem; height: 2.35rem; animation: ornament-float 12s ease-in-out infinite 0.4s; }
@keyframes ornament-float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.55; }
  50% { transform: translateY(-4px) rotate(4deg); opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) {
  .ornament { animation: none; }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--ink); min-width: 0; }
.brand-mark {
  width: 2.35rem; height: 2.35rem; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #2dd4bf 0%, #14b8a6 42%, #0ea5e9 100%);
  color: #041016; font-family: var(--display); font-weight: 700; font-size: 0.8rem;
  flex: 0 0 auto;
  box-shadow:
    0 0 0 1px rgba(45, 212, 191, 0.35),
    0 8px 22px rgba(14, 165, 233, 0.28);
}
.brand-mark svg { display: block; }
.brand-text {
  display: flex; flex-direction: column; gap: 0.05rem; line-height: 1.15;
  font-family: var(--display); font-weight: 600; letter-spacing: 0.02em;
  min-width: 0;
}
.brand-cn { font-size: 0.98rem; }
.brand-en { font-size: 0.68rem; font-weight: 500; color: var(--muted); letter-spacing: 0.06em; }
.site-footer .footer-sep { margin: 0 0.15rem; opacity: 0.7; }
.header-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex: 0 0 auto;
  position: relative;
  z-index: 30;
  pointer-events: auto;
}
.site-nav {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  position: relative;
  z-index: 40;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.nav-ico {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 6px;
  font-size: 0.68rem;
  line-height: 1;
  color: var(--accent);
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.22);
  flex: 0 0 auto;
}
.site-nav a:hover .nav-ico,
.site-nav a.active .nav-ico {
  background: rgba(45, 212, 191, 0.22);
  border-color: rgba(45, 212, 191, 0.4);
}
.site-nav a:hover {
  color: var(--ink);
  background: rgba(45, 212, 191, 0.08);
  border-color: var(--line);
}
.site-nav a.active {
  color: var(--accent);
  background: rgba(45, 212, 191, 0.12);
  border-color: var(--line-strong);
}
.site-nav .nav-mode {
  color: var(--accent);
  font-size: 0.82rem;
  border: 1px solid var(--line-strong);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.08);
  letter-spacing: 0.04em;
}
.site-nav button.linkish,
.nav-logout-form button.linkish {
  background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0;
}
.site-nav button.linkish:hover,
.nav-logout-form button.linkish:hover { color: var(--ink); }
.nav-logout-form { display: inline; margin: 0; }
.nav-toggle:hover { transform: none; border-color: var(--line-strong); }
.nav-toggle-bars {
  width: 1rem;
  height: 0.75rem;
  position: relative;
  display: inline-block;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after,
.nav-toggle-bars {
  background: currentColor;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.nav-toggle-bars {
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}
.nav-toggle-bars::before { top: 0; }
.nav-toggle-bars::after { bottom: 0; }
body.nav-open .nav-toggle-bars {
  background: none;
}
body.nav-open .nav-toggle-bars::before {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
body.nav-open .nav-toggle-bars::after {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}
.nav-scrim {
  display: none;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.stat-chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
}
.stat-chip span { display: block; color: var(--muted); font-size: 0.82rem; }
.stat-chip strong { font-size: 1.15rem; }
.muted { color: var(--muted); }
.site-footer { padding: 2rem 0 3rem; color: var(--muted); font-size: 0.85rem; }
.footer-credit { opacity: 0.75; }

.hero-tech { padding: 2.4rem 0 1rem; }
.eyebrow {
  margin: 0 0 0.55rem; color: var(--accent);
  letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.78rem;
}
.hero-tech h1, .panel h1, .panel h2, .drawer-head h2 {
  font-family: var(--display); margin: 0 0 0.55rem; letter-spacing: 0.02em;
}
.hero-tech h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.lead { color: var(--muted); max-width: 40rem; line-height: 1.65; }
.panel-title-row h1,
.panel-title-row h2,
.panel-title-row h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  flex-wrap: wrap;
}
.title-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.title-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1;
  cursor: help;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}
.title-tip:hover,
.title-tip:focus-visible,
.title-tip.is-open {
  color: var(--accent);
  border-color: var(--line-strong);
  outline: none;
}
/* 挂到 body，避免被 .panel overflow 裁切 */
.title-tip-float {
  position: fixed;
  z-index: 30000;
  width: max-content;
  max-width: min(22rem, 78vw);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}
.title-tip-float[hidden] { display: none !important; }

.panel, .panel-tech {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 1.35rem 1.45rem 1.5rem;
  margin: 1rem 0 1.4rem;
  backdrop-filter: blur(16px) saturate(1.1);
  position: relative;
  overflow: hidden;
}
.panel::before,
.panel-tech::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.45), transparent);
  pointer-events: none;
}
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-title-row h2 { margin: 0; }
.tag {
  font-size: 0.75rem; color: var(--accent-2);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.25rem 0.65rem;
}
button.tag.linkish-tag {
  cursor: pointer;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: inherit;
  color: inherit;
}
button.tag.linkish-tag:hover {
  filter: brightness(1.12);
}
button.tag.muted-tag {
  border-color: rgba(148, 163, 184, 0.45);
  color: #94a3b8;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 0.4rem; }
label span { color: var(--muted); font-size: 0.9rem; }
input, select, textarea, button, .btn {
  font: inherit; color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.78rem 1rem;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(45, 212, 191, 0.28);
  border-color: var(--accent);
}
.optional-tag {
  font-style: normal;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.25rem;
}
.btn, button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition:
    transform .16s ease,
    border-color .16s ease,
    background .16s ease,
    box-shadow .2s ease,
    filter .16s ease;
}
.btn,
.actions > .btn,
.actions > button,
.composer-actions > .btn,
.composer-actions > button,
.workbench-actions > .btn,
#chat-send {
  min-height: 2.85rem;
  padding: 0.8rem 1.35rem;
  border-radius: 12px;
  letter-spacing: 0.03em;
}
a.btn {
  text-decoration: none;
  color: inherit;
}
.btn.primary, button.primary, #chat-send, #btn-generate.primary {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 42%, #0ea5e9 100%);
  border: 1px solid rgba(165, 243, 252, 0.35);
  color: #041016;
  font-weight: 700;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 10px 28px rgba(14, 165, 233, 0.28),
    0 0 0 1px rgba(45, 212, 191, 0.15);
}
.btn.primary:hover, button.primary:hover, #chat-send:hover {
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 14px 34px rgba(14, 165, 233, 0.4),
    0 0 24px rgba(45, 212, 191, 0.22);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(94, 234, 212, 0.32);
  color: var(--ink);
  backdrop-filter: blur(8px);
}
.btn.ghost:hover {
  background: rgba(45, 212, 191, 0.1);
  border-color: var(--line-strong);
  color: var(--accent);
}
[data-theme="light"] .btn.ghost {
  background: rgba(255, 255, 255, 0.72);
}
.btn.danger, button.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn.ghost.danger:hover, button.danger:hover {
  background: rgba(225, 29, 72, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}
.btn:hover, button:hover { transform: translateY(-1px); }
.btn:active, button:active { transform: translateY(0); }
.btn:disabled, button:disabled { opacity: 0.55; cursor: wait; transform: none; filter: none; box-shadow: none; }

.stage-hint {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(45, 212, 191, 0.05);
  color: var(--muted);
  line-height: 1.55;
}
.stage-hint strong { color: var(--ink); display: block; margin-bottom: 0.25rem; }
.stage-hint p { margin: 0 0 0.6rem; }

.preset-scope {
  color: var(--muted);
  font-weight: 400;
  margin-left: 0.35rem;
  font-size: 0.82rem;
}
.mode-hint {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: rgba(56, 189, 248, 0.05);
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
}
.mode-hint strong { color: var(--ink); display: block; margin-bottom: 0.35rem; }
.mode-hint p { margin: 0.25rem 0 0; }
.mode-hint b { color: var(--accent-2); font-weight: 600; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.chip:hover, .chip.active {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.16);
}
.check-row {
  display: flex; flex-wrap: wrap; gap: 0.85rem 1.25rem;
  align-items: center;
  padding: 0.15rem 0 0.35rem;
}
.check {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--ink); font-size: 0.92rem; cursor: pointer;
}
.check input { width: 1rem; height: 1rem; accent-color: #14b8a6; }
.web-hint .web-list {
  margin: 0.4rem 0 0.5rem;
  padding-left: 1.1rem;
  color: var(--muted);
}
.web-hint .web-list li { margin-bottom: 0.45rem; line-height: 1.45; }
.web-hint .web-list b { color: var(--ink); font-weight: 550; }
.web-hint .web-snip { display: block; margin-top: 0.15rem; font-size: 0.86rem; }
.web-hint .web-foot { margin: 0; font-size: 0.82rem; opacity: 0.9; }
.web-hint a { color: var(--accent); margin-left: 0.35rem; }

.workbench-top {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
  padding: 1.55rem 0 0.55rem;
}
.crumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.45rem; }
.crumbs span {
  font-size: 0.8rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.28rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  letter-spacing: 0.02em;
}
.crumbs .accent {
  color: var(--accent);
  border-color: var(--line-strong);
  background: rgba(45, 212, 191, 0.1);
  font-weight: 600;
}
.hint { color: var(--muted); font-size: 0.88rem; }
.hint.tight { margin: 0; }
.workbench-actions { display: none; }

.collapsible summary { cursor: pointer; color: var(--accent-2); font-weight: 500; }
.quote-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 0.8rem; }
.total { color: var(--accent); font-size: 1.05rem; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.quote-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.9rem;
  min-width: 1080px;
}
.quote-table.account-quote {
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
}
.quote-table th, .quote-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0.55rem 0.5rem;
  text-align: left;
  vertical-align: middle;
  box-sizing: border-box;
}
.quote-table th:last-child,
.quote-table td:last-child {
  border-right: none;
}
.quote-table tbody tr:last-child td {
  border-bottom: none;
}
.quote-table th {
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-soft);
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line-strong);
}
.quote-table.account-quote th,
.quote-table.account-quote td {
  border: 1px solid var(--line);
}
.quote-table.account-quote thead th {
  border-bottom-color: var(--line-strong);
}
.quote-table.account-quote tbody tr:last-child td {
  border-bottom: 1px solid var(--line);
}
.quote-table.account-quote .col-flag { width: 5.2rem; }
.quote-table.account-quote .col-brand { width: 6.5rem; }
.quote-table.account-quote .col-sku { width: 6.5rem; }
.quote-table.account-quote .col-name { width: 12rem; }
.quote-table.account-quote .col-spec { width: 7rem; }
.quote-table.account-quote .col-unit { width: 3.5rem; }
.quote-table.account-quote .col-price,
.quote-table.account-quote .col-qty,
.quote-table.account-quote .col-subtotal { width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.quote-table.account-quote .col-note { width: auto; word-break: break-word; overflow-wrap: anywhere; vertical-align: top; }
.quote-table.account-quote .col-note .note-text {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.quote-table.account-quote th.col-price,
.quote-table.account-quote th.col-qty,
.quote-table.account-quote th.col-subtotal { text-align: right; }
.source-cell { min-width: 9.5rem; max-width: 14rem; }
.source-top {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.uncertain-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex: 0 0 auto;
}
.uncertain-tip {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #fbbf24;
  opacity: 0.92;
}
.quote-table.editable input.price-uncertain {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}
.quote-table.editable input.price-uncertain:focus {
  border-color: #fbbf24;
  outline: 2px solid rgba(251, 191, 36, 0.25);
}
.src-tag {
  display: inline-flex; align-items: center;
  width: fit-content;
  font-size: 0.72rem; font-weight: 600;
  border-radius: 999px; padding: 0.1rem 0.45rem;
  border: 1px solid var(--line);
  color: var(--muted);
}
.src-tag.catalog { color: var(--accent); border-color: rgba(45, 212, 191, 0.35); }
.src-tag.promo { color: #ea580c; border-color: rgba(234, 88, 12, 0.4); }
.src-tag.web { color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); text-decoration: none; }
a.src-tag.web { cursor: pointer; }
a.src-tag.web:hover { background: rgba(56, 189, 248, 0.12); }
.src-tag.estimate { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); }
.notice-banner {
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.08);
  border-radius: 12px;
}
.notice-banner strong { display: block; margin-bottom: 0.35rem; color: var(--accent); }
.notice-banner p { margin: 0.25rem 0; color: var(--ink); }
.notice-banner .tight { margin-top: 0.45rem; }
.hint.tight { margin: 0.4rem 0 0.8rem; }
.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin: 0.9rem 0 0.2rem;
}
.insight-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.03);
}
.insight-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  font-family: var(--display);
}
.insight-card .hint { font-weight: 400; font-family: var(--sans, inherit); }
.card-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.35rem;
}
.month-delta { margin: 0.35rem 0 0.85rem; }
.delta-up { color: #fbbf24; }
.delta-down { color: #34d399; }
.notice-banner.peer-high { border-color: rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.08); }
.notice-banner.peer-low { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.notice-banner.peer-flat { border-color: rgba(45, 212, 191, 0.35); }
.revise-table { min-width: 720px; }
.revise-table .cell-changed { font-weight: 700; }
.overview-actions { margin: 0 0 0.85rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-collapse {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.85rem;
  margin: 0.7rem 0 0.85rem;
  background: var(--surface-soft, rgba(255,255,255,0.04));
}
.filter-collapse > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  user-select: none;
}
.filter-collapse > summary::-webkit-details-marker { display: none; }
.filter-collapse > summary::after {
  content: "展开";
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.filter-collapse[open] > summary {
  margin-bottom: 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed var(--line);
}
.filter-collapse[open] > summary::after { content: "收起"; }
.filter-collapse .filter-active-tag {
  font-weight: 500;
  color: #fbbf24;
  font-size: 0.85rem;
}
.filter-collapse .order-filter-bar,
.filter-collapse .toolbar {
  margin: 0;
}
.order-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem 0.75rem;
  align-items: end;
}
.order-filter-bar label { display: grid; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.order-filter-actions { display: flex; gap: 0.45rem; align-items: end; }
.pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.9rem 0 0.2rem;
}
.cond-cell {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-form .insight-card label {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.profile-form .insight-card input,
.profile-form .insight-card select,
.profile-form .insight-card textarea {
  width: 100%;
  box-sizing: border-box;
}
.paper-panel { margin-bottom: 1rem; }
.paper-form {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr auto;
  gap: 0.65rem 0.75rem;
  align-items: end;
}
.paper-form label { display: grid; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.paper-form input[type="text"],
.paper-form input[type="file"] {
  width: 100%;
  box-sizing: border-box;
}
.paper-status { margin: 0.55rem 0 0; }

.workbench-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.28fr);
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: min(70vh, 760px);
  max-height: min(82vh, 920px);
  padding-bottom: 0.85rem;
}
.quote-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: min(70vh, 760px);
  max-height: min(82vh, 920px);
  padding-bottom: 0.85rem;
}
.quote-main > .quote-head {
  flex: 0 0 auto;
}
.quote-main > .table-wrap {
  flex: 1 1 auto;
  min-height: 12rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.quote-main > .actions,
.quote-main > #save-status {
  flex: 0 0 auto;
}
.quote-main .quote-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel-solid, var(--surface-soft));
  box-shadow: 0 1px 0 var(--line);
}
.chat-panel-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.chat-panel-head h2 { margin: 0; }
.chat-bind-status { margin: 0; }
.chat-panel .chips { margin: 0.45rem 0 0.55rem; max-height: 5.5rem; overflow: auto; }
.chat-panel .chat-log {
  flex: 1;
  min-height: 180px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.65rem;
}
.chat-composer { display: grid; gap: 0.55rem; }
.composer-drop {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%),
    rgba(8, 14, 24, 0.55);
  padding: 0.65rem 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.06);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.composer-drop.is-dragover {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.1);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}
.composer-actions .btn {
  min-width: 7.5rem;
}
.composer-actions #chat-send {
  min-width: 9.5rem;
}
.composer-drop textarea {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  resize: vertical;
  min-height: 4.5rem;
  font: inherit;
  outline: none;
}
.attach-preview {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  padding: 0.35rem 0.4rem;
  border-radius: 10px;
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid var(--line);
}
.attach-preview img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.attach-name {
  flex: 1;
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-all;
}
.attach-clear { flex-shrink: 0; }
.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.bubble-image {
  display: block;
  max-width: min(100%, 220px);
  max-height: 160px;
  margin: 0.35rem 0 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: rgba(0,0,0,0.2);
}
.bubble .attach-file-tag {
  display: inline-block;
  margin: 0.25rem 0 0.4rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}
@media (max-width: 980px) {
  .workbench-layout {
    grid-template-columns: 1fr;
  }
  .chat-panel {
    min-height: 420px;
    max-height: min(70vh, 640px);
  }
  .quote-main {
    min-height: 420px;
    max-height: min(70vh, 640px);
  }
}
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 0.85rem;
}
.chart-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.lab-section-title {
  margin: 1.15rem 0 0.15rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.lab-stats-row {
  flex-wrap: wrap;
}
.lab-todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.lab-todo-list li a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  background: rgba(255,255,255,0.03);
}
.lab-todo-list li a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lab-todo-list li.todo-warn a {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}
.lab-todo-list li.todo-accent a {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.08);
}
.lab-lists-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 960px) {
  .chart-grid-3 { grid-template-columns: 1fr; }
  .lab-lists-grid { grid-template-columns: 1fr; }
}
.chart-card canvas { max-height: 220px; }
.chart-progress-wrap {
  position: relative;
  width: 100%;
  min-height: calc(48px + var(--progress-rows, 1) * 42px);
  height: calc(48px + var(--progress-rows, 1) * 42px);
  margin-top: 0.5rem;
}
.chart-progress-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.progress-bar {
  height: 0.45rem;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.25rem 0;
}
.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2dd4bf, #38bdf8);
}
.progress-bar.big { height: 0.65rem; margin: 0.45rem 0; }
.lab-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem 0.7rem;
  align-items: end;
}
.lab-form-grid label { display: grid; gap: 0.25rem; font-size: 0.82rem; color: var(--muted); }
.lab-form-grid .span-2 { grid-column: span 2; }
.lab-form-grid.tight { margin-top: 0.55rem; }
.lab-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}
.lab-tabs a {
  padding: 0.45rem 0.9rem;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.lab-tabs a:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.lab-tabs a.active {
  color: #041016;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
}
.site-header nav a.active,
.site-nav a.active {
  color: var(--accent);
  background: rgba(45, 212, 191, 0.12);
  border-color: var(--line-strong);
}
.check-row { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.88rem; }
@media (max-width: 900px) {
  .paper-form { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .lab-form-grid { grid-template-columns: 1fr 1fr; }
  .lab-form-grid .span-2 { grid-column: 1 / -1; }
}
.addr-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
@media (max-width: 900px) {
  .order-filter-bar { grid-template-columns: 1fr 1fr; }
  .addr-row { grid-template-columns: 1fr; }
}
.mini-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.mini-table th, .mini-table td {
  text-align: left;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--line);
}
.mini-table th { color: var(--muted); font-weight: 600; }
.row-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  align-items: center;
}
/* 禁止把 flex 直接加在 td 上，否则会破坏表格行高与横线对齐 */
td.row-links {
  display: table-cell;
  vertical-align: middle;
}
.inline-form { display: inline; margin: 0; }
.share-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
button.linkish, .linkish {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  margin: 0;
  min-height: 0;
  height: auto;
  line-height: inherit;
  cursor: pointer;
  font: inherit;
  display: inline;
  transform: none;
}
button.linkish.danger, .linkish.danger { color: var(--danger); }
button.linkish:hover { text-decoration: underline; transform: none; }
@media (max-width: 800px) {
  .insight-grid { grid-template-columns: 1fr; }
}
.quote-table tr.row-revised td {
  background: rgba(251, 191, 36, 0.14);
}
.quote-table tr.row-added td {
  background: rgba(56, 189, 248, 0.14);
}
.quote-table tr.row-revised td:first-child {
  box-shadow: inset 3px 0 0 #fbbf24;
}
.quote-table tr.row-low-stock td {
  background: rgba(251, 191, 36, 0.12);
}
.quote-table tr.row-low-stock td:first-child {
  box-shadow: inset 3px 0 0 #fbbf24;
}
.quote-table tr.row-near-expiry td {
  background: rgba(251, 146, 60, 0.1);
}
.quote-table tr.row-near-expiry td:first-child {
  box-shadow: inset 3px 0 0 #fb923c;
}
.quote-table tr.row-expired td {
  background: rgba(248, 113, 113, 0.12);
}
.quote-table tr.row-expired td:first-child {
  box-shadow: inset 3px 0 0 #f87171;
}
.tag-warn {
  border-color: rgba(251, 191, 36, 0.55);
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}
.tag-danger {
  border-color: rgba(248, 113, 113, 0.55);
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}
.low-stock-hint { color: #fbbf24; }
.near-expiry-hint { color: #fb923c; }
.row-expired .near-expiry-hint { color: #f87171; }
.quote-table tr.row-added td:first-child {
  box-shadow: inset 3px 0 0 #38bdf8;
}
.quote-table tr.row-share-revised td {
  background: rgba(45, 212, 191, 0.14);
}
.quote-table tr.row-share-added td {
  background: rgba(45, 212, 191, 0.2);
}
.quote-table tr.row-share-revised td:first-child,
.quote-table tr.row-share-added td:first-child {
  box-shadow: inset 3px 0 0 #2dd4bf;
}
.revise-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #041016;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  white-space: nowrap;
}
.row-added .revise-tag {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}
.revise-tag-share,
.row-share-revised .revise-tag,
.row-share-added .revise-tag {
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  color: #041016;
}
.tag-share {
  border-color: rgba(45, 212, 191, 0.55) !important;
  color: #2dd4bf !important;
  background: rgba(45, 212, 191, 0.12) !important;
}
.notice-banner.notice-share {
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.08);
}
.cell-changed .old-val {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: line-through;
  opacity: 0.85;
}
.cell-changed .new-val {
  font-weight: 700;
  color: #fbbf24;
}
.row-added .cell-changed .new-val,
.row-added td .new-val {
  color: #7dd3fc;
}
.src-link, .src-title {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--accent-2);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-link:hover { text-decoration: underline; color: var(--accent); }
.src-link[data-kind="search"]::after { content: " 🔎"; font-size: 0.7em; }
.src-title { color: var(--muted); white-space: normal; }
.chat-link {
  color: var(--accent-2);
  text-decoration: underline;
  word-break: break-all;
}
.chat-link:hover { color: var(--accent); }
.quote-table.editable input, .quote-table.editable select {
  width: 100%; min-width: 4rem;
  background: var(--input-bg-soft); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.45rem 0.5rem; color: var(--ink); pointer-events: auto;
}
.quote-table.editable input:focus, .quote-table.editable select:focus {
  border-color: var(--accent); outline: 2px solid rgba(45, 212, 191, 0.25);
}
.lead-time-cell {
  position: relative;
  display: block;
  min-width: 6.5rem;
}
.lead-time-td {
  min-width: 6.8rem;
  vertical-align: middle;
}
.lead-time-cell .lead-custom {
  width: 100%;
  min-width: 5.5rem;
  font-size: 0.85rem;
}
.lead-time-suggest {
  position: fixed;
  z-index: 95;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  width: max-content;
  max-width: min(16rem, calc(100vw - 16px));
  padding: 0.4rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--picker-bg, var(--panel, #121a28));
  box-shadow: var(--shadow, 0 10px 28px rgba(0, 0, 0, 0.35));
}
.lead-time-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--input-bg-soft, rgba(255, 255, 255, 0.04));
  color: var(--ink);
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.lead-time-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(45, 212, 191, 0.1);
}
.lead-time-chip.is-active {
  border-color: var(--accent);
  background: rgba(45, 212, 191, 0.16);
  color: var(--accent);
}
.link-btn {
  background: transparent; border: 1px solid var(--line); color: var(--danger);
  border-radius: 8px; padding: 0.35rem 0.55rem; cursor: pointer;
}
.name-cell { display: flex; align-items: center; gap: 0.4rem; }
.name-cell input { flex: 1; min-width: 0; }
.link-badge {
  flex: 0 0 auto;
  font-size: 0.72rem;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  background: rgba(45, 212, 191, 0.12);
}
.link-badge.off {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}
.link-badge.web {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
  text-decoration: none;
  cursor: pointer;
}
a.link-badge.web:hover { filter: brightness(1.12); }
.link-badge.official,
button.link-badge.official {
  color: #9a3412;
  border-color: #fdba74;
  background: #fff7ed;
  cursor: pointer;
  font: inherit;
  line-height: 1.4;
}
button.link-badge.official:hover {
  filter: brightness(0.97);
}
.link-badge.promo {
  color: #c2410c;
  border-color: rgba(234, 88, 12, 0.45);
  background: rgba(234, 88, 12, 0.1);
}
.catalog-picker {
  position: fixed;
  /* 高于 field-expand（1200），避免点选被浮层挡住 */
  z-index: 1300;
  width: min(420px, calc(100vw - 24px));
  max-height: 280px;
  overflow: auto;
  background: var(--picker-bg);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.4rem;
}
.catalog-picker-title {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.25rem 0.45rem 0.45rem;
}
.catalog-picker-section {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.4rem 0.45rem 0.2rem;
  letter-spacing: 0.02em;
}
.catalog-picker-item {
  display: grid;
  grid-template-columns: 72px 88px 1fr auto;
  gap: 0.35rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}
.catalog-picker-item:hover {
  border-color: var(--line-strong);
  background: rgba(45, 212, 191, 0.08);
}
.catalog-picker-item.is-promo:hover {
  background: rgba(234, 88, 12, 0.08);
  border-color: rgba(234, 88, 12, 0.35);
}
.catalog-picker-item .picker-badge {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  vertical-align: 0.05em;
}
.catalog-picker-item .picker-badge.promo {
  color: #c2410c;
  background: rgba(234, 88, 12, 0.12);
}
.catalog-picker-item .picker-list {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  text-decoration: line-through;
  text-align: right;
}
.catalog-picker-item .sku { color: var(--accent-2); }
.catalog-picker-item .nm {
  color: var(--ink);
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  line-height: 1.35;
}
.catalog-picker-item .price { color: var(--accent); white-space: nowrap; align-self: start; }

/* 报价清单：窄列聚焦时浮层完整编辑（避开 table-wrap 裁切） */
.quote-table.editable input.is-expand-source {
  opacity: 0.35;
}
#save-status { min-height: 1.2em; }
#save-status.error { color: var(--danger); }

.fab-stack {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.fab {
  width: 3.4rem; height: 3.4rem; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, #14b8a6, #0284c7);
  color: #041016; font-family: var(--display); font-weight: 700;
  box-shadow: var(--shadow); cursor: pointer;
}
.drawer-mask {
  position: fixed; inset: 0; background: var(--mask-drawer);
  z-index: 70; backdrop-filter: blur(2px);
}
.chat-drawer {
  position: fixed; top: 0; right: 0; width: min(420px, 100%);
  height: 100vh; z-index: 80;
  background: var(--panel-solid);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform .22s ease;
  display: flex; flex-direction: column; padding: 1rem;
}
.chat-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; }
.icon-btn {
  width: 2.2rem; height: 2.2rem; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--ink); font-size: 1.2rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0; }
.chip {
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
  color: var(--muted); border-radius: 999px; padding: 0.35rem 0.7rem;
  font-size: 0.78rem; cursor: pointer; text-align: left;
}
.chip:hover { color: var(--accent); border-color: var(--line-strong); }
.chat-log {
  flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 0.7rem;
  padding: 0.4rem 0.1rem 0.8rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.bubble {
  max-width: 95%; padding: 0.7rem 0.85rem; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface-soft);
}
.bubble.user { align-self: flex-end; background: rgba(45, 212, 191, 0.1); }
.bubble .role { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.25rem; }
.drawer-form { display: grid; gap: 0.65rem; padding-top: 0.75rem; }

.flash { list-style: none; padding: 0; }
.flash li {
  background: rgba(45, 212, 191, 0.1); border: 1px solid var(--line-strong);
  padding: 0.7rem 0.9rem; border-radius: 12px; margin: 1rem 0;
}
.error { color: var(--danger); }
.success-panel .actions { margin-top: 1rem; }

.contact-form { margin-top: 1rem; }
.mono {
  white-space: pre-wrap; background: rgba(0,0,0,0.25);
  border-radius: 10px; padding: 0.8rem; font-size: 0.85rem; max-height: 280px; overflow: auto;
}

@media (max-width: 880px) {
  .form-grid, .workbench-top { grid-template-columns: 1fr; display: grid; }
  .workbench-top { align-items: stretch; }
  .chat-drawer { width: 100%; }
}

.lab-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}
.lab-tabs a {
  padding: 0.45rem 0.9rem;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.lab-tabs a:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.lab-tabs a.active {
  color: #041016;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
}
.site-header nav a.active,
.site-nav a.active {
  color: var(--accent);
}
.use-pct-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.use-pct-row .pct-btn {
  min-width: 3.2rem;
  padding: 0.35rem 0.55rem;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.3);
  color: var(--ink);
}
.use-pct-row .pct-btn:hover:not(:disabled) {
  background: rgba(45, 212, 191, 0.28);
}
.use-pct-row .pct-btn.active {
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  color: #041016;
  border-color: transparent;
  cursor: default;
}
.use-pct-row .pct-btn.rollback {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.4);
}
.use-pct-row .pct-btn:disabled {
  opacity: 1;
}
.used-pct-cell { min-width: 7rem; }
.used-pct-cell strong { display: inline-block; margin-right: 0.25rem; }
.stock-use-table thead th {
  white-space: nowrap;
  vertical-align: middle;
}
.th-sort {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.th-sort:hover {
  color: var(--accent);
}
.th-sort-icon {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.75;
  line-height: 1;
}
.th-sort.is-asc .th-sort-icon,
.th-sort.is-desc .th-sort-icon {
  color: var(--accent);
  opacity: 1;
}
.sync-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.pending-intake-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
}
.lab-color-dot,
.lab-color-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  vertical-align: middle;
  margin-right: 0.35rem;
  background: transparent;
}
.lab-color-dot[data-color="red"],
.lab-color-swatch[data-color="red"] { background: #ef4444; }
.lab-color-dot[data-color="orange"],
.lab-color-swatch[data-color="orange"] { background: #f97316; }
.lab-color-dot[data-color="yellow"],
.lab-color-swatch[data-color="yellow"] { background: #eab308; }
.lab-color-dot[data-color="green"],
.lab-color-swatch[data-color="green"] { background: #22c55e; }
.lab-color-dot[data-color="blue"],
.lab-color-swatch[data-color="blue"] { background: #3b82f6; }
.lab-color-dot[data-color="purple"],
.lab-color-swatch[data-color="purple"] { background: #a855f7; }
.lab-color-dot[data-color="gray"],
.lab-color-swatch[data-color="gray"] { background: #94a3b8; }
.lab-color-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.lab-intake-modal .lab-intake-card {
  width: min(920px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
}
.lab-intake-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.lab-intake-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  align-items: end;
}
.lab-intake-toolbar label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.lab-intake-table-wrap { margin-bottom: 0.75rem; max-height: 48vh; }
.lab-intake-table { min-width: 720px; }
.lab-intake-table select,
.lab-intake-table input[type="date"],
.lab-intake-toolbar select,
.lab-intake-toolbar input[type="date"] {
  min-height: 2.4rem;
  padding: 0.45rem 0.55rem;
  width: 100%;
}
.lab-intake-actions { justify-content: flex-end; }
@media (max-width: 880px) {
  .lab-intake-toolbar { grid-template-columns: 1fr 1fr; }
}
.row-muted { opacity: 0.72; }
.chart-usage-items { margin-top: 0.35rem; }
.share-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 12px;
  background: rgba(45, 212, 191, 0.08);
}
.share-banner strong { color: var(--ink); }
.brand-static { display: flex; align-items: center; gap: 0.65rem; cursor: default; }
.share-nav-note .nav-mode {
  color: var(--muted);
  font-size: 0.85rem;
}
body.share-guest .site-footer { opacity: 0.7; }
.share-workbench-top { margin-bottom: 0.75rem; }
.share-panel {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}
.share-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.45rem;
}
.share-row input {
  flex: 1;
  min-width: 0;
}

.exp-list { display: grid; gap: 0.85rem; margin-top: 0.85rem; }
.exp-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}
.exp-form-block {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.exp-form-label {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.exp-form-row {
  display: grid;
  gap: 0.65rem 0.75rem;
}
.exp-form-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.exp-form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.exp-field {
  display: grid;
  gap: 0.28rem;
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 0;
}
.exp-field input,
.exp-field select {
  width: 100%;
  box-sizing: border-box;
}
.exp-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.15rem;
}
.exp-edit {
  margin-top: 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
}
.exp-edit > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.9rem;
  list-style: none;
  user-select: none;
}
.exp-edit > summary::-webkit-details-marker { display: none; }
.exp-edit[open] > summary { margin-bottom: 0.75rem; }
.exp-delete { margin-top: 0.55rem; }
.material-picker {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: rgba(255,255,255,0.02);
}
.material-picker-head {
  display: flex;
  margin-bottom: 0.55rem;
}
.material-search {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
}
.material-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.6rem;
  margin-bottom: 0.55rem;
}
.material-chip {
  border: 1px solid rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.12);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-chip:hover { border-color: #f87171; background: rgba(248, 113, 113, 0.12); }
.material-groups { display: grid; gap: 0.45rem; max-height: 220px; overflow: auto; }
.material-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.15rem 0.55rem 0.4rem;
}
.material-group summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 0.4rem 0;
}
.material-group summary::-webkit-details-marker { display: none; }
.material-order { font-weight: 600; color: var(--accent); }
.material-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.material-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
}
.material-line:hover { background: rgba(255,255,255,0.04); }
.material-line-main {
  color: var(--ink);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0.35rem 0 0.55rem;
}
.chip-link {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.75rem;
}
.chip-link:hover { border-color: var(--accent); }
@media (max-width: 720px) {
  .exp-form-row.cols-2,
  .exp-form-row.cols-3 { grid-template-columns: 1fr; }
  .material-line {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .material-line .hint { grid-column: 2; }
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
  pointer-events: auto;
}
.share-modal[hidden] { display: none !important; }
.share-modal-card {
  width: min(520px, 100%);
  background: var(--modal-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.65rem;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.share-modal-card h3 { margin: 0; }
.share-recipient-label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.share-recipient-label input,
.share-recipient-label select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: inherit;
  font: inherit;
}
.share-check {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}
.share-check input { margin-top: 0.2rem; }
.share-check[hidden] { display: none !important; }
.share-contact-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.share-contact-chips[hidden] { display: none !important; }
.share-chip {
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: inherit;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.share-chip:hover {
  border-color: var(--accent, #2dd4bf);
  color: var(--accent, #2dd4bf);
}
.share-hide-prices .quote-table th:nth-child(6),
.share-hide-prices .quote-table td:nth-child(6) input {
  outline: 1px dashed color-mix(in srgb, var(--accent, #2dd4bf) 55%, transparent);
  outline-offset: 1px;
}
.row-highlight td {
  background: color-mix(in srgb, var(--accent, #2dd4bf) 12%, transparent);
}
.quote-compare-parties {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-top: 0.85rem;
}
.quote-compare-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  background: var(--panel-soft, transparent);
}
.quote-compare-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.quote-compare-table .diff-up { color: #b45309; font-size: 0.8rem; margin-left: 0.25rem; }
.quote-compare-table .diff-down { color: #047857; font-size: 0.8rem; margin-left: 0.25rem; }
.quote-compare-table .compare-lead {
  margin-top: 0.2rem;
  white-space: nowrap;
}
.quote-compare-table .compare-lead.lead-diff {
  color: var(--accent);
  font-weight: 600;
}
.share-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.share-error { color: #f87171; }
body.share-only .site-header nav,
body.share-only .site-nav,
body.share-only .nav-toggle { display: none; }

/* —— 客户端帮助 —— */
.help-hero { padding-bottom: 0.5rem; }
.help-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-bottom: 1rem;
}
.help-toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
}
.help-toc-links a {
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px dashed rgba(45, 212, 191, 0.35);
}
.help-toc-links a:hover { border-bottom-style: solid; }
.help-section { margin-bottom: 1.1rem; scroll-margin-top: 5rem; }
.help-figure {
  margin: 0.85rem 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--figure-bg);
}
.help-figure img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
.help-figure figcaption {
  padding: 0.55rem 0.85rem 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.help-steps {
  display: grid;
  gap: 0.85rem;
  margin: 0.5rem 0 0.75rem;
}
.help-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(12, 21, 36, 0.55);
}
.help-step-num {
  display: grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border-radius: 9px;
  background: rgba(45, 212, 191, 0.16);
  color: var(--accent);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
}
.help-step h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.help-step p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.help-grid { margin-top: 0.75rem; }
.help-grid .insight-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  font-weight: 400;
  font-family: var(--sans, inherit);
}
.help-callout {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(45, 212, 191, 0.06);
  border-radius: 0 10px 10px 0;
}
.help-callout ul { margin: 0.4rem 0 0; padding-left: 1.15rem; color: var(--muted); }
.help-callout li { margin: 0.25rem 0; }
.help-faq {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  margin: 0.45rem 0;
  background: rgba(12, 21, 36, 0.4);
}
.help-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}
.help-faq p {
  margin: 0.55rem 0 0.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}
@media (max-width: 640px) {
  .help-step { grid-template-columns: 1fr; }
}

/* —— 主题切换 —— */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.28rem;
  min-width: 2.35rem;
  min-height: 2.35rem;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: none;
}
.theme-toggle-icon {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.14);
  color: var(--accent);
  font-size: 0.85rem;
}
[data-theme="light"] .theme-toggle-icon {
  background: rgba(15, 157, 138, 0.14);
}
[data-theme="light"] .insight-card,
[data-theme="light"] .help-step,
[data-theme="light"] .help-faq {
  background: rgba(255, 255, 255, 0.72);
}
[data-theme="light"] .flash li {
  background: rgba(255, 255, 255, 0.9);
}

/* —— 手机端适配 —— */
@media (max-width: 900px) {
  .wrap { width: min(1180px, calc(100% - 1.1rem)); }
  .nav-toggle { display: inline-flex; }
  .header-inner {
    flex-wrap: nowrap;
    padding: 0.65rem 0;
    gap: 0.5rem;
  }
  .brand-en { display: none; }
  .brand-cn { font-size: 0.9rem; }
  .header-tools { margin-left: auto; }

  /* 手机侧滑：导航在 header 外，不被裁切；点遮罩可关 */
  .site-nav {
    display: none !important;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(19.5rem, 86vw);
    z-index: 1200;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    margin: 0;
    padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 0.75rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel-solid);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.28);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
  }
  body.nav-open .site-nav { display: flex !important; }
  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: var(--mask-drawer);
    pointer-events: auto;
  }
  .nav-scrim[hidden] { display: none !important; pointer-events: none !important; }

  .site-header {
    overflow: visible;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--panel-solid);
    z-index: 200;
  }
  /* 打开后顶栏仍可点到「关闭」，高于遮罩 */
  body.nav-open .site-header {
    z-index: 1300;
  }
  .header-inner {
    position: relative;
    z-index: 2;
  }
  .header-tools,
  .nav-toggle {
    position: relative;
    z-index: 210;
    pointer-events: auto;
  }
  .site-nav a,
  .nav-logout-form {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0.78rem 0.85rem;
    border-radius: 10px;
    text-align: left;
    white-space: normal;
  }
  .site-nav a:hover,
  .site-nav a.active {
    background: var(--surface-soft);
  }
  .nav-logout-form { display: block; margin-top: 0.35rem; }
  .nav-logout-form button.linkish {
    width: 100%;
    text-align: left;
    padding: 0.78rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--ink);
  }

  .hero-tech { padding: 1.4rem 0 0.5rem; }
  .hero-tech h1 { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .panel, .panel-tech {
    padding: 1rem 0.95rem 1.1rem;
    margin: 0.75rem 0 1rem;
    border-radius: 14px;
  }
  .panel-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }
  .form-grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .actions { gap: 0.5rem; }
  .actions .btn,
  .actions button,
  .actions a.btn {
    flex: 1 1 auto;
    min-height: 2.6rem;
  }
  .workbench-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }
  .workbench-actions {
    display: none; /* 顶栏已有「新建询价」，工作台内不再重复 */
  }
  .quote-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }
  .quote-head .total {
    align-self: flex-start;
    font-size: 1.15rem;
  }
  .table-wrap {
    margin: 0 -0.15rem;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .table-wrap::after {
    content: "左右滑动查看更多列";
    display: block;
    padding: 0.35rem 0.55rem 0.45rem;
    color: var(--muted);
    font-size: 0.75rem;
    border-top: 1px dashed var(--line);
    background: var(--surface-soft);
  }
  .quote-table {
    min-width: 920px;
    font-size: 0.82rem;
  }
  .quote-table th, .quote-table td {
    padding: 0.45rem 0.4rem;
  }
  .quote-table.editable input,
  .quote-table.editable select {
    min-height: 2.2rem;
    font-size: 16px; /* 避免 iOS 聚焦放大 */
  }
  input, select, textarea, .btn, button {
    font-size: 16px;
    min-height: 2.5rem;
  }
  button.linkish, .linkish {
    min-height: 0;
    height: auto;
    padding: 0;
  }
  textarea { min-height: 5rem; }
  .check-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
  .preset-chips { gap: 0.4rem; }
  .chip { padding: 0.45rem 0.75rem; }
  .fab-stack {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
  }
  .fab {
    width: 3.1rem;
    height: 3.1rem;
  }
  .chat-drawer {
    width: 100%;
    padding: 0.85rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
  }
  .catalog-picker {
    width: calc(100vw - 16px) !important;
    left: 8px !important;
    max-height: min(50vh, 320px);
  }
  .catalog-picker-item {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  #quote-actions.actions {
    position: sticky;
    bottom: 0;
    z-index: 12;
    margin: 0.75rem -0.95rem -1.1rem;
    padding: 0.7rem 0.95rem calc(0.7rem + env(safe-area-inset-bottom));
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
  }
  .help-toc {
    flex-direction: column;
    align-items: flex-start;
  }
  .help-toc-links {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
  .help-toc-links a {
    display: block;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    border-bottom-style: solid;
    text-align: center;
    background: var(--surface-soft);
  }
  .theme-toggle {
    padding: 0.28rem;
  }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .order-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .share-modal { padding: 0.65rem; align-items: end; }
  .share-modal-card {
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    border-radius: 16px 16px 12px 12px;
  }
  .site-footer {
    padding: 1.5rem 0 calc(2rem + env(safe-area-inset-bottom));
    font-size: 0.8rem;
  }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 0.9rem); }
  .brand-cn { font-size: 0.9rem; }
  .stats-row { grid-template-columns: 1fr; }
  .check-row { grid-template-columns: 1fr; }
  .help-toc-links { grid-template-columns: 1fr; }
  .workbench-actions { grid-template-columns: 1fr; }
  .quote-table { min-width: 860px; }
  #quote-actions.actions .btn,
  #quote-actions.actions a.btn {
    flex: 1 1 calc(50% - 0.35rem);
  }
  .nav-toggle { padding: 0.45rem 0.6rem; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .chat-drawer { max-height: 100dvh; }
  .catalog-picker { max-height: min(42vh, 240px); }
}

/* —— 促销专区：马赛克拼版 + 悬停固定尺寸细看 —— */
.promo-page {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-bottom: 2.5rem;
  overflow-x: clip;
}
.wrap-promo {
  width: min(1240px, calc(100% - 1.5rem));
  margin-left: auto;
  margin-right: auto;
}
.promo-page .visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.promo-stage {
  position: relative;
  min-height: min(24vh, 180px);
  display: grid;
  align-items: end;
  padding: 1.2rem clamp(1rem, 3vw, 2rem) 1rem;
  overflow: hidden;
}
.promo-stage-bg {
  position: absolute;
  inset: -2%;
  background:
    linear-gradient(115deg, rgba(4, 12, 20, 0.82) 10%, rgba(4, 18, 28, 0.45) 50%, rgba(3, 10, 18, 0.85) 100%),
    url("/static/img/bg/lab-active.jpg") center 40% / cover no-repeat;
  animation: promo-stage-drift 30s ease-in-out infinite alternate;
  filter: saturate(0.85) brightness(0.75);
}
[data-theme="light"] .promo-stage-bg {
  background-image:
    linear-gradient(115deg, rgba(6, 18, 28, 0.82) 10%, rgba(8, 30, 40, 0.5) 50%, rgba(4, 14, 22, 0.86) 100%),
    url("/static/img/bg/lab-bench.jpg");
}
.promo-stage-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 55% at 85% 15%, rgba(45, 212, 191, 0.22), transparent 60%),
    linear-gradient(180deg, transparent 50%, rgba(7, 11, 18, 0.5) 100%);
  pointer-events: none;
}
.promo-stage-inner {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
}
.promo-brand {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.crumbs .accent.title-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.promo-title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.promo-title .title-tip {
  align-self: center;
  margin-top: 0.15rem;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(4, 16, 22, 0.35);
  color: rgba(232, 242, 255, 0.85);
}
.promo-title .title-tip:hover,
.promo-title .title-tip:focus-visible,
.promo-title .title-tip.is-open {
  color: #5eead4;
  border-color: rgba(94, 234, 212, 0.55);
}
.promo-title-line { font-size: clamp(1.45rem, 3.8vw, 2.1rem); }
.promo-title-accent {
  background: linear-gradient(105deg, #5eead4, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.promo-lead {
  margin: 0.4rem 0 0;
  font-size: 0.84rem;
  color: rgba(232, 242, 255, 0.72);
}
.promo-stage-meta { margin-top: 0.55rem; }
.promo-chip {
  display: inline-flex;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #041016;
  background: linear-gradient(120deg, #5eead4, #2dd4bf);
}

.promo-dock { margin-top: 0.8rem; }
.promo-toolbar {
  position: sticky;
  top: 0.4rem;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.6rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-solid) 90%, transparent);
  backdrop-filter: blur(12px);
}
.promo-search { flex: 1 1 150px; min-width: 130px; }
.promo-search input {
  width: 100%;
  font: inherit;
  padding: 0.36rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
}
.promo-filters { display: flex; flex-wrap: wrap; gap: 0.28rem; }
.promo-filter {
  appearance: none;
  border: 1px solid transparent;
  background: var(--surface-soft);
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}
.promo-filter:hover { color: var(--ink); border-color: var(--line); }
.promo-filter.is-on {
  color: #041016;
  background: linear-gradient(120deg, #5eead4, #2dd4bf);
}

.promo-mosaic {
  --mosaic-row: 118px;
  --peek-w: 320px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: var(--mosaic-row);
  grid-auto-flow: dense;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding: 1.2rem 0.7rem 2rem;
  align-items: stretch;
}
.promo-mosaic[data-count="1"] { max-width: 720px; margin-left: auto; margin-right: auto; }
.promo-mosaic[data-count="2"],
.promo-mosaic[data-count="3"] { max-width: 980px; margin-left: auto; margin-right: auto; }

/* 占位格：负责马赛克尺寸；卡片本体可飞出到固定预览尺寸 */
.promo-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  z-index: 1;
}
.promo-tile[hidden] { display: none !important; }
.promo-tile.m-1x1 { grid-column: span 1; grid-row: span 1; }
.promo-tile.m-1x2 { grid-column: span 1; grid-row: span 2; }
.promo-tile.m-2x1 { grid-column: span 2; grid-row: span 1; }
.promo-tile.m-2x2 { grid-column: span 2; grid-row: span 2; }
.promo-tile.m-4x1 { grid-column: span 4; grid-row: span 1; }
.promo-tile.m-4x2 { grid-column: span 4; grid-row: span 2; }
.promo-tile.is-peek { z-index: 2; }
.promo-card-ph {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 1px dashed rgba(94, 234, 212, 0.25);
  background: rgba(45, 212, 191, 0.06);
}

/* 挂到 body 的顶层预览层，避免被 header / toolbar / main 盖住 */
.promo-peek-root {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
}
.promo-peek-root.is-sticky {
  pointer-events: auto;
  background: rgba(2, 8, 14, 0.45);
}
.promo-peek-root .promo-card.is-peek-card {
  pointer-events: auto;
  position: fixed;
  inset: auto;
  left: var(--peek-left, 12px);
  top: var(--peek-top, 12px);
  width: var(--peek-w, 320px);
  height: auto;
  max-height: min(460px, calc(100vh - 24px));
  overflow-x: hidden;
  overflow-y: auto;
  border-color: var(--line-strong);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(45, 212, 191, 0.3);
  opacity: 1;
  animation: none;
  z-index: 1;
}
.promo-peek-close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 6;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(4, 16, 22, 0.72);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.promo-peek-root.is-sticky .promo-peek-close {
  display: inline-flex;
}
.promo-peek-close:hover,
.promo-peek-close:focus-visible {
  background: rgba(4, 16, 22, 0.9);
  border-color: rgba(94, 234, 212, 0.55);
  outline: none;
}
.promo-peek-root .promo-card.is-peek-card .promo-card-shot {
  flex: 0 0 168px;
  height: 168px;
  min-height: 168px;
}
.promo-peek-root .promo-card.is-peek-card .promo-card-info {
  padding: 0.75rem 0.85rem 0.9rem;
  gap: 0.35rem;
}
.promo-peek-root .promo-card.is-peek-card .promo-card-title {
  display: block;
  font-size: 1.05rem;
  -webkit-line-clamp: unset;
  overflow: visible;
  white-space: normal;
}
.promo-peek-root .promo-card.is-peek-card .promo-card-meta {
  white-space: normal;
  overflow: visible;
  font-size: 0.78rem;
  line-height: 1.4;
}
.promo-peek-root .promo-card.is-peek-card .promo-card-blurb,
.promo-peek-root .promo-card.is-peek-card .promo-card-exp {
  display: block;
}
.promo-peek-root .promo-card.is-peek-card .promo-card-price strong {
  font-size: 1.25rem;
}
.promo-peek-root .promo-card.is-peek-card .promo-card-btn {
  margin-top: 0.45rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
}

.promo-mosaic:has(.promo-tile.is-peek) .promo-tile:not(.is-peek) .promo-card {
  filter: saturate(0.8);
  opacity: 0.45;
}

.promo-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: auto;
  height: auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  opacity: 0;
  animation: promo-fade-in 0.35s ease forwards;
  animation-delay: calc(min(var(--i), 18) * 24ms);
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    filter 0.2s ease,
    opacity 0.2s ease;
}
[data-theme="light"] .promo-card { background: #fff; }

.promo-card-shot {
  position: relative;
  flex: 1 1 auto;
  min-height: 48px;
  background:
    linear-gradient(145deg, rgba(20, 184, 166, 0.42), rgba(14, 165, 233, 0.22)),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), transparent 50%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.promo-card-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 0;
}
.promo-card-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(155deg, var(--promo-tint, transparent) 0%, transparent 48%);
}
.promo-tile.m-1x1 .promo-card-shot { flex: 0 0 50%; }
.promo-tile.m-2x1 .promo-card-shot { flex: 0 0 46%; }

.promo-card--slow {
  --promo-tint: rgba(45, 212, 191, 0.55);
}
.promo-card--slow .promo-card-shot {
  background-image: linear-gradient(145deg, rgba(45, 212, 191, 0.42), rgba(13, 148, 136, 0.28));
}
.promo-card--near_expiry {
  --promo-tint: rgba(251, 146, 60, 0.58);
}
.promo-card--near_expiry .promo-card-shot {
  background-image: linear-gradient(145deg, rgba(251, 146, 60, 0.5), rgba(234, 88, 12, 0.25));
}
.promo-card--test {
  --promo-tint: rgba(56, 189, 248, 0.55);
}
.promo-card--test .promo-card-shot {
  background-image: linear-gradient(145deg, rgba(56, 189, 248, 0.42), rgba(14, 116, 144, 0.3));
}
.promo-card--resale {
  --promo-tint: rgba(52, 211, 153, 0.55);
}
.promo-card--resale .promo-card-shot {
  background-image: linear-gradient(145deg, rgba(52, 211, 153, 0.45), rgba(16, 185, 129, 0.25));
}

.promo-badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 2;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #041016;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 4px rgba(4, 16, 22, 0.18);
}
.promo-card--slow .promo-badge {
  color: #042f2e;
  background: linear-gradient(120deg, #5eead4, #2dd4bf);
}
.promo-card--near_expiry .promo-badge {
  color: #431407;
  background: linear-gradient(120deg, #fdba74, #fb923c);
}
.promo-card--resale .promo-badge {
  color: #052e1c;
  background: linear-gradient(120deg, #6ee7b7, #34d399);
}
.promo-card--test .promo-badge {
  color: #0c4a6e;
  background: linear-gradient(120deg, #7dd3fc, #38bdf8);
}

.promo-card-info {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem 0.55rem 0.55rem;
  background: inherit;
}

.promo-card-title {
  margin: 0;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo-card-meta {
  margin: 0;
  font-size: 0.66rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.promo-card-blurb,
.promo-card-exp {
  display: none;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}
.promo-card-exp { color: #d97706; }

.promo-card-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.4rem;
}
.promo-card-price strong {
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
}
.promo-card-price s { font-size: 0.66rem; color: var(--muted); }
.promo-card-price em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.64rem;
  color: var(--muted);
}
.promo-card-btn {
  appearance: none;
  width: 100%;
  margin-top: 0.3rem;
  border: 0;
  border-radius: 999px;
  padding: 0.36rem 0.5rem;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 650;
  cursor: pointer;
  color: #041016;
  background: linear-gradient(115deg, #5eead4, #2dd4bf 50%, #38bdf8);
}

.promo-none {
  margin: 0.5rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.promo-empty {
  margin: 1.2rem auto 0;
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 14px;
  border: 1px dashed var(--line);
}
.promo-empty p { margin: 0 0 0.85rem; color: var(--muted); }

@keyframes promo-stage-drift {
  from { transform: scale(1.04); }
  to { transform: scale(1.08) translate(-1%, -0.6%); }
}
@keyframes promo-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .promo-stage-bg,
  .promo-card { animation: none; opacity: 1; }
}

@media (max-width: 900px) {
  .promo-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    --mosaic-row: 130px;
    --peek-w: min(320px, calc(100vw - 24px));
    padding: 1rem 0.35rem 1.6rem;
  }
  .promo-tile.m-2x1,
  .promo-tile.m-2x2,
  .promo-tile.m-4x1,
  .promo-tile.m-4x2 { grid-column: span 2; }
  .promo-tile.m-2x2,
  .promo-tile.m-4x2,
  .promo-tile.m-1x2 { grid-row: span 2; }
}
@media (max-width: 520px) {
  .promo-mosaic { --mosaic-row: 148px; gap: 0.5rem; }
}


/* 实验室库存挂售等仍复用 */
.promo-mine { margin-bottom: 1rem; }
.promo-mine-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.promo-mine-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.promo-list-fold { margin-top: 0.4rem; }
.promo-list-fold > summary {
  cursor: pointer;
  list-style: none;
  color: var(--accent);
  font-size: 0.85rem;
}
.promo-list-fold > summary::-webkit-details-marker { display: none; }
.promo-listed-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-top: 0.45rem;
}
.promo-list-form {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.promo-list-form .promo-buy-ref {
  margin: 0;
  font-size: 0.78rem;
}
.promo-list-form .promo-buy-ref strong {
  color: var(--ink);
  font-weight: 600;
}
.promo-list-form label {
  display: grid;
  gap: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.promo-list-form input {
  font: inherit;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

@keyframes promo-stage-drift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}
@keyframes promo-orb {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(8%, -10%, 0) scale(1.12); }
}
@keyframes promo-scan {
  from { background-position: 0 -40%; }
  to { background-position: 0 140%; }
}
@keyframes promo-title-shine {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}
@keyframes promo-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes promo-rise-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .promo-stage-bg,
  .promo-stage-orb,
  .promo-stage-scan,
  .promo-title-accent,
  .promo-ticker-track,
  .promo-poster { animation: none; }
  .promo-poster,
  .promo-poster.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .promo-poster:hover,
  .promo-poster:hover .promo-poster-media,
  .promo-btn:hover { transform: none; }
}

@media (max-width: 960px) {
  .promo-poster,
  .promo-poster--feature,
  .promo-poster--wide,
  .promo-poster--tile {
    grid-column: span 6;
    min-height: 360px;
  }
  .promo-poster--feature { min-height: 420px; }
}
@media (max-width: 640px) {
  .promo-stage { min-height: 46vh; padding-bottom: 1.6rem; }
  .promo-poster,
  .promo-poster--feature,
  .promo-poster--wide,
  .promo-poster--tile {
    grid-column: 1 / -1;
    min-height: 340px;
  }
  .promo-ticker-track { animation-duration: 22s; }
}

/* —— 客户 API / MCP 密钥页 —— */
.api-key-form .api-key-name {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.api-key-form .api-key-name input {
  width: 100%;
  max-width: 28rem;
  box-sizing: border-box;
}
.api-key-scopes {
  margin: 1rem 0 0;
  padding: 0;
  border: none;
}
.api-key-scopes legend {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0;
  margin-bottom: 0.55rem;
}
.api-key-scopes legend .hint {
  margin-left: 0.25rem;
  font-weight: normal;
}
.api-key-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.45rem 0.85rem;
}
.api-key-scope-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  background: var(--card, #fff);
  cursor: pointer;
  font-weight: normal;
  color: inherit;
}
.api-key-scope-item:hover {
  border-color: var(--accent, #2a7);
}
.api-key-scope-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0.2rem 0 0;
  accent-color: var(--accent, #2a7);
}
.api-key-scope-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  line-height: 1.35;
}
.api-key-scope-label {
  font-size: 0.9rem;
  color: var(--text, #1a1a1a);
}
.api-key-scope-code {
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-all;
}
.api-key-raw {
  display: block;
  word-break: break-all;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  font-size: 0.9rem;
}
.api-key-created {
  border-color: var(--accent, #2a7);
}
.api-key-scope-cell {
  max-width: 16rem;
  word-break: break-word;
}
.api-key-revoke {
  display: inline;
  margin: 0;
}

.api-key-mcp-json {
  margin: 0.65rem 0 0;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre;
  color: var(--text, #1a1a1a);
}
.api-key-raw-inline {
  word-break: break-all;
  font-size: 0.8rem;
}
