:root {
  color-scheme: light;
  --paper: #faf8f2;
  --white: #fffefa;
  --ink: #29231b;
  --muted: #746b5d;
  --border: #ebe5d8;
  --yellow: #ffd66b;
  --yellow-hover: #ffc94d;
  --gold: #a76513;
  --green: #47784c;
  --radius: 22px;
  font-family: "DM Sans", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #b57c23; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(30px, 4.2vw, 42px); line-height: 1.2; letter-spacing: -.055em; }
h2 { font-size: 22px; line-height: 1.25; letter-spacing: -.035em; }
h3 { font-size: 18px; line-height: 1.35; }
p { line-height: 1.6; }
.wrap { width: min(1140px, calc(100% - 72px)); margin-inline: auto; }
.topbar { background: #fffefb; border-bottom: 1px solid var(--border); }
.top-inner { min-height: 74px; display: flex; align-items: center; gap: 38px; }
.top-inner nav { display: flex; align-items: center; gap: 5px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; font-size: 19px; white-space: nowrap; letter-spacing: -.035em; }
.brand-logo { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 13px; background: #ffebbb; overflow: hidden; }
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.admin-link { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-inline-start: 2px; border-radius: 10px; border: 1px solid #f4dfbc; background: #fff4dd; text-decoration: none; font-size: 18px; line-height: 1; }
.admin-link:hover { background: #ffe7b1; }
.nav-btn { border: 0; border-radius: 9px; padding: 9px 13px; white-space: nowrap; background: transparent; font-size: 14px; font-weight: 700; color: #6b6154; }
.nav-btn.current, .nav-btn:hover { background: #fff1cb; color: #684711; }
.profile { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.profile-btn { display: flex; align-items: center; gap: 7px; background: transparent; border: 0; padding: 3px; font-weight: 700; white-space: nowrap; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #f7df9a url('/images/bird.jpg') 53% 22% / 210% auto no-repeat; }
.admin-avatar { background: #fbe7aa; color: #79551f; font-size: 13px; }
.chevron { color: var(--muted); }
.btn { border: 1px solid transparent; border-radius: 10px; min-height: 39px; padding: 8px 15px; font-size: 13px; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.35; text-align: center; }
.primary { background: var(--yellow); color: #493514; }
.primary:hover { background: var(--yellow-hover); }
.secondary { background: var(--white); border-color: #e9e1d0; }
.secondary:hover { background: #fff5d8; border-color: #ebd6a4; }
.quiet { background: transparent; border-color: transparent; color: #74624b; }
.quiet:hover { background: #f4eddf; }
.demo-switch { background: #f6f0e4; padding-inline: 11px; min-height: 32px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 34px 0 23px; }
.page-intro p { margin-top: 9px; color: var(--muted); font-size: 15px; }
.date-tag { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 10px; color: #6d614f; font-size: 13px; font-weight: 650; background: #f2eee3; white-space: nowrap; }
.icon { line-height: 1; display: inline-block; }
.gold { color: #ab6a14; }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 2px 7px #4a361107; }
.dashboard { display: grid; grid-template-columns: 1.28fr 1fr; gap: 20px; }
.wallet { position: relative; isolation: isolate; overflow: hidden; background: #f9e9ae; border-color: #efdca6; display: flex; align-items: center; min-height: 264px; }
.wallet-art { z-index: -1; position: absolute; inset: 0 0 0 35%; background: url('/images/bird.jpg') center right / cover no-repeat; mask-image: linear-gradient(90deg, transparent 0%, #000 25%); }
.wallet-copy { padding: 25px 28px; }
.wallet-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; background: #fffbecb8; color: #624717; border: 1px solid #fff7de; padding: 6px 11px; border-radius: 999px; }
.balance { font-size: clamp(48px, 6.4vw, 75px); font-weight: 850; line-height: 1.05; letter-spacing: -.075em; font-variant-numeric: tabular-nums; margin-top: 12px; }
.balance span { font-size: 17px; font-weight: 750; color: #60461e; letter-spacing: 0; }
.wallet p { color: #70562d; font-size: 13px; margin-top: 4px; }
.wallet-btn { margin-top: 16px; background: #fff8df; border-color: #efdaa5; min-height: 34px; color: #664715; }
.wallet-btn:hover { background: white; }
.checkin { padding: 21px 24px 16px; }
.check-top, .section-head, .gift-bottom, .admin-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.inline-title { display: flex; align-items: center; gap: 11px; }
.inline-title p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile-icon { width: 41px; height: 41px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; font-size: 24px; font-weight: 800; }
.calendar, .gift-icon { background: #fff0c9; color: #9b631c; }
.gift-icon { background: #f5e8c9; }
.task-icon { color: #49724a; background: #e8f1df; }
.small-pill { display: inline-block; flex-shrink: 0; white-space: nowrap; border-radius: 999px; padding: 5px 9px; background: #fff2cf; color: #835713; font-size: 12px; font-weight: 760; }
.small-pill.muted { background: #f0ece3; color: var(--muted); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin: 17px 0 14px; }
.day { padding: 6px 0 7px; min-width: 0; text-align: center; border-radius: 10px; background: #f6f3eb; border: 1px solid transparent; color: #766f63; }
.day span, .day b { display: block; }
.day span { font-size: 11px; }
.day b { margin-top: 4px; font-size: 15px; }
.day.today { border-color: #eed18c; background: #fff6dd; color: #7c5418; }
.day.checked { background: #eaf2e4; color: #437347; }
.sign-btn, .signed { width: 100%; }
.signed { color: #41714a; background: #eaf2e4; }
.milestone { text-align: center; margin-top: 9px; color: #716554; font-size: 12px; }
.milestone strong { color: #895a19; }
.milestone .text-button { margin-inline-start: 5px; }
.text-button { min-height: 0; padding: 2px 1px; border: 0; background: transparent; color: #805118; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: #50340f; }
.store { margin-top: 30px; }
.section-head h2 { font-size: 24px; }
.sort select { width: 130px; border-radius: 10px; background: var(--white); border: 1px solid var(--border); padding: 8px; font-size: 13px; color: #655b4d; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0 14px; }
.chip { background: var(--white); border: 1px solid var(--border); padding: 6px 14px; border-radius: 999px; color: #62594b; font-size: 13px; font-weight: 690; }
.chip.selected, .chip:hover { background: #ffedbd; color: #624116; border-color: #f3d78f; }
.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px; }
.gift { overflow: hidden; display: flex; flex-direction: column; }
.gift-media { position: relative; aspect-ratio: 1.95; overflow: hidden; background: #f2ede1; }
.gift-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 49%; }
.category { position: absolute; top: 11px; left: 11px; background: #fffdf6e8; padding: 4px 9px; font-size: 11px; font-weight: 760; color: #67523a; border-radius: 7px; }
.gift-content { flex: 1; padding: 14px 16px 15px; display: flex; flex-direction: column; }
.gift-content h3 { overflow-wrap: anywhere; }
.gift-content p { font-size: 13px; color: var(--muted); min-height: 23px; margin: 3px 0 10px; overflow-wrap: anywhere; }
.gift-rule { color: #805118; font-size: 12px; line-height: 1.5; margin-bottom: 6px; }
.gift-bottom { padding-top: 10px; border-top: 1px solid #f0ebe1; margin-top: auto; }
.price { color: #885912; white-space: nowrap; font-weight: 760; font-size: 15px; }
.price strong { font-size: 19px; }
.price small { font-size: 11px; }
.redeem-btn { min-height: 33px; padding: 5px 11px; }
.unavailable { background: #f1ede4; color: #786e5d; min-height: 33px; padding: 5px 9px; }
.footer { padding: 27px 0 24px; font-size: 12px; color: var(--muted); }
.footer-star { color: #b27820; }
.blank, .placeholder { border: 1px dashed #e5dbc7; border-radius: 14px; padding: 22px; color: var(--muted); background: #fcfaf5; }
.placeholder { margin-top: 28px; }
.setup-callout { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; margin-bottom: 19px; }
.setup-callout p { margin-top: 5px; font-size: 14px; color: var(--muted); }
.task-list { display: grid; gap: 14px; }
.task-filters { margin-top: 0; }
.task-card { padding: 19px; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 14px; }
.task-card p { font-size: 14px; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.task-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.task-reward { display: flex; align-items: center; gap: 9px; width: fit-content; max-width: 100%; border-radius: 10px; background: #fff4d8; color: #734b17; margin-top: 10px; padding: 6px 10px; font-size: 13px; font-weight: 740; overflow-wrap: anywhere; }
.reward-thumb { width: 68px; height: 49px; object-fit: cover; border-radius: 7px; flex: 0 0 auto; }
.past-tasks { margin-top: 18px; }
.task-action { align-self: center; }
.history-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; align-items: start; }
.history, .admin-panel { padding: 20px; min-width: 0; }
.history h2 { margin-bottom: 12px; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 12px 0; min-height: 55px; border-bottom: 1px solid #f0ebe1; }
.item:last-child { border-bottom: 0; }
.item strong { overflow-wrap: anywhere; }
.item small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.item-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.plus { color: var(--green); }
.admin-grid { display: grid; grid-template-columns: 190px 1fr; gap: 18px; align-items: start; }
.admin-nav { display: grid; padding: 9px; gap: 3px; }
.admin-nav button { text-align: left; border: 0; background: transparent; border-radius: 9px; font-size: 14px; padding: 11px 12px; color: var(--muted); }
.admin-nav button.active, .admin-nav button:hover { background: #fff0c7; color: #684512; font-weight: 750; }
.admin-heading { margin-bottom: 14px; }
.admin-heading p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.admin-heading .btn { flex-shrink: 0; }
.admin-gift { display: flex; align-items: center; gap: 10px; }
.admin-gift img, .edit-thumb { width: 65px; height: 45px; object-fit: cover; border-radius: 8px; }
.subheading { margin: 20px 0 10px; }
.invite-code { font-size: 15px; font-weight: 750; letter-spacing: .06em; overflow-wrap: anywhere; user-select: all; }
dialog { border: 1px solid var(--border); border-radius: 19px; background: var(--white); color: var(--ink); padding: 0; width: min(460px, calc(100% - 26px)); max-height: calc(100% - 34px); box-shadow: 0 16px 65px #44331c45; }
dialog::backdrop { background: #29221879; }
.dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 15px 19px; }
.dialog-head { border-bottom: 1px solid var(--border); }
.dialog-foot { justify-content: flex-end; border-top: 1px solid var(--border); }
.close { border: 0; background: #f4eee2; border-radius: 8px; width: 32px; height: 32px; font-size: 23px; line-height: 1; }
.dialog-body { display: grid; gap: 11px; padding: 17px 19px; }
.field { display: grid; gap: 5px; font-size: 13px; font-weight: 700; min-width: 0; }
.field input, .field textarea, .field select { border: 1px solid #e6decc; border-radius: 8px; padding: 8px; background: #fffefa; color: var(--ink); min-width: 0; width: 100%; }
.field textarea { min-height: 75px; resize: vertical; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tick { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.tick input { accent-color: #b57c23; }
.task-window, .reward-fields, .redemption-window { min-width: 0; padding: 0; margin: 0; border: 0; display: grid; gap: 10px; }
.reward-fields { border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px 12px; background: #fbf8ef; }
.reward-fields legend { padding: 0 4px; font-size: 14px; font-weight: 750; }
.reward-fields p, .field-hint, .auth-switch { color: var(--muted); font-size: 13px; }
.auth-switch .text-button { margin-inline-start: 4px; }
.reward-preview { width: min(200px,100%); max-height: 140px; object-fit: contain; justify-self: start; border-radius: 8px; background: #eee8dc; }
.form-error { color: #a03124; padding: 0 19px 12px; font-size: 13px; }
.form-error:empty { display: none; }
.toast { position: fixed; z-index: 5; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); width: max-content; padding: 12px 18px; border-radius: 12px; color: white; background: #373022; box-shadow: 0 5px 15px #30261333; font-size: 14px; }
.toast.error { background: #852f24; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 890px) {
  .wrap { width: calc(100% - 40px); }
  .top-inner { gap: 15px; }
  .wallet-art { inset-inline-start: 33%; opacity: .82; }
  .checkin { padding-inline: 16px; }
  .week { gap: 4px; }
  .gift-grid { gap: 12px; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 30px); }
  .top-inner { flex-wrap: wrap; row-gap: 7px; padding: 10px 0 8px; }
  .top-inner nav { order: 3; flex-basis: 100%; }
  .profile { gap: 4px; }
  .brand { font-size: 15px; gap: 6px; }
  .brand-logo { width: 29px; height: 29px; border-radius: 9px; }
  .admin-link { width: 30px; height: 30px; font-size: 16px; }
  .avatar { width: 26px; height: 26px; }
  .profile-btn, .demo-switch { font-size: 11px; }
  .nav-btn { padding: 7px 9px; font-size: 13px; }
  .page-intro { margin-top: 24px; align-items: start; }
  .page-intro p { font-size: 13px; }
  .date-tag { font-size: 10px; padding: 6px; }
  .dashboard, .history-grid, .admin-grid { grid-template-columns: 1fr; gap: 13px; }
  .wallet { min-height: 218px; }
  .wallet-art { opacity: 1; }
  .wallet-copy { padding: 17px 18px; }
  .gift-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gift-media { aspect-ratio: 1.48; }
  .gift-content { padding: 10px; }
  .gift-bottom { flex-wrap: wrap; gap: 6px; }
  .gift-bottom .btn { font-size: 12px; }
  .admin-nav { display: flex; overflow: auto; }
  .admin-nav button { white-space: nowrap; }
  .task-card { grid-template-columns: auto 1fr; }
  .task-action { grid-column: 2; }
}
@media (max-width: 360px) {
  .date-tag { display: none; }
  .gift-grid { grid-template-columns: 1fr; }
  .gift-media { aspect-ratio: 1.95; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .15s, border-color .15s; }
}
