/* ═════════════════════════════════════════════════════════════
   Shared Theme Definitions (3 themes)
   ═════════════════════════════════════════════════════════════ */

/* ── Theme 1: 极简白 ── */
body[data-theme="1"] {
  --bg-body: #ffffff; --bg-panel: #ffffff; --bg-card: #ffffff; --bg-sidebar: #f9fafb;
  --text-primary: #111827; --text-secondary: #6b7280; --text-muted: #9ca3af;
  --border: #e5e7eb; --border-light: #f3f4f6;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-light: #eff6ff;
  --success: #059669; --error: #dc2626; --warning: #d97706;
  --button-bg: #f3f4f6; --button-hover: #e5e7eb;
  --radius: 6px; --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --font-heading: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --font-body: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --bg-pattern: none; --bg-pattern-size: 0;
  --btn-shadow: none;
  --glass-blur: none; --glass-bg: #ffffff;
  --font-mono: 'SF Mono','Fira Code','Courier New',monospace;
  --accent-rgb: 37,99,235; --bg-body-rgb: 255,255,255;
  --text-primary-rgb: 17,24,39; --border-rgb: 229,231,235;
  --button-bg-rgb: 243,244,246;
}

/* ── Theme 2: 毛玻璃 (默认) ── */
:root, body[data-theme="2"] {
  --bg-body: #f0f0f5;
  --bg-gradient: linear-gradient(135deg,#e8f0fe,#f3e8ff,#fce7f3,#e0f2fe);
  --bg-panel: rgba(255,255,255,0.55); --bg-card: rgba(255,255,255,0.55); --bg-sidebar: rgba(255,255,255,0.55);
  --text-primary: #1e1b4b; --text-secondary: #6b6b8a; --text-muted: #9b9bb8;
  --border: rgba(255,255,255,0.6); --border-light: rgba(255,255,255,0.8);
  --accent: #7c3aed; --accent-hover: #6d28d9; --accent-light: #ede9fe;
  --success: #059669; --error: #dc2626; --warning: #d97706;
  --button-bg: rgba(255,255,255,0.6); --button-hover: rgba(255,255,255,0.8);
  --radius: 12px; --shadow: 0 8px 32px rgba(0,0,0,0.08);
  --font-heading: Georgia,'Times New Roman',serif;
  --font-body: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --bg-pattern: none; --bg-pattern-size: 0;
  --btn-shadow: none;
  --glass-blur: blur(16px); --glass-bg: var(--bg-panel);
  --font-mono: 'SF Mono','Fira Code','Courier New',monospace;
  --accent-rgb: 124,58,237; --bg-body-rgb: 232,240,254;
  --text-primary-rgb: 30,27,75; --border-rgb: 255,255,255;
  --button-bg-rgb: 255,255,255;
}

/* ── Theme 3: 暗色专业 ── */
body[data-theme="3"] {
  --bg-body: #0d1117; --bg-panel: #161b22; --bg-card: #161b22; --bg-sidebar: #0d1117;
  --text-primary: #c9d1d9; --text-secondary: #8b949e; --text-muted: #6e7681;
  --border: #30363d; --border-light: #21262d;
  --accent: #58a6ff; --accent-hover: #79c0ff; --accent-light: #0c2d6b;
  --success: #3fb950; --error: #f85149; --warning: #d2991d;
  --button-bg: #21262d; --button-hover: #30363d;
  --radius: 4px; --shadow: 0 0 0 rgba(0,0,0,0);
  --font-heading: Georgia,'Times New Roman',serif;
  --font-body: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --bg-pattern: none; --bg-pattern-size: 0;
  --btn-shadow: none;
  --glass-blur: none; --glass-bg: var(--bg-card);
  --font-mono: 'SF Mono','Fira Code','Courier New',monospace;
  --accent-rgb: 88,166,255; --bg-body-rgb: 13,17,23;
  --text-primary-rgb: 201,209,217; --border-rgb: 48,54,61;
  --button-bg-rgb: 33,38,45;
}

/* ── Theme 4: 手工复古 ── */
body[data-theme="4"] {
  --bg-body: #faf0e6; --bg-panel: #fdf5e6; --bg-card: #fdf5e6; --bg-sidebar: #f5e6d3;
  --text-primary: #5d4037; --text-secondary: #8d6e63; --text-muted: #bcaaa4;
  --border: #d7ccc8; --border-light: #efebe9;
  --accent: #c62828; --accent-hover: #b71c1c; --accent-light: #ffebee;
  --success: #558b2f; --error: #c62828; --warning: #e65100;
  --button-bg: #efebe9; --button-hover: #d7ccc8;
  --radius: 4px; --shadow: 2px 2px 4px rgba(93,64,55,0.15);
  --font-heading: Georgia,'Times New Roman',serif;
  --font-body: Georgia,'Times New Roman',serif;
  --bg-pattern: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20 Q10 15 20 20 T40 20' stroke='%23d7ccc8' fill='none' opacity='0.3'/%3E%3C/svg%3E");
  --bg-pattern-size: 40px 40px;
  --btn-shadow: 1px 1px 2px rgba(93,64,55,0.2);
  --glass-blur: none; --glass-bg: var(--bg-panel);
  --font-mono: 'Courier New',monospace;
  --accent-rgb: 198,40,40; --bg-body-rgb: 250,240,230;
  --text-primary-rgb: 93,64,55; --border-rgb: 215,204,200;
  --button-bg-rgb: 239,235,233;
}

/* ── Theme 5: 报纸质感 ── */
body[data-theme="5"] {
  --bg-body: #f5f5f0; --bg-panel: #fffff5; --bg-card: #fffff5; --bg-sidebar: #ededdf;
  --text-primary: #1a1a1a; --text-secondary: #555; --text-muted: #999;
  --border: #ccc; --border-light: #e0e0d8;
  --accent: #333; --accent-hover: #000; --accent-light: #eee;
  --success: #2e7d32; --error: #c62828; --warning: #e65100;
  --button-bg: #eee; --button-hover: #ddd;
  --radius: 2px; --shadow: 1px 1px 3px rgba(0,0,0,0.1);
  --font-heading: 'Times New Roman',Georgia,serif;
  --font-body: Georgia,'Times New Roman',serif;
  --bg-pattern: url("data:image/svg+xml,%3Csvg width='4' height='4' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='4' height='4' fill='%23f5f5f0'/%3E%3Crect width='1' height='1' fill='%23ddd' opacity='0.5'/%3E%3C/svg%3E");
  --bg-pattern-size: 4px 4px;
  --btn-shadow: none;
  --glass-blur: none; --glass-bg: var(--bg-panel);
  --font-mono: 'Courier New',monospace;
  --accent-rgb: 51,51,51; --bg-body-rgb: 245,245,240;
  --text-primary-rgb: 26,26,26; --border-rgb: 204,204,204;
  --button-bg-rgb: 238,238,238;
}

/* 主题切换过渡动画 */
.theme-transitioning {
  transition: background 0.35s ease, background-color 0.35s ease,
              color 0.35s ease, border-color 0.35s ease,
              box-shadow 0.35s ease !important;
}
.theme-transitioning * {
  transition: background 0.35s ease, background-color 0.35s ease,
              color 0.35s ease, border-color 0.35s ease,
              box-shadow 0.35s ease !important;
}
