/* ============================================================
   趣学园 · FunLearn Park — 全局设计系统 + 首页样式
   风格：趣味乐园 / 糖果玩具风（Playful Toy & Candy Land）
   ============================================================ */

/* ---------- 字体（Google Fonts） ---------- */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

/* ============================================================
   1. 设计令牌（Design Tokens）
   ============================================================ */
:root {
  /* —— 主色 晴空蓝 —— */
  --brand-50:  #eaf6ff;
  --brand-100: #d4ecff;
  --brand-200: #a9d9ff;
  --brand-300: #7ec6ff;
  --brand-400: #54b6ff;
  --brand-500: #3BB0FF;   /* 主色 */
  --brand-600: #1f8fe0;
  --brand-700: #176fb0;
  --brand-800: #115082;
  --brand-900: #0d3b66;

  /* —— 辅色 —— */
  --accent-yellow: #FFD23F;
  --accent-yellow-soft: #ffe890;
  --accent-green: #5BD66C;
  --accent-green-soft: #b8f0c0;
  --accent-pink: #FF6B9D;
  --accent-pink-soft: #ffc3d8;
  --accent-coral: #FF8A5B;

  /* —— 语义色 —— */
  --success: #5BD66C;
  --danger:  #FF5A5F;
  --info:    #3BB0FF;
  --warning: #FFD23F;

  /* —— 背景与表面（亮色·暖奶油白） —— */
  --bg:          #FFF9EE;
  --bg-2:        #fff3dc;
  --surface:     #ffffff;
  --surface-2:   #fff7eb;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --mesh-1: rgba(59, 176, 255, 0.28);
  --mesh-2: rgba(255, 210, 63, 0.30);
  --mesh-3: rgba(91, 214, 108, 0.26);
  --mesh-4: rgba(255, 107, 157, 0.24);

  /* —— 文本 —— */
  --text:        #2b2440;
  --text-soft:   #6b6486;
  --text-faint:  #9b94b0;
  --text-onbrand:#ffffff;

  /* —— 边框 —— */
  --border:        rgba(43, 36, 64, 0.10);
  --border-strong: rgba(43, 36, 64, 0.18);

  /* —— 阴影 —— */
  --shadow-xs: 0 1px 2px rgba(43, 36, 64, 0.06);
  --shadow-sm: 0 2px 8px rgba(43, 36, 64, 0.08);
  --shadow-soft: 0 12px 30px rgba(43, 36, 64, 0.12);
  --shadow-sticker: 0 6px 0 rgba(43, 36, 64, 0.12), 0 10px 22px rgba(43, 36, 64, 0.14);
  --shadow-pop: 0 18px 40px rgba(59, 176, 255, 0.30);
  --shadow-gummy: 0 5px 0 rgba(0,0,0,0.14), 0 8px 18px rgba(43,36,64,0.18);

  /* —— 圆角 —— */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* —— 间距（4px 基准） —— */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px;
  --sp-10: 40px; --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  /* —— 过渡 —— */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.16s;
  --dur-base: 0.28s;
  --dur-slow: 0.5s;

  /* —— 字体族 —— */
  --font-display: 'Fredoka', 'Baloo 2', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Nunito', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --nav-h: 68px;
  --maxw: 1280px;
}

/* —— 暗色主题：星空游乐场 —— */
[data-theme="dark"] {
  --bg:        #14123a;
  --bg-2:      #1B1A4B;
  --surface:   #24215f;
  --surface-2: #2c2870;
  --surface-glass: rgba(28, 26, 80, 0.72);
  --mesh-1: rgba(59, 176, 255, 0.30);
  --mesh-2: rgba(255, 210, 63, 0.20);
  --mesh-3: rgba(91, 214, 108, 0.20);
  --mesh-4: rgba(255, 107, 157, 0.22);

  --text:        #f4f1ff;
  --text-soft:   #c4bee0;
  --text-faint:  #8a85b8;

  --border:        rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-soft: 0 12px 30px rgba(0,0,0,0.40);
  --shadow-sticker: 0 6px 0 rgba(0,0,0,0.30), 0 10px 22px rgba(0,0,0,0.45);
  --shadow-pop: 0 18px 40px rgba(59, 176, 255, 0.35);
  --shadow-gummy: 0 5px 0 rgba(0,0,0,0.35), 0 8px 18px rgba(0,0,0,0.45);
}

