:root {
  color-scheme: light;
  --bg: #f5e0be;
  --accent: #4d627e;
  --ink: #3e302b;
  --ink-2: #6b574b;
  --ink-3: #9a8577;
  --rest: #7e3f33;
  --rest-mark: #783222;
  --work: #54406a;
  --fest: #763729;
  --term: #315447;
  --west: #573767;
  --paper: #fffaf1;
  --line: rgba(62, 48, 43, .14);
  --glass: rgba(255, 250, 241, .62);
  --shadow: 0 18px 50px -18px rgba(62, 40, 25, .35), 0 4px 14px -6px rgba(62, 40, 25, .18);
  --f-num: "Fredoka", "Avenir Next", system-ui, sans-serif;
  --f-cute: "ZCOOL KuaiLe", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabs-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  overflow-x: hidden;
  transition: background-color .6s ease;
}
/* paper grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .28 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

#bgblur { display: none; }
#app { position: relative; z-index: 1; padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 28px); }

/* ---------- page transitions ---------- */
.page { animation: pageIn .55s cubic-bezier(.2,.7,.2,1) both; }
.page.from-left { animation-name: pageInL; }
.page.from-right { animation-name: pageInR; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes pageInL { from { opacity: 0; transform: translateX(-26px); } }
@keyframes pageInR { from { opacity: 0; transform: translateX(26px); } }
@media (prefers-reduced-motion: reduce) {
  .page, .sheet-anim, .d { animation: none !important; transition: none !important; }
}

/* ---------- art hero (mobile) ---------- */
.stage { position: relative; }
.art {
  position: relative; margin: 0; overflow: hidden;
  aspect-ratio: 1 / .9;
  max-height: 58vh;
  width: 100%;
}
.art img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 0% 50%;
  animation: artIn 1.1s ease both;
}
@keyframes artIn { from { opacity: 0; transform: scale(1.04); } }
.art::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--bg) 70%, transparent) 55%, var(--bg));
}
.topbar {
  position: absolute; z-index: 3; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 0;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 18px -10px rgba(60,40,20,.5);
  font-family: var(--f-cute); font-size: 14px; color: var(--ink);
}
.chip img { height: 18px; width: auto; }
.chip.icon { width: 34px; padding: 0; justify-content: center; }
.chip svg { width: 18px; height: 18px; }

/* ---------- month header ---------- */
.mhead {
  position: relative; z-index: 2;
  display: flex; align-items: flex-end; gap: 14px;
  margin: -78px 20px 0;
}
.mnum {
  font-family: var(--f-num); font-weight: 500; color: var(--accent);
  font-size: 84px; line-height: .8; letter-spacing: -.02em;
  text-shadow: 0 2px 0 rgba(255,255,255,.35);
}
.mtext { padding-bottom: 2px; min-width: 0; }
.men { font-size: 11px; letter-spacing: .22em; color: var(--accent); font-weight: 600; }
.mtitle { margin: 4px 0 0; font-family: var(--f-cute); font-weight: 400; font-size: 26px; line-height: 1.15; color: var(--ink); }
.mlogo { display: none; }

