:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text, #27333d);
  background: var(--page-bg, #fff8ef);
  --page-bg: #fff8ef;
  --surface: #ffffff;
  --text: #27333d;
  --muted: #72808b;
  --primary: #27333d;
  --accent: #ff8367;
  --accent-soft: #fff2e6;
  --child-small-from: #ffd1b3;
  --child-small-to: #ffecb9;
  --child-big-from: #c9e8ff;
  --child-big-to: #e0dcff;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--accent-soft) 80%, transparent), transparent 35%), radial-gradient(circle at 100% 20%, color-mix(in srgb, var(--child-big-from) 45%, transparent), transparent 32%), var(--page-bg); }
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
a.pill { text-decoration: none; display: inline-flex; align-items: center; }
.app-shell { max-width: 760px; min-height: 100vh; margin: auto; padding: max(18px, env(safe-area-inset-top)) 20px calc(96px + env(safe-area-inset-bottom)); }
.topbar, .section-head, .person-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-size: 24px; font-weight: 850; letter-spacing: -.7px; }
.subtitle, .muted { color: var(--muted); font-size: 14px; }
.date-chip, .points { background: var(--surface); border-radius: 999px; padding: 8px 12px; font-size: 13px; box-shadow: 0 3px 14px #8c633018; white-space: nowrap; }
.home-hero { padding: 26px 2px 18px; }
h1 { font-size: clamp(28px, 7vw, 38px); letter-spacing: -1.4px; margin: 6px 0 8px; }
h2 { font-size: 19px; margin: 0; }
.person-grid { display: grid; gap: 14px; }
.person-card { min-height: 150px; padding: 20px; border-radius: 25px; text-align: left; color: var(--text); box-shadow: 0 12px 30px #795f3b1f; transition: transform .15s ease; }
.person-card:active { transform: scale(.98); }
.person-card.small { background: linear-gradient(135deg, var(--child-small-from), var(--child-small-to)); }
.person-card.big { background: linear-gradient(135deg, var(--child-big-from), var(--child-big-to)); }
.avatar { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 19px; background: #ffffffa6; font-size: 30px; }
.avatar-photo { overflow: hidden; padding: 0; }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-card h2 { margin: 13px 0 4px; font-size: 23px; }
.progress { height: 11px; background: #ffffff94; border-radius: 99px; overflow: hidden; margin-top: 14px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s ease; }
.toolbar { margin: 22px 0 14px; display: flex; gap: 8px; overflow: auto; }
.pill, .icon-button { border-radius: 999px; padding: 10px 14px; background: var(--surface); color: #52616d; box-shadow: 0 2px 10px #6f513114; }
.pill.active { background: var(--primary); color: white; }
.icon-button { font-weight: 700; padding: 9px 13px; }
.task-list, .record-list { display: grid; gap: 10px; margin-top: 12px; }
.task { display: grid; grid-template-columns: 45px 1fr auto; align-items: center; gap: 12px; min-height: 76px; padding: 12px; background: var(--surface); border-radius: 19px; box-shadow: 0 4px 16px #744d2412; }
.task.done { opacity: .62; }
.check { width: 43px; height: 43px; border-radius: 15px; background: var(--accent-soft); color: #d27442; font-size: 22px; }
.task.done .check { background: #9ddfc5; color: #126445; }
.task-title { font-weight: 750; font-size: 16px; }
.task-meta { color: #81909b; font-size: 13px; margin-top: 4px; }
.score { color: #cf7547; font-size: 13px; font-weight: 800; white-space: nowrap; }
.fab { position: fixed; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 16px 22px; color: white; border-radius: 999px; background: var(--primary); box-shadow: 0 9px 24px #27333d55; font-weight: 750; white-space: nowrap; }
.empty { text-align: center; padding: 35px 20px; color: #82909a; background: #ffffff8c; border-radius: 20px; }
.back { background: transparent; color: #52616d; font-weight: 650; padding: 8px 0; }
.stat-card { padding: 18px; margin: 16px 0; border-radius: 22px; background: var(--surface); box-shadow: 0 4px 16px #744d2412; }
.stat-big { font-size: 35px; font-weight: 850; margin: 6px 0; }
dialog { width: min(94vw, 520px); border: 0; border-radius: 24px; padding: 22px; box-shadow: 0 20px 65px #1c242d66; }
dialog::backdrop { background: #28323a66; backdrop-filter: blur(3px); }
.form { display: grid; gap: 13px; }
.form label { display: grid; gap: 7px; color: #586672; font-size: 14px; font-weight: 650; }
.form input, .form select { border: 1px solid #e5e8e8; border-radius: 13px; padding: 13px; background: #fbfcfc; }
.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-chip { display: inline-flex !important; align-items: center; gap: 5px !important; background: #f4f3f0; border-radius: 10px; padding: 7px 10px; font-weight: 650 !important; cursor: pointer; color: #586672; }
.weekday-chip input { width: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.primary { background: var(--primary); color: white; border-radius: 13px; padding: 12px 17px; font-weight: 700; }
.secondary { background: #edf0f1; color: #44525c; border-radius: 13px; padding: 12px 17px; }
.settings-list { display: grid; gap: 10px; margin-top: 14px; }
.reward-section { display: grid; gap: 10px; margin: 25px 0; }
.reward-list { display: grid; gap: 10px; }
.reward { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 12px; padding: 13px; background: #fff; border-radius: 18px; box-shadow: 0 4px 16px #744d2412; }
.reward .primary:disabled { cursor: not-allowed; background: #c9d1d4; }
.date-picker { width: 100%; margin-top: 14px; border: 1px solid #e0e5e5; border-radius: 14px; padding: 13px; background: #fff; color: #35434c; }
.add-button { margin-top: 14px; }
.action-pair { display: flex; gap: 7px; align-items: center; }
.action-pair .secondary { padding: 8px 10px; }
.history-detail { margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf0f0; color: #56636b; font-size: 13px; line-height: 1.6; }
.setting-task { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border-radius: 16px; background: #fff; }
.delete { background: #fff0ee; color: #c65242; border-radius: 10px; padding: 8px 10px; }
@media (min-width: 620px) { .person-grid { grid-template-columns: 1fr 1fr; } }

/* ---- 新增：连续打卡 / 抽奖 / 加载 / 口令 ---- */
.loading-shell { min-height: 70vh; display: grid; place-items: center; color: #72808b; }
.pin-shell { padding: 20px; }
.pin-card { background: #fff; border-radius: 26px; padding: 32px 26px; box-shadow: 0 12px 30px #795f3b1f; text-align: center; width: min(90vw, 340px); }
.chip-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.streak-chip, .ticket-chip { display: inline-flex; align-items: center; gap: 4px; background: #ffffffb0; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 750; color: #a1501f; }
.ticket-chip { color: #6b4fae; }
.draw-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 14px 16px; border-radius: 20px; background: linear-gradient(135deg, #ffe9c7, #ffd6e9); box-shadow: 0 8px 22px #a9633b22; cursor: pointer; }
.draw-banner.muted-banner { background: #f2f2f2; cursor: default; opacity: .75; }
.draw-banner-left { display: flex; align-items: center; gap: 12px; }
.draw-emoji { font-size: 30px; }
.draw-modal { text-align: center; }
.draw-wheel { font-size: 54px; margin: 18px auto; width: 110px; height: 110px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, #fff7e8, #ffe0b0); box-shadow: 0 10px 26px #a9633b33; }
.draw-wheel.spinning { animation: spin 0.5s linear infinite; }
@keyframes spin { from { transform: rotate(0deg) scale(1.05); } to { transform: rotate(360deg) scale(1.05); } }
.celebrate { text-align: center; padding: 6px 0; }
.kid-toast { position: fixed; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%) translateY(-12px); background: #27333d; color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 700; box-shadow: 0 10px 28px #27333d4a; z-index: 60; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.kid-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- 新增：每日锦囊 / 周期任务 / 仪表盘 ---- */
.daily-card { background: var(--surface); border-radius: 20px; padding: 16px 18px; margin: 16px 0; box-shadow: 0 4px 16px #744d2412; display: grid; gap: 10px; border: 1px solid #ffffff80; }
.daily-card-tips { background: linear-gradient(135deg, #fffdf6, #f7fbff); }
.word-card { background: linear-gradient(135deg, #f2fff8, #fff7ee); border-color: #b9e8c9; }
.daily-card-title { font-weight: 800; font-size: 15px; }
.daily-row { display: flex; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.6; color: #3c4750; padding: 8px 10px; border-radius: 14px; }
.quote-row { background: #fff2df; }
.idiom-row { background: #eef7ff; }
.classical-row { background: #f4efff; }
.word-card .daily-row { background: #eaf9ef; }
.word-card .daily-row + .daily-row { background: #fff0e7; }
.daily-tag { flex: none; background: #ffffffc7; color: #4b5b66; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 750; }
.goal-task { padding: 14px; background: var(--surface); border-radius: 19px; box-shadow: 0 4px 16px #744d2412; display: grid; gap: 8px; }
.goal-task.done { background: linear-gradient(135deg, #fff8ea, #f4fff6); }
.goal-task-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goal-task-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-list { display: grid; gap: 12px; margin-top: 16px; }
.self-tag { display: inline-block; background: #eef2ff; color: #5b63c9; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 750; vertical-align: middle; margin-left: 4px; }
.vision-card { position: relative; min-height: 190px; margin: 12px 0 22px; border-radius: 24px; overflow: hidden; background: linear-gradient(135deg, var(--child-small-from), var(--child-big-to)); box-shadow: 0 10px 28px #795f3b1f; }
.vision-card img { width: 100%; height: 240px; object-fit: cover; display: block; }
.vision-card.empty-vision { display: grid; place-items: center; }
.vision-placeholder { font-size: 58px; opacity: .85; }
.vision-overlay { position: absolute; inset: auto 0 0; padding: 18px; display: grid; gap: 8px; background: linear-gradient(transparent, #000000a8); color: #fff; }
.empty-vision .vision-overlay { position: static; width: 100%; align-self: end; background: linear-gradient(transparent, #27333d55); }
.vision-title { font-size: 13px; font-weight: 800; opacity: .88; }
.vision-message { font-size: 20px; font-weight: 850; line-height: 1.35; text-shadow: 0 1px 8px #00000055; }
.vision-card .pill { justify-self: start; background: #ffffffde; color: #27333d; box-shadow: none; }
.vision-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 16px; }
