/* ===== CSS 变量 & 主题定义 ===== */
:root {
  /* 颜色系统 */
  --color-work: #4A90D9;
  --color-work-bg: rgba(74, 144, 217, 0.15);
  --color-work-text: #2B6CB0;
  --color-personal: #5CB85C;
  --color-personal-bg: rgba(92, 184, 92, 0.15);
  --color-personal-text: #3A8A3A;
  --color-study: #9B59B6;
  --color-study-bg: rgba(155, 89, 182, 0.15);
  --color-study-text: #7D3C98;
  --color-health: #F0AD4E;
  --color-health-bg: rgba(240, 173, 78, 0.15);
  --color-health-text: #C5851A;
  --color-other: #95A5A6;
  --color-other-bg: rgba(149, 165, 166, 0.15);
  --color-other-text: #6C7A7B;

  /* 亮色主题 */
  --bg-primary: #F5F6FA;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F0F1F5;
  --bg-hover: #E8E9EE;
  --bg-modal-overlay: rgba(0, 0, 0, 0.4);
  --text-primary: #1A1A2E;
  --text-secondary: #555770;
  --text-tertiary: #8E90A6;
  --text-inverse: #FFFFFF;
  --border-color: #E4E6EF;
  --border-light: #F0F1F5;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.16);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 16px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  /* 布局 */
  --header-height: 56px;
  --sidebar-width: 300px;
  --mini-calendar-size: 240px;

  /* FullCalendar 变量 */
  --fc-border-color: var(--border-color);
  --fc-today-bg-color: rgba(74, 144, 217, 0.06);
  --fc-neutral-bg-color: var(--bg-tertiary);
  --fc-page-bg-color: transparent;
  --fc-event-bg-color: transparent;
  --fc-event-border-color: transparent;
  --fc-event-text-color: var(--text-primary);
  --fc-button-bg-color: var(--bg-tertiary);
  --fc-button-border-color: var(--border-color);
  --fc-button-text-color: var(--text-primary);
  --fc-button-hover-bg-color: var(--bg-hover);
  --fc-button-hover-border-color: var(--border-color);
  --fc-button-active-bg-color: var(--color-work);
  --fc-button-active-border-color: var(--color-work);
  --fc-neutral-text-color: var(--text-secondary);
}

/* 暗色主题 */
[data-theme="dark"] {
  --bg-primary: #0F0F14;
  --bg-secondary: #1A1A24;
  --bg-tertiary: #242436;
  --bg-hover: #2E2E42;
  --bg-modal-overlay: rgba(0, 0, 0, 0.65);
  --text-primary: #EAEAF0;
  --text-secondary: #A0A0B8;
  --text-tertiary: #6A6A82;
  --text-inverse: #1A1A2E;
  --border-color: #2E2E42;
  --border-light: #242436;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.6);

  --color-work-bg: rgba(74, 144, 217, 0.2);
  --color-personal-bg: rgba(92, 184, 92, 0.2);
  --color-study-bg: rgba(155, 89, 182, 0.2);
  --color-health-bg: rgba(240, 173, 78, 0.2);
  --color-other-bg: rgba(149, 165, 166, 0.2);
}

/* 全局重置 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

ul, ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
