/**
 * ui-enhance.css — 乐跑平台全局视觉系统
 *
 * 涵盖：Design Token / Reset / Layout / Cards / Forms / Buttons /
 *       Tables / Badges / Toast / Modal / Empty / Skeleton / Stats /
 *       QR / InfoGrid / Segmented / Log / Responsive / Platform / A11y
 *
 * 版本: 1.0 | 编码: UTF-8
 */

/* ================================================================
   1. DESIGN TOKENS — Base (light theme)
   ================================================================ */
:root {
  /* ── Palette ── */
  --primary: #4f6cf7;
  --primary2: #7c5ce7;
  --primary-end: #8a5ce6;
  --primary-glow: rgba(79, 108, 247, 0.15);
  --primary-light: rgba(79, 108, 247, 0.06);

  --success: #16a36a;
  --success-glow: rgba(22, 163, 106, 0.12);
  --warning: #e99a24;
  --warning-glow: rgba(233, 154, 36, 0.10);
  --danger: #e45454;
  --danger-glow: rgba(228, 84, 84, 0.12);

  --bg: #f5f7fb;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --surface-solid: #ffffff;
  --card-border: rgba(255, 255, 255, 0.6);

  --text: #111827;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: rgba(148, 163, 184, 0.20);
  --border-light: rgba(148, 163, 184, 0.10);
  --line: rgba(0, 0, 0, 0.06);

  /* ── Gradients ── */
  --gradient-primary: linear-gradient(135deg, #4f6cf7 0%, #6c63f2 50%, #8a5ce6 100%);
  --gradient-success: linear-gradient(135deg, #16a36a 0%, #10b981 100%);
  --gradient-danger: linear-gradient(135deg, #e45454 0%, #dc2626 100%);

  /* ── Radii ── */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  /* ── Shadows ── */
  --shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 16px 45px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.11);
  --shadow-btn: 0 6px 18px rgba(79, 108, 247, 0.18);

  /* ── Motion ── */
  --transition: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Typography ── */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", Consolas, "Roboto Mono", monospace;
  --font-size-base: 14px;
  --font-size-sm: 12px;
  --font-size-xs: 10px;
  --font-size-lg: 16px;
  --font-size-xl: 20px;

  /* ── Spacing ── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;

  /* ── Layout ── */
  --nav-h: 64px;
  --topbar-h: 56px;
  --max-w: 980px;
  --max-w-wide: 1180px;

  /* ── Backdrop ── */
  --backdrop-blur: 18px;
  --nav-bg: rgba(255, 255, 255, 0.85);
}

/* ================================================================
   2. PLATFORM OVERRIDES
   ================================================================ */

/* ── iOS / iPadOS ── */
.os-ios {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", Menlo, monospace;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --shadow-md: 0 8px 40px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.09);
  --backdrop-blur: 28px;
  --nav-bg: rgba(255, 255, 255, 0.74);
  --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ── Android ── */
.os-android {
  --font: "Roboto", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Roboto Mono", "Droid Sans Mono", monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --shadow-md: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.14);
  --backdrop-blur: 12px;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

/* ── Windows ── */
.os-windows {
  --font: "Segoe UI", "Segoe UI Variable", "Microsoft YaHei", sans-serif;
  --font-mono: "Cascadia Code", Consolas, "Courier New", monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10);
  --backdrop-blur: 16px;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --ease-out: cubic-bezier(0.4, 0, 1, 1);
}

/* ── macOS ── */
.os-mac {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", Menlo, monospace;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.08);
  --backdrop-blur: 22px;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ================================================================
   3. RESET & BASE
   ================================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(ellipse 80% 60% at 15% 5%, rgba(79, 108, 247, 0.10), transparent 50%),
    radial-gradient(ellipse 60% 50% at 85% 0%, rgba(124, 92, 231, 0.08), transparent 45%),
    radial-gradient(ellipse 40% 40% at 5% 50%, rgba(22, 163, 106, 0.04), transparent 50%),
    radial-gradient(ellipse 50% 45% at 90% 90%, rgba(79, 108, 247, 0.05), transparent 50%),
    linear-gradient(175deg, #fafbff 0%, #f3f5fd 30%, #eef1fa 60%, var(--bg) 100%);
  background-attachment: fixed;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ================================================================
   4. TYPOGRAPHY
   ================================================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .text-mono {
  font-family: var(--font-mono);
}

.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.subtle { font-size: 11px; color: var(--text-tertiary); }
.timer-text { font-size: 11px; color: var(--text-tertiary); text-align: center; margin-top: 6px; }

/* ================================================================
   5. LAYOUT — Topbar / Container / Bottom Nav
   ================================================================ */

.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border-bottom: 1px solid var(--line);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar { background: var(--card-solid); }
}

.topbar-inner {
  max-width: var(--max-w);
  height: var(--topbar-h);
  padding: 0 var(--space-lg); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}

.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none !important;
  color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: -0.02em;
}

.topbar-brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--gradient-primary);
  box-shadow: 0 6px 18px var(--primary-glow);
  color: #fff;
}
.topbar-brand .logo svg { width: 16px; height: 16px; display: block; }

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--font-size-sm); color: var(--text-secondary);
}
.topbar-user a { color: var(--danger); text-decoration: none; font-weight: 600; margin-left: 4px; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 18px var(--space-lg) 0; }
.container-wide { max-width: var(--max-w-wide); margin: 0 auto; padding: 18px var(--space-lg) 0; }

/* Bottom Navigation */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border-top: 1px solid var(--line);
  display: flex; align-items: stretch; padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .bottom-nav { background: var(--card-solid); }
}

.bottom-nav button {
  flex: 1; border: none; background: none;
  font-size: 10px; font-weight: 600; font-family: var(--font);
  color: var(--text-tertiary);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; cursor: pointer;
  transition: color 0.25s var(--ease-out), transform 0.2s;
  position: relative; padding: 5px 0;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav button .tab-icon { font-size: 21px; line-height: 1; transition: transform 0.25s var(--ease-spring); }
.bottom-nav button.active { color: var(--primary); }
.bottom-nav button.active .tab-icon { transform: scale(1.14); }
.bottom-nav button::after {
  content: ""; position: absolute; bottom: 2px;
  width: 20px; height: 3px; border-radius: 2px;
  background: var(--primary);
  transform: scaleX(0); transition: transform 0.25s var(--ease-spring);
}
.bottom-nav button.active::after { transform: scaleX(1); }

.nav-badge {
  position: absolute; top: 2px; right: calc(50% - 22px);
  min-width: 16px; height: 16px; padding: 0 5px;
  border-radius: 8px; background: var(--danger);
  color: #fff; font-size: 9px; font-weight: 800;
  line-height: 16px; text-align: center;
  animation: badgePop 0.3s var(--ease-spring);
}
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

/* Tab Panels */
.tab-panels { position: relative; }
.tab-panel { display: none; animation: fadeSlideIn 0.32s var(--ease-out); }
.tab-panel.active { display: block; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   6. CARDS
   ================================================================ */
.card {
  position: relative; overflow: hidden;
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  transition: box-shadow 0.25s var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-lg); }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .card { background: var(--card-solid); }
}
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,108,247,.30), rgba(124,92,231,.20), transparent);
}

