:root{color-scheme:dark;--ink:#f1efe5;--muted:#c0c5c2;--gold:#dbc793;--line:#d7c9a83d;--panel:#10181deb;--soft:#1f292b}
*{box-sizing:border-box}body{margin:0;min-height:100vh;background:#10151b;color:var(--ink);font-family:"Songti SC",SimSun,serif;font-size:16px;line-height:1.75}button,input,select,textarea{font:inherit}button,a,input,select,textarea,summary{touch-action:manipulation}button{cursor:pointer}button:disabled{opacity:.55;cursor:default}input,select,textarea{color:var(--ink);background:#050b10b8;border:1px solid var(--line);width:100%;padding:.62rem .8rem;border-radius:2px;min-width:0}textarea{min-height:5.5rem;resize:vertical}.short{min-height:4rem}input:focus-visible,textarea:focus-visible,button:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible{outline:2px solid var(--gold);outline-offset:3px}input::placeholder,textarea::placeholder{color:#9aa5a7}a{color:#dfd2af;text-underline-offset:4px}a:hover{color:white}p{margin:.5rem 0 1rem}h1,h2,h3,h4{font-weight:500;line-height:1.5;overflow-wrap:anywhere}h2{font-size:1.4rem}h3{font-size:1.15rem;margin:.4rem 0 .85rem}label{display:block;color:var(--muted);font-size:.94rem;margin:.8rem 0 .35rem}fieldset{border:0;padding:0;margin:0;min-width:0}legend.sr-only,.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}.room{position:fixed;inset:0;z-index:-1;background:linear-gradient(180deg,#0a101557,#050a0fc2),url('ritual-room.png') center/cover no-repeat}main{padding:1.4rem clamp(1rem,4vw,4rem) 2rem}header{display:flex;justify-content:space-between;gap:1rem;align-items:center;font:14px system-ui,sans-serif;color:#dbddda}.brand{letter-spacing:.3em}.version{color:var(--muted);font-size:12px}.stage{width:min(56rem,100%);margin:2.5rem auto}h1{font-size:clamp(2.8rem,6vw,4.2rem);letter-spacing:.22em;margin:0 0 1.25rem}.tabs{display:flex;gap:1.5rem;border-bottom:1px solid var(--line);margin:0 0 1.2rem}.tab{border:0;border-bottom:2px solid transparent;background:transparent;padding:.4rem 0 .8rem;color:var(--muted);font-size:1rem}.tab.active{color:var(--ink);border-bottom-color:var(--gold)}.card{padding:clamp(1.15rem,4vw,2.1rem);border:1px solid var(--line);background:var(--panel);box-shadow:0 18px 48px #0004;backdrop-filter:blur(6px)}.grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem;align-items:start}.grid>p{margin-top:1rem}.minor{font-size:.875rem;color:var(--muted);line-height:1.75}.bar{display:flex;gap:1rem;justify-content:space-between;align-items:center;margin-top:1.1rem}.bar .minor{max-width:65%}.cast{border:1px solid #dcca9ac9;background:#c4a77326;color:#fff4d6;padding:.65rem 1.15rem;white-space:normal;min-height:44px}.cast:hover:not(:disabled){background:#c4a77342}.textbtn{border:0;background:transparent;color:var(--gold);padding:.4rem;min-height:44px;text-decoration:underline;text-underline-offset:4px}details{margin:1rem 0;padding:.8rem 0;border-top:1px solid var(--line)}summary{cursor:pointer;color:var(--gold);font-size:.94rem}.score-grid{display:grid;grid-template-columns:1fr 5rem 5rem;gap:.65rem;align-items:center;margin-top:1rem}.score-grid label{margin:0}.score-grid span{font-size:.875rem;color:var(--muted)}#tossPanel{border-top:1px solid var(--line);margin-top:1.3rem;padding-top:1.1rem}.toss-head{display:flex;justify-content:space-between;align-items:center;gap:1rem}#tossStatus{color:var(--gold)}.coins{display:flex;gap:1rem;padding:1rem 0 1.2rem}.coin{display:flex;align-items:center;justify-content:center;text-align:center;width:4.8rem;height:4.8rem;border:1px solid #d2b97b;background:#c6a9722c;border-radius:50%;color:#e9d6ad;font:14px system-ui,sans-serif;white-space:pre-line;box-shadow:inset 0 0 0 5px #c6a97217}.coin.spinning{animation:toss .42s ease-in-out}@keyframes toss{50%{transform:translateY(-7px) rotateY(180deg)}100%{transform:rotateY(360deg)}}#throwLog{font-size:.9rem;color:var(--muted);padding-left:1.5rem}#throwLog li{margin:.25rem 0}#manualSubmit{margin-top:.9rem}#reading{margin-top:1.5rem;border-top:1px solid var(--line);padding-top:1.2rem}#questionEcho{font-size:1.12rem}.hex-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.85rem;margin:1rem 0 1.4rem}.hex-card{border:1px solid var(--line);padding:1rem;background:#ffffff03}.hex-card h3{font-size:1.05rem;color:var(--gold);margin:.2rem 0}.hex-label{font:12px system-ui,sans-serif;color:var(--muted)}.hex-lines{display:flex;flex-direction:column-reverse;gap:.7rem;max-width:6rem;margin:1.15rem auto}.yao{display:flex;gap:14%;width:100%;height:5px;position:relative}.yao>span{background:var(--gold);height:5px;flex:1}.yao.moving::after{content:'○';position:absolute;right:-1.05rem;top:-.66rem;color:#f4d492;font:15px system-ui}.yao.yin.moving::after{content:'×'}.hex-caption{font-size:.875rem;color:var(--muted);margin:0}.result-section{margin:1.3rem 0;border-top:1px solid var(--line);padding-top:1.1rem}.quote{border-left:2px solid var(--gold);padding:.5rem .9rem;margin:.8rem 0;background:#0002}.quote p{margin:.2rem 0;overflow-wrap:anywhere}.quote cite{font-style:normal;font-size:.875rem;color:var(--muted)}.quote-title{color:var(--gold);font-size:.94rem}.modern{color:#d5dcd8;font-size:.94rem}.answer{background:#c9b37e12;border:1px solid var(--line);padding:1rem 1.2rem}.answer h3{margin-top:.55rem}#answerText{color:#f6e9c8;font-size:1.16rem;overflow-wrap:anywhere}.tag{display:inline-block;font:12px system-ui,sans-serif;color:var(--gold);border:1px solid var(--line);padding:.25rem .55rem}#answerDetails p{margin:.5rem 0}#answerDetails ul{padding-left:1.3rem}.table-wrap{overflow-x:auto;margin-top:.85rem}table{border-collapse:collapse;width:100%;font-size:.875rem}th,td{border-bottom:1px solid var(--line);padding:.5rem;text-align:left;vertical-align:top}th{color:var(--gold);font-weight:500}.feedback .cast{margin-top:.85rem}.new-question{margin-top:1rem}.head{display:flex;justify-content:space-between;align-items:center;gap:1rem}.head h2{margin:0}.record-row{border-top:1px solid var(--line);padding:1rem 0}.record-open{width:100%;text-align:left;border:0;background:transparent;color:inherit;padding:0}.record-open:hover strong{color:#fff}.record-row strong{display:block;color:var(--gold);font-weight:500}.record-row p{margin:.4rem 0;overflow-wrap:anywhere}.record-row small{color:var(--muted);font:12px system-ui,sans-serif}.about p{margin:1rem 0}footer{font:12px system-ui,sans-serif;text-align:center;color:#cbd0cd9c;margin-top:1.5rem}#notice{border:1px solid var(--line);padding:.65rem 1rem;background:#17242a;color:#f1e4c1;font-size:.94rem}#sources{font-size:.875rem;line-height:1.9;margin:1rem 0;overflow-wrap:anywhere}
@media(max-width:600px){main{padding:1rem}.stage{margin:1.8rem auto}.tabs{gap:1rem}.tab{font-size:.94rem}.grid{grid-template-columns:1fr;gap:.1rem}.bar{align-items:flex-start;flex-direction:column}.bar .minor{max-width:none}.hex-grid{grid-template-columns:1fr}.hex-card{display:grid;grid-template-columns:1fr 7rem;gap:.25rem 1rem;align-items:center}.hex-lines{grid-column:2;grid-row:1/5;width:5rem;margin:.75rem}.hex-label,.hex-card h3,.hex-caption{grid-column:1}.score-grid{grid-template-columns:1fr 3.8rem 3.8rem;gap:.45rem}h1{font-size:2.8rem}.card{padding:1.1rem}.head{align-items:flex-start}.toss-head{align-items:flex-start}.coin{width:4.3rem;height:4.3rem}}
@media(max-width:600px){.hex-card{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.hex-lines{width:min(5rem,100%);margin:.75rem 0;justify-self:center}.score-grid{grid-template-columns:minmax(0,1fr) minmax(0,3.8rem) minmax(0,3.8rem)}.coins,.tabs{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important}}
.toss-rounds{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;margin:1rem 0 1.15rem}.toss-round{min-width:0;border:1px solid var(--line);background:#070d11a8;padding:.7rem;transition:border-color .2s,background .2s}.toss-round.current{border-color:var(--gold);background:#c6a97212}.toss-round.complete{background:#c6a9720b}.round-heading{display:flex;justify-content:space-between;align-items:baseline;gap:.4rem;margin-bottom:.6rem}.round-heading strong{font-size:.88rem;font-weight:500;color:var(--ink)}.round-status{font:12px system-ui,sans-serif;color:var(--muted);white-space:nowrap}.toss-round.current .round-status,.toss-round.complete .round-status{color:var(--gold)}.round-coins{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.38rem}.round-coins .coin{width:auto;height:auto;aspect-ratio:1;border-radius:50%;min-width:0;padding:.25rem;font-size:12px;line-height:1.2}.toss-round.pending .coin{border-color:#73807a66;background:#1520278c;color:#a9b0ad}.toss-round.current .coin{border-color:var(--gold)}@media(max-width:700px){.toss-rounds{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:430px){.toss-rounds{grid-template-columns:1fr}.round-coins .coin{max-width:5rem;justify-self:center;width:100%}}
.follow-up{padding:1rem 1.2rem;background:#ffffff05;border:1px solid var(--line)}.follow-up h3{color:var(--gold)}.follow-up p{color:var(--muted);font-size:.94rem}
.dayan-board{border:1px solid var(--line);background:#070d11a8;padding:1rem;margin:1rem 0}.dayan-summary{display:flex;justify-content:space-between;gap:1rem;align-items:baseline}.dayan-summary strong{color:var(--gold);font-weight:500}.dayan-summary span{font:12px system-ui,sans-serif;color:var(--muted)}.stalk-meter{display:flex;gap:.4rem;align-items:stretch;height:4.5rem;margin:1rem 0}.stalk-meter span{display:flex;align-items:center;justify-content:center;min-width:2rem;border:1px solid #d2b97b;background:repeating-linear-gradient(90deg,#c6a97225 0 3px,transparent 3px 7px),#c6a97212;color:var(--gold);font:13px system-ui,sans-serif}.stalk-meter i{display:block;width:1px;background:var(--gold);opacity:.8}.dayan-board input[type=range]{accent-color:#d9c587;padding:0}.dayan-board .cast{margin-top:.4rem}#dayanLog{font-size:.86rem;color:var(--muted);padding-left:1.5rem;margin:1rem 0 0}#dayanLog li{margin:.45rem 0}.selection-rule{border-left:2px solid var(--gold);padding:.45rem .8rem;background:#c6a9720f;color:#f4e4bd;font-size:.94rem}
.ai-assistant{background:#ffffff05;padding:1rem 1.2rem;border:1px solid var(--line)}.ai-assistant h3{color:var(--gold)}.ai-web-option{display:flex;align-items:flex-start;gap:.65rem;margin:.9rem 0;color:var(--muted);line-height:1.55}.ai-web-option input{width:1.1rem;height:1.1rem;flex:0 0 auto;margin:.16rem 0 0;padding:0;accent-color:var(--gold)}.ai-answer{margin-top:1rem;border-left:2px solid var(--gold);padding:.65rem .9rem;background:#0002}.ai-answer>p{white-space:pre-wrap;overflow-wrap:anywhere}.ai-answer ul{padding-left:1.3rem;margin:.3rem 0}.ai-assistant details{margin-bottom:0}
@media(max-width:600px){.dayan-summary{align-items:flex-start;flex-direction:column;gap:.1rem}.stalk-meter{height:4rem}}

/* 仪式工作面：采用原创的蓍草盘、过程记录与纸卷阅读层。 */
.ritual-card{min-height:clamp(36rem,76vh,52rem);position:relative;overflow:hidden;background:linear-gradient(135deg,#0b1115ed,#121a1ee8 62%,#081014ed);box-shadow:0 26px 80px #0009}.ritual-card::before{content:'';position:absolute;inset:0;pointer-events:none;opacity:.28;background:radial-gradient(circle at 18% 18%,#d4b56732,transparent 24%),radial-gradient(circle at 88% 82%,#58707222,transparent 28%)}.question-entry,#tossPanel,.casting-summary{position:relative;z-index:1}.question-entry{width:min(43rem,100%);margin:clamp(2rem,9vh,6rem) auto}.question-entry label[for="question"]{font-size:1.1rem;color:#eee6cd}.question-entry #question{min-height:7rem;font-size:1.08rem;background:#060b0ebd;border-color:#d7c9a86b}.casting-active .question-entry{display:none}.casting-active .ritual-card{min-height:clamp(42rem,86vh,64rem)}.casting-active #tossPanel{border-top:0;margin:0;padding:clamp(1rem,3vw,2.25rem) 0 0}.casting-active .toss-head{position:absolute;inset:1rem 0 auto 0;z-index:2;padding:0 1.2rem}.casting-active #tossStatus{font-size:.92rem}.casting-active .ritual-instruction{width:min(42rem,calc(100% - 2rem));margin:3.25rem auto 1.3rem;text-align:center;color:#d9d2ba}.dayan-board{width:min(58rem,100%);margin:0 auto;border:0;background:transparent;padding:0}.dayan-summary{padding:.75rem 1rem;border:1px solid var(--line);background:#171b1aa6}.stalk-stage{display:grid;grid-template-columns:1fr 1px 1fr;gap:1rem;min-height:16rem;padding:1.5rem 1rem;margin:.9rem 0;background:linear-gradient(180deg,#18191aa8,#0c1012e5),repeating-linear-gradient(0deg,transparent 0 2.2rem,#ad93561c 2.2rem 2.3rem);border-top:1px solid #d7c9a840;border-bottom:1px solid #d7c9a840}.stalk-stage>i{background:#d9c587;opacity:.7}.stalk-pile{display:grid;grid-template-columns:repeat(12,minmax(2px,1fr));gap:.45rem;align-content:end;min-width:0}.stalk{display:block;width:100%;height:clamp(3.3rem,8vw,6.3rem);border-radius:999px;background:linear-gradient(90deg,#a89155,#fae49d 48%,#9b8247);box-shadow:0 1px 5px #0008;transform:rotate(-4deg)}.stalk:nth-child(3n){height:calc(clamp(3.3rem,8vw,6.3rem) * .92);transform:rotate(3deg)}.stalk:nth-child(5n){height:calc(clamp(3.3rem,8vw,6.3rem) * .82);transform:rotate(-1deg)}.stalk.right{transform:rotate(4deg)}.stalk.right:nth-child(3n){transform:rotate(-3deg)}.stalk.right:nth-child(5n){transform:rotate(1deg)}.stalk-meter{height:auto;margin:.2rem 0 .75rem;opacity:.82}.stalk-meter span{min-height:2.3rem}.dayan-board label{width:min(30rem,100%);margin:.8rem auto .35rem}.dayan-board input[type=range]{width:min(30rem,100%);margin:0 auto;display:block}.dayan-board .cast{display:block;margin:.9rem auto 0}.process-log{width:min(58rem,100%);margin:1.2rem auto 0;border:1px solid var(--line);background:#121817c2}.process-log-head{display:flex;justify-content:space-between;gap:1rem;padding:.6rem .8rem;color:#e3d5aa;font-size:.9rem}.process-log ol{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem 1rem;max-height:9.4rem;overflow:auto;margin:0;padding:.65rem 1.8rem 1rem;border-top:1px solid var(--line);font-size:.78rem}.process-log #dayanLog li{margin:0}.casting-summary{width:min(23rem,100%);margin:4.4rem 1.2rem 1.4rem auto;padding:1rem;border:1px solid #d7c9a86b;background:linear-gradient(145deg,#32352dd9,#1b211ed9);box-shadow:0 18px 40px #0007}.summary-question{font-size:.95rem;line-height:1.55;color:#f0ead2;margin:0 0 .8rem;max-height:4.8rem;overflow:auto}.summary-lines{border-top:1px solid #ded1aa40;border-bottom:1px solid #ded1aa40;padding:.55rem 0}.summary-lines>div{display:grid;grid-template-columns:3.4rem 1fr 4.7rem;gap:.55rem;align-items:center;min-height:1.65rem;font-size:.78rem;color:#cfcbbd}.summary-lines>div>span{color:#a9afa8}.summary-lines strong{font-weight:400;color:#e7ddbd;text-align:right}.summary-yao{display:flex;gap:13%;height:4px;min-width:0}.summary-yao i{display:block;flex:1;background:#d9c587;border-radius:2px}.summary-yao.moving::after{content:'○';font:12px system-ui;color:#efcf80;line-height:.35rem;margin-left:.15rem}.summary-yao.yin.moving::after{content:'×'}.summary-hexes{display:grid;grid-template-columns:1fr 1fr 1fr;gap:.6rem;margin:1rem 0}.summary-hexes div{min-width:0}.summary-hexes span{display:block;font-size:.73rem;color:#b7b8ac}.summary-hexes strong{display:block;color:#e9ddba;font-weight:500;font-size:.94rem;overflow-wrap:anywhere}.casting-summary .cast{width:100%;margin:.2rem 0 .4rem}.casting-summary .minor{margin:.3rem 0 0;font-size:.74rem}.reading-modal{width:min(48rem,calc(100vw - 2rem));height:min(88vh,64rem);border:1px solid #d8cba7;background:#ece5cc;color:#2d2d28;padding:0;box-shadow:0 24px 90px #000b}.reading-modal::backdrop{background:#020606a8;backdrop-filter:blur(7px)}.reading-paper{height:100%;overflow:auto;padding:1.25rem clamp(1.1rem,4vw,2.5rem) 2rem;font-family:"Songti SC",SimSun,serif;font-size:1.08rem;line-height:1.82;background:linear-gradient(90deg,#e4dbc0,#f4eedb 9%,#f3ecd8 91%,#e2d8bd);scrollbar-color:#94825d transparent}.reading-paper[data-size="small"]{font-size:.94rem}.reading-paper[data-size="large"]{font-size:1.25rem}.reading-paper .minor{color:#5f6059}.reading-paper h2,.reading-paper h3{color:#282a25}.reading-paper h2{font-size:1.35em}.reading-paper a{color:#765b24}.reading-paper .result-section,.reading-paper details{border-color:#8d866f55}.reading-paper .hex-card,.reading-paper .answer,.reading-paper .ai-assistant,.reading-paper .follow-up{background:#8d815e12;border-color:#867c5d66}.reading-paper #answerText{color:#312e22;font-size:1.12em}.reading-paper .quote{background:#b6a97816;border-color:#8d7941}.reading-paper .quote-title,.reading-paper .selection-rule,.reading-paper .tag{color:#735c25}.reading-paper .selection-rule{background:#b6a97819}.reading-paper .cast{color:#362e1e;border-color:#766333;background:#b99b4d2b}.reading-paper input,.reading-paper select,.reading-paper textarea{color:#302d25;background:#fffdf5;border-color:#928462}.reading-tools{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding-bottom:.8rem;border-bottom:1px solid #8d866f55}.text-size{display:flex;gap:.35rem}.size-btn{min-width:2rem;min-height:2rem;border:1px solid #a99d7e;background:transparent;color:#665d49;font:14px system-ui,sans-serif}.size-btn.active{background:#9d8b5f;color:#fffdf5}.reading-actions{display:flex;flex-wrap:wrap;gap:.75rem;border-top:1px solid #8d866f55;margin-top:1.5rem;padding-top:1rem}.reading-actions .textbtn{color:#695720}.reading-paper .ai-answer{background:#756a4d12;border-color:#7d6b3f}.reading-paper .table-wrap{font-size:.84em}.reading-paper .textbtn{color:#6d5924}.reading-paper .new-question{margin-top:0}.casting-active #digitalPanel{width:min(54rem,100%);margin:4rem auto 0}.casting-active #manualPanel{width:min(36rem,calc(100% - 2rem));margin:5rem auto 0}.casting-active #throwLog{width:min(54rem,100%);margin:1rem auto}.casting-active #tossPanel:not(:has(#dayanPanel:not([hidden]))) .toss-head{position:relative;inset:auto;padding:0}.casting-active .toss-rounds{grid-template-columns:repeat(6,minmax(0,1fr))}.casting-active .toss-round{padding:.5rem}.casting-active .round-heading{display:none}.casting-active .round-coins{grid-template-columns:1fr}.casting-active .round-coins .coin{font-size:10px}.casting-active #toss{display:block;margin:1rem auto}
@media(max-width:760px){.ritual-card{min-height:0}.question-entry{margin:1rem auto}.casting-active .toss-head{position:relative;inset:auto;padding:0;margin-bottom:.8rem}.casting-active .ritual-instruction{margin:1rem auto}.stalk-stage{min-height:13rem;gap:.6rem;padding:1rem .55rem}.stalk-pile{grid-template-columns:repeat(8,minmax(2px,1fr));gap:.3rem}.process-log ol{grid-template-columns:1fr}.casting-summary{margin:1rem auto}.reading-modal{width:calc(100vw - 1rem);height:calc(100vh - 1rem)}.reading-paper{padding:1rem}.casting-active .toss-rounds{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:420px){.stalk-stage{grid-template-columns:1fr 1px 1fr}.stalk-pile{grid-template-columns:repeat(6,minmax(2px,1fr));gap:.24rem}.stalk{height:3.45rem}.summary-lines>div{grid-template-columns:3.1rem 1fr 4.1rem;gap:.3rem}.reading-tools{align-items:flex-start;flex-direction:column}.casting-active .toss-rounds{grid-template-columns:repeat(2,minmax(0,1fr))}}
.reading-paper .hex-label,.reading-paper .hex-caption,.reading-paper #recordMeta{color:#756f5e}.reading-paper .modern{color:#565344}

/* Keep the question form compact without changing the casting stage. */
body:not(.casting-active) .stage{margin:1.6rem auto}
body:not(.casting-active) .ritual-card{min-height:0;padding:clamp(1.25rem,3.5vw,2rem)}
body:not(.casting-active) .question-entry{margin:0 auto}
body:not(.casting-active) .question-entry label[for="question"]{margin-top:0}
.site-menu{position:relative;margin:0;padding:0;border:0;z-index:20}
.site-menu>summary{display:flex;align-items:center;justify-content:center;width:44px;height:44px;list-style:none;color:var(--muted);border-radius:2px}
.site-menu>summary::-webkit-details-marker{display:none}
.site-menu>summary::marker{content:''}
.site-menu>summary:hover,.site-menu[open]>summary{color:var(--gold);background:#10181da8}
.site-menu .tabs{position:absolute;right:0;top:calc(100% + .5rem);display:grid;gap:.1rem;width:min(15rem,calc(100vw - 2rem));margin:0;padding:.4rem;background:#111a1ef5;border:1px solid var(--line);box-shadow:0 12px 36px #0006}
.site-menu .tab{padding:.65rem .8rem;border:0;text-align:left;white-space:normal;overflow-wrap:anywhere}
.site-menu .tab:hover,.site-menu .tab.active{color:var(--gold);background:#d7c9a80c}

/* Six-number casting is a compact input step, not a simulated coin tray. */
.casting-active.number-casting .ritual-card{min-height:0}
.casting-active.number-casting #tossPanel{padding:0}
.casting-active.number-casting #manualPanel{width:min(36rem,100%);margin:1.4rem auto 0}
.casting-active.number-casting #throwLog{width:min(36rem,100%);margin:1rem auto;overflow-wrap:anywhere}
.casting-active.number-casting .casting-summary{margin:1.5rem auto 0}
.summary-numbers{overflow-wrap:anywhere}
.number-calculation{border:1px solid #867c5d66;padding:.85rem 1rem;margin:1rem 0;background:#8d815e12;overflow-wrap:anywhere}
.number-calculation h3{font-size:.95em}
.number-calculation p,.number-calculation li{font-size:.85em}
.number-calculation ol{padding-left:1.3rem}

/* A single fan is the split control; no separate slider or commit button. */
.stalk-table{position:relative;min-height:21rem;padding:5rem 0 2.5rem;border-block:1px solid #d7c9a815}
.reserved-stalk{position:absolute;top:2.4rem;left:50%;width:4.5rem;height:3px;transform:translateX(-50%);border-radius:1px;background:#d5c488;box-shadow:0 1px 2px #0005}
.stalk-fan{display:block;position:relative;width:min(44rem,90%);height:12rem;margin:0 auto;padding:0;border:0;border-radius:2px;background:transparent;color:var(--gold);touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.stalk-fan:disabled{opacity:1}.stalk-fan[aria-disabled="true"]{cursor:wait}.complete .stalk-fan{cursor:default}
.fan-stalks{position:absolute;inset-block:0;left:50%;transform:translateX(-50%);pointer-events:none;transition:width .4s ease}
.stalk-fan .stalk{position:absolute;display:block;left:var(--x);top:var(--y);width:3px;height:clamp(3.6rem,7vw,5.7rem);border-radius:1px;background:#d5c488;box-shadow:0 1px 2px #0006;transform:translateX(-50%) rotate(var(--tilt));transform-origin:50% 90%;transition:left .4s ease,top .4s ease,transform .4s ease,opacity .4s ease;pointer-events:none}
.stalk-fan .stalk.removed{opacity:.38}
.stalk-cut{position:absolute;top:18%;height:65%;width:1px;background:#ead49d75;opacity:0;pointer-events:none}
.stalk-cut::before{content:attr(data-label);position:absolute;top:-1.8rem;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:.78rem;color:#e3d5aa}
.choosing .stalk-cut,.stalk-fan:focus-visible .stalk-cut{opacity:1}.splitting .stalk-cut,.complete .stalk-cut{opacity:0}
.split-counts{position:absolute;left:10%;right:10%;top:5.2rem;display:flex;justify-content:space-between;color:#dacb9f;font-size:.8rem;pointer-events:none}
.removed-stalks{position:absolute;bottom:.6rem;left:50%;display:flex;gap:1.1rem;transform:translateX(-50%);opacity:.35;pointer-events:none}
.removed-group{display:flex;gap:5px}.retired-stalk{display:block;width:2px;height:2.4rem;background:#d5c488;border-radius:1px;transform:rotate(-8deg)}
.stalk-hint{text-align:center;margin:.85rem 0 .5rem;font-size:.82rem}.dayan-board #dayanPreview{min-height:3.1rem;font-size:.8rem;margin:.4rem auto 0;width:min(44rem,100%)}
@media(max-width:760px){.stalk-table{min-height:17rem;padding:3.7rem 0 2.5rem}.reserved-stalk{top:1.5rem;width:3.5rem;height:2px}.stalk-fan{width:88%;height:10rem}.stalk-fan .stalk{width:2px;height:4.2rem}.split-counts{top:3.7rem}.stalk-cut::before{font-size:.72rem}.dayan-board #dayanPreview{min-height:4.2rem}.removed-group{gap:4px}}
@media(prefers-reduced-motion:reduce){.fan-stalks,.stalk-fan .stalk{transition:none}}

/* Normal readings generate automatically; only failures reveal a retry. */
.ai-assistant[aria-busy="true"] #aiStatus{color:var(--gold)}
.reading-paper .ai-assistant[aria-busy="true"] #aiStatus{color:#735c25}
.ai-assistant[aria-busy="true"] #aiStatus::before{content:'';display:inline-block;width:.45rem;height:.45rem;border-radius:50%;background:currentColor;vertical-align:middle;margin-right:.6rem}
#aiSettingsStatus:empty{display:none}

/* Five quiet, touch-friendly entries replace the previous menu. */
.home-button{border:0;padding:0;background:none;color:inherit;text-align:left;min-height:44px}
.site-tools{display:flex;align-items:center;gap:clamp(.2rem,1.4vw,1.2rem);margin-left:auto;flex-shrink:0}
.icon-btn{position:relative;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;border-radius:2px;padding:10px;background:transparent;color:#cbd0ce}
.icon-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round}
.icon-btn:hover:not(:disabled),.icon-btn[aria-current="page"]{color:var(--gold);background:#10181d55}
.icon-btn.account-placeholder:disabled{opacity:.65;cursor:default}.language-toggle{font:14px system-ui,sans-serif}
.icon-btn.has-unread::after{content:'';position:absolute;top:9px;right:9px;width:4px;height:4px;border-radius:50%;background:var(--gold)}
.record-filters{display:grid;grid-template-columns:minmax(8rem,1fr) minmax(0,2fr);gap:1rem;margin:1rem 0}
.letters-modal{width:min(40rem,calc(100vw - 2rem));max-height:calc(100dvh - 2rem);padding:0;border:1px solid var(--line);background:#151e22;color:var(--ink);box-shadow:0 24px 90px #0009}
.letters-modal::backdrop{background:#020606aa;backdrop-filter:blur(5px)}
.letters-paper{padding:clamp(1.1rem,3vw,2rem);max-height:calc(100dvh - 2rem);overflow:auto}
.letters-paper h2{font-size:1.4rem}.letter-tabs{display:flex;gap:1.4rem;border-bottom:1px solid var(--line);margin:1rem 0}
.letter-tabs button{border:0;border-bottom:1px solid transparent;background:none;color:var(--muted);padding:.5rem 0;min-height:44px}
.letter-tabs button[aria-selected="true"]{color:var(--gold);border-bottom-color:var(--gold)}
.site-letter{padding:1rem 0;border-bottom:1px solid var(--line)}.site-letter time{font:12px system-ui,sans-serif;color:var(--muted)}.site-letter h3{margin:.4rem 0;font-size:1.1rem;color:var(--gold)}.site-letter p{font-size:.92rem;margin:.4rem 0}
.letter-actions{display:flex;gap:1rem;align-items:center;flex-wrap:wrap;margin-top:1rem}.letter-actions a{text-decoration:none}#letterBody{min-height:9rem}#languageNotice{font:12px/1.6 system-ui,sans-serif;max-width:42rem}
html[lang="en"] body{font-family:Georgia,serif}html[lang="en"] .brand{letter-spacing:.1em}
@media(max-width:600px){header{flex-wrap:wrap;gap:.25rem .5rem}.site-tools{gap:0}.brand{font-size:12px;letter-spacing:.15em}.icon-btn{width:40px;height:44px;padding:9px}.record-filters{grid-template-columns:1fr;gap:.2rem}.letters-modal{width:calc(100vw - 1rem);max-height:calc(100dvh - 1rem)}.letters-paper{max-height:calc(100dvh - 1rem)}.letter-tabs{gap:.8rem;font-size:.88rem}}
@media(max-width:380px){header .brand{width:100%}.site-tools{justify-content:flex-end}.icon-btn{width:44px}}
.letter-trap{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
.site-letter p{white-space:pre-wrap;overflow-wrap:anywhere}
.letters-paper .head{gap:1rem}.letters-paper .head h2{margin:0}
.letter-tabs button{white-space:normal;text-align:left}
.letter-actions .cast{padding:.65rem 1rem}
.site-tools button,.letter-tabs button{user-select:none;-webkit-user-select:none}

/* Original Qianlong-style bronze coins; the square opening stays transparent. */
.round-coins .coin{display:flex;flex-direction:column;gap:.12rem;justify-content:flex-start;width:100%;max-width:6.6rem;height:auto;min-width:0;aspect-ratio:auto;padding:0;justify-self:center;border:0;border-radius:0;background:transparent;box-shadow:none;white-space:normal}
.toss-round.pending .coin,.toss-round.current .coin{border:0;background:transparent}
.coin-art{display:block;width:100%;height:auto;aspect-ratio:1;overflow:visible;filter:drop-shadow(0 3px 3px #0008)}
.coin-inscription{font-family:KaiTi,STKaiti,"Songti SC",SimSun,serif;font-size:21px;font-weight:700;fill:#463a22;stroke:#efd494;stroke-width:.25px;paint-order:stroke fill;filter:drop-shadow(0 .6px 0 #eac98488)}
.coin-ornaments{stroke:#4c4028;stroke-width:2.4;filter:drop-shadow(0 .7px 0 #eac98488)}
.coin-ornament-fine{stroke-width:1.25}
.coin-caption{display:block;max-width:100%;min-height:1.35em;color:#dfca95;font:11px/1.35 system-ui,sans-serif;text-align:center;overflow-wrap:anywhere}
.coin[data-face="pending"] .coin-art,.coin[data-face="unknown"] .coin-art{opacity:.63;filter:saturate(.55) drop-shadow(0 2px 2px #0007)}
.coin[data-face="pending"] .coin-caption,.coin[data-face="unknown"] .coin-caption{color:#b3b0a2}
.toss-round.current .coin-art{opacity:1;filter:drop-shadow(0 3px 4px #b28c3933)}
.casting-active .round-coins{gap:.5rem}
@media(max-width:430px){.round-coins .coin{max-width:5rem}.coin-caption{font-size:11px}}

/* Account dialogs share the quiet dark paper of the letters panel. */
.account-modal{width:min(35rem,calc(100vw - 2rem));max-height:calc(100dvh - 2rem);padding:0;border:1px solid var(--line);background:#151e22;color:var(--ink);box-shadow:0 24px 90px #0009}
.account-modal::backdrop{background:#020606aa;backdrop-filter:blur(5px)}
.account-paper{padding:clamp(1.1rem,3vw,2rem);max-height:calc(100dvh - 2rem);overflow:auto;overscroll-behavior:contain;scrollbar-color:#847b60 transparent}
.account-paper .head{gap:1rem;align-items:center}.account-paper .head h2{margin:0;font-size:1.4rem}.account-intro{font-size:.98rem;color:#dedacb;margin:1rem 0 .5rem}
.account-paper fieldset{border:0;padding:0;margin:0;min-width:0}.account-paper input{min-width:0;width:100%;font:16px/1.5 system-ui,sans-serif}.account-paper label{font-size:.91rem}.account-hint{font-size:.76rem;margin:.3rem 0 .6rem;line-height:1.5}.account-status:empty,.cloud-record-tools:has(#cloudRecordStatus[hidden]){display:none}.account-status{white-space:pre-wrap;overflow-wrap:anywhere}.account-status.is-error,.cloud-record-tools .is-error{color:#e4b49c}
.account-tabs{display:flex;gap:1.1rem;border-bottom:1px solid var(--line);margin:1.1rem 0}.account-tab{border:0;border-bottom:1px solid transparent;background:none;color:var(--muted);padding:.5rem 0;min-height:44px;white-space:normal;text-align:left;font-size:.94rem}.account-tab[aria-selected="true"]{color:var(--gold);border-color:var(--gold)}
.password-field{display:flex;align-items:stretch;position:relative;min-width:0}.password-field input{padding-right:6rem}.password-toggle{position:absolute;inset:1px 1px 1px auto;width:5.8rem;padding:.3rem .4rem;border:0;border-left:1px solid var(--line);background:#151e22;color:var(--muted);font:12px/1.35 system-ui,sans-serif}.password-toggle:hover{color:var(--gold)}.account-submit{width:100%;margin:1.25rem 0 .3rem}.account-founder{border-top:1px solid var(--line);padding-top:.8rem;margin-top:1.3rem}.account-founder .textbtn{font-size:.78rem;color:var(--muted)}
.profile-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin:1.2rem 0 .4rem}.profile-heading>div{min-width:0}.profile-heading h3{font-size:.85rem;font-weight:400;color:var(--muted);margin:0 0 .55rem}.profile-heading strong{font-size:1.25rem;color:var(--gold);font-weight:500;overflow-wrap:anywhere}.profile-heading p{margin:.1rem 0;overflow-wrap:anywhere}.profile-heading .tag{flex-shrink:0;font-size:.76rem}.account-import{padding:.85rem 0 1rem;border-block:1px solid var(--line);margin-top:1rem}.account-import p{margin:0 0 .5rem}.account-details{margin:1rem 0}.account-profile-footer{border-top:1px solid var(--line);padding-top:1rem;margin-top:1rem}.account-actions{display:flex;align-items:center;gap:.6rem 1rem;flex-wrap:wrap}.account-actions .cast{font-size:.85rem;padding:.5rem .8rem}.account-actions .textbtn{min-height:44px;font-size:.84rem}
.recovery-box{border:1px solid #c6a97288;background:#c6a9720c;padding:1rem;margin:1rem 0}.recovery-box h3{color:var(--gold);font-size:1.05rem;margin:0}.recovery-box code{display:block;padding:.8rem;margin:.85rem 0;background:#070d1166;font:16px/1.6 ui-monospace,Consolas,monospace;color:#f0deb2;white-space:pre-wrap;overflow-wrap:anywhere;user-select:all}.recovery-box p{font-size:.8rem}.account-admin{margin-top:1.4rem;border-top:1px solid var(--line);padding-top:1rem}.account-admin h3{font-size:1rem;color:var(--gold)}.admin-row{border-bottom:1px solid var(--line);padding:.8rem 0;overflow-wrap:anywhere}.admin-row strong{font-weight:500;color:var(--gold)}.admin-row p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.87rem;margin:.4rem 0}.cloud-record-tools{display:flex;align-items:center;gap:.3rem 1rem;flex-wrap:wrap}.cloud-record-tools p{margin:0}.signed-in::after{content:'';position:absolute;top:9px;right:9px;width:4px;height:4px;border-radius:50%;background:var(--gold)}
.account-paper button:focus-visible,.account-paper code:focus-visible{outline:2px solid var(--gold);outline-offset:3px}.account-paper button:disabled{opacity:.5;cursor:wait}
.account-paper button,.icon-btn{-webkit-tap-highlight-color:transparent}
@media(max-width:600px){.account-modal{width:calc(100vw - 1rem);max-height:calc(100dvh - 1rem)}.account-paper{padding:1rem;max-height:calc(100dvh - 1rem)}.account-tabs{gap:.85rem}.account-tab{font-size:.84rem}.profile-heading{flex-wrap:wrap}.password-field input{padding-right:5.2rem}.password-toggle{width:5rem;font-size:11px}.recovery-box{padding:.8rem}.account-paper .head h2{font-size:1.25rem}}
/* Separate practice entry and audited traditional chart; preserve compact home. */
.practice-entry{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:0 0 1.1rem;flex-wrap:wrap}
#liuyaoChart .chart-basis{font-size:.85em;line-height:1.8}
#liuyaoChart table{font-size:.8em;min-width:620px}
#liuyaoChart td,#liuyaoChart th{padding:.55em .65em}
