/* lib/theme.css - 全局设计变量与基础样式 */

/* 本地字体（Space Grotesk / JetBrains Mono，替代 Google Fonts）
   中文回退到系统字体：PingFang SC（macOS）/ Microsoft YaHei（Windows） */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../assets/fonts/space-grotesk-latin-ext-400.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../assets/fonts/space-grotesk-latin-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../assets/fonts/space-grotesk-latin-ext-500.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../assets/fonts/space-grotesk-latin-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../assets/fonts/space-grotesk-latin-ext-600.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../assets/fonts/space-grotesk-latin-600.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../assets/fonts/space-grotesk-latin-ext-700.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../assets/fonts/space-grotesk-latin-700.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../assets/fonts/jetbrains-mono-latin-ext-400.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../assets/fonts/jetbrains-mono-latin-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../assets/fonts/jetbrains-mono-latin-ext-600.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../assets/fonts/jetbrains-mono-latin-600.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* 色彩体系 —— 轻快明亮柔和可爱风 */
  --bg: #fdf6f0;
  --bg-secondary: #fffaf4;
  --bg-card: #ffffff;
  --bg-card-hover: #fff3e9;
  --fg: #4a4450;
  --fg-muted: #8f8898;
  --fg-dim: #b7afbc;

  /* 主题色（糖果色系） */
  --accent: #ff9466;
  --accent-glow: rgba(255, 148, 102, 0.14);
  --accent-secondary: #4fd1a5;
  --accent-secondary-glow: rgba(79, 209, 165, 0.14);
  --accent-tertiary: #ff7a8a;
  --accent-tertiary-glow: rgba(255, 122, 138, 0.14);
  --accent-blue: #7db7f5;
  --accent-blue-glow: rgba(125, 183, 245, 0.16);
  --accent-orange: #ffb26b;
  --green: #4fd1a5;

  /* 边框与圆角 */
  --border: #f3e4d8;
  --border-light: #e9d5c4;
  --radius: 18px;
  --radius-sm: 10px;

  /* 字体（均已本地化，中文回退系统字体） */
  --font-display: 'Space Grotesk', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;

  /* 侧边栏宽度 */
  --sidebar-w: 260px;
  --toolbar-h: 60px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* 导航占位：nav.js 加载后会添加 .has-nav */
body.has-nav {
  padding-top: var(--toolbar-h);
}

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

/* 全局背景氛围光（柔和糖果色） */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(90px);
}
body::before {
  width: 520px; height: 520px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(255,148,102,0.22), transparent 70%);
}
body::after {
  width: 420px; height: 420px;
  bottom: -120px; right: -60px;
  background: radial-gradient(circle, rgba(125,183,245,0.18), transparent 70%);
}

/* ---- 明亮主题适配（覆盖实验页内联样式中的暗色硬编码，优先级更高）---- */
body .card:hover { border-color: #f5cba9; }
body .btn-primary { color: #fff; }
body .btn-primary:hover { background: #ff7f4d; box-shadow: 0 6px 20px rgba(255,148,102,.4); }
body .btn-evolve { background: linear-gradient(135deg, #6fdcb4, #3fc392); color: #fff; }
body .btn-evolve:hover { box-shadow: 0 6px 20px rgba(79,209,165,.4); }
body .btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
body .btn-batch { border-color: rgba(125,183,245,.35); }
body .btn-batch:hover { background: rgba(125,183,245,.18); border-color: rgba(125,183,245,.5); }
body .btn-danger { border-color: rgba(255,122,138,.32); }
body .btn-danger:hover { background: rgba(255,122,138,.18); border-color: rgba(255,122,138,.5); }
body .input-field { background: #fffaf5; }
body .stat-row { border-bottom-color: var(--border); }
body .toast { box-shadow: 0 10px 40px rgba(255,160,110,.35); }
body .compare-bar-wrap { background: #f7ecdf; }
body .dist-btn:hover { border-color: var(--accent); color: var(--accent); }
body .counter-badge { border: 1px solid rgba(79,209,165,.3); }
body .stat-window { background: linear-gradient(135deg, #fffaf4, #fff3e9); }
body .divider-glow { background: linear-gradient(90deg, transparent, rgba(255,122,138,.35), rgba(79,209,165,.35), transparent); }
body .distribution-badge { background: rgba(255,178,107,.18); border-color: rgba(255,178,107,.35); }