.card-header {
  min-height: 52px; padding: 15px var(--space-lg);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap; gap: var(--space-sm);
}
.card-header h3 { font-size: 14px; font-weight: 850; letter-spacing: -0.02em; color: var(--text); }
.card-body { padding: 18px var(--space-lg); }

/* ================================================================
   7. FORMS
   ================================================================ */
.form-row {
  display: flex; gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap; align-items: flex-end;
}
.form-row.cols-2 > * { flex: 1; min-width: 120px; }
.form-row.cols-auto { align-items: center; }
.form-row.cols-auto > * { flex: 0 0 auto; }

.form-group {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--line);
}
.form-group:last-child { border-bottom: none; margin-bottom: 0; }

.form-group-label {
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em;
}

.field-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.field-label select,
.field-label input {
  display: block; width: 100%; margin-top: 4px;
}

.unit {
  font-size: 11px; color: var(--text-tertiary);
  margin-left: 4px; font-weight: 400;
}

.form-span {
  font-size: 12px; color: var(--text-secondary);
  white-space: nowrap; line-height: 42px;
}

.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;
}

input,
select,
textarea {
  flex: 1; min-width: 100px; height: 42px; padding: 0 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font);
  outline: none; background: var(--card-solid);
  color: var(--text);
  transition: border 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

/* iOS 防缩放：输入框最小 16px */
@media screen and (max-width: 767px) {
  input, select, textarea { font-size: 16px; }
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea { padding: 10px 12px; height: auto; resize: vertical; font-family: var(--font-mono); }

/* 特定输入尺寸 */
.input-date { max-width: 150px; }
.input-time { max-width: 130px; }
.input-narrow { max-width: 70px; }
.input-sm { height: 32px; font-size: 12px; }
.input-xs { height: 28px; font-size: 10px; max-width: 70px; }

/* Segmented Control */
.segmented {
  display: inline-flex; gap: 0;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  padding: 3px;
  margin-bottom: var(--space-md);
}
.seg-item {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: calc(var(--radius-sm) - 3px);
  font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.seg-item.seg-active {
  background: #fff; color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Mode description */
.mode-desc {
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(79,108,247,.04); border: 1px solid rgba(79,108,247,.08);
  font-size: 11px; color: var(--text-secondary); line-height: 1.6;
  margin-bottom: var(--space-md);
}

/* Order Summary */
.order-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-sm);
}
.order-summary-item {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: #f8fafc; border: 1px solid var(--line);
  text-align: center;
}
.os-label { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; font-weight: 600; }
.os-value { font-size: 18px; font-weight: 900; color: var(--text); margin-top: 2px; }

/* Password toggle */
.pwd-toggle {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  font-size: 18px; cursor: pointer; padding: 6px; line-height: 1;
  opacity: 0.5; transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.pwd-toggle:hover { opacity: 0.8; }

/* ================================================================
   8. BUTTONS
   ================================================================ */
.btn {
  height: 42px; padding: 0 20px;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; cursor: pointer;
  color: #fff; font-family: var(--font);
  background: var(--gradient-primary);
  box-shadow: var(--shadow-btn);
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s var(--ease-out), opacity 0.15s;
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(79,108,247,.26); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; filter: grayscale(0.3); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-lg { height: 48px; padding: 0 28px; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 11px; border-radius: 8px; }

/* Button variants */
.btn-danger {
  background: var(--gradient-danger);
  box-shadow: 0 6px 16px rgba(228,84,84,.16);
}
.btn-danger:hover { box-shadow: 0 10px 24px rgba(228,84,84,.26); }

.btn-ghost {
  background: var(--card-solid); color: var(--text-secondary);
  border: 1px solid #e2e8f0; box-shadow: none; font-weight: 600;
}
.btn-ghost:hover { background: #f8fafc; box-shadow: 0 2px 8px rgba(0,0,0,.04); }

.btn-green {
  background: var(--gradient-success);
  box-shadow: 0 6px 16px rgba(22,163,106,.18);
}
.btn-green:hover { box-shadow: 0 10px 24px rgba(22,163,106,.28); }

/* Loading spinner — dark variant for btn-ghost */
.btn-spinning {
  position: relative; pointer-events: none; opacity: 0.85;
}
.btn-spinning::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 6px;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: spin 0.6s linear infinite; vertical-align: middle;
}
.btn-danger.btn-spinning::after {
  border-color: rgba(255,255,255,.5); border-top-color: #fff;
}

.btn.loading {
  position: relative; color: transparent !important; pointer-events: none;
}
.btn.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   9. TABLES
   ================================================================ */
.tbl-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--space-lg)); padding: 0 var(--space-lg); }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 9px 12px; text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: var(--font-size-sm);
}
th {
  color: var(--text-tertiary); font-weight: 800;
  font-size: 11px; background: #f8f9fc;
  white-space: nowrap; letter-spacing: 0.02em;
  position: sticky; top: 0; z-index: 1;
}
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(79,108,247,.03); }
tbody tr:last-child td { border-bottom: none; }

/* Order row */
.order-row { cursor: pointer; }
.order-row:hover { background: rgba(79,108,247,.04); }
.order-id { font-weight: 700; font-size: 11px; font-family: var(--font-mono); }
.order-refundable { font-weight: 700; }
.order-actions { white-space: nowrap; }
.order-actions form { display: inline; }