/* ---------- calendar ---------- */
.cal { position: relative; z-index: 2; margin: 18px 12px 0; }
.wk, .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.wk {
  font-family: var(--f-cute); font-size: 13px; color: #58413a;
  text-align: center; padding: 8px 0 9px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.wk span:nth-child(n+6) { color: var(--accent); }
.grid { row-gap: 0; }
.d {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  min-height: 62px; padding: 7px 1px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  transition: background-color .2s ease, transform .2s ease;
}
.grid .d:nth-last-child(-n+7) { }
.d.blank { pointer-events: none; }
.d .num {
  font-family: var(--f-num); font-weight: 450; font-size: 20px; line-height: 1;
  color: var(--ink);
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.d.wkend .num { color: var(--accent); }
.d.rest::before { content: ""; position: absolute; inset: 3px 2px; border-radius: 10px; background: rgba(126, 63, 51, .07); z-index: -1; }
.d.work::before { content: ""; position: absolute; inset: 3px 2px; border-radius: 10px; background: rgba(84, 64, 106, .07); z-index: -1; }
.grid { position: relative; z-index: 0; }
.d.rest .num { color: var(--rest); }
.d.work .num { color: var(--work); }
.d .mk {
  position: absolute; top: 4px; right: 2px;
  font-family: var(--f-cute); font-size: 10px; line-height: 1;
  color: var(--rest-mark);
}
.d.work .mk { color: var(--work); }
.d .st { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; object-fit: contain; }
.d .sub {
  margin-top: 1px; max-width: 100%;
  font-size: 10px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink-3); letter-spacing: -.02em;
}
.d .sub.f { color: var(--fest); }
.d .sub.s { color: var(--term); }
.d .sub.w { color: var(--west); }
.d .sub.lm { color: var(--ink-2); }
.dots { display: flex; gap: 3px; height: 5px; margin-top: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--accent)); }
.d:active { transform: scale(.94); }
@media (hover: hover) { .d:not(.blank):hover { background: rgba(255,255,255,.28); } }
.d.today .num { box-shadow: inset 0 0 0 1.5px var(--accent); }
.d.sel .num { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -6px var(--accent); }

.legend {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 6px 0; font-family: var(--f-cute); font-size: 12px; color: #745341;
}
.legend b { font-weight: 400; color: var(--rest-mark); margin-right: 3px; }
.legend b.w { color: var(--work); }
.legend .sign { margin-left: auto; font-family: var(--f-body); font-size: 11px; color: var(--accent); letter-spacing: .05em; }
.legend .hint { width: 100%; font-family: var(--f-body); font-size: 11.5px; color: var(--ink-3); }

/* ---------- swipe arrows (desktop) ---------- */
.arrow { display: none; }

/* ---------- panels (plans, tools) ---------- */
.panel {
  position: relative; z-index: 2;
  margin: 26px 12px 0; padding: 18px 16px 8px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-radius: 22px;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 14px 36px -24px rgba(60,40,20,.45);
}
.panel h2 {
  margin: 0 0 10px; font-family: var(--f-cute); font-weight: 400; font-size: 19px; color: var(--ink);
  display: flex; align-items: baseline; gap: 8px;
}
.panel h2 small { font-family: var(--f-body); font-size: 12px; color: var(--ink-3); }
.empty {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 0 14px; color: var(--ink-2); font-size: 13.5px; line-height: 1.6;
}
.empty img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 4px 12px -6px rgba(60,40,20,.5); }

