:root {
  color-scheme: light;
  --ink: #3c3c3c;
  --mute: #626262;
  --red: #bd3041;
  --blue: #235f9e;
  --accent-red: #f24854;
  --accent-blue: #3b8bed;
  --line: #e4dfd5;
  --item-icon-size: clamp(36px, calc(16vw - 13px), 48px);
  --portrait-base: #ffe6b5;
  font-family: "Microsoft YaHei", "微软雅黑", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: #f8f6ed;
}
* { box-sizing: border-box }
html { scroll-padding-top: 84px }
body { margin: 0; line-height: 1.65 }
a { color: inherit }
a:focus-visible, button:focus-visible { outline: 3px solid #144883; outline-offset: 3px }
h1,h2,h3,h4,p,figure { margin: 0 }
h2,h3,h4 { line-height: 1.3 }
.wrap { width: min(1136px, calc(100% - 48px)); margin-inline: auto }
.skip { position: absolute; left: 10px; top: -75px; padding: 10px; background: white; z-index: 20 }
.skip:focus { top: 10px }
.banner {
  position: relative; isolation: isolate; color: #fff;
  background: #ffedba url("assets/hero-adventure.webp") 50% 44% / cover no-repeat;
}
.mast { background: linear-gradient(#261b1bf5, #302233da 75%, #30223300); padding-bottom: 15px }
.mast-inner { min-height: 50px; display: flex; justify-content: space-between; align-items: center; gap: 12px }
.brand { font-weight: 800; text-decoration: none; display: flex; align-items: center; gap: 9px; font-size: 1.14rem; letter-spacing: .04em }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #ffd792; border-radius: 10px 3px; background: linear-gradient(145deg,#fc8d24,#dc3541); color: #fff3b9; font: bold 1.38rem/1 "Microsoft YaHei","微软雅黑",sans-serif; transform: rotate(-5deg); box-shadow: inset 0 0 0 2px #a63726 }
.shop-link { text-decoration:none; background: #236eb0; padding: 5px 15px; border: 1px solid #b4d7eb; border-radius:999px; box-shadow: inset 0 0 0 2px #ffffff20; font-size: .9rem; font-weight: 700 }
.shop-link:hover { background:#185893 }
.hero { min-height: clamp(195px,19vw,305px); display: flex; align-items: center; padding-bottom: 24px }
.hero-copy { margin-left: 4%; max-width: 46%; text-align: center }
h1 { line-height:0 }
h1 img { display: block; width: clamp(290px,34vw,492px); height: auto; max-width: 100%; filter: drop-shadow(0 3px 1px #fff7d9) }
.hero p { display: inline-block; margin-top: 12px; padding: 4px 22px 5px; color: #fff9e4; background: linear-gradient(100deg,#a83419,#bd4620 60%,#a9381d); clip-path: polygon(0 0,100% 0,97% 50%,100% 100%,0 100%,3% 50%); font-weight: 700; font-size: clamp(.9rem,1.4vw,1.12rem) }
.stage-nav { position: sticky; top:0; z-index:5; background:#f8f6edf7; box-shadow:0 4px 14px #513d2410 }
.stage-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding-block:7px }
.stage-row a {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height:58px;
  background: linear-gradient(108deg,#c92640,#ee4553); color: white; text-decoration: none; border:1px solid #cf3945; border-radius:15px;
  box-shadow:inset 0 1px 0 #ffffff4d,0 2px 4px #49361f16;
}
.stage-row a:nth-child(2) { background: linear-gradient(108deg,#ff9d19,#ffc044); border-color:#efaa32; color:#563009 }
.stage-row a:nth-child(3) { background: linear-gradient(108deg,#236dc3,var(--accent-blue)); border-color:#367ccb }
.stage-row a:hover { filter:brightness(1.08) }
.portrait {
  width:50px; height:50px; flex:none; border-radius:50%;
  background: var(--portrait-base) url("assets/stage-portraits.webp") left center / 300% 100% no-repeat;
  box-shadow:0 0 0 2px #ffe6b2,0 2px 5px #6e39254d;
}
.stage-row a:nth-child(2) .portrait { background-position:center }
.stage-row a:nth-child(3) .portrait { background-position:right center }
.stage-row b { font-size: 1.15rem }
.stage-row small { font-size: .875rem; margin-left: 11px }
main { padding-top: 22px }
.stage { margin-bottom: 22px; padding: clamp(18px,2.5vw,32px); border-radius:22px; background:linear-gradient(140deg,#fffdf9,#fff 38%); border: 1px solid #e6e0d5; box-shadow: 0 6px 20px #49371e0b; --accent: #bd293b }
.stage.login { --wash:#ffebe7; --edge:#e9b5aa }
.stage.play { --accent:#a74b0a; --wash:#fff0ca; --edge:#e7c884 }
.stage.logout { --accent:#215d9d; --wash:#e4f1ff; --edge:#afcde8 }
.section-head { display:flex; align-items:center; gap:14px; padding:11px 15px; margin-bottom:18px; border:1px solid var(--edge); border-radius:15px; background:linear-gradient(105deg,var(--wash),#fffdfa 85%) }
.chapter-portrait { display:block; width:56px; height:56px; flex:none; border:2px solid #fff0bd; border-radius:50%; background:var(--portrait-base) url("assets/chapter-portraits.webp") 0% center / 400% 100% no-repeat; box-shadow:0 0 0 1px #bd9152,0 2px 5px #80561c24 }
.play .section-head .chapter-portrait { background-position:33.333333% center }
.logout .section-head .chapter-portrait { background-position:66.666667% center }
.section-head span { display:block; font-size:.875rem; font-weight:700; color:var(--accent); line-height:1.35 }
.section-head h2 { margin-top:2px; color:var(--accent) }
.section-head::after { content:""; flex:1; margin:0 5px 0 12px; height:1px; background:linear-gradient(90deg,var(--edge),transparent) }
h2 { font-size:clamp(1.45rem,2.45vw,1.95rem); letter-spacing:.025em }
h3 { font-size:1.16rem }
.login-grid,.logout-grid { display:grid; grid-template-columns: 1fr minmax(240px,.8fr); gap:clamp(20px,4vw,55px); align-items:start }
.login-rules div { position:relative; padding-left:16px; margin: 0 0 14px }
.login-rules div:last-child { margin-bottom:0 }
.login-rules div::before { content:""; position:absolute; top:.52em; left:0; width:7px; height:7px; background:#d94146; transform:rotate(45deg) }
.login-rules p,.goods-copy p { margin-top:5px; color:var(--ink) }
.login-rules strong,.goods-copy strong,.steps strong { color:var(--ink) }
.login-pics { display:grid; gap:12px; justify-items:center; background:linear-gradient(135deg,#f7f4ed,#faf9f6); border:1px solid #e8e4db; border-radius:16px; padding:14px; align-self:center }
.login-pics figure { max-width:100% }
.photo { display:grid; place-items:center; overflow:hidden; position:relative; text-decoration:none; cursor:zoom-in; width:fit-content; max-width:100%; margin-inline:auto; border-radius:8px }
.photo img { display:block; max-width:100%; height:auto }
.bag img { width:264px }
.hotbar img { width:224px }
figcaption { margin-top:4px; font-size:.875rem; color:var(--mute); line-height:1.45; text-align:center }
.magnify { position:absolute; right:4px; bottom:4px; display:grid; place-items:center; width:20px; height:20px; background:#191d32cc; border:1px solid #ffffff7d; border-radius:3px }
.magnify::before,.magnify::after { content:""; position:absolute }
.magnify::before { width:7px; height:7px; border-radius:50%; border:1.5px solid white; transform:translate(-1px,-1px) }
.magnify::after { width:5px; height:1.5px; background:white; transform:translate(4px,4px) rotate(45deg) }
.hotbar .magnify { display:none }
.task-rules { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px }
.task-rules>div { display:flex; flex-direction:column; padding:13px 16px; border:1px solid #f4d0cb; border-radius:14px; background:#fff0ec; color:#a3272d }
.task-rules .accept { color:#865008; background:#fff4da; border-color:#eed8a7 }
.task-rules .pet { color:#1c558d; background:#eaf4fd; border-color:#c9ddf3 }
.task-rules p { color:#342a2e; margin-top:5px }
.rule-gallery { display:grid; width:100%; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; margin-top:0; padding-top:10px }
.rule-gallery figure { min-width:0 }
.rule-gallery figure > span,.goods-links a::before,.goods-copy::before {
  width:var(--item-icon-size); height:var(--item-icon-size); border-radius:10px;
  background-color:#f7f5f1; box-shadow:inset 0 0 0 1px #d9d5ce;
}
.rule-gallery figure > span { display:grid; place-items:center; margin-inline:auto; padding:4px }
.rule-gallery img { display:block; width:auto; height:auto; max-width:100%; max-height:calc(var(--item-icon-size) - 8px) }
.cancel .rule-gallery figure:first-child img { --icon-mask-x:0% }
.cancel .rule-gallery figure:last-child img { --icon-mask-x:25% }
.accept .rule-gallery figure:nth-child(1) img { --icon-mask-x:50% }
.accept .rule-gallery figure:nth-child(2) img { --icon-mask-x:75% }
.accept .rule-gallery figure:nth-child(3) img { --icon-mask-x:100% }
.cancel .rule-gallery figure:not(:nth-child(2)) img, .accept .rule-gallery img {
  -webkit-mask: url("assets/rule-icon-masks.webp") var(--icon-mask-x) center / 500% 100% no-repeat;
  mask: url("assets/rule-icon-masks.webp") var(--icon-mask-x) center / 500% 100% no-repeat;
}
.task-rules h3,.task-rules p,.rule-gallery { align-self:start }
@media (min-width:621px) {
  @supports (grid-template-rows:subgrid) {
    .task-rules>div { display:grid; grid-row:span 3; grid-template-rows:subgrid; row-gap:0 }
  }
}
.rule-gallery figcaption { font-size:.875rem; line-height:1.35; color:#50505a; overflow-wrap:anywhere }
.flag-note { margin:14px 0 24px; border:1px solid #ecc36b; border-radius:14px; background:linear-gradient(110deg,#fff3cf,#fffaf0); padding:13px 16px }
.flag-note h3 { color:#813e0b }
.flag-note p { margin-top:4px }
.cost { color:var(--red); display:inline-block }
.store { background:#faf8f3; border:1px solid #ddd9cf; border-radius:17px; overflow:hidden }
.store-intro { display:flex; align-items:center; gap:12px; padding:17px 20px 13px }
.store-intro .chapter-portrait { background-position:100% center }
.store-intro h3 { font-size:1.4rem; color:#85462b }
.store-intro p { margin-top:5px }
.goods-links { display:grid; grid-template-columns:repeat(5,1fr); gap:3px; margin:0 14px 8px; padding:4px; background:#eef4fa; border:1px solid #d8e3ee; border-radius:14px }
#goods-flowers,.goods-links a[href="#goods-flowers"] { --item-x:0%; --item-ink:#ad355b }
#goods-instruments,.goods-links a[href="#goods-instruments"] { --item-x:25%; --item-ink:#764391 }
#goods-medicine,.goods-links a[href="#goods-medicine"] { --item-x:50%; --item-ink:#206a54 }
#goods-cooking,.goods-links a[href="#goods-cooking"] { --item-x:75%; --item-ink:#9b4a16 }
#goods-furniture,.goods-links a[href="#goods-furniture"] { --item-x:100%; --item-ink:#2a5e90 }
.goods-links a { display:flex; align-items:center; justify-content:center; gap:7px; text-align:center; text-decoration:none; font-weight:700; padding:8px 2px; color:var(--item-ink); border-radius:10px }
.goods-links a::before,.goods-copy::before { content:""; display:block; background-image:url("assets/category-items.webp"); background-position:var(--item-x) center; background-size:500% 100%; background-repeat:no-repeat }
.goods-links a::before { flex:none }
.goods-links a:last-child { border-right:none }
.goods-links a:hover { background:#dce9f5 }
.goods-links a[aria-selected=true], .goods-links a[aria-current=location] { background:white; color:var(--item-ink); box-shadow:inset 0 -3px 0 var(--item-ink),0 1px 4px #23466f20 }
.goods-panel { display:grid; grid-template-columns:minmax(190px,1fr) minmax(270px,1fr); gap:20px; align-items:center; padding:18px 20px; border-bottom:1px solid var(--line); background:#fffeff }
.goods-panel:last-child { border-bottom:none }
[hidden] { display:none !important }
.goods-copy { display:grid; grid-template-columns:var(--item-icon-size) minmax(0,1fr); column-gap:10px }
.goods-copy::before { grid-column:1; grid-row:1/3; align-self:center }
.goods-copy h4 { grid-column:2; margin:0; color:var(--item-ink); font-size:1.45rem; font-weight:700 }
.shelf-location { grid-column:2; margin:1px 0 0; color:#665b51; font-size:.9375rem; font-weight:500 }
.goods-copy p { grid-column:1/-1; margin-top:9px }
.goods-images { --shelf-height:118px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; align-items:start }
.goods-images figure { display:grid; grid-template-rows:calc(var(--shelf-height) + 10px) auto; justify-items:center; min-width:0 }
.goods-images figure:only-child { grid-column:1/-1 }
.goods-images .photo { align-self:center; padding:4px; border:1px solid #d6ced7; border-radius:9px; background:#ece8ed }
.goods-images img { border-radius:5px; max-height:var(--shelf-height); width:auto; object-fit:contain }
.goods-images figcaption { max-width:100% }
.handoff-owner { margin:16px 0 10px; padding:14px 16px; border-radius:14px; border:1px solid #c4d8ed; background:#edf5fd }
.handoff-owner h3,.handoff-owner strong { color:var(--blue) }
.handoff-owner p { margin-top:5px }
.handoff-default { color:var(--mute) }
.proof img { width:328px }
.checklist { border:1px solid #c4d8ec; border-radius:16px; background:linear-gradient(115deg,#ebf4fc,#f7faff); padding:17px 20px; margin-top:20px }
.checklist fieldset { margin:0; border:0; padding:0; min-width:0 }
.checklist legend { font-weight:700; font-size:1.2rem; color:#214d78; padding:0; margin-bottom:8px }
.checklist label { display:flex; align-items:flex-start; gap:12px; border-bottom:1px solid #d4dfea; padding:10px 0; cursor:pointer }
.checklist input { width:21px; height:21px; margin:3px 0 0; accent-color:#266cb0; flex:none }
.checklist small { display:block; color:#505963; font-size:.94rem }
.check-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top:12px; color:#345676; font-size:.9rem }
.check-footer button { border:1px solid #94b3cf; border-radius:999px; background:white; color:#214c72; padding:7px 13px; cursor:pointer; font:inherit }
.check-footer button:hover { background:#e6f0fa }
.foot { display:flex; align-items:center; justify-content:space-between; padding:0 0 22px; color:#595661; font-size:.875rem }
.foot a { padding:8px 0; text-underline-offset:4px }
dialog { width:fit-content; max-width:calc(100% - 20px); padding:14px; border:1px solid #ddc9b2; border-radius:18px; color:var(--ink); background:white; box-shadow:0 15px 60px #0005 }
dialog::backdrop { background:#1e1828db }
.viewer-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:10px }
.viewer-head h2 { font-size:1rem; letter-spacing:0 }
.viewer-head button { font:inherit; background:#245e97; color:white; border:0; border-radius:999px; padding:6px 14px; cursor:pointer; flex:none }
#viewer-image { display:block; margin:auto; max-width:100%; height:auto; max-height:74vh; object-fit:contain }
@media(max-width:820px) {
  .wrap { width:calc(100% - 30px) }
  .stage-row small { display:block; margin:0; line-height:1.3 }
  .hero-copy { margin-left:0 }
  .login-grid,.logout-grid { grid-template-columns:1.05fr .95fr; gap:20px }
  .task-rules { gap:7px }
  .task-rules>div { padding:11px }
}
@media(max-width:620px) {
  html { scroll-padding-top:65px }
  .wrap { width:calc(100% - 22px) }
  .mast-inner { min-height:44px }
  .mast { padding-bottom:8px }
  .brand { font-size:1rem; gap:6px }
  .brand-mark { width:27px; height:27px; font-size:1.15rem }
  .shop-link { padding:3px 8px; font-size:.875rem }
  .banner { background-image:linear-gradient(90deg,#fff2cc99,transparent 62%),url("assets/hero-adventure.webp"); background-position:64% center }
  .hero { min-height:156px; padding-bottom:14px }
  .hero-copy { max-width:60%; margin-left:0 }
  h1 img { width:100% }
  .hero p { margin-top:6px; font-size:.875rem; padding:3px 9px; line-height:1.35 }
  .stage-row { width:calc(100% - 22px); gap:6px; padding-block:6px }
  .stage-row a { min-height:44px; gap:6px; border-radius:13px }
  .stage-row small { display:none }
  .portrait { width:31px; height:31px; box-shadow:0 0 0 1px #ffe6b2 }
  .stage-row b { font-size:1.01rem }
  main { padding-top:13px }
  .stage { padding:17px 14px; margin-bottom:13px; border-radius:18px }
  .section-head { padding:9px 11px; margin-bottom:14px; gap:10px }
  .chapter-portrait { width:47px; height:47px }
  .login-grid,.logout-grid,.goods-panel { grid-template-columns:1fr; gap:14px }
  .login-rules div { margin-bottom:11px }
  .login-pics { padding:9px }
  .task-rules { grid-template-columns:1fr }
  .task-rules>div { padding:12px }
  .task-rules h3 { font-size:1rem }
  .task-rules p { margin:0 }
  .store-intro,.goods-panel { padding:13px }
  .goods-links a { padding:6px 0; flex-direction:column; gap:2px }
  .goods-links { margin-inline:9px }
  .goods-panel { margin:9px; border:1px solid #e8e1d7; border-radius:13px }
  .goods-panel:last-child { border-bottom:1px solid #e8e1d7 }
  .goods-images { --shelf-height:104px; gap:8px }
  .goods-images figcaption { font-size:.8125rem }
}
@media(prefers-reduced-motion:no-preference) {
  .stage-row a,.goods-links a { transition:background-color .15s ease,filter .15s ease }
}