/* Detail row */
.detail-row { background: #f8fafc; }
.detail-row td { padding: 14px var(--space-lg); }

.detail-summary {
  font-size: 11px; color: var(--text-secondary); margin-bottom: 8px;
  padding: 6px 10px; background: #f1f5f9; border-radius: 6px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.dot-ok { color: var(--success); font-weight: 700; }
.dot-fail { color: var(--danger); font-weight: 700; }
.dot-pending { color: var(--primary); font-weight: 700; }

.sub-table { font-size: 11px; width: 100%; }
.sub-table th, .sub-table td { padding: 5px 8px; font-size: 10px; }

/* card-body-flush: zero-padding variant for tables */
.card-body-flush { padding: 0; }

/* Progress */
.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress-nums { font-size: 12px; font-weight: 700; white-space: nowrap; }
.progress-bar-mini {
  flex: 1; min-width: 40px; height: 4px; border-radius: 2px;
  background: #e2e8f0; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 2px;
  background: var(--gradient-primary);
  transition: width 0.4s var(--ease-out);
}

/* ================================================================
   10. BADGES & STATUS
   ================================================================ */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 5px;
  font-size: 10px; font-weight: 750; letter-spacing: 0.01em;
}
.badge-success { background: rgba(22,163,106,.10); color: var(--success); }
.badge-running { background: rgba(79,108,247,.08); color: var(--primary); }
.badge-unstart { background: rgba(79,108,247,.08); color: var(--primary); }
.badge-fail { background: rgba(228,84,84,.08); color: var(--danger); }
.badge-pending { background: rgba(233,154,36,.10); color: #b45309; }
.badge-refunded { background: #f1f5f9; color: var(--text-tertiary); }
.badge-other { background: #f1f5f9; color: var(--text-tertiary); }

/* Status rows */
.status-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 10px; font-size: 12px; font-weight: 650;
}
.status-ok { background: #ecfdf5; color: var(--success); }
.status-warn { background: #fffbeb; color: #92400e; }
.status-err { background: #fef2f2; color: var(--danger); }
.status-info { background: rgba(79,108,247,.05); color: var(--primary); }

/* ================================================================
   11. INFO GRID
   ================================================================ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-sm); margin-bottom: 12px;
}
.info-item {
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: #f8fafc; border: 1px solid var(--line);
  font-size: 12px; transition: background 0.15s;
}
.info-item:hover { background: #f1f5f9; }
.info-item .il {
  color: var(--text-tertiary); font-weight: 650;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em;
}
.info-item .iv {
  font-weight: 750; color: var(--text); margin-top: 3px;
}

.info-label {
  font-size: 11px; color: var(--text-tertiary); font-weight: 650;
}
.info-value {
  font-size: 14px; font-weight: 750; color: var(--text); margin-top: 2px;
}

/* ================================================================
   12. STATS
   ================================================================ */
.stats {
  display: grid; gap: var(--space-sm); margin-bottom: 18px;
}
.stat {
  position: relative; overflow: hidden; padding: 20px 18px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.stat:active { transform: scale(0.985); }
.stat::after {
  content: ""; position: absolute; right: -16px; top: -16px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary-glow);
}
.stat .num {
  position: relative; z-index: 1;
  font-size: 30px; font-weight: 950; letter-spacing: -0.04em;
  color: var(--text); transition: all 0.35s var(--ease-out);
}
.stat .label {
  position: relative; z-index: 1;
  margin-top: 8px; color: var(--text-tertiary);
  font-size: 12px; font-weight: 600;
}

/* ================================================================
   13. TOAST — Floating notification
   ================================================================ */
.toast-float {
  position: fixed; top: 72px; left: 50%;
  transform: translateX(-50%); z-index: 300;
  padding: 10px 22px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 700;
  max-width: 88vw; text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.35s var(--ease-out);
  pointer-events: auto;
}
.toast-float.toast-out {
  animation: toastOut 0.3s ease forwards;
}

.toast-float:not(.toast-out) { display: flex; }
.toast-float.toast-out + .toast-float { display: none; }

/* 兼容旧版 toast 类名 */
.toast {
  position: fixed; top: 72px; left: 50%;
  transform: translateX(-50%); z-index: 300;
  padding: 10px 22px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 700;
  max-width: 88vw; text-align: center;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s var(--ease-out);
  pointer-events: none;
}

.toast-ok, .toast-float.toast-ok {
  background: #ecfdf5; color: var(--success);
  border: 1px solid rgba(22,163,106,.15);
}
.toast-err, .toast-float.toast-err {
  background: #fef2f2; color: var(--danger);
  border: 1px solid rgba(228,84,84,.15);
}
.toast-warn, .toast-float.toast-warn {
  background: #fffbeb; color: #92400e;
  border: 1px solid rgba(233,154,36,.2);
}
.toast-info, .toast-float.toast-info {
  background: rgba(79,108,247,.06); color: var(--primary);
  border: 1px solid rgba(79,108,247,.15);
}

.toast-close {
  background: none; border: none; font-size: 14px;
  cursor: pointer; opacity: 0.5; padding: 2px;
  color: inherit; flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-16px); }
}

/* ================================================================
   14. MODAL / CONFIRM DIALOG
   ================================================================ */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
  padding: var(--space-lg);
}
.confirm-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px 24px 20px; max-width: 340px; width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modalPop 0.3s var(--ease-spring);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .confirm-box { background: var(--card-solid); }
}
.confirm-box .confirm-icon { font-size: 36px; margin-bottom: 8px; }
.confirm-box .confirm-title { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.confirm-box .confirm-msg { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.5; }
.confirm-box .confirm-btns { display: flex; gap: 10px; }
.confirm-box .confirm-btns button {
  flex: 1; height: 40px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: var(--font);
  transition: transform 0.15s, box-shadow 0.15s;
}
.confirm-box .confirm-btns button:active { transform: scale(0.97); }
.confirm-box .btn-cancel {
  background: #f1f5f9; color: var(--text-secondary);
}
.confirm-box .btn-confirm {
  background: var(--gradient-danger); color: #fff;
  box-shadow: 0 6px 16px rgba(228,84,84,.16);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ═══ Edit Task Modal ═══ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
  padding: var(--space-lg);
}
.modal-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  max-width: 520px; width: 100%; max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.3s var(--ease-spring);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-header h3 { font-size: 15px; font-weight: 800; margin: 0; }
.modal-close {
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: var(--text-tertiary); padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body {
  padding: 16px 20px; overflow-y: auto; flex: 1;
}
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ═══ Order row clickable hint ═══ */
.order-row-clickable {
  cursor: pointer;
  position: relative;
}
.order-row-clickable::after {
  content: "";
  position: absolute; left: 0; bottom: 0; width: 100%; height: 0;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
}
.order-row-clickable:hover::after {
  border-bottom-color: var(--primary);
}
.order-row-clickable td:first-child::before {
  content: "▸";
  display: inline-block; margin-right: 4px; font-size: 10px;
  transition: transform 0.2s; color: var(--text-tertiary);
}
.order-row-clickable[aria-expanded="true"] td:first-child::before {
  transform: rotate(90deg); color: var(--primary);
}

/* ═══ Edit task section ═══ */
.edit-task-section {
  margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed var(--line);
}

/* ═══ Detail row animation ═══ */
.detail-row {
  animation: detailSlideIn 0.25s var(--ease-out);
}
@keyframes detailSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   15. EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center; padding: 40px var(--space-lg);
  color: var(--text-tertiary);
}
.empty-icon { margin-bottom: 12px; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.empty-desc { font-size: 12px; color: var(--text-tertiary); }

/* Legacy empty (兼容) */
.empty { text-align: center; padding: 36px var(--space-lg); color: #9aa5b5; }
.empty .icon { font-size: 34px; margin-bottom: 8px; }

/* ================================================================
   16. SKELETON
   ================================================================ */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================================
   17. QR / SCAN
   ================================================================ */
.qr-box { text-align: center; padding: 16px 0; }
.qr-box img {
  width: 190px; height: 190px;
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  background: #fff;
}
.qr-tip { margin-top: 10px; font-size: 13px; font-weight: 650; color: var(--text-secondary); }
.qr-tip .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); margin-right: 5px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Spinner */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2.5px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

/* ================================================================
   18. ORDER CARDS (Mobile)
   ================================================================ */
.orders-desktop { display: block; }
.orders-mobile { display: none; }

@media (max-width: 767px) {
  .orders-desktop { display: none; }
  .orders-mobile { display: block; }
}

.order-card {
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.order-card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}

.order-card-mid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}

.oc-item {}
.oc-label { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; font-weight: 600; }
.oc-value { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }

.order-card-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}

.order-card-detail {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
}

.order-card-toggle {
  width: 100%; margin-top: 10px;
}

/* ================================================================
   19. ADMIN SIDEBAR
   ================================================================ */
.admin-layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: var(--space-lg) 0;
  overflow-y: auto;
  transition: transform 0.3s var(--ease-out);
}

.admin-sidebar a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover { background: rgba(79,108,247,.04); text-decoration: none; }
.admin-sidebar a.active {
  background: rgba(79,108,247,.06); color: var(--primary);
  border-left-color: var(--primary);
}

.admin-main { flex: 1; min-width: 0; padding: var(--space-lg); }

.admin-menu-btn {
  display: none;
  background: none; border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px; cursor: pointer;
  font-size: 20px; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.admin-sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,.3);
}

