/* ============================================================
   青穗计划 · 全站自定义样式
   主题：清新青绿 / 温暖柔和 / 卡通简约
   说明：TailwindCSS 负责布局与响应式，本文件负责主题变量、
        动画、装饰性元素与交互细节，便于长期维护。
   ============================================================ */

/* ---------- 设计变量（兜底，即使 CDN 加载失败也有基本配色） ---------- */
:root {
  --leaf-500: #3aa073;
  --leaf-600: #29835c;
  --leaf-700: #22694b;
  --leaf-100: #ddf3e7;
  --leaf-50: #f1faf5;
  --sun-400: #fbbb1f;
  --sun-100: #fff3c4;
  --ink: #1f3a2e;
  --cream: #fbfdf9;
}

/* ---------- 基础 ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background-color: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 更圆润的标题字体氛围 */
.font-display {
  letter-spacing: 0.02em;
}

/* ---------- 自定义滚动条（柔和青绿） ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #eef6f0;
}
::-webkit-scrollbar-thumb {
  background: #bfe2cf;
  border-radius: 999px;
  border: 2px solid #eef6f0;
}
::-webkit-scrollbar-thumb:hover {
  background: #8fd4b3;
}

/* ---------- 导航高亮（当前页） ---------- */
.nav-active {
  color: #22694b !important;
  background-color: #ddf3e7 !important;
  font-weight: 700;
}

/* ---------- 页面切换（淡入上移） ---------- */
.page {
  display: none;
}
.page.active {
  display: block;
  animation: pageIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 滚动显现 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 漂浮装饰（幼苗 / 叶子 / 云朵） ---------- */
@keyframes floatY {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}
.float-slow {
  animation: floatY 6s ease-in-out infinite;
}
.float-mid {
  animation: floatY 4.5s ease-in-out infinite;
}
.float-fast {
  animation: floatY 3s ease-in-out infinite;
}

/* ---------- 柔和光晕 ---------- */
.glow-soft {
  box-shadow: 0 10px 40px -12px rgba(58, 160, 115, 0.35);
}
.hover-lift {
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px -18px rgba(41, 131, 92, 0.42);
}

/* ---------- 柔和渐变背景块 ---------- */
.bg-gradient-sprout {
  background: linear-gradient(135deg, #e8f7ee 0%, #f3fbf6 45%, #fff7e8 100%);
}
.bg-gradient-hero {
  background: radial-gradient(1200px 600px at 15% -10%, #d7f3e4 0%, transparent 60%),
    radial-gradient(1000px 500px at 95% 10%, #fff3d1 0%, transparent 55%),
    linear-gradient(180deg, #f2fbf6 0%, #fbfdf9 100%);
}

/* ---------- 波浪分隔线 ---------- */
.wave-divider {
  display: block;
  width: 100%;
  height: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 44' preserveAspectRatio='none'%3E%3Cpath d='M0,22 C240,44 480,0 720,22 C960,44 1200,0 1440,22 L1440,44 L0,44 Z' fill='%23f2fbf6'/%3E%3C/svg%3E");
  background-size: cover;
  background-repeat: no-repeat;
}

/* ---------- 卡通徽章 ---------- */
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ---------- 手风琴 ---------- */
.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.acc-item.open .acc-body {
  max-height: 800px;
}
.acc-item.open .acc-icon {
  transform: rotate(180deg);
}
.acc-icon {
  transition: transform 0.3s ease;
}

/* ---------- 游戏通用 ---------- */
.game-option {
  transition: all 0.2s ease;
  cursor: pointer;
}
.game-option:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px -14px rgba(41, 131, 92, 0.5);
}
.game-option.correct {
  background: #e8f7ee !important;
  border-color: #3aa073 !important;
  color: #1a7d4e !important;
}
.game-option.wrong {
  background: #fdf0ef !important;
  border-color: #e79a8f !important;
  color: #b3402f !important;
}
.fade-answer {
  animation: pageIn 0.4s ease;
}

/* 红绿灯小圆点 */
.tl-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* 进度条 */
.progress-track {
  height: 12px;
  border-radius: 999px;
  background: #e6f1ea;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4cc98a, #2bb673);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 徽章收集 */
.badge-locked {
  filter: grayscale(1);
  opacity: 0.4;
}

/* ---------- 响应式：小屏隐藏/显示辅助 ---------- */
@media (max-width: 640px) {
  .hide-sm {
    display: none !important;
  }
}
@media (min-width: 641px) {
  .show-sm-only {
    display: none !important;
  }
}

/* 减少动态效果（无障碍） */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
  html {
    scroll-behavior: auto;
  }
}
