:root,
[data-theme="light"] {
  --color-bg-overlay: rgba(255, 255, 255, 0.12);
  --color-bg-glass: rgba(255, 255, 255, 0.18);
  --color-border-glass: rgba(255, 255, 255, 0.25);
  --color-text: rgba(255, 255, 255, 0.95);
  --color-text-muted: rgba(255, 255, 255, 0.7);
  --color-text-subtle: rgba(255, 255, 255, 0.55);
  --color-accent: #ffffff;
  --color-focus: rgba(255, 255, 255, 0.8);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.15);
  --gradient-vignette: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
}

[data-theme="dark"] {
  --color-bg-overlay: rgba(0, 0, 0, 0.25);
  --color-bg-glass: rgba(0, 0, 0, 0.35);
  --color-bg-glass-whisper: rgba(0, 0, 0, 0.18);
  --color-border-glass-whisper: rgba(255, 255, 255, 0.06);
  --color-border-glass: rgba(255, 255, 255, 0.12);
  --color-text: rgba(255, 255, 255, 0.92);
  --color-text-muted: rgba(255, 255, 255, 0.65);
  --color-text-subtle: rgba(255, 255, 255, 0.45);
  --color-accent: #e8e8e8;
  --color-focus: rgba(255, 255, 255, 0.7);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
  --gradient-vignette: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.55) 100%);
  --ambient-frame-color: rgba(212, 175, 55, 0.5);
  --ambient-ripple-color: rgba(212, 175, 55, 0.08);
  --notebook-editor-surface-blur: 12px;
  --notebook-editor-surface-blur-active: 16px;
  --notebook-editor-surface-bg: rgba(0, 0, 0, 0.28);
  --notebook-editor-surface-border: rgba(255, 255, 255, 0.08);
  --notebook-editor-surface-glow: rgba(255, 255, 255, 0.04);
}

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans-cjk: "Inter", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --font-serif: "Georgia", "Times New Roman", serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 2.75rem;
  --space-3xl: 4rem;
  --color-bg-glass-whisper: rgba(255, 255, 255, 0.06);
  --color-border-glass-whisper: rgba(255, 255, 255, 0.08);
  --dashboard-corner-inset-x: var(--space-2xl);
  --dashboard-corner-inset-bottom: var(--space-3xl);
  --dashboard-context-lift: var(--space-md);
  --dashboard-corner-gap: var(--space-xl);
  --dashboard-inspiration-max: 300px;
  --dashboard-context-max: 260px;
  --dashboard-group-padding: var(--space-md) var(--space-lg);
  --dashboard-group-gap: var(--space-sm);
  --dashboard-item-gap: var(--space-xs);
  --dashboard-hero-size: clamp(1.625rem, 3.2vw, 2.125rem);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 450ms cubic-bezier(0.4, 0, 0.2, 1);
  --z-background: 0;
  --z-panels: 10;
  --z-nav: 20;
  --z-global-nav: 21;
  --z-account: 25;
  --z-overlay: 30;
  --z-modal: 40;
  --messages-sheet-width: 34rem;
  --z-ambient-glow: 15;
  --z-ambient-hint: 22;
  --ambient-frame-color: rgba(180, 160, 120, 0.5);
  --ambient-frame-opacity: 0.05;
  --ambient-frame-blur: 14px;
  --ambient-ripple-color: rgba(180, 160, 120, 0.08);
  --ambient-nav-fade-in: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --ambient-nav-fade-out: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --ambient-hint-fade-in: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --ambient-hint-fade-out: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --ambient-breathe-duration: 9s;
  --ambient-hint-bg: rgba(0, 0, 0, 0.22);
  --ambient-hint-text: rgba(255, 255, 255, 0.65);
  --note-color-1: rgba(255, 220, 120, 0.15);
  --note-color-2: rgba(120, 200, 180, 0.15);
  --note-color-3: rgba(180, 160, 220, 0.15);
  --note-color-4: rgba(255, 160, 160, 0.15);
  --note-color-5: rgba(160, 200, 255, 0.15);
  --ambient-hint-arrow: rgba(255, 255, 255, 0.45);
  --account-size: 44px;
  --account-initial-size: 1rem;
  --account-sheet-min-width: 240px;
  --account-sheet-radius: var(--radius-md);
  --account-scrim: rgba(0, 0, 0, 0.15);
  --color-nav-active-glow: rgba(212, 175, 55, 0.5);
  --color-nav-active-glow-soft: rgba(212, 175, 55, 0.18);
  --nav-rail-collapsed-width: 56px;
  --nav-rail-width: var(--nav-rail-collapsed-width);
  --nav-item-size: 44px;
  --nav-icon-size: 20px;
  --nav-rail-active-bar: 3px;
  --nav-rail-label-size: 0.65rem;
  --nav-rail-label-tracking: 0.08em;
  --nav-rail-edge: rgba(255, 255, 255, 0.06);
  --nav-rail-hover: rgba(255, 255, 255, 0.04);
  --nav-rail-active-bg: rgba(255, 255, 255, 0.06);
  --nav-rail-quiet-opacity: 0.55;
  --nav-rail-ultra-quiet-opacity: 0.38;
  /* Nav inner shape — rail: flush left, soft content edge; dock: computed capsule */
  --nav-dock-item-size: 52px;
  --nav-dock-padding-block: var(--space-xs);
  --nav-inner-radius-rail: 0 var(--radius-sm) var(--radius-sm) 0;
  --nav-inner-radius-dock: calc((var(--nav-dock-item-size) + 2 * var(--nav-dock-padding-block)) / 2);
  --nav-dock-shadow: 0 6px 24px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--color-border-glass-whisper);
  --notebook-editor-max: 42rem;
  --notebook-editor-inset: clamp(1.25rem, 4vw, 2.75rem);
  --notebook-editor-surface-blur: 12px;
  --notebook-editor-surface-blur-active: 16px;
  --notebook-editor-surface-bg: rgba(255, 255, 255, 0.07);
  --notebook-editor-surface-border: rgba(255, 255, 255, 0.09);
  --notebook-editor-surface-glow: rgba(255, 255, 255, 0.05);
  --notebook-chrome-btn: 36px;
  --notebook-chrome-icon: 18px;
  --notebook-format-btn: 30px;
  --notebook-format-icon: 15px;
  --notebook-editor-title-size: clamp(1.85rem, 2.6vw, 2.4rem);
  --notebook-editor-body-size: 1.075rem;
  --notebook-editor-line: 1.78;
  --notebook-bubble-radius: 14px;
  --notebook-motion: 160ms cubic-bezier(0.22, 1, 0.36, 1);
  --notebook-view-transition: 320ms cubic-bezier(0.22, 1, 0.36, 1);
  --notebook-view-transition-fast: 250ms cubic-bezier(0.22, 1, 0.36, 1);
  --notebook-view-fade: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --content-safe-top: max(var(--space-lg), env(safe-area-inset-top, 0px));
  --content-safe-right: max(var(--space-lg), env(safe-area-inset-right, 0px));
  --content-safe-bottom: 0px;
  --content-safe-left: 0px;
  --content-safe-account: calc(var(--account-size) + var(--space-sm));
}

html.has-messages-entry {
  --content-safe-account: calc(var(--account-size) * 2 + var(--space-sm) * 2);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
  }
}