@media (max-width: 767px) {
  .admin-sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    z-index: 95; transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--line);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-sidebar-backdrop.open { display: block; }
  .admin-menu-btn { display: inline-flex; }
  .admin-main { padding: var(--space-md); }
}

/* ================================================================
   20. SETTINGS FORM
   ================================================================ */
.settings-row {
  display: grid; grid-template-columns: 150px 1fr;
  gap: var(--space-sm); align-items: center;
  margin-bottom: 8px;
}
.settings-row label {
  font-size: 12px; color: var(--text-secondary);
  text-align: right; font-weight: 600;
}

@media (max-width: 767px) {
  .settings-row { grid-template-columns: 1fr; }
  .settings-row label { text-align: left; }
}

/* ================================================================
   21. LOG VIEWER
   ================================================================ */
.log-level-info { color: var(--text-secondary); font-weight: 600; }
.log-level-warn { color: var(--warning); font-weight: 700; }
.log-level-error { color: var(--danger); font-weight: 700; }
.log-level-webhook { color: var(--primary); font-weight: 600; }

.log-ctx {
  max-width: 250px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; color: var(--text-tertiary);
}

/* ================================================================
   22. GLOBAL PULSE + ANIMATIONS
   ================================================================ */
.refresh-pulse {
  animation: refreshPulse 0.6s var(--ease-out);
}
@keyframes refreshPulse {
  0% { opacity: 0.4; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

/* ================================================================
   23. RESPONSIVE BREAKPOINTS
   ================================================================ */
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; }
  .form-row.cols-2 > * { min-width: 100%; }
  input, select { min-width: 100%; }
  .info-grid { grid-template-columns: 1fr; }
  .card-header { flex-direction: column; align-items: flex-start; }
  .card-body { padding: 14px var(--space-lg); }
  .card-header { padding: 12px var(--space-lg); }
  .qr-box img { width: 160px; height: 160px; }
  .toast, .toast-float { font-size: 12px; padding: 8px 16px; }
  .order-summary-grid { grid-template-columns: 1fr 1fr; }
  .input-date { max-width: 100%; }
  .input-time { max-width: 100%; }
  .segmented { width: 100%; }
  .seg-item { flex: 1; text-align: center; }
}

@media (min-width: 481px) and (max-width: 767px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .container { padding: 24px var(--space-xl) 0; }
  .card-body { padding: 20px var(--space-xl); }
  .card-header { padding: 16px var(--space-xl); }
}

@media (min-width: 1440px) {
  .container { max-width: var(--max-w-wide); }
}

/* ================================================================
   24. PLATFORM-SPECIFIC TWEAKS
   ================================================================ */

/* iOS */
.os-ios .btn { font-weight: 700; letter-spacing: -0.01em; }
.os-ios .card { backdrop-filter: blur(28px); }
.os-ios .bottom-nav { padding-bottom: env(safe-area-inset-bottom, 6px); }
.os-ios .topbar { padding-top: env(safe-area-inset-top, 0); }
.os-ios input[type="date"],
.os-ios input[type="time"],
.os-ios input[type="datetime-local"] { -webkit-appearance: none; min-height: 42px; }
.os-ios input, .os-ios select, .os-ios textarea {
  -webkit-appearance: none;
  border-radius: var(--radius-sm);
}

/* Android */
.os-android .bottom-nav button { font-size: 11px; }
.os-android .bottom-nav button .tab-icon { font-size: 20px; }
.os-android .btn { text-transform: uppercase; letter-spacing: 0.03em; font-size: 12px; }
.os-android .card { backdrop-filter: blur(12px); }

/* Windows */
.os-windows .btn { border-radius: 6px; }
.os-windows .stat { border: 1px solid rgba(0,0,0,.08); }
.os-windows .card { border: 1px solid rgba(0,0,0,.08); }

/* macOS */
.os-mac .card::before {
  background: linear-gradient(90deg, transparent, rgba(79,108,247,.20), rgba(124,92,231,.12), transparent);
}
.os-mac body { -webkit-font-smoothing: antialiased; }

/* ================================================================
   25. ACCESSIBILITY
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip link */
.skip-link {
  position: absolute; top: -100px; left: 10px; z-index: 9999;
  background: var(--primary); color: #fff; padding: 8px 16px;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 13px;
}
.skip-link:focus { top: 10px; }

/* ================================================================
   26. SAFE AREA FALLBACKS
   ================================================================ */
@supports not (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: 0; }
}

/* ================================================================
   27. UTILITY
   ================================================================ */
.link { color: var(--primary); cursor: pointer; font-weight: 700; }
.link:hover { text-decoration: underline; }
.text-mono { font-family: var(--font-mono); }
.flex { display: flex; gap: 6px; margin-bottom: var(--space-sm); flex-wrap: wrap; align-items: center; }
.msg { background: #ecfdf5; color: var(--success); padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; font-size: 12px; font-weight: 600; }

.disabled-soft { opacity: 0.5; pointer-events: none; filter: grayscale(0.3); }
.text-sm { font-size: var(--font-size-sm); }
.text-secondary { color: var(--text-secondary); }

/* ================================================================
   28. FLOW STEPPER — 引导式三步进度条
   ================================================================ */
.flow-stepper {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  margin: 4px 0 18px;
  padding: 16px 14px 14px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  overflow: hidden;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .flow-stepper { background: var(--card-solid); }
}
.flow-stepper::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,108,247,.30), rgba(124,92,231,.20), transparent);
}

