/* ============================================================
   双娃成长营 · 温暖橙黄 + 书卷米白
   ============================================================ */
:root {
  --orange: #f59e0b;
  --orange-deep: #d97706;
  --orange-soft: #fef3e2;
  --cream: #fdf9f0;
  --paper: #fffdf8;
  --brown: #6b4f2e;
  --brown-light: #9a7b58;
  --green: #10b981;
  --red: #ef4444;
  --ink: #3d3229;
  --line: #f0e4d0;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(180, 130, 60, .12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  background: var(--cream);
  background-image: radial-gradient(circle at 12% 8%, #fdf0d5 0%, transparent 42%),
                    radial-gradient(circle at 92% 90%, #fdeecf 0%, transparent 40%);
  color: var(--ink);
  min-height: 100vh;
  font-size: 16px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255, 253, 248, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 800; font-size: 18px; color: var(--orange-deep); letter-spacing: .5px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { color: var(--brown); font-weight: 600; font-size: 14px; }
.today-points {
  background: var(--orange-soft); color: var(--orange-deep);
  border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 14px;
}

/* ---------- 布局 ---------- */
.app { max-width: 760px; margin: 0 auto; padding: 20px 18px 96px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card-head { font-weight: 800; font-size: 17px; color: var(--brown); margin-bottom: 14px; }

/* ---------- 按钮 ---------- */
.btn-main {
  background: linear-gradient(135deg, #fbbf24, var(--orange));
  color: #fff; border: none; border-radius: 999px;
  padding: 10px 26px; font-size: 16px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(245, 158, 11, .35);
  transition: transform .15s, box-shadow .15s;
  font-family: inherit;
}
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245, 158, 11, .45); }
.btn-main:disabled { background: #e7ddcb; box-shadow: none; cursor: not-allowed; }
.btn-big { display: block; width: 100%; padding: 14px; font-size: 18px; margin-top: 16px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--brown-light);
  border-radius: 999px; padding: 5px 14px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-deep); }
.btn-link { background: none; border: none; color: var(--brown-light); cursor: pointer; font-size: 14px; padding: 6px 2px; font-family: inherit; }
.btn-link:hover { color: var(--orange-deep); }

/* ---------- 登录页 ---------- */
.login-hero { text-align: center; padding: 40px 0 26px; }
.login-sun { font-size: 56px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.login-hero h1 { font-size: 30px; color: var(--orange-deep); margin-top: 10px; letter-spacing: 2px; }
.slogan { color: var(--brown-light); margin-top: 8px; }
.login-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 560px; margin: 0 auto; }
.role-card {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 22px 10px; text-align: center; cursor: pointer; transition: all .18s;
}
.role-card:hover { border-color: var(--orange); transform: translateY(-3px); box-shadow: var(--shadow); }
.role-card .emoji { font-size: 40px; display: block; margin-bottom: 8px; }
.role-card .rname { font-weight: 700; color: var(--brown); }
.role-card .rsub { font-size: 12px; color: var(--brown-light); margin-top: 4px; }
.login-pin { max-width: 360px; margin: 22px auto 0; text-align: center; }
.pin-title { font-weight: 700; color: var(--brown); margin-bottom: 12px; }
.pin-row { display: flex; gap: 10px; }
.pin-row input {
  flex: 1; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px;
  font-size: 18px; letter-spacing: 6px; text-align: center; background: #fff; font-family: inherit;
}
.pin-row input:focus { outline: none; border-color: var(--orange); }
.pin-hint { font-size: 12px; color: var(--brown-light); margin-top: 14px; }
.login-pin .btn-link { margin-top: 12px; }

/* ---------- 首页 ---------- */
.greeting { font-size: 22px; font-weight: 800; color: var(--ink); margin: 6px 0 16px; }
.greeting .hi { color: var(--orange-deep); }
.essay-card { background: linear-gradient(150deg, #fffaf0, #fdf3e3); }
.essay-title { font-weight: 700; color: var(--orange-deep); margin-bottom: 8px; }
.essay-text {
  font-size: 17px; line-height: 2; color: #5a4632; letter-spacing: 1px;
  padding: 12px 14px; border-left: 3px solid var(--orange); background: rgba(255,255,255,.6);
  border-radius: 0 10px 10px 0;
}
.essay-note { font-size: 12px; color: var(--brown-light); margin-top: 8px; }
.task-brief { display: grid; gap: 10px; }
.brief-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--cream); border-radius: 12px; padding: 12px 14px;
}
.brief-row .b-left { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brief-row .b-emoji { font-size: 22px; }
.brief-row .b-meta { font-size: 12px; color: var(--brown-light); font-weight: 400; }
.done-chip { color: var(--green); font-weight: 700; font-size: 14px; white-space: nowrap; }
.points-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.pt { background: var(--cream); border-radius: 14px; padding: 12px 4px; }
.pt-num { display: block; font-size: 24px; font-weight: 800; color: var(--orange-deep); }
.pt-label { font-size: 12px; color: var(--brown-light); }
.points-tip { font-size: 13px; color: var(--brown-light); margin-top: 12px; text-align: center; }
.parent-kid { background: var(--cream); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.parent-kid .pk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.parent-kid .pk-name { font-weight: 700; font-size: 16px; }
.parent-kid .pk-stats { display: flex; gap: 14px; font-size: 13px; color: var(--brown-light); flex-wrap: wrap; }
.parent-kid .pk-stats b { color: var(--orange-deep); }
.pk-status { font-size: 13px; font-weight: 700; }

/* ---------- 打卡页 ---------- */
.checkin-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.checkin-head h2 { font-size: 20px; color: var(--ink); }
.date-chip { font-size: 13px; font-weight: 600; color: var(--brown-light); background: var(--orange-soft); border-radius: 999px; padding: 3px 12px; vertical-align: middle; margin-left: 6px; }
.module-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.module-tab {
  border: 1.5px solid var(--line); background: var(--paper); color: var(--brown);
  border-radius: 999px; padding: 8px 18px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.module-tab.active { background: linear-gradient(135deg, #fbbf24, var(--orange)); color: #fff; border-color: transparent; }
.module-tab.tab-done::after { content: ' ✓'; color: var(--green); }
.module-tab.active.tab-done::after { content: ' ✓'; color: #fff; }

/* 讲解块 */
.teach {
  background: linear-gradient(150deg, #fffbf2, #fdf4e4);
  border: 1px dashed #f3d9a8; border-radius: 14px; padding: 16px; margin-bottom: 16px;
}
.teach-tag {
  display: inline-block; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 2px 12px; margin-bottom: 10px;
}
.teach h4 { color: var(--brown); font-size: 15px; margin-bottom: 6px; }
.teach ul { list-style: none; }
.teach li { font-size: 14px; line-height: 1.9; color: #6a5640; padding-left: 16px; position: relative; }
.teach li::before { content: '✦'; color: var(--orange); position: absolute; left: 0; font-size: 11px; top: 2px; }

/* 作答区 */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; color: var(--brown); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 14px; font-size: 15px; background: #fff; color: var(--ink);
  font-family: inherit; transition: border-color .15s;
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.submit-area { margin-top: 18px; }
.done-view {
  background: linear-gradient(150deg, #effcf5, #e8f9f0); border: 1px solid #bce8d2;
  border-radius: 14px; padding: 18px; margin-bottom: 16px;
}
.done-view .dv-title { font-weight: 800; color: #0a8f5c; margin-bottom: 10px; }
.done-view .dv-ans { font-size: 14px; color: #4a6b58; line-height: 1.9; white-space: pre-wrap; }
.done-view .dv-pt { color: var(--orange-deep); font-weight: 700; }

/* ---------- Toast & 飘星 ---------- */
.toast {
  position: fixed; left: 50%; top: 76px; transform: translateX(-50%);
  background: rgba(60, 45, 25, .92); color: #fff; border-radius: 999px;
  padding: 10px 22px; font-size: 14px; z-index: 200; max-width: 88vw; text-align: center;
  animation: toastIn .25s ease;
}
.toast.warn { background: rgba(204, 110, 20, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.star {
  position: absolute; font-size: 22px; animation: starUp 1.6s ease-out forwards; opacity: 0;
}
@keyframes starUp {
  0% { opacity: 0; transform: translateY(0) scale(.4) rotate(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-160px) scale(1.25) rotate(40deg); }
}
.burst {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  font-size: 24px; font-weight: 800; color: var(--orange-deep); text-align: center;
  background: rgba(255, 253, 248, .97); border: 2px solid #f6d79a; border-radius: 20px;
  padding: 26px 44px; z-index: 310; box-shadow: 0 12px 40px rgba(200, 140, 50, .3);
  animation: burstIn .35s cubic-bezier(.2, 1.4, .4, 1);
  pointer-events: none;
}
.burst .b-big { font-size: 40px; display: block; margin-bottom: 6px; }
@keyframes burstIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.5); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: none; justify-content: space-around;
  background: rgba(255, 253, 248, .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.tab {
  background: none; border: none; display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 11px; color: var(--brown-light); cursor: pointer; padding: 4px 18px; font-family: inherit;
}
.tab span { font-size: 22px; }
.tab.active { color: var(--orange-deep); font-weight: 700; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .app { padding: 14px 14px 92px; }
  .tabbar { display: flex; }
  .login-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .role-card { padding: 16px 6px; }
  .role-card .emoji { font-size: 32px; }
  .points-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .pt-num { font-size: 19px; }
  .greeting { font-size: 19px; }
  .logo { font-size: 16px; }
  .who { display: none; }
}
@media (min-width: 721px) {
  .tabbar { display: none; }
}