.plist { list-style: none; margin: 0; padding: 0; }
.pday { display: flex; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); cursor: pointer; }
.pday:first-child { border-top: 0; }
.pdate { flex: none; width: 46px; text-align: center; }
.pdate .dn { font-family: var(--f-num); font-weight: 500; font-size: 24px; line-height: 1; color: var(--accent); }
.pdate .dw { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.pitems { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.pi { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.4; color: var(--ink); }
.pi::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.pi .t { font-family: var(--f-num); font-size: 12.5px; color: var(--ink-2); flex: none; }
.pi .x { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi.done .x { text-decoration: line-through; color: var(--ink-3); }
.pi.note { color: var(--ink-2); font-size: 13px; }
.pi.note::before { border-radius: 2px; background: var(--ink-3); width: 6px; height: 6px; }

/* ---------- cover ---------- */
.cover .art { aspect-ratio: 1 / .95; }
.cv { position: relative; z-index: 2; margin: -96px 22px 0; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--f-cute); font-size: 20px; color: #634737; }
.brand img { height: 30px; width: auto; }
.year {
  font-family: var(--f-num); font-weight: 500; font-size: 96px; line-height: .9; letter-spacing: -.01em;
  color: #654936; margin: 14px 0 4px;
}
.sub-cn { font-family: var(--f-cute); font-size: 26px; color: #634737; }
.sub-en { font-size: 11px; letter-spacing: .3em; color: #526b7c; margin-top: 6px; }
.rule { display: flex; align-items: center; gap: 8px; margin: 20px 0 14px; color: #8a6450; }
.rule::before { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .5; }
.rule svg { width: 12px; height: 12px; }
.idx-title { font-family: var(--f-cute); font-size: 14px; color: #745341; margin-bottom: 12px; }
.idx-nums { display: none; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card {
  position: relative; display: block; text-align: left;
  border-radius: 16px; overflow: hidden;
  background: var(--paper);
  box-shadow: 0 10px 24px -16px rgba(60,40,20,.6), 0 1px 0 rgba(255,255,255,.7) inset;
  transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s;
}
.card:active { transform: scale(.96); }
@media (hover: hover) { .card:hover { transform: translateY(-3px); box-shadow: 0 18px 30px -18px rgba(60,40,20,.7); } }
.card img { width: 100%; aspect-ratio: 1 / .9; object-fit: cover; object-position: 2% 50%; }
.card .cl {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 9px 7px;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--cbg) 92%, transparent) 55%);
}
.card .cn { display: block; font-family: var(--f-num); font-weight: 500; font-size: 20px; line-height: 1; color: var(--cacc); }
.card .ct { display: block; font-family: var(--f-cute); font-size: 11.5px; color: var(--ink); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cbadge {
  position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--cacc); color: #fff; font-size: 11px; font-family: var(--f-num);
  display: grid; place-items: center;
}

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 10px; }
.tbtn {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px;
  background: rgba(255,255,255,.55); text-align: left; font-size: 13.5px; color: var(--ink);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.tbtn svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.tbtn small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.foot { text-align: center; font-family: var(--f-cute); font-size: 12px; color: #8a6a55; margin: 26px 0 0; opacity: .85; }
.foot span { margin: 0 6px; }

/* ---------- tab bar ---------- */
#tabs {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + var(--safe-b));
  width: min(calc(100% - 20px), 640px);
  border-radius: 999px;
  background: rgba(255, 250, 241, .72);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, var(--shadow);
  overflow: hidden;
}
.tabs-inner {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  padding: 6px; scroll-behavior: smooth; scroll-snap-type: x proximity;
}
.tabs-inner::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 40px; min-width: 42px; padding: 0 10px; border-radius: 999px;
  font-family: var(--f-num); font-size: 15px; font-weight: 450; color: var(--ink-2);
  scroll-snap-align: center; position: relative;
  transition: background-color .25s, color .25s;
}
.tab-home { font-family: var(--f-cute); font-size: 14px; padding: 0 14px; }
.tab.on { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -8px var(--accent); }
.tab.has::after {
  content: ""; position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: .7;
}
.tab.on.has::after { background: #fff; }

/* ---------- sheet ---------- */
#sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(50, 34, 24, .28);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .3s ease;
}
#sheet-backdrop.show { opacity: 1; }
#sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0;
  max-height: 90dvh; display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(50,30,20,.45);
  transform: translateY(105%); transition: transform .42s cubic-bezier(.2,.8,.2,1);
  padding-bottom: var(--safe-b);
}
#sheet.show { transform: none; }
#sheet.drag { transition: none; }
.sheet-grip { flex: none; width: 40px; height: 5px; border-radius: 3px; background: rgba(62,48,43,.18); margin: 9px auto 0; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 6px 20px 22px; }

.sh-head { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 0 14px; }
.sh-art {
  position: absolute; inset: -16px -20px auto -20px; height: 150px; z-index: 0; overflow: hidden;
  border-radius: 26px 26px 0 0; pointer-events: none;
}
.sh-art img { width: 100%; height: 100%; object-fit: cover; object-position: 0% 30%; opacity: .5; filter: saturate(.9); }
.sh-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,250,241,.2), var(--paper) 92%); }
.sh-head > *:not(.sh-art) { position: relative; z-index: 1; }
.sheet-body > * { position: relative; z-index: 1; }
.sheet-body > .sh-head { z-index: 0; }
.sh-big { font-family: var(--f-num); font-weight: 500; font-size: 58px; line-height: .85; color: var(--accent); min-width: 64px; }
.sh-meta { min-width: 0; flex: 1; }
#sheet-title { margin: 0; font-family: var(--f-cute); font-weight: 400; font-size: 22px; color: var(--ink); }
.sh-lunar { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.sh-close {
  align-self: flex-start; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.7); box-shadow: 0 0 0 1px var(--line) inset; color: var(--ink-2);
}
.sh-close svg { width: 16px; height: 16px; }
.sh-tags { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px 0 9px; border-radius: 999px;
  font-size: 13px; background: rgba(255,255,255,.75); box-shadow: 0 0 0 1px var(--line) inset;
}
.tag img { width: 17px; height: 17px; object-fit: contain; }
.tag.f { color: var(--fest); } .tag.s { color: var(--term); } .tag.w { color: var(--west); }
.tag.rest { background: #f6e1d9; color: var(--rest-mark); box-shadow: none; font-family: var(--f-cute); }
.tag.work { background: #e9e1f0; color: var(--work); box-shadow: none; font-family: var(--f-cute); }
.tag.cd { color: var(--ink-2); }

.sec-t { font-family: var(--f-cute); font-size: 15px; color: var(--ink-2); margin: 10px 0 8px; display: flex; align-items: center; gap: 8px; }
.sec-t::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.items { list-style: none; margin: 0 0 6px; padding: 0; }
.item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px 10px 2px; border-bottom: 1px solid var(--line);
  animation: itemIn .3s ease both;
}
@keyframes itemIn { from { opacity: 0; transform: translateY(4px); } }
.chk {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--c) inset; display: grid; place-items: center;
  transition: background-color .2s;
}
.chk svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.6); transition: .2s; }
.item.done .chk { background: var(--c); }
.item.done .chk svg { opacity: 1; transform: none; }
.ibody { flex: 1; min-width: 0; }
.itext { font-size: 15.5px; line-height: 1.4; color: var(--ink); word-break: break-word; }
.item.done .itext { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(62,48,43,.35); }
.itime { font-family: var(--f-num); font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.idel { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.idel svg { width: 17px; height: 17px; }
@media (hover: hover) { .idel:hover { background: rgba(126,63,51,.08); color: var(--rest); } }
.none { font-size: 13.5px; color: var(--ink-3); padding: 4px 0 10px; }

.add {
  margin-top: 8px; padding: 12px; border-radius: 18px;
  background: #fff; box-shadow: 0 0 0 1px var(--line) inset, 0 10px 24px -20px rgba(60,40,20,.6);
}
.add input[type=text], .note textarea {
  width: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink); padding: 4px 2px;
}
.add input::placeholder, .note textarea::placeholder { color: #b6a598; }
.add-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.time {
  display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px; border-radius: 999px;
  background: #f6efe4; color: var(--ink-2); font-size: 13px; position: relative;
}
.time svg { width: 15px; height: 15px; }
.time input { border: 0; background: transparent; font: inherit; font-family: var(--f-num); color: var(--ink); width: 74px; outline: 0; }
.swatches { display: flex; gap: 6px; margin-left: 2px; }
.sw { width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff inset; transition: transform .15s; }
.sw.on { box-shadow: 0 0 0 2px #fff inset, 0 0 0 2px var(--c); transform: scale(1.08); }
.addbtn {
  margin-left: auto; height: 36px; padding: 0 16px; border-radius: 999px;
  background: var(--accent); color: #fff; font-family: var(--f-cute); font-size: 15px;
  box-shadow: 0 8px 16px -10px var(--accent);
  transition: transform .15s, opacity .2s;
}
.addbtn:active { transform: scale(.95); }
.addbtn:disabled { opacity: .45; }

.note textarea {
  min-height: 84px; resize: vertical; padding: 12px; border-radius: 16px;
  background: #fff; box-shadow: 0 0 0 1px var(--line) inset; line-height: 1.6; font-size: 15px;
}
.saved { font-size: 11.5px; color: var(--ink-3); text-align: right; height: 16px; margin-top: 4px; transition: opacity .3s; }

.sh-nav { display: flex; justify-content: space-between; margin-top: 14px; }
.sh-nav button { font-size: 13px; color: var(--ink-2); padding: 8px 4px; display: inline-flex; align-items: center; gap: 4px; }
.sh-nav svg { width: 14px; height: 14px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; z-index: 60; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 16px);
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 999px; background: rgba(62,48,43,.9); color: #fff; font-size: 13.5px;
  transition: .3s ease; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- install sheet ---------- */
.install { font-size: 14.5px; line-height: 1.75; color: var(--ink-2); }
.install ol { padding-left: 1.2em; margin: 6px 0 14px; }
.install b { color: var(--ink); font-weight: 600; }

/* ======================================================= */
/* ---------- wide screens: replicate the printed page ---- */
/* ======================================================= */
@media (min-width: 900px) and (min-height: 560px) {
  :root { --tabs-h: 56px; }
  #bgblur {
    display: block; position: fixed; inset: -60px; z-index: 0;
    background-size: cover; background-position: center;
    filter: blur(50px) saturate(1.1); opacity: .5;
    transition: background-image .6s;
  }
  #app { padding-top: 28px; }
  .stage {
    container-type: inline-size;
    width: min(1180px, 94vw, calc((100dvh - 120px) * 1.4184));
    aspect-ratio: 1512 / 1066;
    margin: 0 auto;
    border-radius: 18px; overflow: hidden;
    box-shadow: 0 40px 80px -40px rgba(50,30,15,.55), 0 10px 30px -15px rgba(50,30,15,.35), 0 0 0 1px rgba(255,255,255,.4) inset;
    background: var(--bg);
  }
  .art { position: absolute; inset: 0; aspect-ratio: auto; max-height: none; }
  .art::after { display: none; }
  .topbar { display: none; }

  .mhead { position: absolute; margin: 0; left: 46.3%; right: 4.4%; top: 9.4%; align-items: center; gap: 2.6cqw; }
  .mnum { font-size: 10.6cqw; text-shadow: none; }
  .men { font-size: 1.55cqw; letter-spacing: .12em; font-weight: 500; }
  .mtitle { font-size: 3.7cqw; margin-top: .4cqw; }
  .mlogo { display: block; position: absolute; right: 4.6%; top: 9%; width: 9.9cqw; }
  .mhead .mlogo { position: static; display: none; }
  .stage > .mlogo { display: block; }

  .cal { position: absolute; margin: 0; left: 46.3%; right: 4.4%; top: 28.4%; bottom: 7.5%; display: flex; flex-direction: column; }
  .wk { font-size: 1.7cqw; padding: 1.25cqw 0 1.35cqw; border-top-color: rgba(62,48,43,.18); border-bottom-color: rgba(62,48,43,.18); }
  .grid { flex: 1; grid-auto-rows: 1fr; }
  .d { min-height: 0; align-items: flex-start; padding: 1.25cqw .2cqw 0 .9cqw; border-bottom-color: rgba(62,48,43,.12); }
  .d .num { width: auto; height: auto; font-size: 2.36cqw; border-radius: .5cqw; padding: 0 .15cqw; display: inline-block; }
  .d.sel .num { padding: .1cqw .5cqw; margin: -.1cqw -.5cqw; }
  .d .top { display: flex; align-items: center; gap: .35cqw; }
  .d .st { position: static; width: 1.35cqw; height: 1.35cqw; }
  .d .mk { right: .3cqw; top: 1.55cqw; font-size: 1.45cqw; }
  .d.rest::before, .d.work::before { inset: .35cqw .25cqw; border-radius: .9cqw; }
  .d .sub { font-size: 1.36cqw; margin-top: .45cqw; text-align: left; }
  .d .sub.lm { opacity: .75; }
  .dots { margin-top: .5cqw; height: .8cqw; gap: .45cqw; }
  .dots i { width: .8cqw; height: .8cqw; }
  .d.today .num { box-shadow: 0 0 0 .2cqw var(--accent); }
  .legend { margin-top: auto; padding: 1.6cqw 0 0; font-size: 1.42cqw; gap: 2.2cqw; border-top: 1px solid rgba(62,48,43,.12); }
  .legend .sign { font-size: 1.3cqw; }
  .legend .hint { display: none; }

  .arrow {
    display: grid; place-items: center; position: fixed; top: 50%; z-index: 5;
    width: 46px; height: 46px; border-radius: 50%; margin-top: -23px;
    background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: var(--shadow); color: var(--ink-2); transition: transform .2s;
  }
  .arrow:hover { transform: scale(1.06); }
  .arrow svg { width: 20px; height: 20px; }
  .arrow.prev { left: max(14px, calc(50% - min(1180px, 94vw, calc((100dvh - 120px) * 1.4184)) / 2 - 64px)); }
  .arrow.next { right: max(14px, calc(50% - min(1180px, 94vw, calc((100dvh - 120px) * 1.4184)) / 2 - 64px)); }

  .panel { width: min(1180px, 94vw); margin: 28px auto 0; padding: 22px 26px 12px; }
  .plist { columns: 2; column-gap: 32px; }
  .pday { break-inside: avoid; }

  /* cover */
  .cover .art { aspect-ratio: auto; }
  .cv { position: absolute; margin: 0; left: 54.2%; right: 5%; top: 13.2%; }
  .brand { font-size: 3.2cqw; gap: 1cqw; }
  .brand img { height: 6.1cqw; }
  .year { font-size: 14.4cqw; margin: 3.4cqw 0 0; color: #654936; }
  .sub-cn { font-size: 3.7cqw; margin-top: .4cqw; }
  .sub-en { font-size: 1.26cqw; margin-top: .9cqw; }
  .rule { position: absolute; top: -3cqw; left: 0; right: 0; margin: 0; display: none; }
  .idx-title { font-size: 1.68cqw; margin: 3.6cqw 0 1.5cqw; }
  .cards { display: none; }
  .idx-nums { display: grid; grid-template-columns: repeat(6, 1fr); row-gap: 2.2cqw; width: 39cqw; }
  .idx-nums button {
    justify-self: start; font-family: var(--f-num); font-size: 2.36cqw; font-weight: 450; color: var(--cacc);
    padding-bottom: .5cqw; position: relative; transition: transform .2s;
  }
  .idx-nums button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; opacity: .55; transition: .2s; }
  .idx-nums button:hover { transform: translateY(-2px); }
  .idx-nums button:hover::after { height: 2px; opacity: 1; }
  .cv .foot { text-align: left; margin-top: 5.5cqw; font-size: 1.5cqw; }
  .cv .foot span { margin: 0 .6cqw; }
  .cover .art img { object-position: center; }

  #tabs { width: auto; max-width: 94vw; bottom: 16px; }

  /* sheet becomes a side panel */
  #sheet {
    left: auto; right: 22px; top: 22px; bottom: 22px; width: 420px; max-height: none;
    border-radius: 26px; transform: translateX(calc(100% + 40px));
  }
  #sheet.show { transform: none; }
  .sheet-grip { display: none; }
  .sheet-body { padding-top: 18px; flex: 1; }
}

/* ======================= 兑换码 / 锁定 ======================= */
.chip.key { color: var(--accent); }
.card.lk img { filter: saturate(.85) brightness(1.04); }
.clock {
  position: absolute; z-index: 2; top: 7px; right: 7px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,250,241,.82); color: var(--cacc);
  box-shadow: 0 4px 10px -6px rgba(60,40,20,.6);
}
.clock svg { width: 13px; height: 13px; }
.unlock-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  margin-top: 14px; height: 48px; border-radius: 16px;
  background: #6d4c39; color: #fff; font-family: var(--f-cute); font-size: 16px;
  box-shadow: 0 12px 24px -14px rgba(80,50,30,.9);
  transition: transform .15s;
}
.unlock-cta:active { transform: scale(.97); }
.unlock-cta svg { width: 19px; height: 19px; }