.flow-step {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
}
.flow-step.clickable { cursor: pointer; }

/* 连接线：绘制在节点之间 */
.flow-step::after {
  content: "";
  position: absolute;
  top: 17px;           /* 对齐节点圆心 */
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  z-index: -1;
  transition: background 0.5s var(--ease-out);
}
.flow-step:last-child::after { display: none; }
.flow-step.done::after,
.flow-step.line-done::after {
  background: linear-gradient(90deg, var(--success), var(--success));
}

/* 节点圆 */
.flow-node {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 800;
  background: var(--surface-solid);
  border: 2px solid var(--border);
  color: var(--text-tertiary);
  transition: all 0.35s var(--ease-spring);
  position: relative;
}
.flow-step.current .flow-node {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 5px var(--primary-glow);
  animation: nodePulse 2s var(--ease-out) infinite;
}
.flow-step.done .flow-node {
  background: var(--success);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px var(--success-glow);
}
.flow-step.locked .flow-node {
  background: var(--surface-solid);
  border-style: dashed;
  opacity: 0.7;
}

@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--primary-glow); }
  50% { box-shadow: 0 0 0 9px rgba(79,108,247,.05); }
}

.flow-label {
  font-size: 12px; font-weight: 750;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
  transition: color 0.3s var(--ease-out);
  line-height: 1.2;
}
.flow-sub {
  font-size: 10px; font-weight: 500;
  color: var(--text-tertiary);
  opacity: 0.75;
  line-height: 1.2;
}
.flow-step.current .flow-label { color: var(--primary); }
.flow-step.done .flow-label { color: var(--success); }

@media (max-width: 480px) {
  .flow-stepper { padding: 14px 8px 12px; }
  .flow-sub { display: none; }
  .flow-label { font-size: 11px; }
  .flow-node { width: 30px; height: 30px; font-size: 13px; }
  .flow-step::after { top: 15px; }
}

/* ================================================================
   29. HERO — 引导式首页头图
   ================================================================ */
.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-lg);
  padding: 24px 22px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(ellipse 90% 120% at 100% 0%, rgba(255,255,255,.18), transparent 55%),
    radial-gradient(ellipse 70% 90% at 0% 100%, rgba(124,92,231,.55), transparent 60%),
    var(--gradient-primary);
  box-shadow: 0 18px 50px rgba(79,108,247,.28);
}
.hero::after {
  content: "";
  position: absolute; right: -30px; bottom: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%);
  pointer-events: none;
}
.hero-greeting { font-size: 13px; font-weight: 600; opacity: 0.9; }
.hero-title {
  font-size: 22px; font-weight: 900; letter-spacing: -0.03em;
  margin-top: 4px; color: #fff;
}
.hero-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.hero-uid {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: 12px; font-weight: 700;
  font-family: var(--font-mono);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

/* ── 核心数据：次数超突出 ── */
.hero-balance {
  position: relative;
  margin-top: 18px;
  padding: 4px 0 2px;
}
.hero-balance .hb-main {
  display: flex; align-items: baseline; gap: 4px;
  line-height: 1;
}
.hero-balance .hb-num {
  font-size: 58px; font-weight: 950;
  letter-spacing: -0.05em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 24px rgba(0,0,0,.18);
  font-family: var(--font-mono);
}
.hero-balance .hb-unit {
  font-size: 20px; font-weight: 800; opacity: 0.92;
}
.hero-balance .hb-refresh {
  margin-left: 8px; align-self: center;
  width: 30px; height: 30px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff; font-size: 16px; cursor: pointer;
  display: grid; place-items: center;
  transition: transform 0.4s var(--ease-spring), background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.hero-balance .hb-refresh:hover { background: rgba(255,255,255,.3); }
.hero-balance .hb-refresh:active { transform: rotate(180deg) scale(0.9); }
.hero-balance .hb-refresh.loading { animation: spin 0.7s linear infinite; }
.hero-balance .hb-label {
  font-size: 12px; font-weight: 600; opacity: 0.85;
  margin-top: 4px;
}
/* 余额偏低脉冲警示 */
.hero-balance.is-low .hb-num {
  color: #ffe08a;
  animation: lowBalancePulse 1.6s var(--ease-out) infinite;
}
.hero-balance.is-low .hb-label { color: #ffe08a; opacity: 1; }
@keyframes lowBalancePulse {
  0%, 100% { opacity: 1; text-shadow: 0 4px 24px rgba(0,0,0,.18); }
  50% { opacity: 0.78; text-shadow: 0 0 18px rgba(255,224,138,.6); }
}
.hero-next {
  margin-top: 16px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
}
.hero-next-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.22);
  font-size: 18px;
}
.hero-next-text { flex: 1; min-width: 0; }
.hero-next-label { font-size: 11px; opacity: 0.85; font-weight: 600; }
.hero-next-title { font-size: 15px; font-weight: 800; margin-top: 1px; }
.hero-next-btn {
  flex-shrink: 0;
  height: 36px; padding: 0 16px;
  border: none; border-radius: 999px;
  background: #fff; color: var(--primary);
  font-size: 13px; font-weight: 800; cursor: pointer;
  font-family: var(--font);
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.hero-next-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.hero-next-btn:active { transform: scale(0.96); }
.hero-next.done { background: rgba(255,255,255,.2); }

/* 快捷入口卡（首页） */
.quick-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.quick-card {
  position: relative; overflow: hidden;
  padding: 16px 16px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-card:active { transform: scale(0.98); }
.quick-card .qc-icon { font-size: 20px; }
.quick-card .qc-num {
  font-size: 26px; font-weight: 950; letter-spacing: -0.04em;
  color: var(--text); margin-top: 6px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.quick-card .qc-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; margin-top: 4px; }
.quick-card.qc-primary .qc-num { color: var(--primary); }
.quick-card.qc-success .qc-num { color: var(--success); }

/* ================================================================
   30. SCAN ENHANCE — 扫码区视觉增强
   ================================================================ */
.qr-frame {
  position: relative;
  display: inline-block;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}
/* 四角取景框 */
.qr-frame::before,
.qr-frame::after {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  border: 3px solid var(--primary);
  z-index: 2;
  pointer-events: none;
}
.qr-frame::before { top: 6px; left: 6px; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.qr-frame::after { bottom: 6px; right: 6px; border-left: none; border-top: none; border-bottom-right-radius: 6px; }

/* 扫描线 */
.qr-scanline {
  position: absolute; left: 8px; right: 8px; top: 8px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow: 0 0 8px var(--primary);
  z-index: 3;
  animation: scanMove 2.4s var(--ease-out) infinite;
}
@keyframes scanMove {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(172px); opacity: 0; }
}
@media (max-width: 480px) {
  @keyframes scanMove {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 1; } 90% { opacity: 1; }
    100% { transform: translateY(142px); opacity: 0; }
  }
}

/* 平台选择大按钮（扫码引导） */
.scan-choice {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.scan-choice-btn {
  flex: 1 1 0; max-width: 160px; min-width: 120px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface-solid);
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.scan-choice-btn:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow-sm); }
.scan-choice-btn:active { transform: scale(0.97); }
.scan-choice-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  color: #fff; font-size: 22px; font-weight: 800;
}
.scan-choice-label { font-size: 13px; font-weight: 750; color: var(--text); }
.scan-choice-sub { font-size: 10px; color: var(--text-tertiary); }

