:root{--surface:#f8f2e8;--line:#bdaf9360;--subtle:#766b59;--veil:linear-gradient(90deg,#f5efdfeb 0%,#f5efdfbf 26%,#f5efdf30 59%,transparent 82%);--button:#343b31;--button-ink:#f6efdf;--effect:#9bba8f}
html[data-theme=cultivation]{--paper:#e5ede3;--ink:#233f35;--muted:#4b6c5c;--subtle:#456753;--surface:#eef4e9;--veil:linear-gradient(90deg,#e8f0e6ee,#e8f0e6c4 32%,#d9e8d630 75%);--gold:#9b8350;--button:#315a46;--dragon-ink:#315543;--dragon-face:#dbdfbf;--dragon-scale:#f0e7bc}
html[data-theme=xinjiang]{--paper:#e9f3e8;--ink:#1e4140;--subtle:#3e6562;--surface:#eff6ea;--veil:linear-gradient(90deg,#edf6ebe8,#edf6ebb8 36%,#edf6eb25 80%);--button:#24675f;--dragon-ink:#326456;--dragon-face:#e5ebce;--dragon-scale:#d8f2dd;--effect:#e2f4b6}
html[data-theme=magic],html[data-theme=future],html[data-theme=changan]{--ink:#f3e9dc;--line:#a69bc73d;--surface:#18192e;--subtle:#c3b7d1;--cinnabar:#e1a491;--dragon-ink:#d5c3e6;--dragon-face:#353149;--dragon-scale:#77718d;--button-ink:#fff5e8;--veil:linear-gradient(90deg,#100e24ee,#100e24c9 32%,#100e2450 72%,#100e2425)}
html[data-theme=magic]{--paper:#111026;--button:#655087;--gold:#d6b783;--effect:#d2b8ff}
html[data-theme=future]{--paper:#07182a;--surface:#0d2337;--subtle:#a7cddd;--veil:linear-gradient(90deg,#071525f2,#071525c7 38%,#0715253a 80%);--button:#246278;--gold:#8bdae5;--dragon-ink:#b1e0e5;--dragon-face:#183c50;--effect:#77dcf4}
html[data-theme=changan]{--paper:#252132;--surface:#282432;--subtle:#e1c5b3;--veil:linear-gradient(90deg,#29222eec,#29222ec9 35%,#29222e3d 85%);--button:#964d3b;--gold:#e1b17a;--dragon-ink:#ddbea0;--dragon-face:#4b3435;--dragon-scale:#92785e;--effect:#ffc48a}
html[data-theme=cultivation] .landscape{background-image:url('/personal/theme-cultivation.webp')}html[data-theme=magic] .landscape{background-image:url('/personal/theme-magic.webp')}html[data-theme=future] .landscape{background-image:url('/personal/theme-future.webp')}html[data-theme=changan] .landscape{background-image:url('/personal/theme-changan.webp')}html[data-theme=xinjiang] .landscape{background-image:url('/personal/theme-xinjiang.webp')}
.paper-light{background:var(--veil)}.landscape{animation:scene-breathe 34s ease-in-out infinite alternate;animation-play-state:paused}.theme-effects{position:fixed;inset:0;z-index:-2;overflow:hidden;pointer-events:none}.theme-effects *{animation-play-state:paused!important}.theme-effects svg{overflow:visible}.theme-effects i{position:absolute;display:block;left:var(--x);animation-delay:var(--delay)}
html[data-motion=on] .theme-effects *,html[data-motion=on] .landscape{animation-play-state:running!important}
.spirit-mist{position:absolute;inset:40% -8% -8% 25%;background:radial-gradient(ellipse,#d7e8ccb0,transparent 63%);opacity:.5;animation:cloud-flow 23s ease-in-out infinite alternate}.spirit-mist-high{inset:10% -12% 28% 45%;animation-delay:-10s}.sword-light{top:calc(22% + var(--i)*18%);width:90px;height:2px;box-shadow:0 0 8px #d6f7d6;background:linear-gradient(90deg,transparent,#e4fff1);transform:rotate(-20deg);animation:sword-pass 11s ease-in-out infinite}.sword-light::after{content:'';position:absolute;right:6px;top:-3px;height:8px;border-right:1px solid #f4ffe8}.spirit-mote,.magic-mote,.data-spark,.meadow-spark{width:3px;height:3px;top:calc(22% + var(--i)*4%);border-radius:50%;background:var(--effect);box-shadow:0 0 8px var(--effect);animation:mote-rise 13s ease-in-out infinite}
.magic-sigil{position:absolute;width:min(37vw,450px);right:9%;top:14%;fill:none;stroke:#d8bcf9;stroke-width:.6;opacity:.25;animation:slow-orbit 70s linear infinite}.magic-sigil circle:nth-child(2){stroke-dasharray:2 7}.magic-mote{width:2px;height:2px;animation-duration:17s}.data-grid{position:absolute;inset:58% -25% -20% 32%;background-image:linear-gradient(#7bdaed35 1px,transparent 1px),linear-gradient(90deg,#7bdaed35 1px,transparent 1px);background-size:55px 55px;transform:perspective(500px) rotateX(55deg);transform-origin:center bottom;opacity:.5;animation:grid-flow 9s linear infinite}.scan-beam{position:absolute;top:0;left:35%;right:0;height:65px;background:linear-gradient(transparent,#83dbe320,transparent);border-bottom:1px solid #a3f4ff38;animation:tech-scan 13s ease-in-out infinite}.hud-orbit{position:absolute;width:28vw;height:28vw;border:1px dashed #83dbe359;border-radius:50%;right:12%;top:19%;animation:slow-orbit 50s linear infinite}.data-spark{border-radius:0;width:2px;height:14px;animation-duration:9s}
.lantern{top:calc(8% + var(--i)*6%);width:20px;height:29px;border-radius:45%;border:1px solid #e9b965b5;background:radial-gradient(#ffcb78,#c77a42 55%,#8c4636);box-shadow:0 0 20px #e19a6033;transform-origin:center -20px;animation:lantern-sway 7s ease-in-out infinite alternate}.lantern::before{content:'';position:absolute;left:9px;bottom:100%;height:42px;border-left:1px solid #d6ac7959}.lantern::after{content:'';position:absolute;top:100%;left:9px;height:13px;border-left:1px solid #e7b968}.peach-petal{width:6px;height:10px;top:-15%;border-radius:80% 10% 70% 20%;background:#edb3b5a6;animation:petal-drift 22s linear infinite}.grassland-cloud{position:absolute;inset:8% -30% 52% 38%;background:radial-gradient(ellipse,#ffffffe0,transparent 65%);opacity:.35;animation:cloud-flow 40s ease-in-out infinite alternate}.cloud-second{inset:25% -20% 42% 55%;animation-delay:-20s;opacity:.2}.lake-ripples{position:absolute;right:9%;top:66%;width:40vw;height:80px}.lake-ripples i{inset:0;border:1px solid #e5fffc9c;border-radius:50%;animation:lake-wave 9s ease-out infinite}.lake-ripples i:nth-child(2){animation-delay:-3s}.lake-ripples i:nth-child(3){animation-delay:-6s}.meadow-spark{top:calc(72% + var(--i)*2%);width:2px;height:2px;animation-duration:11s}
html:not([data-theme=ink]) .chapter,html:not([data-theme=ink]) .header-note,html:not([data-theme=ink]) .intro-note p,html:not([data-theme=ink]) .entry-note,html:not([data-theme=ink]) .coming-soon,html:not([data-theme=ink]) .brand-caption,html:not([data-theme=ink]) .site-footer,html:not([data-theme=ink]) .landscape-caption{color:var(--subtle)}html:not([data-theme=ink]) .site-footer{background:transparent;border-color:var(--line)}html:not([data-theme=ink]) .motion-toggle{background:var(--surface);color:var(--ink);border-color:var(--line)}html:not([data-theme=ink]) .primary{background:var(--button);color:var(--button-ink);border-color:var(--button)}html:not([data-theme=ink]) .migration-note{background:var(--surface);color:var(--ink);border-color:var(--line)}html:is([data-theme=magic],[data-theme=future],[data-theme=changan]) .brand-wordmark{filter:invert(1) drop-shadow(0 0 2px #ffffff18)}html:is([data-theme=magic],[data-theme=future],[data-theme=xinjiang]) .poetry-field,html:not([data-theme=ink]) .landscape-caption{display:none}html:not([data-theme=ink]) .mist{display:none}
.background-settings{width:min(880px,calc(100vw - 36px));max-height:calc(100dvh - 36px);padding:0;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:0 20px 100px #0005;overflow:auto}.background-settings::backdrop{background:#11182294;backdrop-filter:blur(4px)}.background-form>header{display:flex;justify-content:space-between;gap:16px;padding:25px 27px 18px}.background-form h2{font-size:24px;font-weight:500;margin:8px 0;letter-spacing:.08em}.background-form header small{font-family:system-ui,sans-serif;letter-spacing:.15em;font-size:9px;color:var(--subtle)}.background-form header p{font-size:12px;color:var(--subtle);line-height:1.8;margin:0}.theme-close{align-self:flex-start;font-size:28px;border:0;background:none;color:inherit;cursor:pointer;width:36px;height:36px}.background-form fieldset{margin:0;padding:0 24px;border:0;min-width:0}.theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.theme-choice{display:block;position:relative;cursor:pointer;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--paper);min-width:0}.theme-choice:has(input:checked){outline:2px solid var(--gold);outline-offset:2px}.theme-choice input{position:absolute;z-index:1;right:9px;top:9px;width:17px;height:17px;accent-color:var(--gold)}.theme-choice img{display:block;width:100%;height:auto;aspect-ratio:1.65;object-fit:cover}.theme-choice>span{display:block;padding:11px 12px}.theme-choice strong{display:block;font-size:12px;line-height:1.8;font-weight:500}.theme-choice small{display:block;font-size:10px;line-height:1.7;margin-top:3px;color:var(--subtle)}.theme-preview-note{font-size:12px;color:var(--subtle);padding:17px 26px;line-height:1.8;min-height:50px}.background-form>footer{display:flex;justify-content:space-between;gap:12px;padding:16px 24px;border-top:1px solid var(--line);position:sticky;bottom:0;background:var(--surface);z-index:2}.background-form footer button{padding:10px 16px;font-size:12px;border-radius:7px;cursor:pointer}.theme-default,.theme-cancel{border:1px solid var(--line);color:var(--ink);background:transparent}.theme-apply{border:1px solid var(--button);background:var(--button);color:var(--button-ink);margin-left:8px}.theme-default{font-size:10px!important}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@keyframes scene-breathe{from{transform:scale(1)}to{transform:scale(1.035)}}@keyframes cloud-flow{from{transform:translateX(-5%) scale(1);opacity:.25}to{transform:translateX(6%) scale(1.12);opacity:.55}}@keyframes sword-pass{0%,12%{opacity:0;translate:-18vw 12vh}30%{opacity:.7}55%,100%{opacity:0;translate:26vw -12vh}}@keyframes mote-rise{0%,100%{opacity:0;transform:translate(0,25px)}40%{opacity:.7}80%{opacity:.2;transform:translate(20px,-45px)}}@keyframes slow-orbit{to{transform:rotate(360deg)}}@keyframes grid-flow{to{background-position:0 55px}}@keyframes tech-scan{0%,100%{opacity:0;transform:translateY(0)}15%,75%{opacity:.7}90%{opacity:0;transform:translateY(80vh)}}@keyframes lantern-sway{from{transform:rotate(-7deg) translateY(0)}to{transform:rotate(7deg) translateY(9px)}}@keyframes petal-drift{0%{opacity:0;transform:translate(0,-5vh) rotate(0)}10%,70%{opacity:.6}100%{opacity:0;transform:translate(-18vw,115vh) rotate(260deg)}}@keyframes lake-wave{from{opacity:0;transform:scale(.15)}25%{opacity:.65}to{opacity:0;transform:scale(1.3)}}
@media(max-width:850px){.paper-light{background:var(--veil)}}@media(max-width:700px){.header-actions{flex-direction:column;gap:7px}.theme-options{grid-template-columns:repeat(2,minmax(0,1fr))}.magic-sigil{width:58vw;right:-4%;top:20%}.hud-orbit{width:45vw;height:45vw;right:0;top:26%}}@media(max-width:520px){.paper-light{background:var(--veil)}.background-form>header{padding:20px 17px 14px}.background-form h2{font-size:21px}.background-form fieldset{padding:0 16px}.theme-options{gap:9px}.theme-choice strong{font-size:11px}.theme-choice small{font-size:9px}.theme-choice>span{padding:9px}.background-form>footer{padding:13px 16px}.background-form footer button{padding:9px 12px}.theme-preview-note{padding:14px 17px;font-size:11px}.lantern{width:15px;height:23px}.theme-default{max-width:112px}}
@media(prefers-reduced-motion:reduce){.landscape,.theme-effects *{animation:none!important}.theme-effects{opacity:.65}.background-settings::backdrop{backdrop-filter:none}}

html:is([data-theme=magic],[data-theme=future],[data-theme=changan]) .dragon-head-art{filter:brightness(1.1) drop-shadow(0 0 1px #d8e9ff80)}

html[data-theme=magic]{--dragon-fog:#d4c6f3}html[data-theme=future]{--dragon-fog:#afebf2}html[data-theme=changan]{--dragon-fog:#f3dbc0}
