/* ============================================================
 * Apple UI Design System for VR Control
 * 设计参照 Apple HIG / apple.com 视觉语言。
 * 单一真实来源：tokens + 组件 + 动效 + 主题切换。
 * 注意：请保持本文件两份（public/ 与 CloudServer/public/）一致。
 * ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
               'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.47;
  letter-spacing: -0.022em;
  min-height: 100vh;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: none; opacity: 0.85; }

/* ==============================================================
 * 1. DESIGN TOKENS — LIGHT
 * ============================================================== */
:root {
  /* -- Apple System Colors (Light) -- */
  --sys-blue:        #0071e3;
  --sys-blue-hover:  #0077ed;
  --sys-blue-active: #006edb;
  --sys-indigo:      #5856d6;
  --sys-purple:      #af52de;
  --sys-pink:        #ff2d55;
  --sys-red:         #ff3b30;
  --sys-orange:      #ff9500;
  --sys-yellow:      #ffcc00;
  --sys-green:       #34c759;
  --sys-mint:        #00c7be;
  --sys-teal:        #30b0c7;
  --sys-cyan:        #32ade6;
  --sys-gray:        #8e8e93;

  /* -- Canvas / Layer stack -- */
  --bg-canvas:       #f5f5f7;  /* 页面底层 */
  --bg-elevated:     #ffffff;  /* 卡片 */
  --bg-elevated-2:   #fbfbfd;  /* 卡片内嵌凹槽 */
  --bg-overlay:      rgba(0,0,0,0.55);   /* 模态遮罩 */
  --bg-sheet:        rgba(255,255,255,0.88);
  --bg-glass:        rgba(255,255,255,0.72);
  --bg-nav:          rgba(22,22,23,0.82);
  --bg-inset:        #f5f5f7;
  --bg-hover:        rgba(0,0,0,0.045);
  --bg-selected:     rgba(0,113,227,0.09);

  /* -- Text -- */
  --text-primary:    #1d1d1f;
  --text-secondary:  rgba(29,29,31,0.72);
  --text-tertiary:   rgba(29,29,31,0.52);
  --text-quaternary: rgba(29,29,31,0.30);
  --text-on-color:   #ffffff;
  --text-link:       #0071e3;
  --text-success:    #248a3d;
  --text-warning:    #b25e00;
  --text-danger:     #c41e3a;

  /* -- Border / separator -- */
  --sep:             rgba(0,0,0,0.08);
  --sep-strong:      rgba(0,0,0,0.14);
  --border-hairline: rgba(0,0,0,0.08);
  --focus-ring:      rgba(0,113,227,0.35);

  /* -- Radii -- */
  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-pill: 980px;

  /* -- Spacing (base 4) -- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;
  --sp-10: 80px;

  /* -- Shadows (Apple multi-layer) -- */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-2: 0 2px 6px rgba(0,0,0,0.05), 0 6px 18px rgba(0,0,0,0.06);
  --shadow-3: 0 4px 12px rgba(0,0,0,0.07), 0 16px 40px rgba(0,0,0,0.10);
  --shadow-modal: 0 8px 24px rgba(0,0,0,0.10), 0 32px 80px rgba(0,0,0,0.22);
  --shadow-inset: inset 0 0 0 1px rgba(0,0,0,0.04);

  /* -- Type scale -- */
  --fs-display: clamp(40px, 5.2vw, 64px);
  --fs-title-1: clamp(28px, 3vw, 36px);
  --fs-title-2: clamp(22px, 2.2vw, 26px);
  --fs-title-3: 20px;
  --fs-headline: 17px;
  --fs-body:     15px;
  --fs-callout:  14px;
  --fs-footnote: 13px;
  --fs-caption:  12px;
  --fs-micro:    11px;

  --lh-display:  1.07;
  --lh-title:    1.18;
  --lh-body:     1.47;

  --tracking-display: -0.022em;
  --tracking-tight:   -0.018em;
  --tracking-normal:  -0.01em;
  --tracking-wide:     0.02em;

  /* -- Motion -- */
  --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);        /* 标准缓出 */
  --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);          /* Material/iOS 混合 */
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);     /* 轻微回弹 */
  --ease-emph:    cubic-bezier(0.16, 1, 0.3, 1);         /* 强调缓出（长距离） */
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --dur-4: 450ms;
  --dur-5: 640ms;
  --dur-6: 900ms;

  /* -- Gradients (Apple accent) -- */
  --grad-blue: linear-gradient(135deg, #007aff 0%, #0071e3 45%, #0054b4 100%);
  --grad-green: linear-gradient(135deg, #34d058 0%, #34c759 55%, #1ea341 100%);
  --grad-orange: linear-gradient(135deg, #ffb340 0%, #ff9500 55%, #e36a00 100%);
  --grad-red:   linear-gradient(135deg, #ff6159 0%, #ff3b30 55%, #c41e3a 100%);
  --grad-card-ambient: radial-gradient(120% 80% at 0% 0%, rgba(0,113,227,0.05) 0%, rgba(0,113,227,0) 50%);
}

/* ==============================================================
 * 2. DESIGN TOKENS — DARK
 * ============================================================== */
/* 无 data-time-scheme 时：跟随系统深浅色 */
@media (prefers-color-scheme: dark) {
  :root:not([data-time-scheme]) {
    --sys-blue:        #0a84ff;
    --sys-blue-hover:  #409cff;
    --sys-blue-active: #0a74e0;
    --sys-red:         #ff453a;
    --sys-orange:      #ff9f0a;
    --sys-yellow:      #ffd60a;
    --sys-green:       #30d158;
    --sys-mint:        #63e6e2;
    --sys-teal:        #40c8e0;
    --sys-cyan:        #64d2ff;
    --sys-gray:        #98989d;

    --bg-canvas:       #000000;
    --bg-elevated:     #1c1c1e;
    --bg-elevated-2:   #2c2c2e;
    --bg-overlay:      rgba(0,0,0,0.72);
    --bg-sheet:        rgba(28,28,30,0.92);
    --bg-glass:        rgba(28,28,30,0.72);
    --bg-nav:          rgba(0,0,0,0.78);
    --bg-inset:        #2c2c2e;
    --bg-hover:        rgba(255,255,255,0.07);
    --bg-selected:     rgba(10,132,255,0.22);

    --text-primary:    #f5f5f7;
    --text-secondary:  rgba(245,245,247,0.72);
    --text-tertiary:   rgba(245,245,247,0.52);
    --text-quaternary: rgba(245,245,247,0.30);
    --text-on-color:   #ffffff;
    --text-link:       #0a84ff;
    --text-success:    #30d158;
    --text-warning:    #ffb340;
    --text-danger:     #ff6961;

    --sep:             rgba(255,255,255,0.10);
    --sep-strong:      rgba(255,255,255,0.18);
    --border-hairline: rgba(255,255,255,0.10);
    --focus-ring:      rgba(10,132,255,0.45);

    --shadow-1: 0 1px 2px rgba(0,0,0,0.40), 0 1px 3px rgba(0,0,0,0.50);
    --shadow-2: 0 4px 14px rgba(0,0,0,0.55), 0 10px 28px rgba(0,0,0,0.45);
    --shadow-3: 0 6px 22px rgba(0,0,0,0.60), 0 20px 56px rgba(0,0,0,0.55);
    --shadow-modal: 0 12px 32px rgba(0,0,0,0.65), 0 48px 120px rgba(0,0,0,0.75);
    --shadow-inset: inset 0 0 0 1px rgba(255,255,255,0.06);

    --grad-blue:  linear-gradient(135deg, #409cff 0%, #0a84ff 45%, #0060d8 100%);
    --grad-green: linear-gradient(135deg, #34d058 0%, #30d158 55%, #1ea74a 100%);
    --grad-orange: linear-gradient(135deg, #ffb340 0%, #ff9f0a 55%, #e37700 100%);
    --grad-red:   linear-gradient(135deg, #ff6961 0%, #ff453a 55%, #d63d36 100%);
    --grad-card-ambient: radial-gradient(120% 80% at 0% 0%, rgba(10,132,255,0.08) 0%, rgba(10,132,255,0) 50%);
  }
}

/* 夜间时段（由 index.html 等设置 html[data-time-scheme=night]），覆盖系统浅色 */
html[data-time-scheme="night"] {
  --sys-blue:        #0a84ff;
  --sys-blue-hover:  #409cff;
  --sys-blue-active: #0a74e0;
  --sys-red:         #ff453a;
  --sys-orange:      #ff9f0a;
  --sys-yellow:      #ffd60a;
  --sys-green:       #30d158;
  --sys-mint:        #63e6e2;
  --sys-teal:        #40c8e0;
  --sys-cyan:        #64d2ff;
  --sys-gray:        #98989d;

  --bg-canvas:       #000000;
  --bg-elevated:     #1c1c1e;
  --bg-elevated-2:   #2c2c2e;
  --bg-overlay:      rgba(0,0,0,0.72);
  --bg-sheet:        rgba(28,28,30,0.92);
  --bg-glass:        rgba(28,28,30,0.72);
  --bg-nav:          rgba(0,0,0,0.78);
  --bg-inset:        #2c2c2e;
  --bg-hover:        rgba(255,255,255,0.07);
  --bg-selected:     rgba(10,132,255,0.22);

  --text-primary:    #f5f5f7;
  --text-secondary:  rgba(245,245,247,0.72);
  --text-tertiary:   rgba(245,245,247,0.52);
  --text-quaternary: rgba(245,245,247,0.30);
  --text-on-color:   #ffffff;
  --text-link:       #0a84ff;
  --text-success:    #30d158;
  --text-warning:    #ffb340;
  --text-danger:     #ff6961;

  --sep:             rgba(255,255,255,0.10);
  --sep-strong:      rgba(255,255,255,0.18);
  --border-hairline: rgba(255,255,255,0.10);
  --focus-ring:      rgba(10,132,255,0.45);

  --shadow-1: 0 1px 2px rgba(0,0,0,0.40), 0 1px 3px rgba(0,0,0,0.50);
  --shadow-2: 0 4px 14px rgba(0,0,0,0.55), 0 10px 28px rgba(0,0,0,0.45);
  --shadow-3: 0 6px 22px rgba(0,0,0,0.60), 0 20px 56px rgba(0,0,0,0.55);
  --shadow-modal: 0 12px 32px rgba(0,0,0,0.65), 0 48px 120px rgba(0,0,0,0.75);
  --shadow-inset: inset 0 0 0 1px rgba(255,255,255,0.06);

  --grad-blue:  linear-gradient(135deg, #409cff 0%, #0a84ff 45%, #0060d8 100%);
  --grad-green: linear-gradient(135deg, #34d058 0%, #30d158 55%, #1ea74a 100%);
  --grad-orange: linear-gradient(135deg, #ffb340 0%, #ff9f0a 55%, #e37700 100%);
  --grad-red:   linear-gradient(135deg, #ff6961 0%, #ff453a 55%, #d63d36 100%);
  --grad-card-ambient: radial-gradient(120% 80% at 0% 0%, rgba(10,132,255,0.08) 0%, rgba(10,132,255,0) 50%);
}

/* ==============================================================
 * 3. BASE TYPOGRAPHY
 * ============================================================== */
.au-display {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
  font-weight: 700;
  color: var(--text-primary);
}
.au-title-1 {
  font-size: var(--fs-title-1);
  line-height: var(--lh-title);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
}
.au-title-2 {
  font-size: var(--fs-title-2);
  line-height: var(--lh-title);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
}
.au-title-3 { font-size: var(--fs-title-3); line-height: 1.3; letter-spacing: var(--tracking-tight); font-weight: 600; }
.au-headline { font-size: var(--fs-headline); line-height: 1.41; letter-spacing: -0.022em; font-weight: 600; }
.au-body { font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--tracking-normal); }
.au-callout { font-size: var(--fs-callout); line-height: 1.4; letter-spacing: -0.01em; }
.au-footnote { font-size: var(--fs-footnote); line-height: 1.38; letter-spacing: -0.005em; color: var(--text-secondary); }
.au-caption { font-size: var(--fs-caption); line-height: 1.33; color: var(--text-tertiary); }

.au-mono-nums { font-variant-numeric: tabular-nums; }

/* ==============================================================
 * 4. LAYOUT PRIMITIVES
 * ============================================================== */
.au-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-5) var(--sp-8);
}
.au-stack > * + * { margin-top: var(--sp-4); }
.au-stack-lg > * + * { margin-top: var(--sp-7); }

/* ==============================================================
 * 5. GLASS NAV BAR
 * ============================================================== */
.au-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  height: 48px;
  padding: 0 var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f5f5f7;
  font-size: var(--fs-caption);
  background: var(--bg-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.au-nav-left { display: flex; align-items: center; gap: var(--sp-4); }
.au-nav-right { display: flex; align-items: center; gap: var(--sp-3); }
.au-nav-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; color: #ffffff; }
.au-nav-link {
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  cursor: pointer;
  transition: color var(--dur-2) var(--ease-out);
  padding: 4px 6px;
  border-radius: 6px;
}
.au-nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.au-nav-sep { color: rgba(255,255,255,0.25); user-select: none; }

/* ==============================================================
 * 6. CARD / SURFACE
 * ============================================================== */
.au-card {
  background: var(--bg-elevated);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: var(--sp-6);
  position: relative;
  overflow: hidden;
}
.au-card.au-card-hero {
  padding: var(--sp-8) var(--sp-8) var(--sp-7);
  background:
    var(--grad-card-ambient),
    var(--bg-elevated);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
}
.au-card-heading {
  font-size: var(--fs-title-2);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--sp-5);
  color: var(--text-primary);
}
.au-card-sub {
  font-size: var(--fs-footnote);
  color: var(--text-secondary);
  margin-top: -var(--sp-4);
  margin-bottom: var(--sp-4);
}

/* ==============================================================
 * 7. BUTTONS
 * ============================================================== */
.au-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 8px 18px;
  font-size: var(--fs-footnote);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-2) var(--ease-out),
              color var(--dur-2) var(--ease-out),
              transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              opacity var(--dur-2) var(--ease-out);
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.au-btn:hover { transform: translateY(-0.5px); }
.au-btn:active { transform: translateY(0); transition-duration: 80ms; }
.au-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus-ring); }
.au-btn:disabled, .au-btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.au-btn-primary   { background: var(--sys-blue);   color: var(--text-on-color); }
.au-btn-primary:hover   { background: var(--sys-blue-hover); }
.au-btn-primary:active  { background: var(--sys-blue-active); }

.au-btn-dark      { background: var(--text-primary); color: var(--bg-elevated); }
.au-btn-dark:hover { filter: brightness(1.15); }

.au-btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--sep);
}
.au-btn-secondary:hover { background: var(--bg-inset); }

.au-btn-success   { background: var(--sys-green); color: #fff; }
.au-btn-warning   { background: var(--sys-orange); color: #fff; }
.au-btn-danger    { background: var(--sys-red); color: #fff; }

.au-btn-ghost {
  background: transparent;
  color: var(--text-link);
  border-color: transparent;
}
.au-btn-ghost:hover { background: var(--bg-hover); }

.au-btn-outline-danger {
  background: transparent;
  color: var(--sys-red);
  border-color: color-mix(in srgb, var(--sys-red) 50%, transparent);
}
.au-btn-outline-danger:hover {
  background: color-mix(in srgb, var(--sys-red) 10%, transparent);
}

.au-btn-lg {
  padding: 12px 22px;
  font-size: var(--fs-body);
  border-radius: var(--r-pill);
}
.au-btn-block {
  display: flex;
  width: 100%;
  padding: 14px 18px;
  font-size: var(--fs-headline);
  border-radius: var(--r-md);
}
.au-btn-sm { padding: 5px 12px; font-size: var(--fs-caption); }

/* ==============================================================
 * 8. BADGES / STATUS PILL
 * ============================================================== */
.au-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.25;
}
.au-badge-neutral { background: var(--bg-inset); color: var(--text-secondary); }
.au-badge-success { background: color-mix(in srgb, var(--sys-green) 14%, transparent); color: var(--text-success); }
.au-badge-warning { background: color-mix(in srgb, var(--sys-orange) 16%, transparent); color: var(--text-warning); }
.au-badge-danger  { background: color-mix(in srgb, var(--sys-red) 14%, transparent); color: var(--text-danger); }
.au-badge-info    { background: color-mix(in srgb, var(--sys-blue) 12%, transparent); color: var(--sys-blue); }

.au-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  font-size: var(--fs-caption);
  color: rgba(255,255,255,0.92);
}
.au-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sys-gray);
  flex-shrink: 0;
  position: relative;
  transition: background var(--dur-3) var(--ease-out);
}
.au-status-dot.au-dot-offline { background: #86868b; }
.au-status-dot.au-dot-good    { background: var(--sys-green); box-shadow: 0 0 6px rgba(52,199,89,0.55); }
.au-status-dot.au-dot-busy    { background: var(--sys-orange); box-shadow: 0 0 6px rgba(255,149,0,0.55); }
.au-status-dot.au-dot-bad     { background: var(--sys-red); box-shadow: 0 0 6px rgba(255,59,48,0.55); }

.au-status-dot.au-dot-good::after,
.au-status-dot.au-dot-busy::after,
.au-status-dot.au-dot-bad::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: au-pulse 2.2s ease-out infinite;
}
.au-status-dot.au-dot-good::after { background: rgba(52,199,89,0.45); }
.au-status-dot.au-dot-busy::after { background: rgba(255,149,0,0.45); }
.au-status-dot.au-dot-bad::after  { background: rgba(255,59,48,0.45); }

@keyframes au-pulse {
  0%   { transform: scale(1);   opacity: 0.9; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* ==============================================================
 * 9. INPUTS / FORM
 * ============================================================== */
.au-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.au-label {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.au-input, .au-select, .au-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: var(--fs-body);
  line-height: 1.4;
  border-radius: var(--r-sm);
  border: 1px solid var(--sep-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.au-input:focus, .au-select:focus, .au-textarea:focus {
  outline: none;
  border-color: var(--sys-blue);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.au-input::placeholder { color: var(--text-quaternary); }

/* ==============================================================
 * 10. MODAL / SHEET
 * ============================================================== */
.au-modal-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
}
.au-modal-overlay.au-open {
  display: flex;
  opacity: 1;
  animation: au-overlay-in var(--dur-3) var(--ease-out);
}
@keyframes au-overlay-in { from { opacity: 0; } to { opacity: 1; } }

.au-modal-sheet {
  background: var(--bg-elevated);
  border-radius: var(--r-xl);
  width: min(560px, 92vw);
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  animation: au-sheet-in var(--dur-4) var(--ease-emph) 40ms forwards;
}
@keyframes au-sheet-in {
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.au-modal-header {
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sep);
}
.au-modal-title {
  font-size: var(--fs-title-3);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
.au-modal-body {
  padding: var(--sp-6);
  overflow-y: auto;
  flex: 1;
}
.au-modal-footer {
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  border-top: 1px solid var(--sep);
  background: var(--bg-elevated-2);
}
.au-modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-inset);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
  line-height: 1;
}
.au-modal-close:hover { background: var(--sep-strong); color: var(--text-primary); }

/* ==============================================================
 * 11. STAT HERO ( big number + label )
 * ============================================================== */
.au-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-5);
}
.au-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-4) 0;
  position: relative;
}
.au-stat + .au-stat::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--sp-5) / 2 - 0.5px);
  top: 12px; bottom: 12px;
  width: 1px;
  background: var(--sep);
}
.au-stat-value {
  font-size: clamp(32px, 3.6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.au-stat-label {
  font-size: var(--fs-footnote);
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}
.au-stat-delta {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
}
.au-stat-delta.au-up { color: var(--text-success); }
.au-stat-delta.au-down { color: var(--text-danger); }

/* ==============================================================
 * 12. KEYFRAMES — UNIFIED ENTRANCE
 * ============================================================== */
@keyframes au-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes au-fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes au-scale-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes au-shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

.au-reveal {
  opacity: 0;
  will-change: opacity, transform;
}
.au-reveal.au-in {
  animation: au-fade-up var(--dur-5) var(--ease-emph) both;
}

/* stagger children if JS attaches index */
.au-stagger > .au-reveal.au-in { animation-delay: calc(var(--i, 0) * 60ms); }

/* ==============================================================
 * 13. SCROLLBAR
 * ============================================================== */
.au-scroll { overflow-y: auto; }
.au-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.au-scroll::-webkit-scrollbar-track { background: transparent; }
.au-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-primary) 18%, transparent);
  border-radius: 8px;
}
.au-scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text-primary) 28%, transparent);
}

/* ==============================================================
 * 14. DIVIDER
 * ============================================================== */
.au-divider {
  height: 1px;
  background: var(--sep);
  margin: var(--sp-5) 0;
  border: 0;
}

/* ==============================================================
 * 15. UTILITY
 * ============================================================== */
.au-hide-scrollbar::-webkit-scrollbar { display: none; }
.au-hide-scrollbar { scrollbar-width: none; }
.au-select-none { user-select: none; }
.au-pointer { cursor: pointer; }
.au-shrink-0 { flex-shrink: 0; }

/* ==============================================================
 * 16. REDUCED MOTION
 * ============================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .au-reveal, .au-reveal.au-in { opacity: 1 !important; transform: none !important; animation: none !important; }
  .au-status-dot::after { display: none !important; }
}