/* 步骤切换横向滑入（核心流程页） */
.flow-slide-in { animation: flowSlideIn 0.4s var(--ease-out); }
@keyframes flowSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 节点点亮反馈 */
.flow-step.just-completed .flow-node { animation: nodeComplete 0.6s var(--ease-spring); }
@keyframes nodeComplete {
  0% { transform: scale(1); }
  45% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ================================================================
   31. ENTRY ANIMATIONS — 错峰入场
   ================================================================ */
/* quick-card / stat 错峰浮入 */
.quick-cards .quick-card,
.tab-panel.active .stat {
  animation: cardRise 0.5s var(--ease-out) both;
}
.quick-cards .quick-card { animation-delay: calc(var(--stagger, 0) * 0.08s + 0.05s); }
.tab-panel.active .stat:nth-child(1) { animation-delay: 0.04s; }
.tab-panel.active .stat:nth-child(2) { animation-delay: 0.10s; }
.tab-panel.active .stat:nth-child(3) { animation-delay: 0.16s; }
.tab-panel.active .stat:nth-child(4) { animation-delay: 0.22s; }
@keyframes cardRise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 数字 count-up 时的轻微弹起 */
.js-balance.counting, .js-count.counting { animation: numTick 0.5s var(--ease-out); }
@keyframes numTick {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ================================================================
   32. WAITING / LOADING — 等待动画
   ================================================================ */
/* 三点加载 */
.loading-dots { display: inline-flex; align-items: center; gap: 4px; }
.loading-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  animation: dotBounce 1.1s var(--ease-out) infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* 骨架屏行（订单/列表占位） */
.skeleton-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px var(--space-lg);
  border-bottom: 1px solid var(--line);
}
.skeleton-bar {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(148,163,184,.12) 25%, rgba(148,163,184,.22) 50%, rgba(148,163,184,.12) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-bar.w-20 { width: 20%; }
.skeleton-bar.w-30 { width: 30%; }
.skeleton-bar.w-40 { width: 40%; }
.skeleton-bar.w-60 { width: 60%; }

/* 列表刷新时的微光遮罩 */
.is-refreshing { position: relative; }
.is-refreshing::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  pointer-events: none;
  border-radius: inherit;
}

/* 进度条流动微光 */
.progress-bar-fill { position: relative; overflow: hidden; }
.progress-bar-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  background-size: 200% 100%;
  animation: progressGlow 1.8s linear infinite;
}
@keyframes progressGlow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 按钮成功态勾选反馈 */
.btn.btn-success-flash {
  background: var(--gradient-success) !important;
  animation: successFlash 0.5s var(--ease-spring);
}
@keyframes successFlash {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ================================================================
   33. PER-OS DEEP TUNING — 四端动画与交互个性化
   ================================================================ */

/* ── iOS：弹性、轻盈、毛玻璃强 ── */
.os-ios .tab-panel { animation: iosPanelIn 0.42s var(--ease-spring); }
@keyframes iosPanelIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.os-ios .hero { border-radius: 26px; }
.os-ios .hero-balance .hb-num { font-size: 60px; }
.os-ios .quick-card:active { transform: scale(0.95); }
.os-ios .btn:active { transform: scale(0.94); }
.os-ios .flow-step.current .flow-node { animation: nodePulse 2.4s var(--ease-out) infinite; }
.os-ios .bottom-nav button.active .tab-icon { transform: scale(1.18); }
/* iOS 橡皮筋滚动 */
.os-ios .container { -webkit-overflow-scrolling: touch; }

/* ── Android：Material 涟漪 + 快速减速 ── */
.os-android .tab-panel { animation: androidPanelIn 0.3s cubic-bezier(0,0,0.2,1); }
@keyframes androidPanelIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.os-android .quick-card,
.os-android .btn,
.os-android .scan-choice-btn {
  position: relative; overflow: hidden;
}
/* 涟漪效果（点击时由 JS 注入 .ripple span） */
.os-android .ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.5);
  transform: scale(0); opacity: 0.6;
  animation: ripple 0.6s var(--ease-out);
  pointer-events: none;
}
.os-android .quick-card .ripple,
.os-android .scan-choice-btn .ripple { background: rgba(79,108,247,.18); }
@keyframes ripple {
  to { transform: scale(2.6); opacity: 0; }
}
.os-android .btn:active { transform: none; }
.os-android .hero-balance .hb-num { font-size: 54px; letter-spacing: -0.03em; }
.os-android .flow-step.current .flow-node { animation: none; box-shadow: 0 0 0 4px var(--primary-glow); }
.os-android .bottom-nav button.active .tab-icon { transform: scale(1.1); }

/* ── Windows：Fluent，锐利、克制、快 ── */
.os-windows .tab-panel { animation: winPanelIn 0.22s cubic-bezier(0.4,0,1,1); }
@keyframes winPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.os-windows .hero { border-radius: 14px; }
.os-windows .hero-balance .hb-num { font-size: 52px; letter-spacing: -0.02em; }
.os-windows .quick-card { transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s; }
.os-windows .quick-card:hover { transform: translateY(-2px); background: rgba(79,108,247,.04); }
.os-windows .quick-card:active { transform: translateY(0); }
.os-windows .btn:hover { transform: translateY(-1px); }
.os-windows .btn:active { transform: translateY(0) scale(0.99); }
.os-windows .flow-node { border-radius: 8px; }            /* 方角更 Fluent */
.os-windows .flow-step.current .flow-node { animation: none; box-shadow: 0 0 0 3px var(--primary-glow); }
.os-windows .flow-step::after { top: 14px; }              /* 配合方角节点 */
/* Fluent 鼠标悬浮揭示边 */
.os-windows .quick-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  border: 1px solid transparent; transition: border-color 0.15s;
  pointer-events: none;
}
.os-windows .quick-card:hover::before { border-color: rgba(79,108,247,.35); }