/* ============================================================
   2. 基础重置
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 1rem; color: inherit; }
ul, ol { list-style: none; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; color: var(--text); }

::selection { background: var(--accent-yellow); color: var(--text); }

/* 全局滚动条（童趣） */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brand-300); border-radius: var(--radius-full); border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-400); }

/* ============================================================
   3. 全局氛围背景（mesh blob + 飘浮装饰）
   ============================================================ */
.bg-decor {
  position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% 8%, var(--mesh-1), transparent 60%),
    radial-gradient(50% 45% at 88% 12%, var(--mesh-2), transparent 60%),
    radial-gradient(55% 50% at 80% 85%, var(--mesh-3), transparent 60%),
    radial-gradient(45% 40% at 15% 88%, var(--mesh-4), transparent 60%),
    var(--bg);
}
.bg-decor::before {
  content: ""; position: absolute; inset: -10%;
  background:
    radial-gradient(40% 40% at 30% 30%, var(--mesh-2), transparent 70%),
    radial-gradient(35% 35% at 70% 60%, var(--mesh-1), transparent 70%);
  filter: blur(20px);
  animation: blobDrift 26s ease-in-out infinite alternate;
  opacity: 0.7;
}
@keyframes blobDrift {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(3%, -2%) scale(1.06); }
  100% { transform: translate(-2%, 3%) scale(0.97); }
}

/* 飘浮装饰云朵/星星 */
.floaties { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.floaties span {
  position: absolute; font-size: 1.8rem; opacity: 0.55;
  animation: floaty 9s ease-in-out infinite;
  will-change: transform;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-22px) rotate(8deg); }
}

/* ============================================================
   4. 容器与导航栏
   ============================================================ */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-5); }

/* —— 顶部导航（玻璃拟态） —— */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  background: var(--surface-glass);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: var(--sp-4); width: 100%; }
.logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
  display: flex; align-items: center; gap: var(--sp-2);
  white-space: nowrap;
}
.logo .logo-badge {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  border-radius: var(--radius-md); font-size: 1.3rem;
  box-shadow: var(--shadow-gummy);
  animation: bobble 4s ease-in-out infinite;
}
@keyframes bobble { 0%,100%{transform:rotate(-6deg);} 50%{transform:rotate(6deg);} }

.nav-spacer { flex: 1; }

/* 搜索框 */
.search-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-full); padding: 0 var(--sp-4);
  height: 42px; transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search-wrap:focus-within { border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--mesh-1); }
.search-wrap .ico { font-size: 1rem; opacity: 0.7; }
.search-wrap input {
  border: none; background: none; outline: none; width: 200px; padding: 0 var(--sp-2);
  font-size: 0.95rem;
}
.search-wrap input::placeholder { color: var(--text-faint); }

/* 图标按钮 */
.icon-btn {
  width: 42px; height: 42px; border-radius: var(--radius-full);
  display: inline-grid; place-items: center; font-size: 1.15rem;
  background: var(--surface); border: 2px solid var(--border);
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast), border-color var(--dur-fast);
}
.icon-btn:hover { transform: translateY(-2px) rotate(-6deg); border-color: var(--brand-300); background: var(--brand-50); }
.icon-btn:active { transform: translateY(1px) scale(0.95); }
[data-theme="dark"] .icon-btn:hover { background: var(--surface-2); }

/* AI 已配置徽标 */
.ai-badge {
  display: none; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 700; color: #fff;
  background: var(--success); padding: 3px 9px; border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
}
.ai-badge.show { display: inline-flex; animation: popIn var(--dur-base) var(--ease-spring); }

/* 移动端：折叠搜索 */
.menu-btn { display: none; }

