:root {
  --ink: #17324d;
  --muted: #65788a;
  --paper: #ffffff;
  --sky: #f3f8fc;
  --line: #dce7ef;
  --gold: #f7c94b;
  --gold-dark: #9b6710;
  --coral: #df6959;
  --mint: #4d9282;
  --soft-blue: #e8f2f8;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--sky); }
body { margin: 0; min-width: 320px; color: var(--ink); background-color: #eef6f9; background-image: linear-gradient(rgb(243 248 252 / 88%), rgb(243 248 252 / 88%)), url('/assets/pattern.svg'); background-size: auto, 360px 360px; background-attachment: fixed; font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; font-size: 15px; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #3b84b5; outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .6; }
input, textarea, select { width: 100%; min-height: 46px; padding: 11px 12px; color: var(--ink); background: #fbfdfe; border: 1px solid #cddbe5; border-radius: 10px; font-size: 16px; }
textarea { resize: vertical; }
label { display: grid; gap: 7px; margin: 14px 0; font-weight: 650; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: -.02em; }
h2 { margin-bottom: 10px; font-size: 24px; }
h3 { margin-bottom: 16px; font-size: 18px; }
.hidden { display: none !important; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.primary, .secondary, .text-button, .logout-button { min-height: 46px; padding: 11px 18px; border-radius: 12px; font-weight: 750; border: 0; }
.primary { background: var(--ink); color: #fff; box-shadow: 0 4px 0 #081b2d; }
.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #081b2d; }
.secondary { background: #fff5cf; color: #6c4a0d; border: 1px solid #e8cf78; }
.text-button { background: var(--soft-blue); color: #285876; }
.wide { width: 100%; }
.muted { color: var(--muted); }
.fine-print { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.section-label { display: block; margin-bottom: 6px; color: #3e718f; font-size: 13px; font-weight: 750; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 28px 0 16px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { display: none; max-width: 230px; margin-bottom: 2px; color: var(--muted); font-size: 13px; text-align: right; }

/* 登录 */
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 28px 18px; overflow: hidden; position: relative; background: #e8f3f8; }
.login-card { width: min(100%, 420px); padding: 32px 26px; background: #fff; border: 1px solid #d9e6ed; border-radius: 24px; box-shadow: 0 20px 60px rgb(23 50 77 / 12%); position: relative; z-index: 2; }
.login-card h1 { margin-bottom: 8px; font-size: 34px; }
.login-card > p { color: var(--muted); line-height: 1.7; }
.brand-kicker { color: #84600e; font-weight: 750; margin-bottom: 10px; }
.login-art { position: absolute; inset: 0; pointer-events: none; }
.login-star { position: absolute; width: 160px; height: 160px; left: calc(50% - 250px); top: calc(50% - 245px); fill: var(--gold); stroke: #fff4c8; stroke-width: 4; transform: rotate(-12deg); filter: drop-shadow(0 10px 0 rgb(155 103 16 / 14%)); }
.orbit { position: absolute; width: 18px; height: 18px; background: var(--gold); clip-path: polygon(50% 0,61% 35%,98% 36%,68% 58%,78% 94%,50% 73%,22% 94%,32% 58%,2% 36%,39% 35%); }
.orbit-one { left: 14%; top: 22%; transform: rotate(20deg); }
.orbit-two { right: 12%; bottom: 18%; width: 28px; height: 28px; }
.orbit-three { right: 20%; top: 12%; width: 12px; height: 12px; }
.form-error { min-height: 22px; margin-top: 14px; color: #b13c30; }

/* 应用框架 */
.app { min-height: 100dvh; padding-bottom: 88px; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; text-align: left; }
.brand > svg { width: 42px; height: 42px; fill: var(--gold); stroke: #e0a62b; stroke-width: 3; }
.brand strong { display: block; font-size: 18px; }
.brand small { display: block; margin-top: 2px; color: var(--mint); font-size: 11px; }
.header-metrics { display: flex; gap: 8px; }
.metric { min-width: 66px; padding: 5px 8px; border: 0; border-left: 1px solid var(--line); background: transparent; text-align: right; }
.metric span { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin-top: 2px; font-size: 20px; font-variant-numeric: tabular-nums; }
.time-metric strong { font-size: 16px; }
.main-nav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.nav-button { min-height: 56px; display: grid; place-items: center; gap: 1px; border: 0; border-radius: 12px; background: transparent; color: #64778a; font-size: 12px; font-weight: 700; }
.nav-button.active { background: #fff3c6; color: #6b4a0a; }
.nav-icon { height: 23px; font-size: 23px; line-height: 1; }
.nav-icon svg { width: 22px; height: 22px; }
.main-content { width: min(100%, 1240px); margin: 0 auto; padding: 16px 14px 36px; }
.view { animation: view-in .25s ease-out; }
@keyframes view-in { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 本周概览 */
.week-hero { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 8px 0 #e6eff4; overflow: hidden; position: relative; }
.week-hero::after { content: ""; position: absolute; width: 140px; height: 140px; right: -60px; top: -70px; border: 20px solid #fff1bc; border-radius: 50%; pointer-events: none; }
.week-hero h2 { margin-bottom: 6px; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.week-hero h2 small { margin-left: 8px; font-size: 16px; font-weight: 650; }
.week-hero p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.goal-medal { width: 82px; height: 96px; display: grid; place-items: center; align-content: center; position: relative; z-index: 1; }
.goal-medal svg { position: absolute; inset: 0; width: 82px; height: 82px; fill: var(--gold); stroke: #e9b637; stroke-width: 3; }
.goal-medal strong { position: relative; margin-top: 8px; font-size: 24px; }
.goal-medal span { margin-top: 8px; font-size: 11px; color: var(--muted); }
.week-progress-track { grid-column: 1 / -1; height: 12px; overflow: hidden; background: #eaf0f3; border-radius: 20px; }
.week-progress { width: 0; height: 100%; background: var(--gold); border-radius: inherit; transition: width .5s ease; }
.week-hero-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
#settle-countdown { font-variant-numeric: tabular-nums; color: #3e718f; }

/* 打卡：仅显示今天 */
.today-summary { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 11px; border: 1px solid #d7e5ec; border-radius: 10px; background: rgb(255 255 255 / 78%); color: #3e718f; font-size: 13px; font-weight: 750; }
.habit-grid { display: grid; gap: 12px; }
.habit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 13px; background: rgb(255 255 255 / 94%); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 0 rgb(220 231 239 / 65%); }
.habit-name { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 48px; font-weight: 750; line-height: 1.45; }
.habit-name svg { flex: 0 0 auto; width: 27px; height: 27px; fill: var(--gold); stroke: #d4a029; stroke-width: 3; }
.today-total { grid-column: 1; margin-top: -8px; padding-left: 37px; color: var(--muted); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.today-total.positive { color: var(--mint); }
.today-total.negative { color: var(--coral); }
.today-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 8px; }
.star-button { width: 46px; height: 46px; padding: 0; border: 0; border-radius: 12px; background: #edf5f8; color: #2a637e; font-size: 24px; font-weight: 800; }
.star-button.add { background: #fff3c8; color: #8c5c08; }
.star-button:active { transform: scale(.92); }

/* 记录 */
.records-list { display: grid; gap: 12px; }
.record-card { display: grid; grid-template-columns: 58px minmax(0, 1fr) 44px; gap: 12px; align-items: start; padding: 15px; background: rgb(255 255 255 / 96%); border: 1px solid var(--line); border-radius: 15px; }
.record-delta { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #fff2bd; color: #815509; font-size: 20px; font-weight: 850; }
.record-delta.negative { background: #fbe5e1; color: #ad4538; }
.record-title { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.record-title strong { line-height: 1.45; }
.record-time { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.record-note { margin: 7px 0 0; white-space: pre-wrap; line-height: 1.65; }
.record-meta { color: var(--muted); font-size: 12px; }
.record-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.record-images a { display: block; }
.record-images img { width: 82px; height: 82px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
.record-delete { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0 0 3px; border: 1px solid #edd8d4; border-radius: 50%; background: #fff7f5; color: #a6483d; font-size: 27px; line-height: 1; }
.record-delete:hover { background: #fbe5e1; }
.empty-state { padding: 40px 20px; background: #fff; border: 1px dashed #c9d8e2; border-radius: var(--radius); text-align: center; color: var(--muted); }

/* 结算和计时 */
.weekly-layout { display: grid; gap: 16px; }
.settlement-panel, .timer-panel, .history-panel, .settings-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.settlement-numbers { display: grid; grid-template-columns: 1fr 1fr; margin: 20px 0; border-block: 1px solid var(--line); }
.settlement-numbers > div { padding: 18px 10px; text-align: center; }
.settlement-numbers > div:first-child { border-right: 1px solid var(--line); }
.settlement-numbers strong { display: block; font-size: 34px; font-variant-numeric: tabular-nums; }
.settlement-numbers span { color: var(--muted); font-size: 12px; }
.timer-panel { text-align: center; background: #17324d; color: #fff; }
.timer-panel .section-label { color: #f7cf62; }
.timer-ring { width: 210px; height: 210px; display: grid; place-items: center; margin: 20px auto; border: 9px solid #38536c; border-top-color: var(--gold); border-radius: 50%; position: relative; }
.timer-ring.running { animation: timer-pulse 2s ease-in-out infinite; border-top-color: var(--gold); border-right-color: var(--gold); }
@keyframes timer-pulse { 50% { transform: scale(1.02); } }
.timer-ring strong { display: block; font-size: 32px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.timer-ring span { display: block; margin-top: 8px; color: #bcd0df; font-size: 12px; }
.timer-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.timer-actions .primary { background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 #9b6710; }
.manual-adjust { display: grid; grid-template-columns: minmax(70px, 1fr) auto auto; gap: 7px; margin-top: 18px; }
.manual-adjust input { background: #24435e; color: #fff; border-color: #4a647a; text-align: center; }
.history-panel { margin-top: 16px; }
.history-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.history-row strong { font-size: 17px; }
.history-row .history-reward { color: #7c550c; font-weight: 800; }
.history-row p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* 设置 */
.settings-grid { display: grid; gap: 14px; }
.settings-card > p { color: var(--muted); line-height: 1.7; }
.category-settings { margin-top: 14px; }
.category-edit-row { display: grid; grid-template-columns: 1fr 86px; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.category-edit-row label { margin: 0; font-size: 12px; }
.category-edit-row .category-edit-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.category-edit-actions button { min-height: 44px; }
.logout-button { width: 100%; margin-top: 22px; color: #a04035; background: #fff; border: 1px solid #eccdc8; }

/* 弹窗 */
.event-dialog { width: min(calc(100% - 24px), 560px); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 24px 90px rgb(0 0 0 / 28%); }
.event-dialog::backdrop { background: rgb(10 27 42 / 65%); }
.event-dialog form { padding: 22px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin-bottom: 4px; }
.close-button { flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #edf3f6; font-size: 28px; line-height: 1; }
.rule-hint { padding: 10px 12px; color: #76510b; background: #fff4cd; border-radius: 9px; font-size: 13px; }
.upload-field input { padding: 9px; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.upload-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

/* 游戏式动作动画：2.4秒 */
.star-animation { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgb(9 25 39 / 76%); }
.animation-stage { width: min(100%, 680px); aspect-ratio: 4 / 3; position: relative; overflow: hidden; border: 5px solid #fff2b7; border-radius: 24px; background: #fff5d8; box-shadow: 0 0 0 8px rgb(247 201 75 / 20%); animation: stage-enter 2.4s cubic-bezier(.22,1,.36,1) both; }
.animation-stage > img { width: 100%; height: 100%; object-fit: cover; animation: scene-action 2.4s cubic-bezier(.22,1,.36,1) both; }
@keyframes stage-enter { 0% { opacity: 0; transform: scale(.78) rotate(-1deg); } 9%, 89% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.03); } }
@keyframes scene-action { 0% { transform: scale(1.06) translateX(-1%); } 45% { transform: scale(1.03) translateX(1%); } 100% { transform: scale(1.04) translateX(0); } }
.scene-school-road > img { animation-name: school-walk; }
.scene-quiet > img { animation-name: quiet-focus; }
.scene-seat > img { animation-name: seat-raise; }
.scene-homework > img { animation-name: homework-handoff; }
.scene-praise > img { animation-name: praise-dip; }
.scene-criticism > img { animation-name: criticism-nod; }
.scene-exam > img { animation-name: exam-focus; }
@keyframes school-walk { 0% { transform: scale(1.07) translateX(-2%); } 30% { transform: scale(1.04) translateX(1%) translateY(-.5%); } 62% { transform: scale(1.05) translateX(2%) translateY(.4%); } 100% { transform: scale(1.04) translateX(1%); } }
@keyframes quiet-focus { 0% { transform: scale(1.08); } 45%, 100% { transform: scale(1.03); } }
@keyframes seat-raise { 0% { transform: scale(1.05) translateY(2%); } 45%, 80% { transform: scale(1.04) translateY(-1%); } 100% { transform: scale(1.04); } }
@keyframes homework-handoff { 0% { transform: scale(1.06) translateX(-2%); } 45%, 78% { transform: scale(1.04) translateX(1.5%); } 100% { transform: scale(1.04) translateX(1%); } }
@keyframes praise-dip { 0% { transform: scale(1.06) translateY(-1%); } 42%, 70% { transform: scale(1.04) translateY(1%); } 100% { transform: scale(1.04); } }
@keyframes criticism-nod { 0%, 25% { transform: scale(1.05) translateY(-.5%); } 48%, 68% { transform: scale(1.04) translateY(1%); } 100% { transform: scale(1.04); } }
@keyframes exam-focus { 0% { transform: scale(1.07) translateX(-1%); } 35% { transform: scale(1.04) translateX(.5%); } 65% { transform: scale(1.04) translateX(-.5%); } 100% { transform: scale(1.04); } }
.motion-prop { position: absolute; z-index: 3; width: 18%; pointer-events: none; filter: drop-shadow(0 8px 6px rgb(23 50 77 / 22%)); }
.motion-prop:empty { display: none; }
.motion-prop svg { display: block; width: 100%; height: auto; overflow: visible; }
.scene-school-road .motion-prop { left: 42%; top: 49%; width: 17%; animation: pencil-case-out 2.25s cubic-bezier(.22,1,.36,1) both; }
.scene-homework .motion-prop { left: 32%; top: 61%; width: 20%; animation: book-handoff 2.2s cubic-bezier(.22,1,.36,1) both; }
.scene-praise .motion-prop { left: 39%; top: 59%; width: 22%; animation: certificate-out 2.25s cubic-bezier(.22,1,.36,1) both; }
.scene-exam .motion-prop { left: 39%; top: 62%; width: 11%; animation: pencil-write 1.7s ease-in-out .2s both; }
.scene-star .motion-prop { left: 41%; top: 35%; width: 18%; animation: star-cheer 2.2s cubic-bezier(.22,1,.36,1) both; }
@keyframes pencil-case-out { 0%, 12% { opacity: 0; transform: translate(-28%,24%) scale(.45) rotate(12deg); } 24% { opacity: 1; } 58%, 84% { opacity: 1; transform: translate(125%,-75%) scale(1) rotate(-9deg); } 100% { opacity: 0; transform: translate(135%,-82%) scale(.96) rotate(-6deg); } }
@keyframes book-handoff { 0%, 12% { opacity: 0; transform: translate(-25%,12%) rotate(-5deg) scale(.8); } 25% { opacity: 1; } 58%, 84% { opacity: 1; transform: translate(105%,-8%) rotate(3deg) scale(1); } 100% { opacity: 0; transform: translate(112%,-10%) rotate(2deg); } }
@keyframes certificate-out { 0%, 12% { opacity: 0; transform: translate(-25%,10%) rotate(-8deg) scale(.75); } 25% { opacity: 1; } 56%, 82% { opacity: 1; transform: translate(58%,-24%) rotate(4deg) scale(1.06); } 100% { opacity: 0; transform: translate(60%,-28%) rotate(3deg); } }
@keyframes pencil-write { 0% { opacity: 0; transform: translate(-20%,-20%) rotate(-18deg); } 15% { opacity: 1; } 30% { transform: translate(12%,6%) rotate(-13deg); } 45% { transform: translate(-5%,14%) rotate(-18deg); } 60% { transform: translate(22%,22%) rotate(-12deg); } 78% { opacity: 1; transform: translate(4%,32%) rotate(-16deg); } 100% { opacity: 0; transform: translate(12%,36%) rotate(-14deg); } }
@keyframes star-cheer { 0% { opacity: 0; transform: scale(.2) rotate(-25deg); } 30%, 75% { opacity: 1; transform: scale(1.15) rotate(10deg); } 100% { opacity: 0; transform: scale(.9) rotate(25deg); } }
.animation-stars { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.burst-star { position: absolute; left: 50%; top: 54%; width: var(--size); height: var(--size); fill: #ffd84f; stroke: #fff5b5; stroke-width: 4; filter: drop-shadow(0 5px 3px rgb(116 72 0 / 30%)); animation: star-burst 2.05s cubic-bezier(.17,.84,.35,1) var(--delay) both; }
.burst-star.loss { fill: #9ba8b3; stroke: #e2e8ec; }
@keyframes star-burst { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.05) rotate(0); } 14% { opacity: 1; } 72% { opacity: 1; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.15) rotate(var(--r)); } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) - 20px)) scale(.8) rotate(var(--r)); } }
.animation-delta { position: absolute; z-index: 5; left: 50%; top: 14%; transform: translate(-50%,-50%); color: #fff9d7; font-size: clamp(48px, 12vw, 88px); font-weight: 950; text-shadow: 0 5px 0 #a56808, 0 8px 22px rgb(0 0 0 / 38%); animation: delta-pop 2.3s ease-out both; }
.animation-delta.loss { color: #e7edf1; text-shadow: 0 5px 0 #526673, 0 8px 22px rgb(0 0 0 / 38%); }
@keyframes delta-pop { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.2); } 18% { opacity: 1; transform: translate(-50%,-50%) scale(1.15); } 28%, 82% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-62%) scale(1); } }
.animation-caption { position: absolute; z-index: 6; left: 50%; bottom: 6%; transform: translateX(-50%); width: max-content; max-width: 90%; padding: 10px 18px; border-radius: 12px; background: rgb(23 50 77 / 88%); color: #fff; font-size: 18px; font-weight: 800; text-align: center; white-space: nowrap; animation: caption-in 2.3s ease both; }
@keyframes caption-in { 0%, 10% { opacity: 0; bottom: 0; } 24%, 86% { opacity: 1; bottom: 6%; } 100% { opacity: 0; } }
.motion-symbol { position: absolute; z-index: 7; right: 7%; top: 31%; display: grid; place-items: center; min-width: 68px; min-height: 68px; padding: 10px; border-radius: 50%; background: #fff; color: #8b5a08; font-size: 25px; font-weight: 900; box-shadow: 0 5px 0 #e2b23c; animation: symbol-motion 2.2s ease-out both; }
.scene-quiet .motion-symbol { left: 46%; right: auto; top: 35%; animation-name: quiet-gesture; }
.scene-seat .motion-symbol { left: 29%; right: auto; top: 48%; animation-name: hand-raise; }
.scene-criticism .motion-symbol { left: 37%; right: auto; top: 26%; animation-name: gentle-reminder; }
.scene-school-road .motion-symbol { right: 8%; top: 34%; }
@keyframes symbol-motion { 0%, 12% { opacity: 0; transform: translate(-35px,45px) rotate(-15deg) scale(.5); } 32%, 78% { opacity: 1; transform: translate(0) rotate(5deg) scale(1); } 100% { opacity: 0; transform: translate(15px,-15px) scale(.9); } }
@keyframes quiet-gesture { 0%, 12% { opacity: 0; transform: translateY(80px) scale(.6); } 34%, 78% { opacity: 1; transform: translateY(-35px) scale(1); } 100% { opacity: 0; transform: translateY(-42px) scale(.9); } }
@keyframes hand-raise { 0%, 10% { opacity: 0; transform: translate(20px,100px) rotate(18deg) scale(.65); } 38%, 78% { opacity: 1; transform: translate(-30px,-150px) rotate(-8deg) scale(1); } 100% { opacity: 0; transform: translate(-30px,-160px) rotate(-5deg); } }
@keyframes gentle-reminder { 0%, 15% { opacity: 0; transform: translateY(-12px) scale(.8); } 35%, 78% { opacity: 1; transform: translateY(12px) scale(1); } 100% { opacity: 0; transform: translateY(18px); } }
.toast { position: fixed; z-index: 150; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: #102a40; color: #fff; box-shadow: 0 8px 24px rgb(0 0 0 / 20%); text-align: center; }

@media (min-width: 700px) {
  .app { padding-bottom: 0; }
  .app-header { padding-inline: 28px; }
  .main-nav { position: sticky; top: 69px; bottom: auto; width: min(calc(100% - 28px), 760px); margin: 14px auto 0; padding: 6px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 0 #e5edf2; }
  .nav-button { display: flex; justify-content: center; gap: 8px; min-height: 46px; font-size: 14px; }
  .main-content { padding: 22px 24px 48px; }
  .week-hero { padding: 28px; }
  .habit-row { grid-template-columns: minmax(0, 1fr) 110px auto; padding: 12px 16px; }
  .habit-name { padding: 0; }
  .today-total { grid-column: 2; grid-row: 1; margin: 0; padding: 0; text-align: right; }
  .today-actions { grid-column: 3; grid-row: 1; }
  .star-button { width: 48px; height: 48px; }
  .weekly-layout { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .category-edit-row { grid-template-columns: minmax(200px, 1fr) 120px auto; align-items: end; }
  .category-edit-row .category-edit-actions { grid-column: auto; }
  .record-card { grid-template-columns: 64px minmax(0, 1fr) 44px; padding: 18px; }
  .toast { bottom: 28px; }
}
@media (min-width: 1080px) {
  .app-header { padding-inline: max(32px, calc((100vw - 1180px)/2)); }
  .week-hero { grid-template-columns: 1fr 120px; padding: 30px 36px; }
  .goal-medal { width: 100px; }
  .goal-medal svg { width: 100px; height: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