/* ── macOS：顺滑、精致、克制弹性 ── */
.os-mac .tab-panel { animation: macPanelIn 0.4s cubic-bezier(0.16,1,0.3,1); }
@keyframes macPanelIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.os-mac .hero { border-radius: 22px; }
.os-mac .hero-balance .hb-num { font-size: 56px; }
.os-mac .quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.os-mac .quick-card:active { transform: scale(0.985); }
.os-mac .btn:hover { transform: translateY(-1.5px); }
.os-mac .flow-step.current .flow-node { animation: nodePulse 2.6s var(--ease-out) infinite; }

/* 减弱动画偏好：四端统一尊重 */
@media (prefers-reduced-motion: reduce) {
  .hero-balance.is-low .hb-num,
  .flow-step.current .flow-node,
  .progress-bar-fill::after,
  .qr-scanline,
  .loading-dots span { animation: none !important; }
}

/* ================================================================
   34. SCHEDULE CARD — 排期卡片化
   ================================================================ */

/* ── 模式选择卡片 ── */
.sched-mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.sched-mode-card {
  position: relative;
  overflow: hidden;
  padding: 16px 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--surface-solid);
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}
.sched-mode-card:hover {
  border-color: rgba(79,108,247,.35);
  box-shadow: var(--shadow-sm);
}
.sched-mode-card:active { transform: scale(0.985); }

.sched-mode-card.sched-active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(79,108,247,.06), rgba(124,92,231,.04));
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.sched-mode-card.sched-active::after {
  content: "✓";
  position: absolute; top: 10px; right: 12px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff; font-size: 12px; font-weight: 900;
  display: grid; place-items: center;
  animation: nodeComplete 0.4s var(--ease-spring);
}

.sched-card-icon { font-size: 20px; margin-bottom: 6px; }
.sched-card-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.sched-card-sub { font-size: 11px; color: var(--text-tertiary); line-height: 1.4; }
.sched-active .sched-card-title { color: var(--primary); }
.sched-active .sched-card-sub { color: var(--primary); opacity: 0.75; }

@media (max-width: 480px) {
  .sched-mode-cards { grid-template-columns: 1fr; }
}

/* ── 固定模式表单卡片 ── */
.sched-form-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: #f8fafd;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.sched-form-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.sched-form-row:last-child { margin-bottom: 0; }
.sched-form-row .sched-label {
  font-size: 13px; font-weight: 650; color: var(--text);
  white-space: nowrap;
}

/* 次数步进器 */
.sched-stepper {
  display: inline-flex; align-items: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-solid);
  overflow: hidden;
}
.sched-stepper button {
  width: 32px; height: 36px;
  border: none; background: none;
  font-size: 16px; font-weight: 700; cursor: pointer;
  color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}
.sched-stepper button:hover { background: #f1f5f9; color: var(--text); }
.sched-stepper button:active { background: var(--primary-glow); color: var(--primary); }
.sched-stepper button:disabled { opacity: 0.3; pointer-events: none; }
.sched-stepper input {
  width: 44px; height: 36px;
  border: none; border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  border-radius: 0;
  text-align: center; font-size: 15px; font-weight: 800;
  background: var(--surface-solid); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.sched-stepper input:focus { box-shadow: none; }

/* ── 时段滑块 ── */
.sched-time-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
}
.sched-time-bar input[type=time] {
  width: 108px; height: 38px; flex-shrink: 0;
  font-size: 14px; font-weight: 700;
  text-align: center; font-family: var(--font-mono);
}

/* ── 预览时间线 ── */
.sched-preview {
  margin-top: 12px; padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  border: 1px solid var(--line);
}
.sched-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 700; color: var(--text-tertiary);
  margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.sched-preview-list {
  display: flex; flex-direction: column; gap: 5px;
  max-height: 160px; overflow-y: auto;
}
.sched-preview-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  padding: 4px 0;
}
.sched-preview-num {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
}
.sched-preview-date { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.sched-preview-time { color: var(--text-tertiary); margin-left: auto; font-family: var(--font-mono); font-size: 11px; }

/* ── 多时段模式：每条为一张小卡 ── */
.slot-cards { display: flex; flex-direction: column; gap: 10px; }
.slot-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: cardRise 0.35s var(--ease-out) both;
}
.slot-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.slot-card-num {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; color: var(--text);
}
.slot-card-num .sn-badge {
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--gradient-primary);
  color: #fff; font-size: 10px; font-weight: 900;
  display: grid; place-items: center;
}
.slot-card-mode select {
  height: 30px; font-size: 11px; font-weight: 700;
  padding: 0 8px; border-radius: 6px; min-width: auto;
}
.slot-card-close {
  width: 28px; height: 28px; border-radius: 8px;
  border: none; background: rgba(228,84,84,.08);
  color: var(--danger); font-size: 13px; cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.slot-card-close:hover { background: rgba(228,84,84,.18); }

.slot-card-body { display: flex; flex-direction: column; gap: 8px; }
.slot-card-body .sched-form-row { margin-bottom: 0; }

/* 周期展开预览 */
.slot-period-preview {
  margin-top: 6px; padding: 6px 10px;
  border-radius: 6px;
  background: rgba(233,154,36,.06);
  border: 1px solid rgba(233,154,36,.12);
  font-size: 11px; color: var(--text-secondary);
}
.slot-period-preview b { color: #92400e; }

/* ── 添加按钮 ── */
.slot-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
  background: none; color: var(--text-tertiary);
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  margin-top: 8px;
}
.slot-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79,108,247,.03);
}

/* ================================================================
   35. ONBOARDING — 强制引导式悬浮窗
   ================================================================ */

/* ── 遮罩层 ── */
.onboard-overlay {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: onboardOverlayIn 0.3s ease;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
@keyframes onboardOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.onboard-overlay.closing {
  animation: onboardOverlayOut 0.28s ease forwards;
}
@keyframes onboardOverlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ── 悬浮窗口 ── */
.onboard-window {
  position: relative;
  z-index: 9991;
  border-radius: var(--radius-xl);
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 32px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.08) inset;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: onboardWindowIn 0.42s var(--ease-spring);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out);
  min-width: 320px; max-width: 90vw; max-height: 90vh;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .onboard-window { background: var(--card-solid); }
}
.onboard-window.closing {
  animation: onboardWindowOut 0.25s var(--ease-out) forwards;
}
@keyframes onboardWindowIn {
  from { opacity: 0; transform: scale(0.88) translateY(24px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes onboardWindowOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(0.92) translateY(16px); }
}
.onboard-window::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 1px; z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(79,108,247,.30), rgba(124,92,231,.20), transparent);
}