/* ============================================================
   5. 按钮（3D 厚切软糖）
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  padding: 12px 24px; border-radius: var(--radius-lg);
  background: var(--brand-500); color: #fff;
  box-shadow: var(--shadow-gummy);
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast), filter var(--dur-fast);
  position: relative; white-space: nowrap;
}
.btn:hover { transform: translateY(-3px) rotate(-1deg); filter: brightness(1.06); box-shadow: 0 8px 0 rgba(0,0,0,0.14), 0 14px 26px rgba(43,36,64,0.22); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,0.14), 0 4px 10px rgba(43,36,64,0.18); }
.btn--lg { font-size: 1.18rem; padding: 16px 32px; }
.btn--xl { font-size: 1.3rem; padding: 18px 40px; border-radius: var(--radius-xl); }
.btn--yellow { background: var(--accent-yellow); color: #5a4a00; }
.btn--green  { background: var(--accent-green); color: #14401f; }
.btn--pink   { background: var(--accent-pink); color: #fff; }
.btn--ghost  { background: var(--surface); color: var(--text); border: 2px solid var(--border-strong); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { border-color: var(--brand-400); }
.btn--block { width: 100%; }
.btn--sm { font-size: 0.88rem; padding: 8px 16px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: var(--shadow-sm); }

/* ============================================================
   6. 首页 Hero
   ============================================================ */
.hero { position: relative; padding: var(--sp-12) 0 var(--sp-10); text-align: center; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero .pill-hello {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-full); padding: 6px 16px; font-weight: 700; font-size: 0.9rem;
  box-shadow: var(--shadow-sm); margin-bottom: var(--sp-5);
  animation: dropIn var(--dur-slow) var(--ease-spring) both;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: var(--sp-4);
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand-500), var(--accent-pink) 55%, var(--accent-yellow));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-soft); max-width: 560px; margin: 0 auto var(--sp-7); }
.hero .cta-row { display: flex; gap: var(--sp-4); justify-content: center; flex-wrap: wrap; }

/* Hero 装饰 emoji */
.hero-emojis span {
  position: absolute; font-size: 2.4rem; opacity: 0.9;
  animation: floaty 7s ease-in-out infinite;
}

/* 彩虹分隔 */
.rainbow-divider {
  height: 6px; border-radius: var(--radius-full); margin: var(--sp-8) auto; max-width: 220px;
  background: linear-gradient(90deg, var(--brand-400), var(--accent-green), var(--accent-yellow), var(--accent-pink), var(--brand-400));
  background-size: 200% 100%; animation: rainbowSlide 6s linear infinite;
}
@keyframes rainbowSlide { to { background-position: 200% 0; } }

/* ============================================================
   7. 区块标题
   ============================================================ */
.section { padding: var(--sp-10) 0; }
.section-head { text-align: center; margin-bottom: var(--sp-8); }
.section-head .eyebrow {
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 0.82rem; color: var(--brand-500); margin-bottom: var(--sp-2);
}
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.section-head p { color: var(--text-soft); margin-top: var(--sp-2); }

/* ============================================================
   8. 趣味工具岛（游戏地图式错落大卡）
   ============================================================ */
.tool-island {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6);
}
.island-card {
  position: relative; border-radius: var(--radius-xl);
  padding: var(--sp-7) var(--sp-6); overflow: hidden;
  border: 3px solid var(--border-strong); background: var(--surface);
  box-shadow: var(--shadow-sticker);
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base);
  animation: popIn var(--dur-slow) var(--ease-spring) both;
}
.island-card:nth-child(1) { transform: rotate(-1.5deg); animation-delay: 0.05s; }
.island-card:nth-child(2) { transform: rotate(1deg); animation-delay: 0.18s; }
.island-card:nth-child(3) { transform: rotate(-0.6deg); animation-delay: 0.30s; }
.island-card:hover { transform: translateY(-8px) rotate(0deg); box-shadow: var(--shadow-pop); }
.island-card .blob {
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  filter: blur(8px); opacity: 0.55; top: -50px; right: -40px; z-index: 0;
}
.island-card .ic-big {
  font-size: 3.6rem; line-height: 1; display: inline-block; position: relative; z-index: 1;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.15));
  animation: bobble 5s ease-in-out infinite;
}
.island-card h3 { font-size: 1.6rem; margin: var(--sp-4) 0 var(--sp-2); position: relative; z-index: 1; }
.island-card .desc { color: var(--text-soft); position: relative; z-index: 1; margin-bottom: var(--sp-5); }
.island-card .tagline {
  display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: 0.8rem;
  padding: 4px 12px; border-radius: var(--radius-full); margin-bottom: var(--sp-4);
  position: relative; z-index: 1;
}
.island-card .play-btn { position: relative; z-index: 1; }

