:root{color-scheme:light;--ink:#3b3024;--muted:#695746;--earth:#843d2a;--paper:#fffaf0;--bg:#f7eddb;--line:#dbc4a6;--serif:"Noto Serif TC","Songti TC","PMingLiU",serif}
*{box-sizing:border-box}[hidden]{display:none!important}
body{margin:0;background:radial-gradient(ellipse at 10% 1%,#fff9ec,transparent 54%),var(--bg);color:var(--ink);font:1rem/1.65 system-ui,"PingFang TC","Microsoft JhengHei",sans-serif}
button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit}a{color:#713824}a:hover{text-decoration:none}button:focus-visible,a:focus-visible{outline:3px solid #4f694f;outline-offset:3px}
.shell{max-width:1040px;margin:auto;padding:0 clamp(15px,4vw,38px)}
header{height:65px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);margin-bottom:clamp(14px,4vw,38px)}
.brand{padding:0;background:none;border:0;display:flex;align-items:center;gap:8px;font:700 1.18rem var(--serif);letter-spacing:.12em;min-height:44px}
.seal{background:var(--earth);color:#fff8e9;border-radius:7px 5px 8px 4px;padding:3px 5px 3px 7px;font-size:.94rem}.badge{border:1px solid var(--line);border-radius:25px;padding:3px 11px;color:var(--muted);font-size:.875rem;white-space:nowrap}
h1{font:800 clamp(2rem,5.5vw,3.25rem)/1.18 var(--serif);letter-spacing:.035em;margin:6px 0 18px}h1:focus{outline:none}p{margin:0 0 13px}.eyebrow{font-size:.875rem;letter-spacing:.2em;color:#783d2b;font-weight:750;margin:0 0 9px}.note{font-size:.875rem;color:var(--muted)}
.welcome,.panel{background:var(--paper);border:1px solid var(--line);border-radius:24px;box-shadow:0 13px 38px #6e442118}
.welcome{display:grid;grid-template-columns:1.05fr 1fr;align-items:center;overflow:hidden}.art{align-self:stretch;background:#fae9cc;min-height:0}.art img{display:block;width:100%;height:100%;object-fit:cover;object-position:center 56%;max-height:560px}
.intro{padding:clamp(20px,4vw,52px)}.bodycopy{max-width:29rem}
.panel{max-width:650px;margin:auto;padding:clamp(19px,4vw,40px)}
.actions{display:flex;flex-wrap:wrap;gap:9px;margin:21px 0 14px}
.primary,.secondary,.choices button{display:inline-flex;justify-content:center;align-items:center;min-height:46px;border-radius:12px;font-weight:700;padding:8px 17px;text-align:center;text-decoration:none;border:1px solid transparent}
.primary{background:var(--earth);color:white}.primary:hover{background:#713422}.secondary,.choices button{background:#faf0df;color:#683a2c;border-color:#d6bc9e}.secondary:hover,.choices button:hover{background:#f3e4cd}.full{width:100%;margin-top:5px}.textbtn{background:none;border:0;color:#713824;text-decoration:underline;min-height:44px;padding:0}.paper{background:#f4e8d4;border:1px solid #dfc9a9;border-radius:13px;padding:15px 17px;margin:15px 0}.paper p{margin:4px 0 12px}.paper p:last-child{margin-bottom:0}
.split{display:flex;justify-content:space-between;align-items:center;gap:8px}.coins{display:flex;justify-content:center;align-items:center;gap:clamp(10px,3vw,20px);min-height:104px;background:radial-gradient(ellipse,#f0d6a3 0%,transparent 70%);margin:6px 0}
.coins span{display:grid;place-items:center;width:56px;height:56px;border:4px double #7a522a;border-radius:50%;background:#dbb260;color:#4e311c;font:700 1.15rem var(--serif);box-shadow:2px 4px 0 #79522b33}
.coins span.back{background:#aa7b4b;color:white}.coins.flip span{animation:tumble .34s ease-out both}.coins.flip span:nth-child(2){animation-delay:45ms}.coins.flip span:nth-child(3){animation-delay:90ms}@keyframes tumble{45%{transform:translateY(-14px) rotateX(100deg)}100%{transform:none}}
.steps{display:grid;gap:6px;margin:12px auto;width:min(48%,155px);padding:4px}.line{height:8px;display:flex;gap:12px;align-items:stretch}.line i{flex:1;background:#614b38;border-radius:4px;display:block}.line.moving i{background:#a3482d}.line.empty i{background:#dfcfb8}.line.empty{opacity:.55}.toss-status{text-align:center;min-height:28px;font-weight:650}.footnote{margin:11px 0 0}
.hexpair{display:grid;grid-template-columns:1fr auto 1fr;text-align:center;align-items:center;gap:6px;background:#f7ecd9;border-radius:13px;padding:13px 5px}.compact{width:min(78%,95px);gap:4px}.compact .line{height:6px;gap:8px}.change{font-size:.875rem;color:#7d3b28}
blockquote{margin:17px 0;padding:9px 14px;border-inline-start:4px solid #994b33;font:700 1.15rem/1.5 var(--serif)}blockquote small{display:block;font:400 .875rem/1.4 system-ui,sans-serif;color:var(--muted);margin-top:4px}
details{margin:14px 0}summary{cursor:pointer;font-weight:650}
.wallpaper{max-width:760px;display:grid;grid-template-columns:1fr 235px;gap:19px;align-items:center}
figure{margin:0;justify-self:center}figure img{display:block;width:min(100%,235px);height:auto;border-radius:17px;border:1px solid var(--line)}.choices{display:flex;gap:8px;margin:16px 0 0}.choices [aria-pressed=true]{background:#783c2b;color:white;border-color:#783c2b}.downloads{margin-top:11px}
footer{color:var(--muted);max-width:650px;margin:18px auto 24px;text-align:center;font-size:.875rem;padding-bottom:env(safe-area-inset-bottom)}
@media(max-width:650px){header{height:55px}.welcome{max-width:470px;margin:auto;grid-template-columns:1fr}.art img{height:clamp(230px,35svh,355px);object-position:center 56%}.intro{padding:19px 21px}.welcome h1{margin-bottom:11px}.welcome .actions{margin-top:16px}.wallpaper{grid-template-columns:1fr}.wallpaper figure{grid-row:2}.downloads{margin-bottom:8px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;scroll-behavior:auto!important}}
.hexpair.unchanged{grid-template-columns:1fr auto;padding-inline:14%}.change{min-width:0}a[aria-disabled=true]{opacity:.55;pointer-events:none}
/* 結果頁以白話為主，掌中閱讀時古文與卦畫不會搶走焦點。 */
.read-intro{margin:6px 0 18px}.read-intro h2,.read-shift h2{font:750 1.32rem/1.45 var(--serif);letter-spacing:.015em;margin:4px 0 9px}
.read-intro p:last-child,.read-example p:last-child,.read-prompt p:last-child,.read-shift p:last-child{margin-bottom:0}
.read-example,.read-prompt,.read-shift{padding:14px 16px;margin:12px 0;border-radius:13px}
.read-example{background:#f6ead7;border:1px solid #e2cbae}.read-prompt{background:#edf0e4;border:1px solid #ced5c0}
.read-label{font-weight:750;margin-bottom:4px}.read-shift{border:1px solid var(--line)}
.read-sources{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:0 0 4px}.read-sources summary,.method summary{min-height:44px;align-content:center}
.read-sources .hexpair{margin:8px 0 10px}.classic-links{display:flex;flex-wrap:wrap;gap:8px 16px;margin:8px 0 13px}.method{font-size:.875rem;margin:0 0 12px}
#wallSamples{grid-column:1/-1;border-top:1px solid var(--line);padding-top:13px}
#wallSamples h2{font:750 1.15rem var(--serif);margin:0 0 11px}
.sample-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.sample-grid button{min-width:0;padding:4px;background:#f6ead7;border:1px solid var(--line);border-radius:8px;font-size:.875rem;line-height:1.3}
.sample-grid button[aria-pressed=true]{border-color:#843d2a;outline:2px solid #843d2a;outline-offset:1px}
.sample-grid img{width:100%;height:auto;aspect-ratio:1/2;object-fit:cover;display:block;border-radius:5px;margin-bottom:4px}
@media(max-width:650px){.sample-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){.wallpaper:has(#wallSamples:not([hidden])) figure{grid-row:3}}
.wallpicker{display:flex;align-items:center;gap:.7rem;margin:0 0 13px;color:var(--muted);font-weight:650;font-size:1rem;flex-wrap:wrap}.wallpicker select{font:inherit;min-height:44px;padding:.4rem .7rem;border:1px solid var(--line);color:#4a3628;background:#fff8ec;border-radius:8px}

/* 搖手機是選用操作，與原有擲幣按鈕清楚分開。 */
.shakebox{margin:9px 0 0}
.shakebox .note{margin:6px 0 0}
.shakebox .secondary[aria-pressed=true]{background:#ebefdf;border-color:#73815f;color:#37492b}

/* 提問、剩餘次數與個人解讀：沿用原本的紙張色，手機上採單欄。 */
.ai-card{background:#f6ead8;border:1px solid #d9c3a3;border-radius:16px;padding:1rem;margin-block:1.15rem}
.ai-card h2{margin-top:0}.ai-card label{display:block;font-weight:750;margin-bottom:.45rem}
.ai-card textarea{box-sizing:border-box;width:100%;min-height:6rem;resize:vertical;border-radius:10px;border:1px solid #b09775;background:#fffaf1;color:#35271d;padding:.75rem;font:inherit}
.ai-card .note{margin:.55rem 0;color:#59412f}
.ai-answer{white-space:pre-wrap;line-height:1.75;margin-top:.75rem}
