/* ===== 三角洲识字特训营 —— 战术风儿童主题 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --c-bg: #E8E6D8;
  --c-primary: #C75B39;
  --c-secondary: #3F6B4F;
  --c-yellow: #E0A526;
  --c-purple: #566A7D;
  --c-green: #4A8A5C;
  --c-blue: #2E6396;
  --c-text: #2C2A24;
  --radius: 20px;
  --shadow: 0 6px 0 rgba(0,0,0,0.1);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Comic Sans MS", sans-serif;
  background: var(--c-bg);
  background-image: radial-gradient(#ccc6a8 1.6px, transparent 1.6px);
  background-size: 28px 28px;
  color: var(--c-text);
  min-height: 100vh;
}

/* ===== 头部导航 ===== */
header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  padding: 14px 22px; background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  position: sticky; top: 0; z-index: 50; border-radius: 0 0 24px 24px;
}
.logo { font-size: 24px; font-weight: 800; cursor: pointer; }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-btn {
  border: none; background: #f2f2f8; padding: 10px 18px; border-radius: 999px;
  font-size: 16px; font-weight: 700; cursor: pointer; color: var(--c-text);
  transition: transform .12s;
}
.nav-btn:hover { transform: scale(1.06); }
.nav-btn.active { background: var(--c-primary); color: #fff; }

main { max-width: 980px; margin: 24px auto; padding: 0 16px 60px; }
.page { animation: pop .3s ease; }
.hidden { display: none !important; }
@keyframes pop { from { opacity: 0; transform: translateY(12px);} to { opacity: 1; transform: none;} }

/* ===== 通用卡片与按钮 ===== */
.card {
  background: #fff; border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.btn {
  border: none; border-radius: 999px; padding: 14px 30px; font-size: 18px;
  font-weight: 800; cursor: pointer; transition: transform .12s, box-shadow .12s;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.15); }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-secondary { background: var(--c-secondary); color: #fff; }
.btn-yellow { background: var(--c-yellow); color: #7a5c00; }
.btn-green { background: var(--c-green); color: #fff; }
.btn-purple { background: var(--c-purple); color: #fff; }
.btn-big { font-size: 22px; padding: 18px 40px; }

h2.sec-title { font-size: 26px; margin-bottom: 14px; }
.progress-wrap { background: #eee; border-radius: 999px; height: 22px; overflow: hidden; margin: 10px 0; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--c-secondary), var(--c-green)); border-radius: 999px; transition: width .4s; display:flex; align-items:center; justify-content:center; color:#fff; font-size:13px; font-weight:700; }

/* ===== 首页 ===== */
.hero {
  text-align: center; padding: 36px 20px;
  background:
    linear-gradient(rgba(20,30,25,0.55), rgba(20,30,25,0.78)),
    url("assets/hero.jpg") center/cover no-repeat;
  border-radius: 28px; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.hero h1 { font-size: 34px; margin-bottom: 8px; }
.hero p { font-size: 18px; color: rgba(255,255,255,0.92); }
.hero .day-badge { color: #fff; background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.3); }
.hero .chip { background: rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.3); color: #fff; }
.day-badge {
  display: inline-block; background: var(--c-yellow); border-radius: 16px;
  padding: 10px 24px; font-size: 20px; font-weight: 800; margin: 14px 0;
  box-shadow: var(--shadow);
}
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.home-tile {
  border-radius: var(--radius); padding: 26px 20px; text-align: center; cursor: pointer;
  color: #fff; box-shadow: var(--shadow); transition: transform .15s;
}
.home-tile:hover { transform: translateY(-4px) scale(1.02); }
.home-tile .icon { font-size: 44px; }
.home-tile h3 { font-size: 22px; margin: 8px 0 4px; }
.home-tile p { font-size: 15px; opacity: .92; }
.tile-study { background: linear-gradient(135deg, #C75B39, #E08A2E); }
.tile-review { background: linear-gradient(135deg, #3F6B4F, #2E6396); }
.tile-stats { background: linear-gradient(135deg, #566A7D, #2E6396); }

.stat-chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.chip { background: #fff; border-radius: 999px; padding: 8px 18px; font-weight: 700; box-shadow: var(--shadow); font-size: 15px; }

/* ===== 学习页 ===== */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.mode-card {
  background: #fff; border-radius: 18px; padding: 22px 12px; text-align: center;
  cursor: pointer; box-shadow: var(--shadow); border: 4px solid transparent; transition: all .15s;
}
.mode-card:hover { border-color: var(--c-yellow); transform: scale(1.04); }
.mode-card .icon { font-size: 40px; }
.mode-card h4 { font-size: 17px; margin-top: 8px; }
.mode-card p { font-size: 13px; color: #999; margin-top: 4px; }
.mode-card.done { border-color: var(--c-green); }
.mode-card .done-badge { color: var(--c-green); font-weight: 800; font-size: 14px; }

/* ===== 识字卡片 ===== */
.flash-stage { text-align: center; padding: 20px; }
.flash-char {
  font-size: 150px; font-weight: 800; line-height: 1.2; cursor: pointer;
  background: linear-gradient(180deg, #fff, #F1EFE0); border-radius: 28px;
  width: 280px; height: 280px; margin: 10px auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center; box-shadow: var(--shadow);
  border: 6px solid var(--c-yellow); user-select: none;
}
.flash-pinyin { font-size: 30px; color: var(--c-primary); font-weight: 700; }
.flash-meta { font-size: 16px; color: #999; margin-top: 6px; }
.flash-nav { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.know-btns { display: flex; gap: 14px; justify-content: center; margin-top: 16px; }

/* ===== 游戏通用 ===== */
.game-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.game-q { text-align: center; font-size: 26px; font-weight: 800; margin: 18px 0; }
.game-q .big { font-size: 90px; display: block; margin: 10px 0; }
.options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 560px; margin: 0 auto; }
.opt-btn {
  font-size: 34px; padding: 22px; border-radius: 18px; border: 4px solid #eee;
  background: #fff; cursor: pointer; font-weight: 800; transition: all .12s;
  box-shadow: var(--shadow); color: var(--c-text);
}
.opt-btn.pinyin-opt { font-size: 26px; }
.opt-btn:hover { border-color: var(--c-secondary); }
.opt-btn.correct { background: var(--c-green); color: #fff; border-color: var(--c-green); animation: bounce .4s; }
.opt-btn.wrong { background: #ffdddd; border-color: var(--c-primary); animation: shake .4s; }
@keyframes bounce { 0%{transform:scale(1)} 40%{transform:scale(1.12)} 100%{transform:scale(1)} }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }
.feedback { text-align: center; font-size: 24px; font-weight: 800; min-height: 36px; margin-top: 14px; }
.feedback.good { color: var(--c-green); }
.feedback.bad { color: var(--c-primary); }
.streak { background: var(--c-yellow); border-radius: 999px; padding: 6px 16px; font-weight: 800; }

/* 找字游戏 */
.hunt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 520px; margin: 0 auto; }
.hunt-cell {
  font-size: 36px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 14px; border: 3px solid #eee; cursor: pointer; font-weight: 800;
  transition: all .12s; box-shadow: 0 3px 0 rgba(0,0,0,0.06);
}
.hunt-cell.hit { background: var(--c-green); color: #fff; border-color: var(--c-green); }
.hunt-cell.miss { animation: shake .3s; border-color: var(--c-primary); }

/* ===== 复习页 ===== */
.review-day-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-radius: 14px; background: #f8f8fc; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.review-day-row .info { font-weight: 700; }
.review-day-row .tag { font-size: 13px; background: var(--c-purple); color: #fff; border-radius: 999px; padding: 3px 12px; margin-left: 8px; }
.review-day-row .tag.wrong-tag { background: var(--c-primary); }
.review-day-row.done { opacity: .55; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: #888; margin: 8px 0 16px; }

/* ===== 报告页 ===== */
.stats-hero {
  background:
    linear-gradient(rgba(20,30,25,0.65), rgba(20,30,25,0.85)),
    url("assets/report.jpg") center/cover no-repeat;
  color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.stats-hero .stat-box { background: rgba(255,255,255,0.92); }
.header-logo { height: 38px; vertical-align: middle; margin-right: 8px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.attribution { text-align: center; font-size: 12px; color: #888; padding: 16px 8px 24px; letter-spacing: 0.3px; }
.attribution a { color: #6f8b76; text-decoration: none; }
.attribution a:hover { text-decoration: underline; }
.knife-deco { width: 86px; height: auto; position: fixed; right: 8px; top: 38%; opacity: 0.85; pointer-events: none; z-index: 5; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35)); animation: knifeBob 4.5s ease-in-out infinite; }
@keyframes knifeBob { 0%,100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-6px); } }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; text-align: center; }
.stat-box { background: #fff; border-radius: 16px; padding: 20px 10px; box-shadow: var(--shadow); }
.stat-box .num { font-size: 38px; font-weight: 800; }
.stat-box .label { color: #999; font-size: 14px; margin-top: 4px; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 12px; }
.cal-day { aspect-ratio: 1; border-radius: 12px; background: #f0f0f5; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.cal-day.studied { background: var(--c-green); color: #fff; }
.cal-day.today { border: 3px solid var(--c-primary); }
.weak-chars { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.weak-char { font-size: 30px; font-weight: 800; background: #fff0f0; border: 3px solid var(--c-primary); border-radius: 12px; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ===== 弹窗 ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-card { background: #fff; border-radius: 24px; padding: 34px; max-width: 460px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: pop .3s; }
.modal-card h2 { margin-bottom: 12px; }
.modal-card p { margin: 10px 0; line-height: 1.7; }
.modal-card input[type=date] { font-size: 18px; padding: 10px 16px; border-radius: 12px; border: 2px solid #ddd; margin: 10px 0; }
.modal-btns { margin-top: 16px; }
.tip { font-size: 13px; color: #aaa; }

/* ===== 跨终端同步 ===== */
.sync-code {
  font-size: 30px; font-weight: 800; letter-spacing: 3px;
  background: linear-gradient(135deg, #F1EFE0, #F3E6DC);
  border: 3px dashed var(--c-yellow); border-radius: 16px;
  padding: 14px; margin: 12px 0; font-family: "Courier New", monospace;
}
.celebrate { font-size: 20px; }
.celebrate .emoji-rain { font-size: 46px; }

.empty-state { text-align: center; padding: 50px 20px; }
.empty-state .icon { font-size: 64px; }

/* ===== 吉祥物：威龙·宇航员 + 线条刀 ===== */
.mascot { width: 170px; margin: 0 auto 4px; }
.mascot-celebrate { width: 200px; margin: 0 auto 6px; }
.mascot-svg { width: 100%; height: auto; display: block; animation: float 3.2s ease-in-out infinite; transform-origin: 110px 200px; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-12px) rotate(1.5deg); }
}
/* 全面浮动时不干扰手臂挥刀，手臂独立绕肩部旋转 */
.mascot-svg .arm { transform-box: view-box; transform-origin: 150px 146px; }
.mascot-svg.slash .arm { animation: slash .7s cubic-bezier(.3,1.4,.5,1); }
@keyframes slash {
  0% { transform: rotate(-14deg); }
  40% { transform: rotate(82deg); }
  100% { transform: rotate(0deg); }
}
.mascot-svg .slash-fx { stroke-dasharray: 130; stroke-dashoffset: 130; }
.mascot-svg.slash .slash-fx { animation: fx .7s ease-out; }
@keyframes fx {
  0% { opacity: 0; stroke-dashoffset: 130; }
  35% { opacity: 1; stroke-dashoffset: 0; }
  60% { opacity: .65; }
  100% { opacity: 0; stroke-dashoffset: -40; }
}
.mascot-svg .sparkles { animation: twinkle 2.4s ease-in-out infinite; transform-box: view-box; transform-origin: 110px 130px; }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mascot-svg, .mascot-svg .sparkles { animation: none; }
  .mascot-svg.slash .arm, .mascot-svg.slash .slash-fx { animation: none; }
}

@media (max-width: 600px) {
  .flash-char { width: 220px; height: 220px; font-size: 110px; }
  .options-grid { grid-template-columns: 1fr 1fr; }
  .opt-btn { font-size: 26px; padding: 16px; }
  .hero h1 { font-size: 26px; }
}
