:root{--rpx:min(0.1333333vw, 0.64px)}*{box-sizing:border-box}body{margin:0}view,scroll-view{display:block}text{display:inline}image{display:inline-block}scroll-view{overflow:auto}#app{max-width:480px;margin:auto}#tabbar{display:none;position:fixed;bottom:0;left:0;right:0;z-index:100;background:#1c2030;border-top:1px solid #544c41;padding-bottom:env(safe-area-inset-bottom);justify-content:center}#tabbar.visible{display:flex}#tabbar button{width:min(25%,120px);border:0;background:none;color:#aaa092;font-family:inherit;font-size:14px;padding:13px 0}#tabbar button.selected{color:#d4ad71}body.has-tab #app{padding-bottom:70px}body.light #tabbar{background:#fbf7ef}body.light #tabbar button{color:#756a5c}body.light #tabbar button.selected{color:#7a4b22}#toast{position:fixed;z-index:1000;left:50%;top:45%;transform:translate(-50%,-50%);padding:12px 20px;background:#222d;color:white;border-radius:5px;display:none;max-width:85%;text-align:center}input{font:inherit;outline:none;border:0;background:transparent}image{object-fit:contain}[data-clickable]{cursor:pointer}[data-clickable]:focus-visible{outline:2px solid #c99c60;outline-offset:2px}

#navbar{display:none;max-width:480px;margin:auto;padding:12px 18px;background:#1a1a2e;color:#eee;align-items:center;gap:25px;font-size:15px}#navbar.visible{display:flex}#navbar button{background:none;border:0;color:inherit;font:inherit;padding:6px}body.light #navbar{background:#f4eee3;color:#30271f}.login .backdrop,.login .veil{position:absolute}.world .top{padding-right:0}
@media (min-width:800px){.world,.login{width:100vw!important;left:50%;transform:translateX(-50%)}.world-content{max-width:780px;width:100%;margin:0 auto}.login .content{max-width:520px;margin:0 auto}.login .viewport{position:relative}}

