/**
 * Fischer AgentKit Design Tokens — Notion-Inspired Light Theme
 *
 * CSS Custom Properties as the single source of truth.
 * Ant Design Vue theme tokens are mapped from these values in theme.ts.
 *
 * Design Philosophy:
 * - Warm neutrals (Notion-style) instead of cold grays
 * - Softer shadows with more spread, less offset
 * - Generous border-radius for friendly feel
 * - Subtle borders that fade into background
 * - Refined hover/active states with gentle transitions
 */

:root {
  /* ── Brand Colors ── */
  /* 2026-06-18 VI 重梳: 主色由 indigo 改为近黑 + 中性灰，accent 仅做语义信号 */
  --color-primary: #1a1a1a;
  --color-primary-hover: #2f2f2f;
  --color-primary-active: #000000;
  --color-primary-light: #f3f4f6;
  --color-primary-bg: #fbfbfa;

  /* ── Accent: @team 专家团 (中性蓝) ── */
  --accent-team: #3b82f6;
  --accent-team-hover: #2563eb;
  --accent-team-soft: #dbeafe;
  --accent-team-bg: #eff6ff;

  /* ── Accent: @board 私董会 (琥珀/紫) ── */
  --accent-board: #a855f7;
  --accent-board-hover: #9333ea;
  --accent-board-soft: #f3e8ff;
  --accent-board-bg: #faf5ff;

  /* ── Gradient ── */
  --gradient-brand: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
  --gradient-team: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  --gradient-board: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);

  /* ── Semantic Colors ── */
  --color-success: #22c55e;
  --color-success-light: #dcfce7;
  --color-warning: #f59e0b;
  --color-warning-light: #fef9c3;
  --color-error: #ef4444;
  --color-error-light: #fee2e2;
  --color-info: #3b82f6;
  --color-info-light: #dbeafe;

  /* ── Neutral / Warm Gray Scale (Notion-inspired) ── */
  --color-gray-50: #fbfbfa;
  --color-gray-100: #f7f7f5;
  --color-gray-200: #ededec;
  --color-gray-300: #dfdfde;
  --color-gray-400: #cececd;
  --color-gray-500: #9b9b9a;
  --color-gray-600: #6b6b6a;
  --color-gray-700: #4a4a4a;
  --color-gray-800: #2f2f2f;
  --color-gray-900: #1a1a1a;

  /* ── Background ── */
  --bg-primary: #ffffff;
  --bg-secondary: #fbfbfa;
  --bg-tertiary: #f7f7f5;
  --bg-elevated: #ffffff;
  --bg-code: #1e1e2e;
  /* 消息气泡背景，与 inline code/table 背景解耦 (F1-A) */
  --bg-message-bubble: #ffffff;

  /* ── Foreground / Text ── */
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-tertiary: #6b6b6a;
  --text-placeholder: #9b9b9a;
  --text-inverse: #ffffff;
  --text-code: #cdd6f4;

  /* ── Border ── */
  --border-color: #ededec;
  --border-color-hover: #dfdfde;
  --border-color-active: var(--color-primary);
  --border-color-split: #f2f2f0;

  /* ── Spacing ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Border Radius ── */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-card: 12px;
  --radius-full: 9999px;

  /* ── Font Size ── */
  --font-xs: 12px;
  --font-sm: 13px;
  --font-base: 14px;
  --font-md: 16px;
  --font-lg: 20px;
  --font-xl: 24px;

  /* ── Font Weight ── */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* ── Monospace Font ── */
  --font-mono: 'SF Mono', 'Fira Code', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  /* ── Line Height ── */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* ── Shadow (Notion-style: softer, more ambient) ── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.04);

  /* ── Message Layout ── */
  /* 2026-07-01: 全宽自适应 — 移除 860px 限制，内容区域跟随窗口宽度。
   * 之前 860px 居中限制（类 ChatGPT/Notion）导致用户感觉"宽度没有自适应"。
   * 设为 none 使 max-width: var(--max-chat-width) 不生效。 */
  --max-chat-width: none;
  --space-message-gap: 24px;
  --leading-message: 1.65;

  /* ── Transition ── */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;

  /* ── Z-Index ── */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* ── Layout ── */
  --topnav-height: 48px;
  --sidebar-width: 280px;
  --quadrant-min-size: 320px;

  /* ── Code Theme (Catppuccin Mocha — warmer dark theme) ── */
  --code-bg: #1e1e2e;
  --code-fg: #cdd6f4;
  --code-keyword: #cba6f7;
  --code-string: #a6e3a1;
  --code-number: #fab387;
  --code-comment: #6c7086;
  --code-function: #89b4fa;
  --code-variable: #f38ba8;
  --code-type: #f9e2af;
  --code-added-bg: rgba(166, 227, 161, 0.15);
  --code-removed-bg: rgba(243, 139, 168, 0.15);
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  /* ── Brand Colors ── */
  --color-primary: #fbfbfa;
  --color-primary-hover: #ededec;
  --color-primary-active: #ffffff;
  --color-primary-light: #2f2f2f;
  --color-primary-bg: #1a1a1a;

  /* ── Accent: @team (亮蓝) ── */
  --accent-team: #60a5fa;
  --accent-team-hover: #93c5fd;
  --accent-team-soft: rgba(59, 130, 246, 0.18);
  --accent-team-bg: rgba(59, 130, 246, 0.10);

  /* ── Accent: @board (亮紫) ── */
  --accent-board: #c084fc;
  --accent-board-hover: #d8b4fe;
  --accent-board-soft: rgba(168, 85, 247, 0.18);
  --accent-board-bg: rgba(168, 85, 247, 0.10);

  /* ── Gradient ── */
  --gradient-brand: linear-gradient(135deg, #fbfbfa 0%, #9b9b9a 100%);
  --gradient-team: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  --gradient-board: linear-gradient(135deg, #c084fc 0%, #9333ea 100%);

  /* ── Semantic Colors ── */
  --color-success: #4ade80;
  --color-success-light: #14532d;
  --color-warning: #fbbf24;
  --color-warning-light: #422006;
  --color-error: #f87171;
  --color-error-light: #450a0a;
  --color-info: #60a5fa;
  --color-info-light: #172554;

  /* ── Neutral / Warm Gray Scale (Dark) ── */
  --color-gray-50: #1a1a1a;
  --color-gray-100: #2f2f2f;
  --color-gray-200: #3a3a3a;
  --color-gray-300: #4a4a4a;
  --color-gray-400: #6b6b6a;
  --color-gray-500: #9b9b9a;
  --color-gray-600: #b0b0af;
  --color-gray-700: #cececd;
  --color-gray-800: #ededec;
  --color-gray-900: #fbfbfa;

  /* ── Background ── */
  --bg-primary: #1a1a1a;
  --bg-secondary: #1f1f1f;
  --bg-tertiary: #2a2a2a;
  --bg-elevated: #252525;
  --bg-code: #11111b;
  /* 消息气泡背景，与 inline code/table 背景解耦 (F1-A) */
  --bg-message-bubble: #1f1f1f;

  /* ── Foreground / Text ── */
  --text-primary: #fbfbfa;
  --text-secondary: #cececd;
  --text-tertiary: #9b9b9a;
  --text-placeholder: #6b6b6a;
  --text-inverse: #1a1a1a;
  --text-code: #cdd6f4;

  /* ── Border ── */
  --border-color: #3a3a3a;
  --border-color-hover: #4a4a4a;
  --border-color-active: var(--color-primary);
  --border-color-split: #2f2f2f;

  /* ── Shadow (darker ambient for dark mode) ── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);

  /* ── Border Radius ── */
  --radius-card: 12px;

  /* ── Monospace Font ── */
  --font-mono: 'SF Mono', 'Fira Code', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  /* ── Code Theme (Catppuccin Mocha — unchanged, already dark) ── */
  --code-bg: #11111b;
  --code-fg: #cdd6f4;
  --code-keyword: #cba6f7;
  --code-string: #a6e3a1;
  --code-number: #fab387;
  --code-comment: #6c7086;
  --code-function: #89b4fa;
  --code-variable: #f38ba8;
  --code-type: #f9e2af;
  --code-added-bg: rgba(166, 227, 161, 0.2);
  --code-removed-bg: rgba(243, 139, 168, 0.2);
}
