/* ==========================================
   主题系统：统一 CSS 变量定义
   所有页面通过此文件获取颜色/间距/阴影变量
   切换主题通过 <html data-theme="dark|light"> 控制
   ========================================== */

/* ==========================================
   深色主题 (Obsidian + Amber 黑曜石琥珀金)
   ========================================== */
[data-theme="dark"] {
  /* --- 背景色 --- */
  --bg-base: #09090b;
  --bg-surface: #121214;
  --bg-hover: #1f1f22;
  --bg-input: #000000;

  /* --- 边框 --- */
  --border-subtle: #27272a;
  --border-strong: #3f3f46;

  /* --- 文字 --- */
  --text-title: #ffffff;
  --text-body: #a1a1aa;
  --text-muted: #71717a;
  --text-main: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;

  /* --- 主题色 (琥珀金) --- */
  --accent-color: #f59e0b;
  --accent-hover: #d97706;
  --accent-bg: rgba(245, 158, 11, 0.1);

  /* --- 功能色 --- */
  --danger: #ef4444;
  --success: #10b981;

  /* --- 阴影 --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

  /* --- 动效 --- */
  --transition-base: all 0.2s ease;

  /* --- 装饰 --- */
  --grid-color: rgba(255, 255, 255, 0.03);

  /* --- 文章内容页专用 --- */
  --article-bg: #18181b;
  --article-card-bg: #f4f4f5;
  --article-card-text: #3f3f46;
  --article-card-title: #27272a;
  --toc-bg: rgba(24, 24, 27, 0.8);
  --toc-border: rgba(255, 255, 255, 0.05);

  /* --- 聊天页专用 --- */
  --chat-bg-primary: #0d0d0d;
  --chat-bg-secondary: #1a1a1a;
  --chat-bg-tertiary: #262626;
  --chat-accent-primary: #2aa5f7;
  --chat-accent-secondary: #00d4aa;
  --chat-accent-hint: #ff4c88;
  --chat-text-primary: #ffffff;
  --chat-text-secondary: #b3b3b3;
  --chat-text-tertiary: #808080;
  --chat-border: #333333;

  /* --- 个人主页专用 --- */
  --profile-bg-body: #121212;
  --profile-bg-card: #1e1e1e;
  --profile-card-border: #333;
  --profile-accent: #0d6efd;
  --profile-bg-card-hover: #2a2a2a;
  --profile-modal-bg: #2b2b2b;

  /* --- 编辑器专用 --- */
  --editor-bg: #2b3035;
  --editor-border: #444;
  --editor-text: #fff;
}

/* ==========================================
   浅色主题 (White + Amber 白色琥珀金)
   ========================================== */
[data-theme="light"] {
  /* --- 背景色 --- */
  --bg-base: #f8f9fa;
  --bg-surface: #ffffff;
  --bg-hover: #f1f3f5;
  --bg-input: #ffffff;

  /* --- 边框 --- */
  --border-subtle: #dee2e6;
  --border-strong: #adb5bd;

  /* --- 文字 --- */
  --text-title: #1a1a2e;
  --text-body: #495057;
  --text-muted: #868e96;
  --text-main: #1a1a2e;
  --text-primary: #1a1a2e;
  --text-secondary: #495057;

  /* --- 主题色 (琥珀金 - 略深保证对比度) --- */
  --accent-color: #e67e00;
  --accent-hover: #cc7000;
  --accent-bg: rgba(230, 126, 0, 0.08);

  /* --- 功能色 --- */
  --danger: #dc3545;
  --success: #198754;

  /* --- 阴影 --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.08);

  /* --- 动效 --- */
  --transition-base: all 0.2s ease;

  /* --- 装饰 --- */
  --grid-color: rgba(0, 0, 0, 0.04);

  /* --- 文章内容页专用 --- */
  --article-bg: #f1f3f5;
  --article-card-bg: #ffffff;
  --article-card-text: #495057;
  --article-card-title: #1a1a2e;
  --toc-bg: rgba(255, 255, 255, 0.9);
  --toc-border: rgba(0, 0, 0, 0.08);

  /* --- 聊天页专用 --- */
  --chat-bg-primary: #f8f9fa;
  --chat-bg-secondary: #ffffff;
  --chat-bg-tertiary: #e9ecef;
  --chat-accent-primary: #0d6efd;
  --chat-accent-secondary: #198754;
  --chat-accent-hint: #dc3545;
  --chat-text-primary: #1a1a2e;
  --chat-text-secondary: #495057;
  --chat-text-tertiary: #868e96;
  --chat-border: #dee2e6;

  /* --- 个人主页专用 --- */
  --profile-bg-body: #f8f9fa;
  --profile-bg-card: #ffffff;
  --profile-card-border: #dee2e6;
  --profile-accent: #0d6efd;
  --profile-bg-card-hover: #f1f3f5;
  --profile-modal-bg: #ffffff;

  /* --- 编辑器专用 --- */
  --editor-bg: #ffffff;
  --editor-border: #dee2e6;
  --editor-text: #1a1a2e;
}
