@font-face{font-family:TideSong;src:url('./assets/tide-song.woff') format('woff');font-display:swap}
:root{color-scheme:light;--ink:#503853;--secondary:#735b74;--line:rgba(96,61,100,.20);--accent:#825878;--serif:TideSong,"Songti SC","STSong","Noto Serif CJK SC",serif;--sans:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}
*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;overflow:hidden}
body{height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr) auto;color:var(--ink);font:16px/1.55 var(--sans);background:linear-gradient(110deg,#e3d5f0 0%,#f0def0 53%,#f9e2eb 100%);overscroll-behavior:none;-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation}
button:focus-visible,main:focus-visible{outline:2px solid #916185;outline-offset:3px}main:focus:not(:focus-visible){outline:none}
button:disabled{cursor:default;opacity:.47}
[hidden]{display:none!important}
svg{height:22px;width:22px;fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.glyphs{position:absolute;width:0;height:0;pointer-events:none}
.mast,.reading-bar{z-index:4;position:relative;margin:0 clamp(18px,4.6vw,86px);user-select:none}
.mast{padding:calc(13px + env(safe-area-inset-top)) 0 9px;display:flex;align-items:center;justify-content:space-between;min-height:66px}
button.quiet,.tool,.circle,.round,.under,#panBar button{background:none;border:none}
.brand{display:inline-flex;align-items:center;gap:11px;padding:2px 0;color:#604160;font:600 22px/1.25 var(--serif);letter-spacing:.12em}.brand .shellmark{width:32px;height:32px;stroke-width:1.35}
.tools{display:flex;align-items:center;gap:5px}
.circle,.round,.tool{display:inline-flex;align-items:center;justify-content:center;border-radius:99px;min-width:42px;min-height:42px;padding:8px}
.tool,.round,.under,.close,#panBar button{transition:background .15s,color .15s}
.tool:hover,.round:hover,.close:hover,#panBar button:hover{background:#fff6}.index{gap:8px;padding-inline:16px;margin-left:4px;border:1px solid var(--line);font-size:14px;letter-spacing:.06em;background:#fff2}
#stage{position:relative;overflow:hidden;min-height:0;min-width:0;isolation:isolate;outline:none;touch-action:none}
#world,#gameUI,#loading{position:absolute;inset:0}
#world{right:auto;bottom:auto;width:var(--world-w,100%);height:100%;left:var(--world-left,0px);touch-action:none}
#bookCanvas,#adventure{display:block;position:absolute;inset:0;width:100%;height:100%;touch-action:none}
#bookCanvas{outline:none}
#adventure,#gameUI{pointer-events:none}
#gameUI{z-index:5}
#stage.can-turn{cursor:grab}#stage[data-dragging="true"]{cursor:grabbing}
#loading{display:grid;place-content:center;font:17px var(--serif);color:var(--secondary);pointer-events:none}
#loading.error{pointer-events:auto;text-align:center}
#loading button{margin:12px auto;background:white;border:1px solid var(--line);border-radius:20px;padding:7px 17px}
.reading-bar{display:grid;grid-template-columns:1fr minmax(130px,auto) 1fr;align-items:center;gap:18px;border-top:1px solid var(--line);padding:15px 1px calc(15px + env(safe-area-inset-bottom));min-height:88px}
.chapter-label{display:grid;gap:2px;justify-self:start}
#chapterNo{font:13px/1.4 var(--sans);letter-spacing:.13em;color:var(--secondary)}
#chapterTitle{font:500 clamp(18px,1.7vw,27px)/1.37 var(--serif);letter-spacing:.06em;margin:0}
.center-control{text-align:center}.right-control{justify-self:end}.open-button{border-radius:99px;background:#60415e;color:#fff7fc;min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:11px;border:1px solid #60415e;padding:9px 22px;letter-spacing:.07em;font-size:15px;box-shadow:0 3px 7px #69436717}.open-button:hover{background:#71506e}
#liveHint,#coverTip{margin:0;font-size:14px;letter-spacing:.025em;color:var(--secondary)}
#paging{display:flex;align-items:center;gap:6px}
.round{width:40px;min-width:40px;height:40px;min-height:40px;border:1px solid var(--line);background:#fff2}.round svg{width:17px;height:17px}
#folio{font:15px/1 Georgia,serif;letter-spacing:.07em;padding:0 6px;white-space:nowrap;font-variant-numeric:tabular-nums}
.shell-dialog{color:var(--ink);background:#f9f0f6;border:1px solid #cfbacd;border-radius:18px;padding:23px min(6vw,30px) 24px;width:min(440px,90vw);max-height:85dvh;box-shadow:0 18px 75px #5331532e;overscroll-behavior:contain}
.shell-dialog::backdrop{background:#49304d45}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:15px}.dialog-head h2{font:500 26px var(--serif);letter-spacing:.07em;margin:0}
#chapterList{list-style:none;padding:0;margin:12px 0}.list-row{display:flex;min-height:48px;align-items:center;gap:17px;width:100%;padding:6px 3px;text-align:left;border:0;border-bottom:1px solid var(--line);background:none}
.list-row:hover{background:#efe2ef}.list-row .ord{font:italic 17px Georgia,serif;color:#876180;min-width:25px}.list-row .where{font-family:var(--serif);font-size:19px}.list-row .here{margin-left:auto;color:var(--secondary);font-size:13px}
.under{padding:6px 0;border-bottom:1px solid var(--accent);font-size:15px;color:var(--accent)}
.help-list{display:grid;grid-template-columns:max-content 1fr;gap:14px 20px;line-height:1.65;margin-bottom:0}.help-list dt{font-family:var(--serif);font-weight:600}.help-list dd{margin:0;color:var(--secondary);font-size:15px}
#panBar{position:absolute;right:12px;top:5px;z-index:6;display:flex;align-items:center;border-radius:100px;background:#faf3fae8;box-shadow:0 2px 9px #68526720;color:var(--secondary);font-size:13px}#panBar button{height:39px;width:39px;display:grid;place-content:center;border-radius:50%}#panBar svg{width:16px;height:16px}
#notice{position:fixed;z-index:30;left:50%;top:calc(67px + env(safe-area-inset-top));transform:translateX(-50%);background:#594056f5;color:white;border-radius:30px;padding:7px 16px;white-space:normal;text-align:center;font-size:14px;pointer-events:none}
@media(max-width:760px){.brand{font-size:19px;gap:7px}.brand .shellmark{width:27px;height:27px}.mast{min-height:53px;padding-top:calc(5px + env(safe-area-inset-top));padding-bottom:3px}.reading-bar{gap:7px;padding:10px 0 calc(11px + env(safe-area-inset-bottom));min-height:70px}.index{padding-inline:9px}.tools{gap:1px}.circle,.tool{min-width:36px;min-height:38px;padding:7px}.tool svg{width:20px;height:20px}#coverTip,#liveHint{font-size:13px}}
@media(max-aspect-ratio:1/1) and (max-width:920px){.reading-bar{grid-template-columns:1fr auto;gap:7px 12px}.center-control{grid-column:1/-1;grid-row:2;justify-self:center}.right-control{grid-column:2;grid-row:1}.chapter-label{gap:0}#chapterTitle{font-size:18px}.center-control .open-button{font-size:15px;min-height:40px;padding:7px 21px}#liveHint{font-size:14px;min-height:22px}#coverTip{display:none}.tools{gap:2px}#world{height:100%}.mast,.reading-bar{margin-inline:16px}}
@media(max-height:540px) and (orientation:landscape){.mast,.reading-bar{margin-inline:max(18px,env(safe-area-inset-left))}.mast{min-height:38px;padding-block:0}.brand{font-size:17px}.brand .shellmark{width:24px;height:24px}.circle,.tool{min-height:32px;min-width:34px;padding:5px}.index{padding-inline:11px}.reading-bar{min-height:45px;padding:4px 0 calc(4px + env(safe-area-inset-bottom))}.chapter-label{display:flex;align-items:center;gap:8px}#chapterTitle{font-size:17px}#chapterNo{font-size:12px}.round{width:33px;height:33px;min-width:33px;min-height:33px}.open-button{min-height:33px;padding:4px 14px}.help-list{gap:9px 15px}}

#loading{container-type:size}
#loading>img{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(91cqw,82cqh);aspect-ratio:1.04;object-fit:fill;box-shadow:0 5px 1px #d7a9c1,0 9px 2px #ad89b2,0 13px 21px #694d7524;border-radius:5px}
#loading>span{position:absolute;left:50%;bottom:2%;transform:translateX(-50%);font-size:14px}
#loading.error>span{position:static;transform:none}
