/* ========================================
   数学助手 · 公共基础样式
   深色科技主题 · 简洁风格
   ======================================== */

:root {
  --bg-primary: #0f0f16;
  --bg-secondary: #161622;
  --bg-card: #1a1a2e;
  --bg-card-hover: #1e1e35;
  --bg-surface: #22223a;

  --text-primary: #e8e8f0;
  --text-secondary: #9898b0;
  --text-muted: #686880;

  --accent: #534AB7;
  --accent-light: #7F77DD;
  --accent-glow: rgba(83,74,183,0.25);
  --accent-dim: rgba(83,74,183,0.08);

  --border: #2a2a3e;
  --border-light: #333350;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --font-sans: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", "Consolas", monospace;

  --transition-fast: 0.18s ease;
  --transition: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(83,74,183,0.06), transparent 70%),
              radial-gradient(ellipse 40% 40% at 80% 100%, rgba(127,119,221,0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ----- 排版 ----- */
h1 { font-size: 22px; font-weight: 500; letter-spacing: -0.3px; }
h2 { font-size: 17px; font-weight: 500; }
h3 { font-size: 15px; font-weight: 500; }
h4 { font-size: 13px; font-weight: 500; }
p { color: var(--text-secondary); }

/* ----- 按钮 ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 18px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; cursor: pointer; border: none;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  user-select: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); box-shadow: 0 4px 28px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-light); background: var(--accent-dim); }

.btn-ghost {
  background: transparent; color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: var(--radius-lg); }

/* ----- 标签 ----- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.3px;
}

.tag-master { background: rgba(216,90,48,0.18); color: #F0997B; }
.tag-understand { background: rgba(186,117,23,0.18); color: #FAC775; }
.tag-know { background: rgba(29,158,117,0.18); color: #9FE1CB; }
.tag-apply { background: rgba(212,83,126,0.18); color: #F4C0D1; }
.tag-practice { background: rgba(206,145,120,0.18); color: #CE9178; }

/* ----- 动画工具类 ----- */
.fade-in {
  animation: fadeIn 0.4s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slideUp 0.35s ease both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- 滚动条 ----- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ----- 响应式辅助 ----- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 640px) {
  body { font-size: 13px; }
  h1 { font-size: 18px; }
  h2 { font-size: 15px; }
  h3 { font-size: 14px; }
}
