/* ============================================================
   Raymoon · UI
   编辑式排版：细线、字距、米白纸面、深色玻璃面板
   ============================================================ */


/* ---------------- 字体（本地子集，不依赖网络） ---------------- */
@font-face{
  font-family:'Noto Serif SC'; font-style:normal; font-weight:300; font-display:swap;
  src:url('../fonts/noto-serif-sc-300.woff2') format('woff2');
}
@font-face{
  font-family:'Noto Serif SC'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/noto-serif-sc-400.woff2') format('woff2');
}
@font-face{
  font-family:'Cormorant Garamond'; font-style:italic; font-weight:300; font-display:swap;
  src:url('../fonts/cormorant-italic.woff2') format('woff2');
}

:root{
  --ink: #f0ece3;
  --ink-dim: rgba(240,236,227,.52);
  --ink-faint: rgba(240,236,227,.28);
  --line: rgba(240,236,227,.18);
  --line-soft: rgba(240,236,227,.10);
  --panel: rgba(9,14,22,.46);
  --panel-deep: rgba(9,13,20,.72);
  --cream: #ece3d2;
  --cream-ink: #1b1a17;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --latin: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

*{ box-sizing: border-box; }
html,body{ height:100%; margin:0; background:#05070c; }
body{
  font-family: var(--sans);
  color: var(--ink);
  overflow:hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior:none;
}
button{ font: inherit; color: inherit; background:none; border:0; cursor:pointer; -webkit-tap-highlight-color: transparent; }
select{ font: inherit; }

#stage{ position:fixed; inset:0; overflow:hidden; }
#c{ position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; cursor:grab; }
#c.dragging{ cursor:grabbing; }
#c.pointing{ cursor:pointer; }

.grade{
  position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(54% 42% at 10% 85%, rgba(4,10,20,.48) 0%, rgba(4,10,20,.18) 48%, rgba(4,10,20,0) 78%),
    linear-gradient(to top, rgba(4,10,20,.42) 0%, rgba(4,10,20,0) 24%);
}
.grain{
  position:absolute; inset:-40%; pointer-events:none; opacity:.05; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.55'/></svg>");
  animation: grain 1.2s steps(3) infinite;
}
@keyframes grain{
  0%{transform:translate3d(0,0,0)} 33%{transform:translate3d(-2%,1%,0)} 66%{transform:translate3d(1%,-2%,0)} 100%{transform:translate3d(0,0,0)}
}

/* ---------------- boot ---------------- */
.boot{
  position:absolute; inset:0; z-index:60; display:flex; align-items:center; justify-content:center;
  background:#04060b; transition:opacity 1.1s var(--ease);
}
.boot.out{ opacity:0; pointer-events:none; }
.boot-in{ display:flex; flex-direction:column; align-items:center; gap:12px; }
.boot-line{ width:1px; height:38px; background:linear-gradient(to bottom, transparent, rgba(236,227,210,.5)); }
.boot-in b{ font-family:var(--serif); font-weight:300; font-size:22px; letter-spacing:.42em; color:rgba(240,236,227,.8); text-indent:.42em; }
.boot-in i{ font-style:normal; font-size:8px; letter-spacing:.36em; color:rgba(240,236,227,.24); }

/* ---------------- top bar ---------------- */
.topbar{
  position:absolute; left:0; right:0; top:0; z-index:6;
  display:flex; align-items:flex-start; justify-content:space-between;
  padding: 22px 26px; pointer-events:none;
  background: linear-gradient(to bottom, rgba(4,10,22,.56) 0%, rgba(4,10,22,0) 100%);
}
.topbar > *{ pointer-events:auto; }
.mark{ display:flex; align-items:center; gap:11px; }
.mark-dot{
  width:7px; height:7px; border-radius:50%; background:var(--cream);
  box-shadow:0 0 12px rgba(236,227,210,.75); position:relative;
}
.mark-dot::after{
  content:""; position:absolute; inset:-5px; border:1px solid rgba(236,227,210,.28); border-radius:50%;
}
.mark-txt{ display:flex; flex-direction:column; gap:3px; }
.mark-txt b{ font-size:9.5px; letter-spacing:.34em; font-weight:500; color:rgba(240,236,227,.86); }
.mark-txt i{ font-style:normal; font-size:8.5px; letter-spacing:.26em; color:var(--ink-faint); }

.topbar-right{ display:flex; gap:6px; align-items:center; }
.ghost-btn{
  display:flex; align-items:center; gap:7px;
  font-size:11px; letter-spacing:.14em; color:var(--ink-dim);
  padding:7px 11px; border:1px solid transparent; border-radius:2px;
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.ghost-btn:hover{ color:var(--ink); border-color:var(--line); background:rgba(255,255,255,.03); }
.ghost-btn[aria-pressed="true"]{ color:var(--cream); border-color:rgba(236,227,210,.32); }
.ico-wave{
  width:12px; height:10px; display:inline-block;
  background:
    linear-gradient(to right, transparent 0 1px, currentColor 1px 2px, transparent 2px 4px, currentColor 4px 5px, transparent 5px 6px) no-repeat,
    linear-gradient(to right, currentColor 8px, transparent 8px) no-repeat;
  background-size: 12px 4px, 12px 4px; background-position: 0 3px, 0 3px;
  opacity:.8;
}

/* ---------------- hero ---------------- */
.hero{
  position:absolute; left:34px; bottom:168px; z-index:5; max-width:min(560px, 62vw);
  transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease);
}
.hero .eyebrow{
  display:flex; align-items:center; gap:10px;
  margin:0 0 16px; font-size:10.5px; letter-spacing:.36em; color:var(--ink-faint); font-weight:500;
}
.eyebrow .rule{ width:26px; height:1px; background:rgba(240,236,227,.34); display:inline-block; }
.hero .title{
  margin:0; font-family: var(--serif); font-weight:300;
  font-size: clamp(44px, 5.9vw, 78px);
  line-height:1.02; letter-spacing:.10em;
  color:#f7f3ea;
  text-shadow: 0 2px 40px rgba(0,0,0,.55), 0 0 1px rgba(255,255,255,.4);
}
.hero .sub{
  margin:16px 0 0; font-family: var(--serif); font-weight:300;
  font-size:15px; letter-spacing:.10em; color:rgba(240,236,227,.78);
}
.hero .en{
  margin:9px 0 0; font-family: var(--latin); font-style:italic;
  font-size:15px; letter-spacing:.05em; color:rgba(240,236,227,.45);
}
body.mode-walk .hero{ opacity:.0; transform:translateY(10px); filter:blur(2px); pointer-events:none; }
body.panel-open .hero{ opacity:0; }

/* ---------------- docks ---------------- */
.dock{ position:absolute; bottom:26px; z-index:6; }
.dock-left{ left:26px; display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.dock-right{ right:26px; }

.panel{
  display:flex; align-items:center; gap:14px;
  padding:9px 12px;
  background: var(--panel);
  border:1px solid var(--line-soft);
  border-radius:3px;
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  box-shadow: 0 12px 40px rgba(0,0,0,.34);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.panel-k{ font-size:10px; letter-spacing:.22em; color:var(--ink-faint); padding-left:2px; }
.chips{ display:flex; gap:3px; }
.chip{
  font-size:12.5px; letter-spacing:.1em; color:var(--ink-dim);
  padding:6px 13px; border-radius:2px;
  transition: color .28s var(--ease), background .28s var(--ease), box-shadow .28s var(--ease);
}
.chip:hover{ color:var(--ink); }
.chip.is-on{
  background: var(--cream); color: var(--cream-ink); font-weight:500;
  box-shadow: 0 2px 14px rgba(236,227,210,.22);
}
.v-rule{ width:1px; height:16px; background:var(--line); }
.switch{ display:flex; align-items:center; gap:8px; font-size:11.5px; letter-spacing:.1em; color:var(--ink-dim); padding:4px 4px 4px 0; }
.switch:hover{ color:var(--ink); }
.switch .sw{
  width:30px; height:15px; border-radius:9px; border:1px solid rgba(240,236,227,.26);
  position:relative; transition: background .3s var(--ease), border-color .3s var(--ease);
}
.switch .sw::after{
  content:""; position:absolute; top:2px; left:2px; width:9px; height:9px; border-radius:50%;
  background:rgba(240,236,227,.75); transition: transform .3s var(--ease), background .3s var(--ease);
}
.switch[aria-pressed="true"] .sw{ background:rgba(236,227,210,.9); border-color:rgba(236,227,210,.9); }
.switch[aria-pressed="true"] .sw::after{ transform:translateX(15px); background:#171a1f; }

.view-panel{ gap:2px; padding:7px; }
.vchip{
  display:flex; align-items:center; gap:7px;
  font-size:12.5px; letter-spacing:.08em; color:var(--ink-dim);
  padding:7px 13px 7px 11px; border-radius:2px;
  transition: color .28s var(--ease), background .28s var(--ease);
}
.vchip svg{ width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:1.3; stroke-linecap:round; stroke-linejoin:round; opacity:.85; }
.vchip:hover{ color:var(--ink); background:rgba(255,255,255,.035); }
.vchip.is-on{ color:var(--cream); background:rgba(236,227,210,.10); }
.vchip.is-on svg{ opacity:1; }

.hint{
  position:absolute; left:50%; bottom:32px; transform:translateX(-50%);
  z-index:5; font-size:11.5px; letter-spacing:.18em; color:var(--ink-faint);
  white-space:nowrap; pointer-events:none; transition: opacity .5s var(--ease);
}
.hint b{ color:rgba(240,236,227,.55); font-weight:500; }

.toast{
  position:absolute; left:50%; top:74px; transform:translate(-50%, -8px);
  z-index:8; padding:9px 18px; border-radius:2px;
  background: rgba(9,13,20,.74); border:1px solid var(--line-soft);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size:11.5px; letter-spacing:.12em; color:rgba(240,236,227,.86);
  opacity:0; pointer-events:none; transition: opacity .4s var(--ease), transform .4s var(--ease);
  max-width:min(80vw, 520px); text-align:center; line-height:1.7;
}
.toast.show{ opacity:1; transform:translate(-50%, 0); }

/* ---------------- hotspots ---------------- */
.hotspots{ position:absolute; inset:0; z-index:4; pointer-events:none; }
.hot{
  position:absolute; transform:translate(-50%,-50%);
  display:flex; align-items:center; gap:8px;
  padding:5px 10px 5px 7px; border-radius:2px;
  background: rgba(8,12,18,.55); border:1px solid rgba(240,236,227,.2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size:10.5px; letter-spacing:.1em; color:rgba(240,236,227,.9);
  pointer-events:auto; cursor:pointer; white-space:nowrap;
  opacity:0; transition: opacity .35s var(--ease), background .2s;
  will-change: transform;
}
.hot.show{ opacity:1; }
.hot:hover{ background: rgba(236,227,210,.92); color:#171a1f; border-color:transparent; }
.hot .dot{
  width:5px; height:5px; border-radius:50%; background:var(--cream);
  box-shadow:0 0 0 4px rgba(236,227,210,.14), 0 0 12px rgba(236,227,210,.8);
  animation: dotPulse 2.4s var(--ease) infinite;
}
@keyframes dotPulse{
  0%,100%{ box-shadow:0 0 0 3px rgba(236,227,210,.10), 0 0 10px rgba(236,227,210,.55); }
  50%{ box-shadow:0 0 0 6px rgba(236,227,210,.16), 0 0 16px rgba(236,227,210,.9); }
}
.hot .k{ opacity:.45; font-size:9px; }

/* ---------------- dialogue card ---------------- */
.card-wrap{
  position:absolute; left:50%; bottom:112px; transform:translate(-50%, 14px);
  z-index:7; width:min(560px, calc(100vw - 48px));
  opacity:0; pointer-events:none; transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.card-wrap.show{ opacity:1; transform:translate(-50%,0); pointer-events:auto; }
.card{
  position:relative; padding:20px 24px 22px;
  background: linear-gradient(180deg, rgba(12,17,25,.86), rgba(9,13,20,.9));
  border:1px solid var(--line-soft); border-left:1px solid rgba(236,227,210,.42);
  border-radius:2px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.card-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.card-k{ font-size:9.5px; letter-spacing:.26em; color:rgba(236,227,210,.5); }
.card-x{ font-size:16px; line-height:1; color:var(--ink-faint); padding:2px 4px; }
.card-x:hover{ color:var(--ink); }
.card-t{ margin:0; font-family:var(--serif); font-weight:300; font-size:15.5px; line-height:1.95; letter-spacing:.05em; color:rgba(247,243,234,.95); }
.card-s{ margin:12px 0 0; font-family:var(--serif); font-style:italic; font-size:10.5px; letter-spacing:.08em; color:rgba(240,236,227,.32); }

/* ---------------- letter ---------------- */
.veil{
  position:absolute; inset:0; z-index:20; display:flex; align-items:center; justify-content:center;
  background: rgba(3,5,9,.62); backdrop-filter: blur(10px) saturate(90%); -webkit-backdrop-filter: blur(10px);
  opacity:0; pointer-events:none; transition: opacity .55s var(--ease);
  padding: 28px;
}
.veil.show{ opacity:1; pointer-events:auto; }
.letter{
  position:relative; width:min(720px, 100%); max-height:min(88vh, 840px);
  display:flex; flex-direction:column;
  background:
    radial-gradient(120% 80% at 20% 0%, #f5eddd 0%, #ece2cf 46%, #e3d8c2 100%);
  color:#2a2722; border-radius:2px;
  box-shadow: 0 40px 120px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.16) inset;
  transform: translateY(18px) scale(.985); opacity:0;
  transition: transform .7s var(--ease), opacity .7s var(--ease);
}
.veil.show .letter{ transform:none; opacity:1; transition-delay:.08s; }
.letter::before{
  content:""; position:absolute; inset:9px; border:1px solid rgba(60,50,36,.16); pointer-events:none;
}
.letter-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:22px 34px 12px; font-size:9px; letter-spacing:.3em; color:rgba(60,50,36,.5);
}
.letter-x{ font-size:10px; letter-spacing:.16em; color:rgba(60,50,36,.6); }
.letter-x:hover{ color:#2a2722; }
.letter-body{
  overflow-y:auto; min-height:0; flex:1 1 auto; padding: 2px 40px 6px;
  font-family: var(--serif); font-weight:300; font-size:14.2px; line-height:2.05;
  letter-spacing:.035em; color:#332f28;
  scrollbar-width:thin; scrollbar-color:rgba(60,50,36,.24) transparent;
}
.letter-body.scrollable{ mask-image: linear-gradient(to bottom, #000 86%, rgba(0,0,0,0) 100%); -webkit-mask-image: linear-gradient(to bottom, #000 86%, rgba(0,0,0,0) 100%); }
.letter-body::-webkit-scrollbar{ width:3px; }
.letter-body::-webkit-scrollbar-thumb{ background:rgba(60,50,36,.24); }
.letter-body p{ margin:0 0 10px; text-indent:0; }
.letter-body p.lead{ font-size:16px; letter-spacing:.08em; margin-bottom:14px; }
.letter-body p.strong{ color:#241f19; }
.letter-sign{
  display:flex; align-items:center; justify-content:flex-end; gap:12px;
  padding: 4px 40px 26px;
}
.sign-line{ width:34px; height:1px; background:rgba(60,50,36,.25); }
.letter-sign b{ font-family:var(--serif); font-weight:400; font-size:15px; letter-spacing:.24em; color:#2a2620; }
.letter-sign i{ font-style:normal; font-size:9px; letter-spacing:.24em; color:rgba(60,50,36,.4); }

/* ---------------- hexagram ---------------- */
#hex-wrap{
  left:0; right:0; top:0; bottom:0; width:auto; display:flex; align-items:center; justify-content:center;
  padding:24px; background:rgba(3,5,9,.52);
  backdrop-filter: blur(9px) saturate(95%); -webkit-backdrop-filter: blur(9px);
}
#hex-wrap.show{ transform:none; }
#hex-wrap .hex-card{ width:min(560px, 100%); }
.hex-card{
  position:relative; display:flex; gap:26px; padding:26px 28px;
  background: linear-gradient(160deg, rgba(14,19,27,.92), rgba(8,11,17,.94));
  border:1px solid var(--line-soft); border-radius:2px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.hex-left{ display:flex; flex-direction:column; align-items:center; gap:12px; padding-top:4px; }
.hex{ width:56px; height:84px; }
.hex line{ stroke:rgba(236,227,210,.86); stroke-width:4.6; }
.hex line.broken-gap{ stroke:transparent; }
.hex-no{ font-size:8.5px; letter-spacing:.24em; color:var(--ink-faint); white-space:nowrap; }
.hex-right{ flex:1; }
.hex-name{ margin:0 0 14px; font-family:var(--serif); font-size:26px; font-weight:300; letter-spacing:.16em; color:#f6f1e7; display:flex; align-items:baseline; gap:12px; }
.hex-name span{ font-family:var(--sans); font-size:9px; letter-spacing:.24em; color:var(--ink-faint); font-weight:400; }
.hex-quote{ margin:0; font-family:var(--serif); font-size:14px; line-height:2.1; letter-spacing:.06em; color:rgba(247,243,234,.9); }
.hex-ps{ margin:16px 0 0; font-size:11px; line-height:1.9; letter-spacing:.04em; color:rgba(240,236,227,.44); }
.hex-ans{ margin:14px 0 0; font-family:var(--serif); font-size:12.5px; letter-spacing:.2em; color:rgba(236,227,210,.82); }
.hex-x{ position:absolute; top:12px; right:14px; }

/* ---------------- riddle ---------------- */
.riddle{
  position:relative; width:min(520px, 100%); padding:34px 34px 30px;
  background: linear-gradient(170deg, rgba(15,20,28,.94), rgba(8,11,17,.96));
  border:1px solid var(--line-soft); border-radius:2px;
  box-shadow: 0 36px 110px rgba(0,0,0,.6);
  transform: translateY(16px); opacity:0; transition: transform .6s var(--ease), opacity .6s var(--ease);
}
.veil.show .riddle{ transform:none; opacity:1; }
.r-k{ margin:0 0 18px; font-size:9px; letter-spacing:.3em; color:rgba(236,227,210,.42); }
.r-q{ margin:0; font-family:var(--serif); font-weight:300; font-size:27px; letter-spacing:.14em; color:#f7f3ea; }
.r-h{ margin:12px 0 30px; font-size:11.5px; letter-spacing:.08em; color:var(--ink-dim); }
.r-input{ display:flex; align-items:flex-end; gap:14px; }
.r-input label{ display:flex; flex-direction:column; gap:8px; flex:1; }
.r-input label span{ font-size:9px; letter-spacing:.24em; color:var(--ink-faint); }
.r-input select{
  appearance:none; -webkit-appearance:none;
  width:100%; padding:11px 12px; border-radius:2px;
  background: rgba(255,255,255,.04); border:1px solid var(--line);
  color:#f2eee5; font-family:var(--serif); font-size:15px; letter-spacing:.08em;
  text-align:center; outline:none; transition:border-color .25s, background .25s;
}
.r-input select:focus{ border-color:rgba(236,227,210,.5); background:rgba(255,255,255,.07); }
.r-input select option{ background:#0d1219; color:#f2eee5; }
.r-foot{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:30px; }
.r-tip{ margin:0; font-size:11px; letter-spacing:.06em; color:rgba(240,236,227,.4); min-height:16px; }
.r-go{
  padding:11px 26px; font-size:11.5px; letter-spacing:.22em;
  background: var(--cream); color:var(--cream-ink); border-radius:2px;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease);
  box-shadow:0 6px 24px rgba(236,227,210,.16);
}
.r-go:hover{ transform:translateY(-1px); box-shadow:0 10px 30px rgba(236,227,210,.24); }
.r-x{ position:absolute; top:12px; right:14px; }
.riddle.shake{ animation: shake .42s ease; }
@keyframes shake{ 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 45%{transform:translateX(6px)} 70%{transform:translateX(-3px)} }

/* ---------------- gift ---------------- */
.gift-card{
  position:relative; width:min(460px, 100%); padding:40px 38px 34px; text-align:center;
  background: linear-gradient(170deg, rgba(18,22,30,.95), rgba(9,12,18,.97));
  border:1px solid rgba(236,227,210,.14); border-radius:2px;
  box-shadow: 0 40px 120px rgba(0,0,0,.65), 0 0 90px rgba(120,200,255,.06) inset;
  transform: translateY(16px) scale(.99); opacity:0; transition: transform .7s var(--ease), opacity .7s var(--ease);
}
.veil.show .gift-card{ transform:none; opacity:1; }
.g-k{ margin:0 0 24px; font-size:9px; letter-spacing:.3em; color:rgba(236,227,210,.4); }
.g-t{ margin:0; font-family:var(--serif); font-size:24px; font-weight:300; letter-spacing:.14em; color:#f7f3ea; }
.g-s{ margin:18px 0 0; font-size:12px; line-height:2; letter-spacing:.06em; color:rgba(240,236,227,.55); }
.g-q{ margin:24px 0 0; font-family:var(--serif); font-size:14px; letter-spacing:.24em; color:rgba(236,227,210,.9); }
.g-close{
  margin-top:32px; padding:10px 30px; font-size:11px; letter-spacing:.24em;
  border:1px solid rgba(236,227,210,.26); border-radius:2px; color:rgba(240,236,227,.8);
  transition: background .25s, color .25s, border-color .25s;
}
.g-close:hover{ background:var(--cream); color:var(--cream-ink); border-color:var(--cream); }

/* ---------------- help ---------------- */
.help{
  position:relative; width:min(520px,100%); padding:34px 36px 30px;
  background: rgba(9,13,20,.94); border:1px solid var(--line-soft); border-radius:2px;
  box-shadow:0 30px 100px rgba(0,0,0,.6);
  transform:translateY(14px); opacity:0; transition: transform .6s var(--ease), opacity .6s var(--ease);
}
.veil.show .help{ transform:none; opacity:1; }
.h-k{ margin:0 0 22px; font-size:9px; letter-spacing:.3em; color:rgba(236,227,210,.4); }
.help ul{ margin:0; padding:0; list-style:none; }
.help li{ font-size:12px; line-height:2.15; letter-spacing:.04em; color:rgba(240,236,227,.58); padding-left:14px; position:relative; }
.help li::before{ content:""; position:absolute; left:0; top:13px; width:4px; height:1px; background:rgba(236,227,210,.4); }
.help li b{ color:rgba(247,243,234,.9); font-weight:500; }
.help .h-credit{ margin-top:14px; font-size:10.5px; line-height:1.8; letter-spacing:.03em; color:rgba(240,236,227,.36); }
.h-close{ margin-top:26px; padding:10px 26px; font-size:11px; letter-spacing:.24em; background:var(--cream); color:var(--cream-ink); border-radius:2px; }

/* ---------------- joystick ---------------- */
.joy{ position:absolute; left:26px; bottom:96px; z-index:6; opacity:0; pointer-events:none; transition:opacity .4s var(--ease); }
body.touch.mode-walk .joy{ opacity:1; pointer-events:auto; }
.joy-base{
  width:104px; height:104px; border-radius:50%;
  border:1px solid rgba(240,236,227,.16); background:rgba(9,13,20,.32);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display:flex; align-items:center; justify-content:center;
  touch-action:none;
}
.joy-knob{
  width:40px; height:40px; border-radius:50%;
  background:rgba(236,227,210,.82); box-shadow:0 0 24px rgba(236,227,210,.3);
  transform:translate(0,0);
}

/* ---------------- responsive ---------------- */
@media (max-width: 900px){
  .topbar{ padding:16px 16px; }
  .mark-txt i{ display:none; }
  .hero{ left:20px; bottom:196px; max-width:78vw; }
  .hero .title{ font-size:clamp(36px, 9.4vw, 50px); }
  .hero .sub{ font-size:12px; }
  .hero .en{ font-size:10.5px; }
  .dock{ bottom:18px; }
  .dock-left{ left:14px; }
  .dock-right{ right:14px; }
  .panel{ padding:7px 9px; gap:9px; backdrop-filter: blur(12px); }
  .panel-k{ display:none; }
  .chip{ padding:6px 9px; font-size:11px; }
  .vchip{ padding:8px 9px; font-size:10.5px; gap:5px; }
  .vchip svg{ width:13px; height:13px; }
  .vchip span{ display:none; }
  .weather-panel{ gap:6px; }
  .chip{ padding:7px 8px; font-size:11px; }
  .hint{ display:none; }
  .hint{ bottom:132px; font-size:9.5px; letter-spacing:.12em; }
  .card-wrap{ bottom:150px; }
  .letter{ max-height:86vh; }
  .letter-body{ padding:2px 22px 4px; font-size:13.2px; line-height:2.0; }
  .letter-head{ padding:18px 24px 10px; }
  .letter-sign{ padding:2px 24px 20px; }
  .hex-card{ flex-direction:row; gap:16px; padding:22px 18px; }
  .hex{ width:44px; height:66px; }
  .hex-name{ font-size:22px; }
  .hex-quote{ font-size:12.5px; }
  .riddle{ padding:26px 22px 24px; }
  .r-q{ font-size:23px; }
  .r-input{ gap:8px; }
  .gift-card{ padding:32px 24px 28px; }
  .g-t{ font-size:21px; }
  .help{ padding:28px 22px 24px; }
  .joy{ left:16px; bottom:84px; }
  .joy-base{ width:88px; height:88px; }
  .joy-knob{ width:34px; height:34px; }
  body.touch.mode-walk .dock-left{ bottom:18px; }
}
@media (max-width: 560px){
  .topbar-right .ghost-btn span:last-child{ display:none; }
  .vchip{ padding:7px 8px; }
  .weather-panel{ gap:7px; }
  .hint{ width:92vw; white-space:normal; text-align:center; line-height:1.7; }
  /* 窄屏：两组控件分两行，互不遮挡 */
  .dock-left{ bottom:76px; }
  body.touch.mode-walk .dock-left{ bottom:76px; }
  .hero{ bottom:250px; }
  .card-wrap{ bottom:206px; }
  .joy{ bottom:140px; }
  .topbar-right{ gap:6px; }
  .ghost-btn{ white-space:nowrap; padding:7px 9px; font-size:11px; }
  .mark-txt b{ letter-spacing:.22em; font-size:10px; }
}

@media (prefers-reduced-motion: reduce){
  .grain{ animation:none; }
  *{ transition-duration:.01ms !important; }
}

/* 竖屏时底部压暗，保证标题压在斑马线/车流上仍可读 */
@media (max-width: 700px) and (orientation: portrait){
  .grade{
    background:
      radial-gradient(125% 80% at 50% 38%, rgba(0,0,0,0) 42%, rgba(3,6,12,.5) 82%, rgba(2,4,8,.78) 100%),
      linear-gradient(to top, rgba(2,4,9,.88) 0%, rgba(2,4,9,.55) 16%, rgba(2,4,9,.18) 34%, rgba(2,4,9,0) 50%);
  }
  .hero{ left:20px; right:20px; }
  .hero .title{ text-shadow: 0 2px 30px rgba(0,0,0,.85), 0 1px 2px rgba(0,0,0,.6); }
}


/* ---------------- reset view & room tour ---------------- */
.vreset{
  width:30px; height:30px; display:flex; align-items:center; justify-content:center;
  border-radius:50%; color:var(--ink-dim); margin-left:4px;
  transition: color .28s var(--ease), background .28s var(--ease), transform .3s var(--ease);
}
.vreset svg{ width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.45; stroke-linecap:round; stroke-linejoin:round; }
.vreset:hover{ color:var(--cream); background:rgba(236,227,210,.12); transform:rotate(-35deg); }

.tour-wrap{ position:relative; }
.tour-badge{
  font-style:normal; font-size:9.5px; letter-spacing:.08em; padding:1px 6px;
  border-radius:10px; background:rgba(142,226,255,.16); color:#a8e6ff;
}
.tour-menu{
  position:absolute; right:0; top:calc(100% + 10px); width:212px; padding:10px;
  background: rgba(10,16,28,.86); border:1px solid var(--line); border-radius:3px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  opacity:0; transform:translateY(-6px); pointer-events:none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.tour-menu.show{ opacity:1; transform:none; pointer-events:auto; }
.tour-h{ margin:2px 6px 8px; font-size:9px; letter-spacing:.22em; color:var(--ink-faint); }
.tour-item{
  width:100%; display:flex; align-items:center; justify-content:space-between;
  padding:7px 8px; border-radius:2px; font-size:11.5px; letter-spacing:.06em; color:var(--ink-dim);
  transition: background .2s, color .2s;
}
.tour-item:hover{ background:rgba(236,227,210,.1); color:var(--ink); }
.tour-item i{ font-style:normal; font-size:10px; color:var(--ink-faint); }
.tour-item.is-done span::before{ content:"✓ "; color:#8de2ff; }
.tour-item.is-done i{ color:rgba(141,226,255,.78); }


/* ---------------- GTA Enter CTA / Crosshair / Prompt / Pause ---------------- */
.enter-cta{
  margin-top:22px; display:inline-flex; align-items:center; gap:12px;
  padding:11px 22px; border-radius:2px;
  background: var(--cream); color: var(--cream-ink);
  box-shadow: 0 10px 34px rgba(236,227,210,.26);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.enter-cta:hover{ transform:translateY(-2px); box-shadow:0 14px 40px rgba(236,227,210,.36); }
.enter-cta span{ font-size:13px; font-weight:600; letter-spacing:.18em; }
.enter-cta i{ font-style:normal; font-size:10.5px; letter-spacing:.06em; opacity:.62; }

.crosshair{
  position:absolute; left:50%; top:50%; width:6px; height:6px; margin:-3px 0 0 -3px;
  border-radius:50%; background:rgba(247,243,234,.9);
  box-shadow:0 0 0 2px rgba(8,14,24,.45), 0 0 10px rgba(155,220,255,.5);
  z-index:9; pointer-events:none; opacity:0; transition:opacity .25s var(--ease);
}
body.is-locked .crosshair{ opacity:1; }

.interact-prompt{
  position:absolute; left:50%; top:calc(50% + 26px); transform:translateX(-50%);
  z-index:9; display:flex; align-items:center; gap:8px;
  padding:6px 13px; border-radius:2px;
  background:rgba(8,14,24,.76); border:1px solid rgba(236,227,210,.26);
  backdrop-filter:blur(10px); font-size:12px; letter-spacing:.08em; color:var(--ink);
  pointer-events:none; opacity:0; transition:opacity .22s var(--ease);
}
.interact-prompt.show{ opacity:1; }
.interact-prompt kbd{
  font-family:var(--sans); font-size:10px; font-weight:600; padding:1px 6px;
  border-radius:2px; background:var(--cream); color:var(--cream-ink);
}

.pause-card{
  position:relative; width:min(440px, 100%); padding:32px 34px; text-align:center;
  background: linear-gradient(170deg, rgba(14,20,30,.95), rgba(8,12,18,.97));
  border:1px solid var(--line); border-radius:3px;
  box-shadow:0 36px 110px rgba(0,0,0,.65);
}
.sens-row{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  margin-bottom:26px; font-size:12px; color:var(--ink-dim);
}
.sens-row input{ flex:1; accent-color:var(--cream); }
.sens-row em{ font-style:normal; min-width:34px; text-align:right; color:var(--cream); }
.pause-actions{ display:flex; align-items:center; justify-content:center; gap:14px; }

/* ---------------- 开场：电影遮幅 + UI 延迟浮现 ---------------- */
.letterbox{ position:absolute; inset:0; pointer-events:none; z-index:40; }
.letterbox::before, .letterbox::after{
  content:""; position:absolute; left:0; right:0; height:11vh; background:#020408;
  transition: transform 1.6s cubic-bezier(.7,0,.2,1);
}
.letterbox::before{ top:0; transform:translateY(-100%); }
.letterbox::after{ bottom:0; transform:translateY(100%); }
/* v15：不再用黑色遮幅——开场也保持全画幅（黑边在宽屏上看起来像画面坏了） */
.letterbox{ display:none; }
.topbar, .hero, .dock, .hint{ transition: opacity 1.4s var(--ease), transform 1.4s var(--ease); }
body.intro .topbar, body.intro .hero, body.intro .dock, body.intro .hint{ opacity:0; pointer-events:none; }
body.intro .hero{ transform:translateY(14px); }
.intro-skip{
  position:absolute; right:28px; bottom:28px; z-index:41; pointer-events:none;
  font:500 10px/1 var(--sans, sans-serif); letter-spacing:.32em; color:rgba(220,232,245,.55);
  opacity:0; transition:opacity .8s var(--ease);
}
body.intro .intro-skip{ opacity:1; }

/* ---------------- 庆祝：烟花秀 / 孔明灯 ---------------- */
.celebrate-panel{ gap:6px; padding:6px 10px 6px 12px; }
.cel-btn{
  display:flex; align-items:center; gap:7px; padding:6px 11px; border-radius:2px;
  font-size:12px; letter-spacing:.12em; color:var(--ink-dim);
  transition: color .28s var(--ease), background .28s var(--ease);
}
.cel-btn svg{ width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.4; stroke-linecap:round; }
.cel-btn:hover{ color:var(--ink); background:rgba(236,227,210,.08); }
.cel-btn.is-on{ color:#ffd9a0; }
.cel-btn.is-on svg{ filter: drop-shadow(0 0 6px rgba(255,190,120,.7)); }
.cel-tip{ font-size:10.5px; letter-spacing:.14em; color:rgba(220,226,235,.38); padding-left:4px; }
@media (max-width: 900px){ .cel-tip{ display:none; } .cel-btn{ padding:6px 8px; font-size:11px; } }
@media (max-width: 900px){ body.touch.mode-walk .celebrate-panel{ display:none; } }

body.show .hero, body.show .hint{ opacity:0; pointer-events:none; transform:translateY(10px); }

/* ---------------- 电影字幕（开场标题 / 生日庆典） ---------------- */
.cine-caption {
  position: fixed; left: 50%; bottom: 17vh; transform: translate(-50%, 12px);
  z-index: 40; pointer-events: none; text-align: center; opacity: 0;
  transition: opacity 1.1s ease, transform 1.4s cubic-bezier(.2,.7,.2,1), letter-spacing 2.4s ease;
  color: #f4f7fb; text-shadow: 0 2px 24px rgba(0, 10, 30, .65);
}
.cine-caption.on { opacity: 1; transform: translate(-50%, 0); }
.cine-caption b { display: block; font: 300 clamp(26px, 4.2vw, 54px)/1.1 "Noto Serif SC", "Songti SC", serif; letter-spacing: .14em; }
.cine-caption span { display: block; margin-top: 12px; font: 400 clamp(11px, 1.1vw, 14px)/1.4 "Helvetica Neue", Arial, sans-serif; letter-spacing: .42em; color: rgba(214, 228, 245, .82); text-transform: uppercase; }
.cine-caption.title { bottom: auto; top: 40%; }
.cine-caption.title b { font: 200 clamp(20px, 4.2vw, 70px)/1 "Helvetica Neue", Arial, sans-serif; letter-spacing: .38em; white-space: nowrap; }
.cine-caption b, .cine-caption span { white-space: nowrap; }
.cine-caption.title.on b { letter-spacing: .3em; }
.cine-caption.title span { font: 300 clamp(16px, 1.8vw, 24px)/1.4 "Noto Serif SC", "Songti SC", serif; letter-spacing: .6em; color: #ffe3b4; }
.cine-caption.small b { font-size: clamp(16px, 1.8vw, 22px); letter-spacing: .5em; }
.cine-caption.soft b { color: #ffe9c6; }
body.celebrating .hero, body.celebrating .dock, body.celebrating .hint { opacity: 0 !important; pointer-events: none !important; transition: opacity .8s ease; }
.cel-btn.cel-main { background: linear-gradient(135deg, rgba(255, 214, 150, .22), rgba(120, 180, 255, .16)); border-color: rgba(255, 220, 170, .45); }
body.celebrating .cel-btn.cel-main { box-shadow: 0 0 0 1px rgba(255, 220, 170, .6), 0 0 22px rgba(255, 200, 120, .35); }