/* 让页面外侧和内容使用同一套配色。 */
body{background:#171b2b;color:#e8e1d5}
body.light{background:#f4eee3;color:#30271f}
@media (min-width:800px){
  #app,#navbar{max-width:900px}
  body.has-tab #app{max-width:1180px}
  #tabbar button{width:140px}
  .home{display:grid;grid-template-columns:minmax(270px,0.85fr) minmax(360px,1.15fr);column-gap:clamp(40px,6vw,90px);align-content:start;padding:46px clamp(40px,5vw,80px) 100px}
  .home>.brand-row,.home>.brand-sub{grid-column:1/-1}
  .home>.story-header:not(.secondary){grid-column:1;grid-row:3;align-self:start;position:sticky;top:32px;padding-top:64px;padding-bottom:28px}
  .home>.timeline{grid-column:2;grid-row:3;padding-top:68px}
  .home>.story-header.secondary{grid-column:1/-1}
  .home .story-title{font-size:40px}
  .home .story-title.smaller{font-size:29px}
  .home .story-intro{font-size:17px;max-width:35em}
  .home .chapter-title{font-size:22px}
  .home .chapter-desc,.home .chapter-action,.home .side-desc{font-size:15px}
  .home .timeline-item{min-height:150px}
  .home .timeline-content{padding-bottom:32px}
  .side,.container{padding-left:clamp(40px,5vw,80px);padding-right:clamp(40px,5vw,80px)}
  .container .card{width:calc(16.666% - 10px)}
}
@media (min-width:800px) and (max-width:1000px){
  .home{column-gap:36px;padding-left:40px;padding-right:40px}
}

/* 电脑使用横向阅读空间，场景与对话并排；手机保持单栏。 */
@media (min-width:800px){
  #app,body.has-tab #app,#navbar{width:min(100%,1360px);max-width:none}
  .page{padding:36px clamp(32px,5vw,76px) 92px}
  .page .hero{max-width:840px;padding-top:36px}
  .page .progress{max-width:1100px}
  .page .dialogue-stage:has(.scene-art){display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,.85fr);grid-template-areas:'art dialogue' 'art hint';column-gap:28px;align-items:end}
  .page .dialogue-stage:has(.scene-art)>.scene-art{grid-area:art;height:clamp(330px,43vw,540px);margin:0}
  .page .dialogue-stage:has(.scene-art)>.dialogue{grid-area:dialogue;margin:0;align-self:end;padding:28px}
  .page .dialogue-stage:has(.scene-art)>.tap-hint{grid-area:hint}
  .page .dialogue-stage:not(:has(.scene-art)){max-width:850px}
  .page .task-card,.page>.choice,.page>.intro,.page>.primary,.page>.dialogue,.page>.ritual-card{max-width:850px}
  .overlay{align-items:center;justify-content:center}
  .overlay .sheet{width:min(720px,calc(100vw - 48px));max-height:85vh;overflow:auto;border-radius:18px}
}

@keyframes dialogue-arrive{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@keyframes portrait-arrive{from{opacity:0;transform:translateX(-9px) scale(.97)}to{opacity:1;transform:translateX(0) scale(1)}}
@keyframes feedback-arrive{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@keyframes background-breathe{from{transform:scale(1.025)}to{transform:scale(1)}}
.dialogue-a,.dialogue-b{animation:dialogue-arrive .42s cubic-bezier(.2,.7,.2,1) both}
.dialogue-stage .portrait{animation:portrait-arrive .48s ease-out both}
.dialogue-stage .dialogue-text{animation:dialogue-arrive .48s .05s ease-out both}
.scene-art .scene-bg{animation:background-breathe 1.15s ease-out both}
.feedback{animation:feedback-arrive .32s ease-out both}
.world .reading{animation:dialogue-arrive .48s ease-out both}
.primary,.choice,.word,.option,.continue-main,.chapter-action,.theme-toggle,.checkin-button,.tabbar button{transition:background-color .2s ease,color .2s ease,border-color .2s ease,transform .18s ease,box-shadow .2s ease}
@media (hover:hover){.primary:hover,.continue-main:hover,.checkin-button:hover{transform:translateY(-2px);box-shadow:0 6px 18px #0002}.choice:hover,.word:hover,.option:hover{transform:translateY(-2px);border-color:#d4ad71}}
.primary:active,.choice:active,.word:active,.option:active,.continue-main:active{transform:scale(.98)}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* 主线首页：画卷封面、章节长线与人物故事。 */
.home{--home-accent:#d9b779;--home-muted:#b5ac9b;--home-line:#716957;--home-ink:#f4ebda;display:block;padding:28px 24px 95px}
.home .brand-row{gap:18px}.home .brand{font-size:24px;letter-spacing:5px}.home .brand-sub{font-size:12px;letter-spacing:1px;margin-top:6px}
.home .theme-toggle{font-size:12px;padding:9px 12px;white-space:nowrap}
.home>.story-header:not(.secondary){position:static;display:flex;flex-direction:column;gap:26px;padding:28px 0 36px;border-bottom:1px solid var(--home-line)}
.home .story-cover{position:relative;overflow:hidden;min-height:240px;border:1px solid #bc9d6b66;background:#27232a}
.home .story-cover-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.home .story-cover-shade{position:absolute;inset:0;background:linear-gradient(180deg,transparent 25%,rgba(24,23,28,.88) 100%)}
.home .story-cover-caption{position:absolute;left:22px;right:22px;bottom:22px;color:#efe4d2;font-size:12px;letter-spacing:2px;line-height:1.7}
.home .cover-title{font-size:30px;letter-spacing:6px;color:#fff7e8;margin:3px 0}
.home .eyebrow{font-size:12px;letter-spacing:3px}.home .story-title{font-size:36px;letter-spacing:4px;margin:10px 0 15px;line-height:1.25}
.home .story-intro{font-size:15px;line-height:1.85;max-width:38em}
.home .home-glossary{font-size:13px;line-height:1.8;color:var(--home-muted);border-left:2px solid var(--home-accent);padding-left:12px;margin-top:17px;max-width:35em}
.home .home-progress{display:flex;gap:30px;margin-top:23px;color:var(--home-muted);font-size:12px;line-height:1.5}
.home .progress-num{font-size:22px;color:var(--home-accent);margin-right:3px}
.home .continue-main{font-size:15px;padding:14px 18px;margin-top:24px;border-radius:3px;line-height:1.5}
.home .home-links{display:flex;flex-wrap:wrap;column-gap:22px;row-gap:2px;margin-top:6px}.home .home-links .chapter-action{font-size:13px;margin-top:12px}
.home>.timeline{padding-top:46px;max-width:960px;margin:0 auto}
.home .timeline-heading{padding:0 0 30px 37px}.home .timeline-heading-title{font-size:27px;color:var(--home-ink);margin-top:8px}.home .timeline-heading-note{font-size:13px;color:var(--home-muted);margin-top:8px;line-height:1.6}
.home .timeline-item{min-height:0}.home .rail{width:37px}.home .dot{top:8px;left:4px;width:13px;height:13px;border-width:2px}.home .line{top:22px;left:10px;width:1px}
.home .timeline-content{padding:0 0 30px 5px;min-width:0}.home .chapter-season{font-size:12px;letter-spacing:1px}.home .chapter-title{font-size:21px;margin:7px 0;color:var(--home-ink)}
.home .chapter-desc{font-size:14px;line-height:1.7}.home .timeline .chapter-action{font-size:13px;margin-top:8px}.home .current .dot{box-shadow:0 0 0 5px #d4aa6b33,0 0 18px #d4aa6b}
.home>.story-header.secondary{max-width:960px;margin:0 auto;padding:34px 0 12px}.home .story-title.smaller{font-size:26px}.home .side-entry{padding:17px 0}.home .side-title{font-size:18px}.home .side-desc{font-size:13px;line-height:1.7}
.home.theme-light{--home-accent:#8c582b;--home-muted:#6d6051;--home-line:#cdbda8;--home-ink:#30271f}
.home.theme-light .story-cover-caption,.home.theme-light .cover-title{color:#fff7e8}
@media (min-width:800px){
  .home{padding:42px clamp(40px,5vw,76px) 110px}
  .home>.story-header:not(.secondary){position:static;display:grid;grid-template-columns:minmax(0,1.06fr) minmax(0,.94fr);gap:clamp(38px,5vw,72px);align-items:center;padding:42px 0 52px}
  .home .story-cover{min-height:390px}.home .story-cover-caption{left:32px;bottom:30px}.home .cover-title{font-size:42px}
  .home .story-title{font-size:43px}.home .story-intro{font-size:16px}
  .home>.timeline{padding-top:58px}.home .timeline-heading{padding-left:57px}.home .rail{width:57px}.home .dot{left:10px}.home .line{left:16px}
  .home .timeline-item{min-height:0}.home .timeline-content{padding-bottom:37px}.home .chapter-title{font-size:23px}
}
@media (max-width:359px){.home{padding-left:17px;padding-right:17px}.home .story-cover{min-height:200px}.home .home-progress{gap:18px}.home .continue-main{font-size:13px}}
