:root {
  color-scheme: light;
  --paper: #fff9f4;
  --card: #fffdfb;
  --ink: #392c36;
  --muted: #725e69;
  --line: #eedfdc;
  --rose: #a53a62;
  --deep-rose: #86294b;
  --rose-wash: #fce6ed;
  --gold: #f9ca58;
  --green: #316c55;
  --green-wash: #e4f3ea;
  --shadow: 0 4px 0 #efdedb;
  font-family: "Nunito", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.55; }
button, input, textarea, select { font: inherit; }
button {
  cursor: pointer; background: transparent; color: inherit; border: 0; font-weight: 700;
  min-height: 44px; touch-action: manipulation;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--deep-rose); outline-offset: 3px;
}
main:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.26; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }

.shell, .top-inner { width: min(1140px, calc(100% - 80px)); margin-inline: auto; }
.topbar { background: #fffcf8; border-bottom: 1px solid var(--line); }
.top-inner {
  min-height: 78px; display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 22px; align-items: center; padding-block: 9px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; padding: 0; justify-self: start; text-align: left; }
.brand span { font-size: 21px; font-weight: 850; letter-spacing: .02em; line-height: 1.18; }
.brand small { display: block; padding-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--muted); }
.tabs, .admin-tabs { display: flex; gap: 5px; }
.tabs button, .account, .admin-tabs button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 13px; border-radius: 13px; white-space: nowrap; font-size: 14px;
}
.tabs .icon, .account .icon { width: 17px; height: 17px; }
.tabs button { color: var(--muted); }
.tabs button:hover, .admin-tabs button:hover { background: #faefeb; }
.tabs button[aria-current], .admin-tabs button[aria-current] { color: var(--deep-rose); background: var(--rose-wash); }
.account { grid-column: 3; justify-self: end; border: 1px solid var(--line); background: var(--card); }
.account:hover { background: var(--rose-wash); }

main.shell { padding-top: 37px; padding-bottom: 15px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 28px; margin-bottom: 23px; }
.intro h1, .login-panel h1 { font-size: clamp(32px, 4vw, 47px); font-weight: 850; letter-spacing: -.045em; }
.intro p { margin-top: 9px; color: var(--muted); }
.today, .point-chip {
  display: inline-flex; align-items: center; gap: 6px; align-self: center; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 100px; background: var(--card);
  padding: 7px 13px; color: var(--muted); font-weight: 700; font-size: 14px;
}
.today .icon, .point-chip .icon { width: 16px; height: 16px; }
.point-chip { color: var(--deep-rose); background: #ffedf3; }
.point-chip .icon, .hero-label .icon, .price .icon { fill: var(--gold); color: #83571c; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.82fr) minmax(0, 1fr); gap: 20px; }
.hero, .goal { min-height: 281px; border-radius: 27px; }
.hero {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center;
  padding: 24px 31px; background: linear-gradient(116deg, #f9cad8 7%, #ffe2e0 92%);
  border: 1px solid #ecc3cf; box-shadow: 0 4px 0 #f0d4d8;
}
.hero::after {
  position: absolute; z-index: -2; content: ""; right: -8%; top: -39%; width: 59%; aspect-ratio: 1;
  border-radius: 50%; background: #fff6df59; border: 24px solid #fff3ed55;
}
.hero-bunny {
  position: absolute; right: 1%; bottom: 0; z-index: -1; width: 53%; height: calc(100% - 18px);
  object-fit: contain; object-position: center bottom; padding-bottom: 6px;
  filter: drop-shadow(0 10px 14px #ac4a4f21);
}
.hero-content { max-width: 56%; }
.hero-label, .price {
  display: inline-flex; gap: 6px; align-items: center; border-radius: 100px;
  background: #fffaf2; color: #69394d; border: 1px solid #fffdf9; padding: 4px 10px;
  font-weight: 800; font-size: 14px; white-space: nowrap;
}
.hero-label .icon, .price .icon { width: 17px; height: 17px; }
.score { display: flex; align-items: baseline; gap: 7px; color: #692941; line-height: 1.14; }
.score strong { font-size: clamp(54px, 6.5vw, 86px); font-weight: 900; letter-spacing: -.065em; overflow-wrap: anywhere; }
.score span { font-size: 21px; font-weight: 800; flex: 0 0 auto; }
.hero p { color: #6f4558; line-height: 1.45; margin: 6px 0 17px; }
.primary, .secondary, .quiet, .text-button, .log, .danger, .icon-button, .redeem {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 12px; padding: 8px 14px;
}
.primary { background: var(--rose); color: white; box-shadow: 0 3px 0 var(--deep-rose); }
.primary:hover { background: var(--deep-rose); }
.primary .icon, .text-button .icon { width: 17px; height: 17px; }
.secondary { background: var(--rose-wash); color: var(--deep-rose); border: 1px solid #f3ccda; }
.secondary:hover, .quiet:hover { background: #f4dce5; }
.quiet { background: #f8efec; color: var(--ink); }
.text-button { color: var(--deep-rose); margin-right: -9px; }
.text-button:hover { background: var(--rose-wash); }

.goal {
  display: flex; flex-direction: column; gap: 19px; justify-content: center;
  padding: 24px 27px; background: #fff4d9; border: 1px solid #eedcb7; box-shadow: 0 4px 0 #efe1cc;
}
.goal-label { display: flex; gap: 10px; align-items: center; }
.goal-icon {
  width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px;
  background: #ffe5a5; color: #815326; border: 1px solid #f3d38c; flex: 0 0 auto;
}
.goal-label h2 { font-size: 17px; color: #6c4c31; flex: 1; }
.goal-choice {
  padding-inline: 10px; white-space: nowrap; font-size: 14px;
  color: #744b24; background: #fffbef; border: 1px solid #e8d39e;
}
.goal-choice:hover { background: #ffe9b5; }
.goal-info h3 { font-size: clamp(23px, 2.4vw, 29px); }
.goal-info p { margin-top: 6px; color: #6d5642; }
.goal-info strong { color: #8e4e2b; }
.goal-progress { color: #775b3f; font-size: 14px; }
.goal-progress div { margin-top: 6px; text-align: right; }
.goal-progress progress {
  appearance: none; display: block; width: 100%; height: 12px; border: none; border-radius: 30px;
  background: #f1e1bc; overflow: hidden;
}
progress::-webkit-progress-bar { background: #f1e1bc; border-radius: 30px; }
progress::-webkit-progress-value { background: #e9a642; border-radius: 30px; }
progress::-moz-progress-bar { background: #e9a642; border-radius: 30px; }

.block { margin-top: 28px; }
.section-title, .admin-intro {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px;
}
.section-title h2, .admin-intro h2 { font-size: clamp(20px, 2.6vw, 26px); font-weight: 820; letter-spacing: -.025em; }
.reward-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.reward {
  border-radius: 21px; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
  --art: #f9dce8; --bubble: #fff2f7; --drawing: #913a61;
}
.reward.movie { --art: #e9e2f7; --bubble: #f8f2ff; --drawing: #694987; }
.reward.outing { --art: #daeee3; --bubble: #f2fff8; --drawing: #386952; }
.reward-art {
  position: relative; display: grid; place-items: center; min-height: 105px; isolation: isolate;
  border-bottom: 1px solid var(--line); background: var(--art); color: var(--drawing); overflow: hidden;
}
.reward-art::before, .reward-art::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; background: #ffffff3b;
}
.reward-art::before { width: 130px; height: 130px; top: 28px; left: -28px; }
.reward-art::after { width: 130px; height: 130px; top: -74px; right: -12px; }
.art-bubble {
  width: 61px; height: 61px; display: grid; place-items: center; border-radius: 22px;
  background: var(--bubble); box-shadow: 0 4px 0 #35284a17, inset 0 1px 0 white;
  border: 1px solid #ffffffd6; transform: rotate(-8deg);
}
.movie .art-bubble { transform: rotate(8deg); }
.art-bubble .icon { width: 34px; height: 34px; }
.art-left, .art-right { position: absolute; width: 15px; height: 15px; opacity: .65; fill: currentColor; stroke-width: 0; }
.art-left { left: calc(50% - 60px); bottom: 25%; }
.art-right { left: calc(50% + 43px); top: 23%; width: 11px; height: 11px; }
.price { position: absolute; top: 9px; right: 10px; font-size: 12px; padding: 3px 7px; gap: 4px; }
.price .icon { width: 14px; height: 14px; }
.reward-body { display: flex; flex-direction: column; flex: 1; padding: 15px; }
.reward h3 { font-size: 19px; }
.reward p { color: var(--muted); margin: 5px 0 13px; min-height: 1.5em; overflow-wrap: anywhere; }
.redeem { margin-top: auto; color: var(--deep-rose); background: var(--rose-wash); justify-content: space-between; }
.redeem:hover:not(:disabled) { background: #f6d1de; }
.redeem:disabled { background: #f8f1ed; color: #72616c; justify-content: center; }
.redeem .icon { width: 16px; height: 16px; }

.list, .empty, .profile { background: var(--card); border: 1px solid var(--line); border-radius: 17px; }
.list { list-style: none; padding: 0; margin: 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: 11px; padding: 12px 15px; min-height: 62px; }
.row + .row { border-top: 1px solid var(--line); }
.row-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; }
.row-icon.plus, .log.positive { color: var(--green); background: var(--green-wash); }
.row-icon.minus, .log.negative { color: var(--deep-rose); background: var(--rose-wash); }
.row-icon.gift { color: #76558c; background: #f0e8fa; }
.row-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-title strong { display: block; font-size: 15px; }
.row-title small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.number { font-weight: 800; white-space: nowrap; }
.positive { color: var(--green); }
.negative { color: var(--deep-rose); }
.row-actions { display: flex; gap: 7px; }
.row-actions button { padding-inline: 11px; }
.row .quiet, .log { white-space: nowrap; }
.status { font-size: 13px; font-weight: 800; white-space: nowrap; padding: 5px 9px; border-radius: 20px; }
.status.pending { background: #fff0c9; color: #6e4c1b; }
.status.approved { background: var(--green-wash); color: var(--green); }
.status.declined { background: #f6e8ef; color: var(--deep-rose); }
.help { color: var(--muted); margin-bottom: 12px; font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 24px 12px; }
.empty button { margin-top: 10px; }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; align-items: start; }
.rule-grid .block { margin-top: 6px; }
.admin-tabs { border-bottom: 1px solid var(--line); margin-bottom: 21px; padding-bottom: 8px; flex-wrap: wrap; }
.admin-tabs button { gap: 6px; }
.count { border-radius: 20px; min-width: 20px; text-align: center; padding-inline: 3px; background: var(--deep-rose); color: white; }
.profile { justify-content: space-between; }
.loading, .footer { color: var(--muted); text-align: center; }
.footer { font-size: 13px; padding: 20px 0 27px; }
.footer:empty { padding: 10px 0; }

.login-panel {
  margin: clamp(12px, 5vw, 54px) auto; max-width: 780px; padding: 30px;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 30px;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); border-radius: 28px;
}
.login-panel img { width: 100%; height: auto; }
.login-panel h1 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 13px; }
.login-roles { display: flex; gap: 8px; margin-bottom: 16px; }
.login-roles [aria-pressed="true"] { color: var(--deep-rose); background: var(--rose-wash); box-shadow: inset 0 0 0 1px #e9bfd0; }
#login-form { display: grid; gap: 7px; justify-items: start; }
#login-form button { margin-top: 6px; }
dialog {
  background: var(--card); color: var(--ink); padding: 22px; border: 1px solid var(--line); border-radius: 22px;
  width: min(440px, calc(100% - 30px)); box-shadow: 0 25px 100px #3a1c3360;
  max-height: calc(100vh - 35px); max-height: calc(100dvh - 35px);
}
dialog::backdrop { background: #36202e79; }
.dialog-head, .dialog-actions { display: flex; align-items: center; gap: 9px; }
.dialog-head { justify-content: space-between; margin-bottom: 13px; }
.dialog-head h2 { font-size: 23px; }
.dialog-actions { justify-content: flex-end; margin-top: 17px; }
.dialog-note { color: var(--muted); }
.icon-button { width: 44px; padding: 0; }
.icon-button:hover { background: var(--rose-wash); }
.danger { margin-right: auto; color: var(--deep-rose); }
.danger:hover { background: var(--rose-wash); }
.fields { display: grid; gap: 6px; }
.fields label:not(:first-child) { margin-top: 4px; }
label { font-weight: 750; font-size: 14px; }
input, textarea, select {
  width: 100%; color: var(--ink); background: white; border: 1px solid #d4b9c6; padding: 8px 11px;
  min-height: 44px; border-radius: 10px;
}
textarea { resize: vertical; }
.fields .help { margin: 0; }
.form-error { margin-top: 8px; color: var(--deep-rose); }
.toast {
  position: fixed; z-index: 3; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 28px); border: 1px solid #d2e3d7;
  background: #f1fcf5; color: #275943; border-radius: 16px; padding: 10px 20px;
  font-weight: 750; box-shadow: 0 4px 25px #392c3626;
}
.toast.error { background: #ffedf1; color: var(--deep-rose); border-color: #f1d5dd; }

@media (max-width: 910px) {
  .shell, .top-inner { width: calc(100% - 40px); }
  .top-inner { gap: 10px; }
  .tabs button, .account { padding-inline: 10px; }
  .hero, .goal { padding: 20px; }
  .hero-grid { gap: 14px; }
  .hero-bunny { right: 0; width: 50%; }
}
@media (min-width: 701px) and (max-width: 910px) {
  .hero-grid { grid-template-columns: minmax(0, 1.52fr) minmax(0, 1fr); }
}
@media (pointer: coarse) and (min-width: 701px) {
  .tabs button, .account, .admin-tabs button, .hero .primary, .goal-choice,
  .redeem, .row-actions button, .log, .dialog-actions button { min-height: 48px; }
}
@media (pointer: coarse) and (min-width: 911px) and (max-height: 850px) and (orientation: landscape) {
  main.shell { padding-top: 20px; }
  .intro { margin-bottom: 17px; }
  .intro h1 { font-size: 39px; }
  .hero, .goal { min-height: 232px; padding-block: 13px; }
  .score strong { font-size: 68px; }
  .block { margin-top: 18px; }
  .reward-art { min-height: 86px; }
}
@media (max-width: 700px) {
  .shell, .top-inner { width: calc(100% - 32px); }
  .top-inner { min-height: 67px; grid-template-columns: 1fr auto; gap: 6px 10px; }
  .brand span { font-size: 19px; }
  .brand img { width: 40px; height: 40px; }
  .account { grid-column: 2; grid-row: 1; }
  .tabs { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(4, 1fr); }
  .tabs button { padding-inline: 4px; font-size: 13px; gap: 4px; }
  .tabs .icon { width: 14px; height: 14px; }
  main.shell { padding-top: 23px; }
  .intro { margin-bottom: 17px; flex-wrap: wrap; }
  .intro p { margin-top: 5px; }
  .intro h1 { font-size: clamp(29px, 7vw, 41px); }
  .today { display: none; }
  .hero-grid, .rule-grid { grid-template-columns: 1fr; }
  .hero { min-height: 253px; padding: 17px; }
  .hero-content { max-width: 57%; }
  .hero-content p { font-size: 14px; }
  .hero-bunny { width: 54%; right: -3%; bottom: 10px; }
  .hero-content .primary { padding-inline: 10px; font-size: 14px; }
  .goal { min-height: 0; padding: 15px 17px; gap: 10px; }
  .goal-label h2 { font-size: 15px; }
  .goal-icon { width: 32px; height: 32px; border-radius: 11px; }
  .goal-icon .icon { width: 17px; height: 17px; }
  .goal-info h3 { font-size: 22px; }
  .goal-info p { margin-top: 3px; font-size: 15px; }
  .reward-grid { gap: 12px; }
  .reward-body { padding: 12px; }
  .reward-body p { font-size: 14px; }
  .reward-body h3 { font-size: 17px; }
  .row { padding: 10px 11px; gap: 8px; }
  .row-title small { font-size: 12px; }
  .login-panel { gap: 11px; padding: 18px; }
}
@media (max-width: 510px) {
  .reward-grid { grid-template-columns: 1fr; }
  .reward { display: grid; grid-template-columns: 106px minmax(0, 1fr); border-radius: 16px; }
  .reward-art { border-right: 1px solid var(--line); border-bottom: 0; padding-top: 19px; }
  .art-left { left: 9px; bottom: 15%; }
  .art-right { left: auto; right: 10px; top: 30%; }
  .art-bubble { width: 51px; height: 51px; border-radius: 18px; }
  .art-bubble .icon { width: 29px; height: 29px; }
  .price { top: 7px; right: 50%; transform: translateX(50%); }
  .redeem { font-size: 14px; }
  .login-panel { grid-template-columns: 1fr; justify-items: center; }
  .login-panel img { max-width: 170px; }
  .login-panel > div { width: 100%; }
  .admin-tabs button, .row .quiet, .row .log { font-size: 14px; }
  .admin-tabs button { padding-inline: 8px; gap: 4px; }
}
@media (max-width: 355px) {
  .tabs .icon, .account .icon { display: none; }
  .hero-bunny { width: 50%; }
  .row-icon { display: none; }
  .row-actions { flex-wrap: wrap; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
