@font-face{font-family:"Zhi Mang Xing";src:url("fonts/zhi-mang-xing-zhizhi.ttf") format("truetype");font-display:swap}
@font-face{font-family:"Ma Shan Motto";src:url("fonts/ma-shan-zheng-motto.ttf") format("truetype");font-display:swap}
:root{font-family:"Noto Serif SC","Songti SC","SimSun",serif;color:#303932;background:#f7f2e8;color-scheme:light}
*{box-sizing:border-box}[hidden]{display:none!important}html{height:100%;overflow:hidden;overscroll-behavior:none}
body{position:relative;isolation:isolate;overflow:hidden;overscroll-behavior:none;margin:0;width:100%;height:var(--scene-height,100svh);background:#f7f2e8}
.ink-landscape{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none}
.ink-landscape img{display:block;width:100%;height:100%;object-fit:cover;object-position:center bottom;filter:contrast(.95) brightness(1.06)}
.ink-landscape:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(250,248,241,.2),rgba(250,248,241,.05) 55%,rgba(250,248,241,.04))}
#ink-scene{position:absolute;z-index:1;top:0;left:0;display:block;width:100%;height:100%;pointer-events:none}
main{position:relative;z-index:2;height:100%;width:100%;pointer-events:none}
.brand{position:absolute;top:11.5%;left:0;right:0;display:flex;align-items:center;justify-content:center;margin:0;text-align:center;font-weight:400;line-height:1}
.brand-title{display:inline-flex;align-items:flex-start;font-family:"Zhi Mang Xing","STKaiti","KaiTi",serif;font-size:clamp(82px,24vw,100px);font-weight:400;letter-spacing:-.035em;color:#26372e}
.brand-title span{display:inline-block}
.brand-motto{position:absolute;top:calc(11.5% + 105px);left:0;right:0;margin:0;text-align:center;font-family:"Ma Shan Motto","STKaiti","KaiTi",serif;font-size:21px;line-height:1.25;letter-spacing:.045em;color:#445345}
.brand-seal{position:absolute;left:28px;bottom:36px;display:block;width:34px;height:52px;object-fit:contain;opacity:.93;transform:rotate(-3deg)}
.preview-dots{position:absolute;top:40px;left:29px;display:flex;align-items:center;gap:5px;width:54px;height:48px;opacity:.82}.preview-dots i{width:4px;height:4px;border-radius:50%;background:#3c4a40}
.avatar-stage{position:absolute;inset:0;pointer-events:none}
button{-webkit-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;border:0;background:none;font:inherit;cursor:pointer;touch-action:manipulation}
button:disabled{opacity:.7;cursor:default}button:focus-visible{outline:2px solid #697768;outline-offset:2px}button:focus:not(:focus-visible){outline:none}
.ink-talk{position:absolute;top:51.5%;left:50%;display:grid;place-items:center;width:244px;height:148px;padding:0;transform:translate(-50%,-50%);color:#39473e;pointer-events:auto}
.ink-talk:focus-visible{border-radius:20px}
.ink-brush{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;transform-origin:center;transition:transform .75s cubic-bezier(.18,.75,.25,1)}
body.is-conversing .ink-brush{transform:scaleX(1.82)}
.ink-brush .wash{fill:#59675d;opacity:.13}.ink-brush .fiber{fill:none;stroke:#33463c;stroke-width:1.8;stroke-linecap:round;opacity:.27}
.ink-brush .fiber:last-child{stroke-width:1.1;opacity:.16}
.ink-action{position:relative;z-index:3;display:grid;place-items:center;width:76px;height:76px;color:#39473e;filter:drop-shadow(0 1px 3px rgba(250,248,238,.95));pointer-events:none}
.ink-action svg{grid-area:1/1;width:59px;height:59px;fill:currentColor;stroke:#f8f4ea;stroke-width:1.8;paint-order:stroke fill}
.ink-action .control-play{margin-left:9px}.ink-action .control-stop{display:none}
.ink-talk[data-active="true"] .control-play{display:none}.ink-talk[data-active="true"] .control-stop{display:block}
.portrait{position:absolute;z-index:2;left:50%;top:50%;width:83px;height:83px;overflow:hidden;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 2px 10px #293e3138}
.portrait img{display:block;width:100%;height:100%;object-fit:cover}
.ink-talk.has-custom-portrait .ink-action{color:#f7f4e8;filter:drop-shadow(0 1px 3px #1e332e)}
.photo-status{position:absolute;top:calc(51.5% + 96px);left:50%;transform:translateX(-50%);width:min(340px,90vw);min-height:30px;color:#485847;text-align:center;font-size:14px;line-height:1.5;pointer-events:none}.photo-status:empty{visibility:hidden}
#unlock{position:absolute;top:calc(51.5% + 104px);left:50%;transform:translateX(-50%);width:min(340px,90vw);padding:18px;border:1px solid #d6d7c9;border-radius:18px;background:#f9f6eee8;box-shadow:0 8px 30px #3b4c341f;text-align:left;pointer-events:auto}
#unlock label{display:block;margin-bottom:12px;color:#485847;font-size:15px}.unlock-row{display:flex;gap:8px}.unlock-row input{width:100%;min-width:0;padding:12px;border:1px solid #b8bdad;border-radius:10px;background:#fffdf7;font:inherit;font-size:16px}.unlock-row input:focus-visible{outline:2px solid #6f846b;outline-offset:2px}.unlock-row button{min-height:44px;flex-shrink:0;padding:12px 18px;border-radius:10px;background:#505e4e;color:white;font-size:15px}
#message{position:absolute;bottom:3%;left:50%;transform:translateX(-50%);width:min(340px,90vw);margin:0;padding:8px 12px;border-radius:10px;background:#fff8ecdd;color:#963b2e;text-align:center;font-size:15px;line-height:1.5;pointer-events:none}#message:empty{display:none}
#camera-dialog{width:min(480px,calc(100% - 32px));max-height:calc(100vh - 32px);max-height:calc(100svh - 32px);padding:18px;border:1px solid #d4dec8;border-radius:24px;background:#f7f3e7;color:#30483c}#camera-dialog::backdrop{background:#20362966;backdrop-filter:blur(8px)}.camera-heading{display:flex;align-items:center;justify-content:space-between;font-size:16px}#close-camera{width:44px;height:44px;background:none;color:#526653;font-size:24px}#camera-video{display:block;width:100%;max-height:55vh;max-height:55svh;aspect-ratio:4/3;object-fit:contain;background:#eaf0e2;border-radius:14px}#camera-message{font-size:14px;color:#526653}#camera-message:empty{display:none}
@media(max-height:680px){.brand{top:8%}.brand-title{font-size:82px}.brand-motto{top:calc(8% + 85px);font-size:19px}.brand-seal{left:20px;bottom:24px;width:30px;height:46px}.ink-talk{top:52%;width:222px;height:135px}.photo-status{top:calc(52% + 85px)}#unlock{top:calc(52% + 92px)}}
@media(prefers-reduced-motion:reduce){.ink-brush{transition:none}}
