:root{--ink:#14221d;--muted:#66726d;--paper:#f4f1e8;--paper2:#ebe7dc;--cinnabar:#a23a2a;--line:rgba(20,34,29,.18);--serif:"Songti SC","STSong","Noto Serif CJK SC",serif;--sans:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}
*{box-sizing:border-box}html{background:var(--paper);color:var(--ink)}body{margin:0;min-height:100vh;font-family:var(--sans);background:radial-gradient(circle at 82% 14%,rgba(255,255,255,.75),transparent 28%),linear-gradient(135deg,var(--paper),#f7f5ef 52%,var(--paper2));letter-spacing:.02em}button,textarea{font:inherit;color:inherit}.shell{width:min(1100px,100%);min-height:100vh;margin:auto;padding:28px 42px 60px}.topbar{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding-bottom:18px}.wordmark{font-family:var(--serif);font-size:1.55rem;letter-spacing:.28em;border:0;background:none;padding:6px 0;cursor:pointer}.topbar nav{display:flex;gap:25px}.nav-btn,.text-btn{border:0;background:none;color:var(--muted);cursor:pointer;padding:8px 0}.nav-btn:hover,.text-btn:hover{color:var(--ink)}.view{display:none}.view.active{display:block}.opening{max-width:690px;padding:12vh 0 0 7%}.eyebrow{font-size:.78rem;letter-spacing:.28em;color:var(--cinnabar);text-transform:uppercase;margin:0 0 18px}h1,h2,h3{font-family:var(--serif);font-weight:500;margin:0}h1{font-size:clamp(2.6rem,6vw,5.1rem);line-height:1.12;letter-spacing:.08em}h2{font-size:clamp(2rem,4.5vw,3.7rem);line-height:1.2}.lead{font-family:var(--serif);color:var(--muted);font-size:1.08rem;line-height:1.9;max-width:610px}.question-box{display:block;margin-top:42px;border-bottom:1px solid var(--ink);position:relative}.question-box span{display:block;color:var(--muted);font-size:.78rem;letter-spacing:.18em}.question-box textarea{display:block;width:100%;height:80px;padding:13px 52px 12px 0;border:0;resize:none;background:transparent;outline:none;font-family:var(--serif);font-size:1.16rem;line-height:1.6}.question-box small{position:absolute;right:0;bottom:15px;color:var(--muted)}.question-box b{font-weight:400}.primary,.secondary{border:1px solid var(--ink);padding:15px 28px;letter-spacing:.12em;cursor:pointer;transition:.25s}.primary{margin-top:28px;background:var(--ink);color:var(--paper)}.primary:hover:not(:disabled){background:var(--cinnabar);border-color:var(--cinnabar)}.primary:disabled{opacity:.3;cursor:not-allowed}.secondary{background:transparent}.quiet{font-size:.76rem;color:#87908c;line-height:1.6}.seal{position:fixed;right:7vw;bottom:8vh;width:72px;height:72px;border:2px solid rgba(162,58,42,.25);transform:rotate(-5deg);display:grid;place-items:center;color:rgba(162,58,42,.25);font-family:var(--serif);font-size:2rem}.ritual{text-align:center;padding-top:7vh}.ritual-head{max-width:600px;margin:auto}.stalk-stage{height:270px;display:flex;justify-content:center;align-items:center;gap:25px;margin:20px auto;overflow:hidden}.pile{width:170px;height:210px;position:relative;transition:.5s}.pile::before{content:"";position:absolute;inset:0;background:repeating-linear-gradient(88deg,transparent 0 6px,var(--ink) 7px 8px,transparent 9px 12px);opacity:.72;clip-path:polygon(8% 2%,94% 7%,86% 98%,15% 95%)}.void{width:45px}.void i{display:block;width:8px;height:8px;background:var(--cinnabar);border-radius:50%;margin:auto}.choices{display:flex;justify-content:center;gap:12px}.choices button{width:155px;padding:16px 10px;border:1px solid var(--line);background:rgba(255,255,255,.23);cursor:pointer}.choices button:hover{border-color:var(--cinnabar);transform:translateY(-2px)}.choices span,.choices small{display:block}.choices small{color:var(--muted);font-size:.72rem;margin-top:6px}.ritual .text-btn{margin-top:24px}.result{max-width:850px;margin:auto;padding-top:8vh}.hexagram-wrap{display:grid;grid-template-columns:1fr 60px 1fr;align-items:center;text-align:center;margin:45px 0}.hexagram-wrap article>p,.card-kicker{color:var(--muted);font-size:.75rem;letter-spacing:.22em}.hexagram{width:145px;margin:22px auto;display:flex;flex-direction:column-reverse;gap:10px}.yao{height:13px;display:flex;gap:19px;position:relative}.yao::before,.yao::after{content:"";height:100%;background:var(--ink);flex:1}.yao.yang::after{display:none}.yao.moving::before,.yao.moving::after{background:var(--cinnabar)}.yao em{position:absolute;right:-27px;top:-5px;color:var(--cinnabar);font-style:normal}.change-mark{font-family:var(--serif);color:var(--muted);font-size:1.3rem}.hexagram-wrap h3{font-size:1.45rem}.reading-card{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:28px 4px;font-family:var(--serif);line-height:1.9;font-size:1.05rem}.moving{color:var(--cinnabar);margin-top:14px}.result-actions{display:flex;gap:12px}.result-actions .secondary{margin-top:28px}.narrow{max-width:720px;margin:auto;padding-top:10vh}.history-list{margin-top:35px}.history-item{border-top:1px solid var(--line);padding:22px 0}.history-item:last-child{border-bottom:1px solid var(--line)}.history-item time{font-size:.75rem;color:var(--muted)}.history-item h3{margin:8px 0;font-size:1.1rem}.history-item p{margin:0;color:var(--muted);font-family:var(--serif)}.empty{color:var(--muted);font-family:var(--serif);padding:38px 0;border-top:1px solid var(--line)}.prose{font-family:var(--serif);font-size:1.08rem;line-height:2;margin-top:40px}.prose p{padding-left:25px;border-left:1px solid var(--line);margin:25px 0}#toast{position:fixed;left:50%;bottom:30px;transform:translate(-50%,15px);background:var(--ink);color:var(--paper);padding:10px 18px;opacity:0;pointer-events:none;transition:.3s;font-size:.85rem}#toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:650px){.shell{padding:20px 20px 45px}.topbar nav{gap:15px}.nav-btn{font-size:.86rem}.opening{padding:11vh 0 0}.seal{display:none}.choices{gap:7px}.choices button{width:31%;padding:13px 4px}.stalk-stage{height:220px}.pile{width:120px;height:170px}.hexagram-wrap{grid-template-columns:1fr 34px 1fr}.hexagram{width:112px}.result-actions{flex-direction:column}.result-actions .secondary{margin-top:0}.primary,.secondary{width:100%}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

.stalk-table{max-width:780px;margin:28px auto 0;padding:40px 34px 25px;background:#192720;color:#d8c58c;min-height:320px;border-radius:3px}.reserved{display:block;width:45px;height:4px;background:#d8c58c;margin:0 auto 36px;border-radius:2px}#stalk-field{position:relative;width:100%;height:145px;cursor:crosshair;touch-action:pan-y;outline-offset:8px}#stalk-field:focus-visible{outline:2px solid #d8c58c}#stalk-row{position:absolute;inset:0;pointer-events:none}.stalk{position:absolute;top:22px;width:3px;height:77px;border-radius:2px;background:#d8c58c;transition:transform .35s ease,opacity .3s,top .35s;pointer-events:none}.stalk.set-aside{top:-24px!important;opacity:.5}.stalk.remainder{top:67px;opacity:.28}#cut-marker{position:absolute;top:3px;height:112px;border-left:1px dashed #e0d9b6;opacity:0;pointer-events:none}#stalk-field:focus-visible #cut-marker{opacity:.75}#stalk-field.splitting #cut-marker{opacity:0}#split-status{min-height:44px;margin:10px 0 0;font-size:.875rem;line-height:1.6;color:#dfd9c7}#stalk-field[aria-disabled=true]{cursor:default}.ritual-ledger{display:flex;align-items:center;justify-content:center;gap:30px;min-height:145px}.ritual-ledger .hexagram{width:82px;margin:20px 0}.ritual-ledger .yao{height:7px;gap:11px}.ritual-ledger .yao em{font-size:12px;top:-5px}#ledger-caption{color:var(--muted);font-size:.875rem}.ritual .text-btn{margin-top:0}@media(hover:hover){#stalk-field:hover #cut-marker{opacity:.6}#stalk-field.splitting:hover #cut-marker{opacity:0}}@media(max-width:650px){.stalk-table{padding:30px 25px 20px;margin-top:24px;min-height:300px}.stalk{width:2px}.ritual{padding-top:5vh}.ritual-ledger{min-height:120px}}

.analysis-panel{margin-top:36px;border-top:1px solid var(--line);padding-top:32px}.analysis-heading{display:flex;justify-content:space-between;align-items:start;gap:20px}.analysis-heading h3{font-size:1.7rem;line-height:1.5}.analysis-heading .eyebrow{font-size:.875rem;margin-bottom:10px}.analysis-badge{flex-shrink:0;padding:7px 10px;border:1px solid var(--line);font-size:.875rem;color:var(--muted)}#analysis-status,.analysis-note{font-size:.875rem;color:var(--muted);line-height:1.9}#analyze{margin-top:8px}.analysis-note{margin-bottom:30px}.reading-section{padding:32px 0;border-bottom:1px solid var(--line);font-family:var(--serif);font-size:1.125rem;line-height:2.05;overflow-wrap:anywhere}.reading-section h4{display:flex;gap:16px;align-items:baseline;font-size:1.35rem;font-weight:500;line-height:1.6;margin:0 0 22px}.reading-section h4 span{font: .875rem var(--sans);color:var(--cinnabar);letter-spacing:.1em}.reading-section p{margin:0 0 22px;white-space:pre-line}.reading-section p:last-child{margin-bottom:0}blockquote{margin:20px 0;padding:12px 0 12px 20px;border-left:2px solid var(--cinnabar);color:var(--ink);line-height:1.9}.line-reading{margin-top:25px}.line-reading h5{font-size:1.1rem;font-weight:500;margin:0}.reference-panel{margin:28px 0;border:1px solid var(--line);padding:18px 22px;font-size:1rem;line-height:1.9}.reference-panel summary{cursor:pointer}.reference-panel article{padding:10px 0 24px;overflow-wrap:anywhere}.reference-panel h4{font-family:var(--serif);font-size:1.2rem;font-weight:500}.reference-panel a{color:var(--muted);font-size:.875rem}.reference-panel p{font-family:var(--serif);margin:14px 0}.legacy-note{font-size:.875rem;margin-top:12px!important}.history-item button{color:var(--cinnabar);font-size:.875rem;margin-top:12px}.quiet{font-size:.875rem;line-height:1.8;color:var(--muted)}.hexagram-wrap article>p,.card-kicker,.history-item time{font-size:.875rem}.result-actions{padding-bottom:20px}button:focus-visible,summary:focus-visible,a:focus-visible{outline:2px solid var(--cinnabar);outline-offset:4px}[hidden]{display:none!important}@media(max-width:650px){.analysis-heading{flex-direction:column;gap:12px}.reading-section{font-size:1.125rem;padding:28px 0;line-height:2}.reading-section h4{font-size:1.25rem}.reference-panel{padding:15px}.result{padding-top:6vh}}
.account-form{margin:25px 0}.account-form label{display:block;margin:18px 0;color:var(--muted);font-size:1rem}.account-form input{display:block;width:100%;margin-top:8px;padding:13px;background:transparent;color:var(--ink);border:1px solid var(--line);font:inherit;min-height:48px}.account-form .result-actions{align-items:stretch}.account-form .secondary{margin-top:28px}.user-id{overflow-wrap:anywhere;font-size:.95rem;line-height:1.7}.balance-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:24px 0;border-block:1px solid var(--line)}.balance-grid strong{display:block;font-size:2rem;margin:15px 0;font-weight:500}#profile-pane h3{margin-top:32px}#profile-pane .text-btn{display:block;margin:16px 0}#account-message,#admin-message{line-height:1.7;color:var(--cinnabar)}.reading-section:first-child:has(h4){scroll-margin-top:25px}#history-more{margin-top:20px}#admin-entry{color:var(--muted);font-size:.875rem}@media(max-width:650px){.topbar nav{gap:12px}.nav-btn{font-size:.875rem}}

#analysis-content.narrative .reading-section{border:0;padding:0;margin:0 0 2em}#analysis-content.narrative h4{display:none}#analysis-content.narrative .reading-section:first-child p:first-child{font-size:1.15em;color:var(--ink,#d9d4bf)}#analysis-content.narrative p{line-height:2.1;margin:0 0 1.5em}#feedback-choices{display:flex;flex-wrap:wrap;gap:18px}#feedback-choices label{display:flex;align-items:center;gap:7px}#feedback-choices input{width:auto}#inbox-detail{white-space:pre-wrap}.account-form textarea{min-height:100px;width:100%;background:transparent;color:inherit;border:1px solid #666;padding:12px;box-sizing:border-box}.history-item p{overflow-wrap:anywhere}nav{flex-wrap:wrap}#admin hr{margin:2.5em 0;opacity:.3}

[hidden]{display:none!important}
.wordmark{display:flex;align-items:center;gap:10px;letter-spacing:.2em}.wordmark img{width:44px;height:44px;object-fit:cover;mix-blend-mode:multiply}.wordmark span{display:block}
@media(max-width:650px){.wordmark{gap:7px;font-size:1.25rem}.wordmark img{width:36px;height:36px}}
#home,#ritual,#result{isolation:isolate;position:relative;border-radius:2px;background-repeat:no-repeat;background-size:cover;background-position:center;overflow:hidden}
#home::before,#ritual::before,#result::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:rgba(247,244,236,.68)}
#home{min-height:calc(100vh - 115px);background-image:url('./assets/brand/bg-home-dingfire.png');background-position:center right}
#home::before{background:linear-gradient(90deg,rgba(247,244,236,.97) 0%,rgba(247,244,236,.85) 48%,rgba(247,244,236,.25) 100%)}
#ritual{min-height:calc(100vh - 115px);background-image:url('./assets/brand/bg-ritual-dingfire.png');background-position:center}
#ritual::before{background:rgba(247,244,236,.5)}
#result{background-image:url('./assets/brand/bg-reading-dingfire.png');background-position:center top}
#result::before{background:linear-gradient(90deg,rgba(247,244,236,.88),rgba(247,244,236,.76) 58%,rgba(247,244,236,.56))}
#home .opening,#ritual .ritual-head,#ritual .stalk-table,#ritual .ritual-actions,#result>*{position:relative;z-index:1}
@media(max-width:650px){#home,#ritual{min-height:calc(100vh - 95px)}#home{background-position:64% center}#home::before{background:rgba(247,244,236,.78)}#ritual::before{background:rgba(247,244,236,.6)}#result::before{background:rgba(247,244,236,.8)}}
.home-path{display:flex;align-items:center;gap:14px;margin:38px 0 0;color:var(--muted);font-size:.75rem;letter-spacing:.18em}.home-path i{display:block;width:34px;height:1px;background:var(--line)}
#home-title span{white-space:nowrap}
/* Safari must not turn the ritual's hold gesture into native text selection. */
#ritual,#ritual *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
/* Full-viewport scene independent of the readable content column. */
body{isolation:isolate;min-height:100vh;min-height:100dvh}
body::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background-image:var(--scene-wash,linear-gradient(transparent,transparent)),var(--scene-image,none);background-position:center,var(--scene-position,center);background-size:cover;background-repeat:no-repeat}
body:has(#home.active){--scene-image:url('./assets/brand/bg-home-dingfire.png');--scene-position:center right;--scene-wash:linear-gradient(90deg,rgba(247,244,236,.94),rgba(247,244,236,.78) 48%,rgba(247,244,236,.25))}
body:has(#ritual.active){--scene-image:url('./assets/brand/bg-ritual-dingfire.png');--scene-wash:linear-gradient(rgba(247,244,236,.5),rgba(247,244,236,.5))}
body:has(#result.active){--scene-image:url('./assets/brand/bg-reading-dingfire.png');--scene-position:center;--scene-wash:linear-gradient(90deg,rgba(247,244,236,.88),rgba(247,244,236,.76) 58%,rgba(247,244,236,.56))}
body #home,body #ritual,body #result{background:none;border-radius:0}
body #home::before,body #ritual::before,body #result::before{display:none}
.shell{padding-top:max(28px,env(safe-area-inset-top));padding-bottom:max(60px,env(safe-area-inset-bottom))}
@media(max-width:650px){body:has(#home.active){--scene-position:64% center;--scene-wash:linear-gradient(rgba(247,244,236,.78),rgba(247,244,236,.78))}body:has(#ritual.active){--scene-wash:linear-gradient(rgba(247,244,236,.6),rgba(247,244,236,.6))}body:has(#result.active){--scene-wash:linear-gradient(rgba(247,244,236,.8),rgba(247,244,236,.8))}.shell{padding-top:max(20px,env(safe-area-inset-top));padding-bottom:max(45px,env(safe-area-inset-bottom));padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right))}}
/* The close-up below gives the paper, not decorative stems, the full working width. */
#ritual .stalk-table{max-width:960px;background-size:100% 100%,220% 100%;padding:56px 0 40px}
#ritual .stalk-workspace{width:96%;max-width:none;padding:12px 28px 0;overflow:hidden}
#ritual .stalk-workspace::before{display:none}
#ritual #stalk-field{width:100%;height:150px;-webkit-touch-callout:none}
#ritual #split-status{font-size:.875rem;white-space:normal;min-height:48px;line-height:1.7}
@media(max-width:650px){#ritual .stalk-workspace{padding-inline:24px}#ritual .stalk-table{padding-top:48px;padding-bottom:40px}#ritual #stalk-field{height:145px}}
.stalk-table{padding:40px 0 25px;background-color:#e8d7b8;background-image:linear-gradient(rgba(248,241,224,.34),rgba(248,241,224,.34)),url('./assets/brand/bg-ritual-table.png');background-size:100% 100%;background-position:center;background-repeat:no-repeat;color:#544633;border:1px solid rgba(91,66,40,.24);box-shadow:0 18px 45px rgba(55,32,14,.16);overflow:hidden}
.stalk-workspace{position:relative;isolation:isolate;width:72%;max-width:565px;margin:0 auto;padding:18px 0 0}.stalk-workspace::before{content:"";position:absolute;inset:0 -3%;z-index:-1;pointer-events:none;background:radial-gradient(ellipse at center,rgba(250,241,218,.58),rgba(250,241,218,.25) 68%,transparent 100%)}
.stalk-table .reserved{background:linear-gradient(90deg,#873728,#c85a43,#873728);box-shadow:0 1px 3px rgba(80,37,24,.28);margin-bottom:28px}.stalk-table #stalk-field{width:85%;height:132px;margin-inline:auto;user-select:none}.stalk-table #stalk-field:focus-visible{outline-color:#a94835}.stalk-table .stalk{background:linear-gradient(90deg,#5f4b2d,#c9aa67,#6d5735);box-shadow:0 1px 2px rgba(58,39,19,.35)}.stalk-table #cut-marker{border-left-color:#a94835}.stalk-table #stalk-field.is-choosing{cursor:ew-resize}.stalk-table #stalk-field.is-choosing #cut-marker{opacity:.9;border-left-style:solid;filter:drop-shadow(0 0 3px rgba(169,72,53,.35))}.stalk-table #stalk-field.is-choosing .stalk{filter:saturate(1.12) brightness(1.04)}.stalk-table #split-status{color:#655844}
@media(max-width:650px){#home .opening{padding:8vh 0 42px}#home-title{font-size:clamp(2.6rem,12.2vw,3.35rem);line-height:1.2;letter-spacing:.035em;text-wrap:balance}#home-title span{display:inline-block}.home-path{justify-content:center;margin-top:34px}.stalk-table{padding:38px 0 20px;background-color:#e8d7b8;background-image:linear-gradient(rgba(248,241,224,.3),rgba(248,241,224,.3)),url('./assets/brand/bg-ritual-table.png');background-size:100% 100%;box-shadow:0 12px 30px rgba(55,32,14,.16)}.stalk-workspace{width:76%;padding-top:16px}.stalk-table .reserved{width:38px;margin-bottom:24px}.stalk-table #stalk-field{width:78%;height:124px}.stalk-table #split-status{font-size:.8rem;white-space:nowrap}}

.code-status{margin:0 0 1rem;color:var(--red,#a23e30);font-size:1rem;line-height:1.65;min-height:1.65em}.recharge-card{margin:1.5rem 0;padding:1.25rem;border:1px solid #b9b3a5}.admin-qr{display:block;width:min(100%,280px);height:auto;margin:1rem auto}#register-form{padding-bottom:1.5rem;border-bottom:1px solid #b9b3a5}#auth-pane{margin-bottom:2rem}

.guide-link{display:block;margin:-6px 0 24px;color:var(--cinnabar);font-size:.9rem;border-bottom:1px solid rgba(162,58,42,.35)}
.guide-dialog{width:min(680px,calc(100% - 32px));max-height:min(88vh,820px);padding:0;border:1px solid rgba(20,34,29,.22);border-radius:2px;color:var(--ink);background:#f4f0e5;box-shadow:0 30px 90px rgba(20,25,22,.32)}
.guide-dialog::backdrop{background:rgba(13,24,20,.58);backdrop-filter:blur(3px)}
.guide-sheet{position:relative;padding:42px 48px 34px;background:linear-gradient(rgba(249,246,237,.92),rgba(241,235,220,.94)),url('./assets/brand/bg-home-dingfire.png') center/cover no-repeat}
.guide-close{position:absolute;top:16px;right:19px;width:40px;height:40px;border:0;background:transparent;color:var(--muted);font:300 2rem/1 var(--sans);cursor:pointer}
.guide-dialog h2{max-width:520px;font-size:clamp(2rem,5vw,3rem);line-height:1.3;letter-spacing:.04em}
.guide-intro{margin:22px 0 28px;font-family:var(--serif);font-size:1.05rem;line-height:1.95;color:#4f5b56}
.guide-section{padding:23px 0;border-top:1px solid var(--line)}
.guide-section h3{display:flex;align-items:center;gap:12px;margin-bottom:18px;font-size:1.2rem}.guide-section h3 span{color:var(--cinnabar);font:500 .8rem var(--sans);letter-spacing:.12em}
.guide-steps{display:grid;grid-template-columns:1fr 1fr;gap:16px 26px;margin:0;padding:0;list-style:none;counter-reset:step}.guide-steps li{position:relative;padding-left:24px}.guide-steps li::before{content:"·";position:absolute;left:4px;color:var(--cinnabar)}.guide-steps b,.guide-steps small{display:block}.guide-steps b{font-family:var(--serif);font-weight:500}.guide-steps small{margin-top:5px;color:var(--muted);font-size:.84rem;line-height:1.65}
.guide-tips{margin:0;padding-left:1.2em;color:#4f5b56}.guide-tips li{margin:10px 0;line-height:1.75}.guide-tips li::marker{color:var(--cinnabar)}
.guide-note{margin:4px 0 0;font-family:var(--serif)}.guide-start{width:100%;margin-top:26px}.guide-sheet>.quiet{text-align:center;margin-bottom:0}
@media(max-width:650px){.guide-dialog{width:calc(100% - 22px);max-height:92vh}.guide-sheet{padding:34px 25px 28px}.guide-dialog h2{font-size:2rem}.guide-intro{font-size:1rem;line-height:1.85}.guide-steps{grid-template-columns:1fr;gap:13px}.guide-section{padding:19px 0}.guide-tips{font-size:.94rem}.guide-link{margin-bottom:20px}}
