/* 命運之書 V3 | scoped standalone styling; no runtime CSS framework */
:root{color-scheme:dark;--bg:#0e0d1d;--surface:#1c1930;--panel:#1d1b32;--line:rgba(229,207,164,.22);--gold:#e9c98b;--gold2:#c7a267;--text:#f7f0e4;--sub:#c1b9ce;--violet:#a997df;--radius:22px;font-family:"Noto Serif TC","Microsoft JhengHei","PingFang TC",serif}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);min-height:100vh;line-height:1.7;overflow-x:hidden}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.54}a{color:inherit;text-decoration:none}a:hover{text-decoration:underline}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #f5ca82;outline-offset:4px}[hidden]{display:none!important}
.sky{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden;background:radial-gradient(ellipse 95% 48% at 55% 8%,#2c204a 0%,transparent 76%),linear-gradient(180deg,#121024,#0c0b19 65%)}.sky-glow{position:absolute;inset:-20% 0 0;background:radial-gradient(circle at 23% 29%,#40326680 0,transparent 27%),radial-gradient(circle at 76% 27%,#3a245880 0,transparent 20%)}.stars{position:absolute;inset:0;background-image:radial-gradient(#e6d5b9 1px,transparent 1px),radial-gradient(#fff8 1px,transparent 1px);background-size:127px 163px,233px 191px;background-position:17px 12px,90px 75px;opacity:.4}
.page-shell{position:relative;z-index:1;max-width:1220px;padding:0 24px;margin:auto}.site-header{display:flex;align-items:center;justify-content:space-between;gap:20px;border-bottom:1px solid var(--line);padding:22px 0}.brand{display:flex;align-items:center;gap:11px}.brand:hover{text-decoration:none}.brand-mark{width:43px;height:43px;display:grid;place-items:center;border:1px solid var(--gold2);border-radius:50%;color:var(--gold);font-size:1.8rem;box-shadow:0 0 28px #ddbb7040}.brand strong{display:block;font-size:.93rem;letter-spacing:.1em}.brand small{display:block;color:var(--gold2);font-size:.55rem;letter-spacing:.13em}.site-links{display:flex;gap:23px;font-family:"Microsoft JhengHei",sans-serif;font-size:.84rem;color:#e4d4bb}.site-links a{padding:8px 0}
.hero{text-align:center;padding:60px 0 52px}.hero-ornament{color:var(--gold2);font-size:1.35rem;letter-spacing:1.3em;padding-left:1.3em}.eyebrow{display:flex;gap:15px;justify-content:center;align-items:center;color:var(--gold);font:700 .65rem Georgia,serif;letter-spacing:.36em;margin-top:23px}.eyebrow-line{width:37px;height:1px;background:var(--gold2)}.hero h1{font-weight:500;letter-spacing:.23em;margin:12px 0 8px;padding-left:.23em;font-size:clamp(2.4rem,6vw,4.4rem);text-shadow:0 2px 28px #b19ddd80}.hero-subtitle{color:#d7cadf;font-size:clamp(.92rem,2.5vw,1.1rem);margin:0 auto;max-width:660px}.hero-chips{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-top:26px;color:#dac8a9;font:400 .76rem "Microsoft JhengHei",sans-serif}.hero-chips span{border:1px solid #e5c98d2b;border-radius:50px;padding:5px 13px;background:#241d35aa}
.section-heading{text-align:center;margin:15px 0 26px}.section-heading .chapter{color:var(--gold2);font:700 .68rem Georgia,serif;letter-spacing:.3em}.section-heading h2{font-size:clamp(1.35rem,3vw,1.8rem);font-weight:500;letter-spacing:.13em;margin:10px 0 5px}.section-heading p{color:var(--sub);font-size:.85rem;margin:0}
.mode-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin:0 auto 26px}.mode-card{border:1px solid var(--line);border-radius:16px;background:linear-gradient(148deg,#27213f,#18172b);color:var(--text);padding:19px 12px 16px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;position:relative;min-width:0;transition:transform .2s,border-color .2s,box-shadow .2s}.mode-card:hover:not(:disabled){transform:translateY(-3px);border-color:#d2ac78}.mode-card.is-active{border-color:var(--gold);background:linear-gradient(145deg,#423050,#241d39);box-shadow:0 0 0 1px #d9bb8850,inset 0 0 30px #e0bb6d18}.mode-symbol{font:2rem Georgia,serif;color:var(--gold)}.mode-name{font-size:1.07rem;font-weight:700;letter-spacing:.07em}.mode-desc{color:var(--sub);font-size:.79rem}.mode-tag{font:.7rem "Microsoft JhengHei",sans-serif;color:var(--gold2);margin-top:3px}
.reading-layout{display:grid;grid-template-columns:minmax(280px,370px) minmax(0,1fr);align-items:start;gap:20px}.panel{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(155deg,#232037,#19172c);box-shadow:0 15px 50px #02010950;padding:28px}.panel-kicker{font:700 .68rem Georgia,serif;letter-spacing:.25em;color:var(--gold2)}.small-star{font:1rem serif;letter-spacing:0;margin-right:8px}.panel h2{font-size:1.35rem;font-weight:600;letter-spacing:.06em;margin:10px 0}.supporting{font-size:.83rem;color:var(--sub);margin:0 0 20px}.question-panel label:not(.switch-label){display:block;color:#ebdcc7;font-weight:600;font-size:.86rem;margin:16px 0 8px}.required{color:#e9afaa}.question-panel textarea,.question-panel select,.question-panel input[type=text],.choice-inputs input{display:block;width:100%;border-radius:10px;border:1px solid #6d607d;background:#120f24;color:#fff;padding:12px;line-height:1.55;resize:vertical;outline:none}.question-panel textarea:focus,.question-panel select:focus,.choice-inputs input:focus{border-color:var(--gold);box-shadow:0 0 0 3px #e9c98b28}.question-panel textarea::placeholder,.choice-inputs input::placeholder{color:#ab9db8}.question-panel select{cursor:pointer;appearance:auto}.field-meta{display:flex;justify-content:space-between;gap:10px;color:#b7aec3;margin-top:5px;font:400 .71rem "Microsoft JhengHei",sans-serif}.form-feedback{min-height:22px;font:.82rem "Microsoft JhengHei",sans-serif;color:#ffbbb2;margin-top:7px}.mini-heading{font-size:.76rem;color:var(--sub);margin-bottom:8px}.examples{margin-top:20px}.example-chips{display:flex;flex-wrap:wrap;gap:8px}.example-chip{font:.75rem "Microsoft JhengHei",sans-serif;border:1px solid #615477;background:#302844;color:#efdeed;border-radius:30px;padding:8px 10px}.example-chip:hover:not(:disabled){border-color:var(--gold);background:#433451}.choice-inputs{padding:8px 0}.choice-inputs label{margin-top:10px!important}.actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}.primary-btn,.secondary-btn{border-radius:10px;padding:12px 15px;font-weight:700;font-size:.88rem;min-height:46px}.primary-btn{border:1px solid #eacb93;background:linear-gradient(125deg,#e6c38a,#b99358);color:#201528;flex:1}.primary-btn:hover:not(:disabled){filter:brightness(1.1)}.secondary-btn{border:1px solid #786987;background:#241d35;color:#e9d9ea}.secondary-btn:hover:not(:disabled){background:#382d47}.reading-preferences{display:flex;flex-wrap:wrap;gap:14px;margin-top:17px}.switch-label{font:400 .72rem "Microsoft JhengHei",sans-serif;color:#cfc6d9;display:flex;align-items:center;gap:5px}.switch-label input{accent-color:#deb87e;width:17px;height:17px}
.table-panel{min-width:0}.table-heading{display:flex;align-items:start;justify-content:space-between;gap:10px}.table-heading p{font-size:.84rem;color:var(--sub);margin:0 0 18px}.phase-badge{flex:none;border:1px solid #b4956250;border-radius:30px;padding:5px 9px;font:.69rem "Microsoft JhengHei",sans-serif;color:var(--gold);background:#2c243b}.table-surface{min-height:415px;background:radial-gradient(ellipse at center,#33264d 0%,#201b38 51%,#141126 100%);border:1px solid #b79b7050;border-radius:50% / 18%;box-shadow:inset 0 0 48px #03020db8,0 10px 30px #090715c0;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:28px 10px;isolation:isolate}.table-decoration{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;z-index:-1}.outer-ring,.inner-ring{position:absolute;display:block;border:1px solid #bd9d6957;width:74%;aspect-ratio:1;border-radius:50%;box-shadow:0 0 16px #d8bc4d18}.inner-ring{width:55%;border-style:dashed;transform:rotate(16deg)}.center-sigil{font:6rem Georgia,serif;color:#ddc17a24;text-align:center}.center-sigil small{display:block;font-size:1.3rem;line-height:0}.cards-area{display:flex;align-items:center;justify-content:center;gap:clamp(5px,1.2vw,12px);min-width:0;width:100%;min-height:330px}.cards-area.is-idle{min-height:330px}.empty-table{text-align:center;color:var(--gold);padding:22px}.empty-glyph{font:4rem serif;color:#d4b480a6}.empty-table p{font-size:1.1rem;letter-spacing:.16em;margin:7px}.empty-table small{display:block;color:#c0aeca;font-size:.79rem}
.tarot-card{width:clamp(100px,19%,152px);aspect-ratio:5/8;padding:0;flex:none;border:0;color:inherit;background:transparent;perspective:900px;position:relative;transform:translateY(0);transition:transform .3s;touch-action:manipulation}.tarot-card:not(:disabled):hover{transform:translateY(-10px)}.tarot-card:disabled{opacity:1;cursor:default}.card-inner{width:100%;height:100%;position:relative;display:block;transform-style:preserve-3d;transition:transform .7s cubic-bezier(.18,.72,.15,1.08)}.tarot-card.is-revealed .card-inner{transform:rotateY(180deg)}.card-face{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;backface-visibility:hidden;border:3px double #d8b477;border-radius:11px;overflow:hidden;box-shadow:0 7px 23px #0a061a70}.card-back{background:radial-gradient(circle,#5a427d 0%,#271d48 58%,#141126 100%)}.card-back:before,.card-front:before{content:"";position:absolute;inset:7px;border:1px solid #dac38b78;border-radius:7px;pointer-events:none}.back-frame{position:absolute;inset:18px 9px;border:1px solid #bb9c67b2;border-radius:40% / 10%}.back-moon{font:clamp(2.2rem,5vw,4rem) Georgia,serif;color:#e9c98b;text-shadow:0 0 25px #f4c97888}.back-stars{position:absolute;top:13%;font:1.1rem serif;color:#e3b979}.back-footer{position:absolute;bottom:9%;font:clamp(.4rem,.8vw,.59rem) Georgia,serif;letter-spacing:.25em;color:#c8a77f}.card-front{transform:rotateY(180deg);background:radial-gradient(ellipse at 50% 38%,var(--card-accent,#514677) 0%,#2c244a 72%,#161226 100%);padding:13px 6px;text-align:center;gap:1px}.card-number{position:absolute;top:8%;font:clamp(.58rem,1.2vw,.85rem) Georgia,serif;color:var(--gold)}.card-symbol{font:clamp(2.5rem,5vw,4rem) Georgia,serif;text-shadow:0 4px 25px #090516,0 0 15px #ffffff39;line-height:1.25}.card-name{font-size:clamp(.66rem,1.4vw,1rem);font-weight:700;letter-spacing:.06em;color:#fff8e5}.card-orient{font-size:clamp(.55rem,1.1vw,.7rem);color:#f5d49e}.card-slot{position:absolute;bottom:11%;font-size:clamp(.52rem,1.1vw,.68rem);color:#ffe6af}.card-prompt{position:absolute;bottom:-33px;left:0;right:0;font:.67rem "Microsoft JhengHei",sans-serif;color:#f1d59e;text-align:center}.tarot-card.is-revealed{filter:drop-shadow(0 0 12px #bfa06a7a)}.tarot-card.is-revealed .card-prompt{color:#cfbdcb}.tarot-card.is-backward .card-orient{color:#ffc4c4}.tarot-card:not(.is-revealed) .card-front{visibility:visible}.tarot-card.is-selected:not(.is-revealed){box-shadow:none}
.spread--single .tarot-card{width:clamp(95px,22%,154px)}.spread--triple .tarot-card,.spread--choice .tarot-card{width:clamp(94px,21%,151px)}.spread--single .tarot-card:first-child{rotate:-8deg}.spread--single .tarot-card:last-child{rotate:8deg}.table-footer{display:flex;justify-content:space-between;gap:12px;align-items:center;padding-top:18px;color:#e4cda7;font-size:.78rem}.deck-count{color:#a293aa;font: .59rem Georgia,serif;letter-spacing:.15em;white-space:nowrap}
.result-panel{margin-top:24px}.result-intro{text-align:center}.result-intro h2{font-size:1.7rem}.result-question{color:#d1c4de;font-size:.9rem;overflow-wrap:anywhere}.result-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:15px;margin-top:25px}.result-item{border:1px solid var(--line);border-radius:15px;background:#141327;padding:20px}.result-item .result-slot{color:var(--gold);font-size:.75rem;letter-spacing:.09em}.result-item .result-symbol{font:3rem Georgia,serif;float:right;line-height:1.1}.result-item h3{font-size:1.15rem;margin:7px 0 5px}.result-orient{font-size:.74rem;color:#dabf8d}.keywords{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}.keyword{font:.7rem "Microsoft JhengHei",sans-serif;background:#2d2841;border:1px solid #695681;border-radius:50px;padding:4px 8px;color:#eadbfa}.result-desc{color:#d8d0df;font-size:.88rem;white-space:pre-wrap;overflow-wrap:anywhere}.conclusion{margin-top:25px;padding:24px;border:1px solid #a68b5b80;border-radius:15px;background:linear-gradient(125deg,#352b41,#231d36)}.conclusion-kicker{font:.7rem Georgia,serif;letter-spacing:.2em;color:var(--gold)}.conclusion h3{margin:8px 0;color:#ffe2aa;font-size:1.27rem}.conclusion p{font-size:.9rem;white-space:pre-wrap;overflow-wrap:anywhere}.reflection-box,.action-box{border-left:2px solid var(--gold2);margin-top:15px;padding:4px 15px;background:#100c1a4f}.reflection-box strong,.action-box strong{font-size:.77rem;color:var(--gold)}.reflection-box p,.action-box p{margin:5px 0}.result-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin-top:20px}.result-actions .primary-btn{flex:0 1 auto}
.journal-section{padding:55px 0 60px}.journal{max-width:1000px;margin:auto}.journal-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;font:.8rem "Microsoft JhengHei",sans-serif;color:var(--gold)}.journal-actions{display:flex;gap:13px;flex-wrap:wrap}.text-btn{border:0;background:none;color:#ded0e9;font-size:.78rem;padding:7px 2px}.text-btn:hover{text-decoration:underline}.text-btn.danger{color:#ffb8b8}.history-list{margin-top:12px}.history-item{border-top:1px solid var(--line);padding:13px 0}.history-item summary{cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:13px;list-style:none}.history-item summary::-webkit-details-marker{display:none}.history-item summary:after{content:"＋";color:var(--gold);font-size:1.15rem;flex:none}.history-item[open] summary:after{content:"−"}.history-main{min-width:0}.history-main strong{display:block;font-size:.9rem;overflow-wrap:anywhere}.history-main small{color:#b7aac1}.history-details{color:#d0c5d8;font-size:.84rem;padding:12px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.no-history{text-align:center;color:#bcafc8;padding:26px;font-size:.87rem}.storage-note{font:.75rem "Microsoft JhengHei",sans-serif;color:#a9a1b1;border-top:1px solid #ffffff17;padding-top:11px;margin-top:12px}.site-footer{text-align:center;border-top:1px solid var(--line);padding:28px 0 45px;color:#b9aabf;font-size:.75rem}.site-footer p{margin:3px}.footer-symbol{color:var(--gold);letter-spacing:.8em;padding-left:.8em;font-size:1.1rem}.site-footer small{color:#8d819d}.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:30;background:#f2ddb8;color:#211831;border-radius:40px;padding:11px 22px;box-shadow:0 8px 25px #0008;text-align:center;font:.82rem "Microsoft JhengHei",sans-serif;max-width:92vw}
@media(max-width:900px){.reading-layout{grid-template-columns:1fr}.question-panel{order:0}.table-panel{order:1}.table-surface{min-height:340px}.cards-area,.cards-area.is-idle{min-height:280px}.tarot-card,.spread--single .tarot-card,.spread--triple .tarot-card,.spread--choice .tarot-card{width:clamp(90px,21vw,156px)}.card-number{font-size:.76rem}.card-name{font-size:.93rem}.card-orient{font-size:.72rem}.card-slot{font-size:.67rem}}
@media(max-width:600px){.page-shell{padding:0 12px}.site-header{padding:13px 0}.brand-mark{width:36px;height:36px}.brand small{font-size:.48rem}.site-links{gap:9px;font-size:.71rem}.site-links a{padding:7px 0}.hero{padding:36px 0 34px}.hero-chips{gap:6px}.hero-chips span{padding:5px 8px;font-size:.65rem}.mode-grid{gap:7px;margin-bottom:14px}.mode-card{padding:13px 5px 11px;border-radius:12px}.mode-symbol{font-size:1.55rem}.mode-name{font-size:.83rem}.mode-desc{font-size:.64rem}.mode-tag{font-size:.6rem}.panel{padding:18px 14px;border-radius:15px}.reading-layout{gap:13px}.table-heading{flex-wrap:wrap}.table-heading p{margin-bottom:12px}.table-surface{min-height:270px;border-radius:45% / 12%;padding:16px 5px}.cards-area,.cards-area.is-idle{min-height:235px;gap:5px}.tarot-card,.spread--single .tarot-card,.spread--triple .tarot-card,.spread--choice .tarot-card{width:min(28%,125px)}.card-face{border-width:2px;border-radius:8px}.card-back:before,.card-front:before{inset:5px}.back-frame{inset:12px 6px}.back-moon{font-size:2.65rem}.card-symbol{font-size:2.5rem}.card-name{font-size:.72rem}.card-number,.card-orient,.card-slot{font-size:.57rem}.card-prompt{font-size:.59rem;bottom:-24px}.table-footer{font-size:.68rem}.deck-count{font-size:.52rem}.result-cards{grid-template-columns:1fr}.conclusion{padding:17px}.journal-section{padding:40px 0}.journal-actions{gap:9px}}
@media(max-width:350px){.site-links a:last-child{display:none}.hero-chips span:last-child{display:none}.mode-desc{font-size:.55rem}.card-symbol{font-size:2rem}.card-name{font-size:.64rem}.table-footer .deck-count{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
body.reduce-motion *,body.reduce-motion *::before,body.reduce-motion *::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}

/* V3 knowledge & category-specific inspiration; V2 layout, cards and game mechanics unchanged. */
.field-hint{color:var(--gold2);font-weight:400;font-size:.75rem;margin-left:5px}
.helper-copy{display:block;color:#b7aec3;font:400 .72rem "Microsoft JhengHei",sans-serif;margin-top:8px}
.examples{margin-top:18px}
.examples label{margin-top:0!important}
.knowledge-disclaimer{font-size:.77rem;color:#c9bdc9;margin:12px 0 0;line-height:1.7}
.card-knowledge{margin-top:14px;border-top:1px solid var(--line);padding-top:10px;color:#d9cdd9}
.card-knowledge summary{color:#e9c98b;cursor:pointer;font-size:.8rem;font-weight:600;list-style:revert}
.card-knowledge p{margin:8px 0 0;font-size:.81rem;line-height:1.8;white-space:normal;overflow-wrap:anywhere}
.tarot-knowledge-section{padding:52px 0 0}
.knowledge-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.knowledge-item{border:1px solid var(--line);border-radius:16px;background:linear-gradient(150deg,#262039,#181628);padding:21px 23px;min-width:0}
.knowledge-item h3{color:var(--gold);font-size:1rem;margin:0 0 9px;letter-spacing:.04em}
.knowledge-item p{color:#d3cad7;font-size:.85rem;margin:0;line-height:1.9}
.knowledge-source{text-align:center;color:#b9afc9;font-size:.76rem;margin-top:16px;line-height:1.9}
.knowledge-source a{color:var(--gold);text-decoration:underline;text-underline-offset:3px}
@media(max-width:600px){
  .tarot-knowledge-section{padding-top:34px}
  .knowledge-grid{grid-template-columns:1fr;gap:10px}
  .knowledge-item{padding:17px}
  .knowledge-item p{font-size:.82rem}
}
