/* ============================================================
   设计系统令牌 (Design System Tokens)
   病历生成器 - 统一色彩、排版、间距、动画
   ============================================================ */

:root {
  /* ── 主色调 (Primary) ── */
  --color-primary: #3b82f6;
  --color-primary-light: #60a5fa;
  --color-primary-dark: #2563eb;
  --color-primary-50: #eff6ff;
  --color-primary-100: #dbeafe;
  --color-primary-200: #bfdbfe;
  --color-primary-500: #3b82f6;
  --color-primary-600: #2563eb;
  --color-primary-700: #1d4ed8;

  /* ── 辅助色 (Accent) ── */
  --color-accent: #06b6d4;
  --color-accent-light: #22d3ee;
  --color-accent-dark: #0891b2;
  --color-accent-50: #ecfeff;

  /* ── 语义色 (Semantic) ── */
  --color-success: #10b981;
  --color-success-light: #34d399;
  --color-warning: #f59e0b;
  --color-warning-light: #fbbf24;
  --color-danger: #ef4444;
  --color-danger-light: #f87171;
  --color-info: #6366f1;
  --color-info-light: #818cf8;

  /* ── 中性色 (Neutral) ── */
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* ── 渐变 (Gradients) ── */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --gradient-primary-hover: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
  --gradient-hero: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 50%, #f8fafc 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.9) 100%);
  --gradient-surface: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f97316 100%);

  /* ── 文字颜色 (Text) ── */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;
  --text-link: #3b82f6;

  /* ── 背景色 (Background) ── */
  --bg-body: var(--gradient-hero);
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-surface: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.96);
  --bg-overlay: rgba(15, 23, 42, 0.5);
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;

  /* ── 边框 (Border) ── */
  --border-default: rgba(148, 163, 184, 0.25);
  --border-light: rgba(148, 163, 184, 0.15);
  --border-focus: var(--color-primary);
  --border-error: var(--color-danger);
  --border-radius-xs: 6px;
  --border-radius-sm: 10px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
  --border-radius-xl: 26px;
  --border-radius-full: 9999px;

  /* ── 阴影 (Shadow) ── */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.10);
  --shadow-xl: 0 16px 48px rgba(15, 23, 42, 0.14);
  --shadow-2xl: 0 24px 64px rgba(15, 23, 42, 0.18);
  --shadow-primary: 0 8px 24px rgba(59, 130, 246, 0.25);
  --shadow-danger: 0 8px 24px rgba(239, 68, 68, 0.25);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);
  --shadow-card: 0 4px 24px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 8px 40px rgba(15, 23, 42, 0.10), 0 2px 4px rgba(15, 23, 42, 0.04);

  /* ── 排版 (Typography) ── */
  --font-sans: "Inter", "SF Pro Display", -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-serif: "Noto Serif SC", "SimSun", "Songti SC", "STSong", serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Source Code Pro", monospace;

  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.8125rem;  /* 13px */
  --text-base: 0.875rem; /* 14px */
  --text-md: 0.9375rem;  /* 15px */
  --text-lg: 1rem;       /* 16px */
  --text-xl: 1.125rem;   /* 18px */
  --text-2xl: 1.25rem;   /* 20px */
  --text-3xl: 1.5rem;    /* 24px */
  --text-4xl: 1.875rem;  /* 30px */

  --leading-tight: 1.25;
  --leading-normal: 1.6;
  --leading-relaxed: 1.85;
  --leading-loose: 2;

  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.05em;

  /* ── 间距 (Spacing) ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* ── 动画 (Animation) ── */
  --duration-instant: 100ms;
  --duration-fast: 180ms;
  --duration-normal: 280ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.22, 1.2, 0.36, 1);

  /* ── 模糊 (Blur) ── */
  --blur-sm: 6px;
  --blur-md: 12px;
  --blur-lg: 20px;
  --blur-xl: 40px;

  /* ── 层级 (Z-Index) ── */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-popover: 500;
  --z-toast: 600;
  --z-tooltip: 700;

  /* ── 布局 (Layout) ── */
  --container-max: 1560px;
  --sidebar-width: minmax(420px, 560px);
  --header-height: 64px;
  --panel-gap: 22px;
}

/* ── 暗色模式 (Dark Mode) ── */
[data-theme="dark"] {
  --bg-body: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --bg-card: rgba(30, 41, 59, 0.92);
  --bg-card-hover: rgba(30, 41, 59, 0.98);
  --bg-surface: #1e293b;
  --bg-elevated: rgba(30, 41, 59, 0.96);
  --bg-input: #1e293b;
  --bg-input-focus: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-link: #60a5fa;
  --border-default: rgba(148, 163, 184, 0.15);
  --border-light: rgba(148, 163, 184, 0.08);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.3);
  --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
  --gradient-surface: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --color-primary-50: rgba(59, 130, 246, 0.1);
  --color-primary-100: rgba(59, 130, 246, 0.15);
  --color-primary-200: rgba(59, 130, 246, 0.25);
}