.locked .art img { transform: scale(1.06); }
.locked .cal { filter: blur(3px); opacity: .55; pointer-events: none; user-select: none; }
.lock {
  position: absolute; z-index: 4; left: 0; right: 0; top: 0;
  aspect-ratio: 1 / .9; max-height: 58vh;
  display: grid; place-items: center; padding: 56px 20px 70px; pointer-events: none;
}
.lock-card {
  width: min(320px, 100%); text-align: center; pointer-events: auto;
  padding: 22px 20px 18px; border-radius: 24px;
  background: rgba(255,250,241,.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, var(--shadow);
  animation: pageIn .6s .1s cubic-bezier(.2,.7,.2,1) both;
}
.lock-ic {
  width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  box-shadow: 0 10px 20px -10px var(--accent);
}
.lock-ic svg { width: 22px; height: 22px; }
.lock-card h2 { margin: 0; font-family: var(--f-cute); font-weight: 400; font-size: 22px; color: var(--ink); }
.lock-card p { margin: 6px 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.lock-card small { display: block; margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.lock-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  background: var(--accent); color: #fff; font-family: var(--f-cute); font-size: 16px;
  box-shadow: 0 10px 20px -12px var(--accent); transition: transform .15s, opacity .2s;
}
.lock-btn svg { width: 18px; height: 18px; }
.lock-btn:active { transform: scale(.96); }
.lock-btn:disabled { opacity: .45; }
.lock-btn.wide { width: 100%; height: 50px; }
.lock-btn.busy { opacity: .7; pointer-events: none; }

.redeem { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.codebox {
  display: flex; align-items: center; justify-content: center; height: 58px; padding: 0 14px; border-radius: 16px;
  background: #fff; box-shadow: 0 0 0 1.5px var(--line) inset; transition: box-shadow .2s;
  font-family: var(--f-num); font-size: 24px; font-weight: 500; letter-spacing: .08em; color: var(--ink);
}
.codebox:focus-within { box-shadow: 0 0 0 2px var(--accent) inset; }
.codepre { color: var(--ink-3); flex: none; }
.codein {
  width: 6.2em; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0;
  font: inherit; letter-spacing: inherit; color: inherit; text-transform: uppercase;
}
.codein::placeholder { color: #cbbcae; }
.rmsg { min-height: 18px; font-size: 13px; color: var(--rest); text-align: center; }
.rhint { font-size: 12.5px; line-height: 1.7; color: var(--ink-3); text-align: center; margin: 14px 0 4px; }

@media (max-width: 899px), (max-height: 559px) { .locked .mhead { visibility: hidden; } }
@media (min-width: 900px) and (min-height: 560px) {
  .lock { aspect-ratio: auto; max-height: none; inset: 0 auto 0 0; width: 46%; padding: 0 3cqw; }
  .lock-card { width: min(34cqw, 340px); }
  .unlock-cta { width: auto; height: auto; padding: 1cqw 2cqw; margin-top: 3cqw; font-size: 1.6cqw; border-radius: 999px; }
  .unlock-cta svg { width: 1.8cqw; height: 1.8cqw; }
  .cv .foot { margin-top: 3cqw; }
}