/* ── 标题栏（拖拽手柄） ── */
.onboard-titlebar {
  position: relative; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px 10px 16px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  border-bottom: 1px solid var(--line);
  background: rgba(248,250,252,0.6);
}
.onboard-titlebar:active { cursor: grabbing; }
.onboard-titlebar .onboard-ts-icon {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--gradient-primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.onboard-titlebar .onboard-ts-icon svg { width: 14px; height: 14px; }
.onboard-titlebar .onboard-ts-title {
  flex: 1; font-size: 13px; font-weight: 800; color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.onboard-titlebar .onboard-ts-btns {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.onboard-ts-btn {
  width: 28px; height: 28px; border-radius: 7px;
  border: none; background: none;
  font-size: 13px; cursor: pointer;
  color: var(--text-tertiary);
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.onboard-ts-btn:hover { background: rgba(0,0,0,0.05); color: var(--text); }
.onboard-ts-btn.onboard-ts-close:hover { background: rgba(228,84,84,0.12); color: var(--danger); }

/* ── 进度圆点 ── */
.onboard-dots {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 16px 6px;
}
.onboard-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
  transition: all 0.35s var(--ease-spring);
  position: relative;
}
.onboard-dot.done { background: var(--success); box-shadow: 0 0 0 3px var(--success-glow); }
.onboard-dot.current { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); animation: dotCurrentPulse 2s ease infinite; }
.onboard-dot.locked { background: var(--border); opacity: 0.5; }
@keyframes dotCurrentPulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--primary-glow); }
  50% { box-shadow: 0 0 0 9px rgba(79,108,247,0.05); }
}
.onboard-dot-line {
  width: 28px; height: 2px; border-radius: 1px;
  background: var(--border);
  transition: background 0.4s var(--ease-out);
}
.onboard-dot-line.done { background: var(--success); }

/* ── 内容区 ── */
.onboard-body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 10px 20px 16px;
  -webkit-overflow-scrolling: touch;
}
.onboard-body::-webkit-scrollbar { width: 4px; }
.onboard-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 2px; }

/* 步骤内容淡入淡出 */
.onboard-step {
  display: none;
  animation: onboardStepIn 0.35s var(--ease-out);
}
.onboard-step.active {
  display: block;
}
@keyframes onboardStepIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.onboard-step-icon { font-size: 44px; text-align: center; margin-bottom: 8px; line-height: 1; }
.onboard-step-title {
  font-size: 18px; font-weight: 900; color: var(--text);
  text-align: center; letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.onboard-step-sub {
  font-size: 12px; color: var(--text-tertiary);
  text-align: center; margin-bottom: 14px;
}

/* ── 示意图容器 ── */
.onboard-image-wrap {
  position: relative; overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #f8fafc;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.onboard-image-wrap img {
  display: block; width: 100%; height: auto;
  max-height: 320px; object-fit: contain;
  background: #fff;
}
.onboard-image-wrap .onboard-img-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 12px;
  gap: 8px;
  min-height: 160px;
}
.onboard-image-wrap .onboard-img-placeholder .placeholder-icon { font-size: 36px; opacity: 0.5; }

/* ── 操作指引列表 ── */
.onboard-guide {
  margin-bottom: 12px;
}
.onboard-guide-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 5px 0;
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.5;
}
.onboard-guide-num {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
  margin-top: 1px;
}

/* ── 底部操作栏 ── */
.onboard-actions {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}
.onboard-actions .btn { flex: 1; }
.onboard-btn-skip {
  height: 42px; padding: 0 16px;
  border: none; border-radius: var(--radius-sm);
  background: none; color: var(--text-tertiary);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.onboard-btn-skip:hover { color: var(--text-secondary); }
.onboard-btn-skip:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── 强制步骤的锁定样式 ── */
.onboard-actions .btn:disabled {
  opacity: 0.5; filter: grayscale(0.3); cursor: not-allowed;
}

/* ── 右下角缩放手柄 ── */
.onboard-resize-handle {
  position: absolute; right: 0; bottom: 0; z-index: 5;
  width: 24px; height: 24px;
  cursor: nwse-resize;
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 0 4px 4px 0;
}
.onboard-resize-handle::after {
  content: "";
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-bottom: 8px solid var(--text-tertiary);
  opacity: 0.45;
  transition: opacity 0.15s;
}
.onboard-resize-handle:hover::after { opacity: 0.8; }
/* 移动端放大触控区域 */
@media (hover: none) and (pointer: coarse) {
  .onboard-resize-handle { width: 44px; height: 44px; padding: 0 8px 8px 0; }
  .onboard-resize-handle::after { border-left-width: 12px; border-bottom-width: 12px; }
}

/* ── 窗口尺寸预设 ── */
.onboard-window.size-sm { width: 360px; }
.onboard-window.size-md { width: 520px; }
.onboard-window.size-lg { width: 740px; }
.onboard-window.size-custom { /* width set by inline style */ }

/* ── 拖拽时禁止选中文本 ── */
.onboard-dragging,
.onboard-dragging * { user-select: none !important; -webkit-user-select: none !important; }

/* ── 响应式 ── */
@media (max-width: 480px) {
  .onboard-overlay { padding: 12px; align-items: flex-end; }
  .onboard-window {
    min-width: 100%; max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: onboardWindowMobileIn 0.38s var(--ease-spring);
  }
  @keyframes onboardWindowMobileIn {
    from { opacity: 0; transform: translateY(60px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .onboard-window.size-sm,
  .onboard-window.size-md,
  .onboard-window.size-lg { width: 100%; }
  .onboard-body { padding: 8px 16px 12px; }
  .onboard-actions { padding: 10px 16px 14px; flex-direction: column; }
  .onboard-actions .btn { width: 100%; }
  .onboard-btn-skip { width: 100%; text-align: center; }
  .onboard-resize-handle { display: none; }
  .onboard-titlebar { cursor: default; }
  .onboard-image-wrap img { max-height: 200px; }
  .onboard-step-icon { font-size: 36px; }
  .onboard-step-title { font-size: 16px; }
}

/* ── 聚光灯（高亮目标区域） ── */
.onboard-spotlight {
  position: fixed; z-index: 9991;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  transition: all 0.45s var(--ease-out);
}
.onboard-spotlight-pulse {
  animation: spotlightPulse 2s ease infinite;
}
@keyframes spotlightPulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55); }
  50% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48), 0 0 30px rgba(79,108,247,0.15); }
}
@media (max-width: 480px) {
  .onboard-spotlight { display: none; }
}

/* ── 完成庆祝微动效 ── */
.onboard-complete-icon {
  width: 72px; height: 72px; margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--gradient-success);
  display: grid; place-items: center;
  font-size: 36px; color: #fff;
  animation: onboardCompletePop 0.55s var(--ease-spring);
}
@keyframes onboardCompletePop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