/* 三种主题色卡 */
.island-card.c-blue   { background: linear-gradient(160deg, #eaf6ff, #ffffff 60%); }
.island-card.c-blue .blob, .island-card.c-blue .tagline { background: var(--brand-300); color: var(--brand-800); }
.island-card.c-green  { background: linear-gradient(160deg, #e9fbe9, #ffffff 60%); }
.island-card.c-green .blob { background: var(--accent-green); }
.island-card.c-green .tagline { background: var(--accent-green-soft); color: #1f5a2a; }
.island-card.c-pink   { background: linear-gradient(160deg, #ffeaf2, #ffffff 60%); }
.island-card.c-pink .blob { background: var(--accent-pink); }
.island-card.c-pink .tagline { background: var(--accent-pink-soft); color: #8a1f47; }
[data-theme="dark"] .island-card.c-blue { background: linear-gradient(160deg, #1c2a5e, #24215f 60%); }
[data-theme="dark"] .island-card.c-green { background: linear-gradient(160deg, #14401f, #24215f 60%); }
[data-theme="dark"] .island-card.c-pink { background: linear-gradient(160deg, #5a1f3f, #24215f 60%); }

/* ============================================================
   9. 筛选 chips
   ============================================================ */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; margin-bottom: var(--sp-7); }
.chip {
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem;
  padding: 8px 16px; border-radius: var(--radius-full);
  background: var(--surface); border: 2px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--dur-fast) var(--ease-spring);
}
.chip:hover { transform: translateY(-2px); border-color: var(--brand-300); }
.chip.active { background: var(--brand-500); color: #fff; border-color: var(--brand-500); box-shadow: var(--shadow-sm); }
.chip .count {
  font-size: 0.72rem; background: rgba(0,0,0,0.10); padding: 1px 8px; border-radius: var(--radius-full);
}
.chip.active .count { background: rgba(255,255,255,0.28); }

/* ============================================================
   10. 资源宝箱网格（贴纸卡片）
   ============================================================ */
.chest-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-2);
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base), border-color var(--dur-base);
  animation: popIn var(--dur-slow) var(--ease-spring) both;
}
.tool-card:nth-child(3n) { transform: rotate(0.6deg); }
.tool-card:nth-child(3n+1) { transform: rotate(-0.5deg); }
.tool-card:hover { transform: translateY(-6px) rotate(0deg); box-shadow: var(--shadow-pop); border-color: var(--brand-300); }
.tool-card .ic {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  display: grid; place-items: center; font-size: 1.6rem; margin-bottom: var(--sp-2);
  background: var(--brand-50); box-shadow: var(--shadow-xs);
}
[data-theme="dark"] .tool-card .ic { background: var(--surface-2); }
.tool-card h4 { font-size: 1.1rem; }
.tool-card .desc { font-size: 0.88rem; color: var(--text-soft); flex: 1; }
.tool-card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-3); }
.tool-card .cat-tag {
  font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--accent-yellow-soft); color: #6a5500;
}
.tool-card .ext-ico { font-size: 0.9rem; opacity: 0.6; }
.tool-card.featured {
  border-color: var(--accent-pink); border-width: 3px;
  background: linear-gradient(160deg, #fff5fa, var(--surface) 70%);
}
.tool-card.featured .star {
  position: absolute; top: -10px; right: 14px;
  background: var(--accent-pink); color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 3px 12px; border-radius: var(--radius-full); box-shadow: var(--shadow-sm);
}

/* 分类色 */
.cat-lesson .ic   { background: #e9fbe9; }
.cat-quiz .ic     { background: #fff3d6; }
.cat-course .ic   { background: #eaf6ff; }
.cat-evaluate .ic { background: #ffeaf2; }
.cat-interact .ic { background: #f0e9ff; }

/* 空状态 */
.empty-state {
  grid-column: 1 / -1; text-align: center; padding: var(--sp-16) var(--sp-5);
  color: var(--text-soft);
}
.empty-state .big { font-size: 3rem; margin-bottom: var(--sp-3); }

/* ============================================================
   11. 模态框（AI 配置）
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: var(--sp-5);
  background: rgba(20, 18, 58, 0.55); backdrop-filter: blur(6px);
}
.modal-mask.open { display: flex; animation: fadeIn var(--dur-base) var(--ease-out); }
.modal {
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft); border: 3px solid var(--border-strong);
  animation: popIn var(--dur-base) var(--ease-spring);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-6) var(--sp-6) var(--sp-4); }
.modal-head h3 { font-size: 1.4rem; display: flex; align-items: center; gap: var(--sp-2); }
.modal-body { padding: 0 var(--sp-6) var(--sp-6); }

/* 表单 */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; }
.field .hint { font-size: 0.78rem; color: var(--text-faint); margin-top: 4px; }
.input, .textarea, .select {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-md);
  background: var(--surface-2); border: 2px solid var(--border);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  font-size: 0.95rem;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--mesh-1); background: var(--surface); }
.textarea { min-height: 90px; resize: vertical; line-height: 1.6; }

/* 预设按钮 */
.preset-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.preset-btn {
  font-size: 0.82rem; font-weight: 700; padding: 6px 12px; border-radius: var(--radius-full);
  background: var(--brand-50); color: var(--brand-700); border: 2px solid transparent;
  transition: all var(--dur-fast);
}
.preset-btn:hover { background: var(--brand-500); color: #fff; transform: translateY(-2px); }
[data-theme="dark"] .preset-btn { background: var(--surface-2); color: var(--brand-200); }

/* 滑块 */
.range-wrap { display: flex; align-items: center; gap: var(--sp-3); }
.range-wrap input[type="range"] { flex: 1; accent-color: var(--brand-500); height: 6px; }
.range-val {
  min-width: 44px; text-align: center; font-family: var(--font-mono); font-weight: 700;
  background: var(--brand-500); color: #fff; padding: 3px 8px; border-radius: var(--radius-full); font-size: 0.85rem;
}

.modal-foot { display: flex; gap: var(--sp-3); justify-content: flex-end; padding: var(--sp-4) var(--sp-6) var(--sp-6); }

/* ============================================================
   12. Toast
   ============================================================ */
.toast-stack { position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: var(--sp-2); align-items: center; }
.toast {
  display: flex; align-items: center; gap: var(--sp-2); padding: 12px 20px; border-radius: var(--radius-full);
  background: var(--text); color: var(--bg); font-weight: 700; box-shadow: var(--shadow-soft);
  animation: toastIn var(--dur-base) var(--ease-spring);
}
.toast.success { background: var(--success); color: #fff; }
.toast.error   { background: var(--danger); color: #fff; }
.toast.info    { background: var(--brand-500); color: #fff; }
.toast.leaving { animation: toastOut var(--dur-base) var(--ease-out) forwards; }

/* ============================================================
   13. 页脚
   ============================================================ */
.footer {
  margin-top: var(--sp-16); padding: var(--sp-10) 0; text-align: center;
  border-top: 2px dashed var(--border-strong); color: var(--text-soft);
}
.footer .logo { justify-content: center; margin-bottom: var(--sp-3); }
.footer p { font-size: 0.9rem; }

/* ============================================================
   14. 通用动画
   ============================================================ */
@keyframes popIn { from { opacity: 0; transform: scale(0.7) translateY(20px); } to { opacity: 1; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(0.9); } to { opacity: 1; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(20px) scale(0.9); } }

/* 滚动揭示 */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   15. 响应式
   ============================================================ */
@media (max-width: 1024px) {
  .tool-island { grid-template-columns: repeat(2, 1fr); }
  .chest-grid  { grid-template-columns: repeat(3, 1fr); }
  .island-card:nth-child(3) { grid-column: 1 / -1; transform: rotate(0.5deg); }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .search-wrap { display: none; }
  .search-wrap.mobile-open { display: flex; position: absolute; top: calc(var(--nav-h) + 8px); left: var(--sp-5); right: var(--sp-5); width: auto; }
  .search-wrap.mobile-open input { width: 100%; }
  .menu-btn { display: inline-grid; }
  .container { padding: 0 var(--sp-4); }

  .hero { padding: var(--sp-8) 0 var(--sp-6); }
  .tool-island { grid-template-columns: 1fr; }
  .island-card { transform: rotate(0) !important; }
  .chest-grid { grid-template-columns: repeat(2, 1fr); }

  .logo span.txt { display: none; }
  .ai-badge.show { display: none; }
}

@media (max-width: 480px) {
  .chest-grid { grid-template-columns: 1fr; }
  .hero .cta-row { flex-direction: column; }
  .hero .cta-row .btn { width: 100%; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
