:root{color-scheme:dark;--bg:#111214;--panel:#1b1c20;--line:#34353a;--text:#f7f7f8;--muted:#999ba5;--accent:#ffbc66;--font-size:36px;--prompt-leading:1.65;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-size:16px;-webkit-font-smoothing:antialiased}button,input,textarea,select,a{-webkit-tap-highlight-color:transparent}button,input,textarea,select{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer;border:0;color:inherit}button:disabled{opacity:.45;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:4px}[hidden]{display:none!important}.sr-only{position:absolute;clip:rect(0,0,0,0);width:1px;height:1px;overflow:hidden}.editor{max-width:620px;margin:auto;padding:calc(20px + var(--safe-top)) 22px calc(20px + var(--safe-bottom))}.masthead{display:flex;align-items:center;justify-content:space-between}.brand{font-size:18px;font-weight:650;display:flex;gap:10px;align-items:center;letter-spacing:.02em}.brand-icon{color:var(--accent);font-size:26px;line-height:1}.icon-button{height:44px;min-width:44px;background:#24252a;border:1px solid var(--line);border-radius:50%;font-size:18px}.intro{margin:27px 0 22px}.eyebrow{color:var(--accent);font-size:14px;margin:0 0 9px;letter-spacing:.07em}h1{font-size:clamp(29px,6.5vw,38px);margin:0 0 8px;letter-spacing:-.04em;line-height:1.3}.subtle{color:var(--muted);line-height:1.6;margin:0}.script-card{background:var(--panel);border:1px solid var(--line);border-radius:20px;overflow:hidden}.card-header{padding:17px 18px 0;display:flex;justify-content:space-between;font-size:14px;color:#d5d6db}.save-status{font-size:12px;color:var(--muted)}.script-title{background:transparent;color:var(--text);border:0;outline:0;width:100%;padding:15px 18px 10px;font-size:20px;font-weight:600}.script-title::placeholder{color:#646770}textarea{width:100%;height:clamp(180px,25vh,280px);resize:vertical;display:block;background:transparent;color:#e4e5e9;border:0;padding:0 18px 16px;outline:0;font-size:18px;line-height:1.85;min-height:145px;caret-color:var(--accent)}textarea::placeholder{color:#6f727c}.script-footer{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:12px 14px 12px 18px;border-top:1px solid #2b2c31;font-size:12px;color:var(--muted);flex-wrap:wrap}.text-actions{display:flex;gap:2px}.text-actions button,.import-button{background:none;padding:10px 7px;color:var(--accent);font-size:13px;cursor:pointer;min-height:38px;display:inline-flex;align-items:center}.settings{padding:5px 1px 0}.setting-row{padding:19px 0;border-bottom:1px solid #282a2f;display:flex;align-items:center;justify-content:space-between;gap:16px}.setting-row label{font-size:15px}.setting-value{display:inline-block;font-size:13px;margin-left:9px;color:var(--muted);font-variant-numeric:tabular-nums}.stepper{display:flex;align-items:center;gap:10px;flex:1;max-width:260px}.stepper button{background:#25262c;width:44px;height:42px;border-radius:10px;font-size:16px;font-weight:600}.stepper input{width:100%;min-width:30px}input[type=range]{accent-color:var(--accent);cursor:pointer;height:24px;min-width:0}.speed-row{flex-wrap:wrap;gap:7px}.speed-row>div:first-child{width:100%}.speed-row>input{width:100%;margin:4px 0}.range-caption{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);width:100%}.options-row{flex-wrap:wrap;gap:12px}.options-row select{background:#25262c;color:#dddfe5;border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-left:auto;font-size:14px;min-height:44px}.switch-label{display:flex;align-items:center;width:100%;justify-content:space-between;min-height:48px;gap:10px;margin-top:4px}.switch-label small{display:block;color:var(--muted);font-size:12px;margin-top:3px}.switch-label input{position:absolute;width:46px;height:30px;opacity:0;right:24px}.switch{background:#393b44;width:46px;height:28px;border-radius:20px;position:relative;flex-shrink:0}.switch:after{content:"";position:absolute;width:22px;height:22px;top:3px;left:3px;background:white;border-radius:50%;transition:transform .15s}.switch-label input:checked+.switch{background:#c68837}.switch-label input:checked+.switch:after{transform:translateX(18px)}.switch-label input:focus-visible+.switch{outline:3px solid var(--accent);outline-offset:3px}.launch-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:22px}.primary-button,.secondary-button{min-height:56px;border-radius:14px;padding:15px 16px;text-align:center;font-size:16px;font-weight:650;display:flex;align-items:center;justify-content:center;gap:8px;text-decoration:none}.primary-button{background:var(--accent);color:#19140d}.secondary-button{background:#27282e;color:#f0f0f3;border:1px solid #3b3d46}.record-symbol{background:#ff656d;width:12px;height:12px;border-radius:50%;display:inline-block}.privacy-note{text-align:center;font-size:12px;color:#858893;margin:15px 0 0;line-height:1.6}.inline-error{margin:18px 0 0;padding:13px 15px;border-radius:12px;background:#382329;color:#ffbcc4;font-size:14px;line-height:1.6}.stage{position:fixed;inset:0;background:#000;overflow:hidden;isolation:isolate;height:100dvh;height:-webkit-fill-available}.stage-header{height:calc(66px + var(--safe-top));padding:calc(10px + var(--safe-top)) 14px 10px;display:flex;align-items:center;justify-content:space-between;position:absolute;top:0;left:0;right:0;z-index:5;background:linear-gradient(#0009,transparent)}.stage-icon{width:44px;height:44px;background:#202125cc;border:1px solid #ffffff26;border-radius:50%;font-size:19px}.stage-status{font-size:14px;color:#d7d8dd}.stage-status.recording:before{content:"";display:inline-block;width:8px;height:8px;background:#ff5d68;border-radius:50%;margin-right:8px}.camera-preview{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transform:scaleX(-1);z-index:-3}.camera-shade{display:none}.camera-mode .camera-shade{display:block;position:absolute;inset:0;background:linear-gradient(#000a 0%,#0008 36%,#0000 60%,#0009 100%);z-index:-2}.prompt-viewport{position:absolute;top:calc(66px + var(--safe-top));bottom:calc(164px + var(--safe-bottom));left:0;right:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;touch-action:pan-y;-webkit-overflow-scrolling:touch;mask-image:linear-gradient(transparent,#000 5%,#000 86%,transparent);-webkit-mask-image:linear-gradient(transparent,#000 5%,#000 86%,transparent)}.prompt-viewport::-webkit-scrollbar{display:none}.prompt-text{padding:60px 35px 0;font-size:var(--font-size);line-height:var(--prompt-leading);font-weight:650;letter-spacing:.015em;overflow-wrap:anywhere;word-break:normal;white-space:pre-wrap;color:#eeeeef;text-shadow:0 2px 7px #0008}.prompt-text p{margin:0 0 .8em;transition:color .15s}.prompt-text p.active{color:var(--accent)}.prompt-text.mirror{transform:scaleX(-1)}.read-marker{position:absolute;top:calc(132px + var(--safe-top));left:12px;right:12px;pointer-events:none;z-index:3;display:flex;align-items:center;height:calc(var(--font-size)*var(--prompt-leading));color:var(--accent)}.read-marker>span{font-size:35px;line-height:1}.read-marker>i{height:1px;background:#ffbc6628;flex:1;margin-left:8px;align-self:flex-end}.camera-mode .prompt-viewport{bottom:auto;height:min(42vh,380px)}.camera-mode .prompt-text{font-weight:700;text-shadow:0 2px 5px #000,0 0 16px #000c}.stage-bottom{position:absolute;bottom:0;left:0;right:0;padding:10px 22px calc(16px + var(--safe-bottom));background:linear-gradient(transparent,#08080be6 30%);z-index:5}.progress-track{height:3px;background:#ffffff24;border-radius:2px;overflow:hidden}.progress-track>div{height:100%;width:0;background:var(--accent);transition:width .12s}.stage-meta{display:flex;justify-content:space-between;color:#abadb8;font-size:12px;font-variant-numeric:tabular-nums;margin-top:8px}.stage-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:13px}.stage-side{background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;width:64px;min-height:62px;gap:7px;color:#cecfd6}.stage-side>span{font-size:27px;line-height:1}.stage-side small{font-size:12px}.play-button{border-radius:40px;min-height:62px;min-width:146px;background:var(--accent);color:#17130e;display:flex;align-items:center;justify-content:center;gap:9px;padding:16px 25px;font-size:17px;font-weight:700}.play-button.record-action{background:#ff6570;color:#fff}.play-button>span:first-child{font-size:22px}.stage-hint{text-align:center;color:#838692;font-size:12px;margin:12px 0 0}.stop-symbol{display:block;width:22px;height:22px;background:#ff5d68;border-radius:4px;margin:3px 0}.countdown-overlay{position:absolute;inset:0;background:#0006;z-index:9;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}.countdown-overlay>span{font-size:100px;font-weight:600;color:var(--accent);font-variant-numeric:tabular-nums}.countdown-overlay small{font-size:16px;color:#ddd}.stage.focused .stage-header,.stage.focused .stage-bottom{visibility:hidden}.restore-controls{position:absolute;bottom:calc(20px + var(--safe-bottom));right:20px;z-index:10;color:#ddd;background:#27282bd9;border:1px solid #5557;border-radius:28px;padding:12px 18px;font-size:14px;min-height:44px}.stage-settings{position:absolute;left:0;right:0;bottom:0;background:#1b1c21f5;border:1px solid #3d3f48;border-radius:24px 24px 0 0;padding:22px 24px calc(28px + var(--safe-bottom));z-index:12;box-shadow:0 -20px 80px #0008}.stage-settings label{display:flex;justify-content:space-between;margin:19px 0 8px;color:#ddd;font-size:16px}.stage-settings output{color:var(--accent)}.stage-settings input{width:100%;height:32px}.stage-settings p{color:var(--muted);font-size:13px;line-height:1.5;margin:16px 0 0}.sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.sheet-heading h2{font-size:22px;margin:0;letter-spacing:-.02em}.dialog{max-width:490px;width:calc(100% - 28px);max-height:88dvh;border:1px solid #454750;background:#1b1c20;color:var(--text);border-radius:24px;padding:22px;overflow-y:auto}.dialog::backdrop{background:#000b;backdrop-filter:blur(4px)}.help-list{list-style:none;counter-reset:steps;padding:0;margin:25px 0}.help-list li{counter-increment:steps;position:relative;padding-left:38px;margin:23px 0}.help-list li:before{content:counter(steps);position:absolute;left:0;top:0;color:var(--accent);font-size:14px;border:1px solid #60513a;width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center}.help-list strong{font-size:16px}.help-list p,.help-note p{color:#b1b3bf;line-height:1.7;font-size:14px;margin:6px 0}.help-note{background:#292a30;padding:16px;border-radius:14px}.help-note strong{color:var(--accent);font-size:15px}.result-dialog video{display:block;width:100%;max-height:45dvh;background:#000;border-radius:13px;margin:20px 0 12px}.result-dialog .primary-button,.result-dialog .secondary-button{width:100%;margin:12px 0}.result-dialog .subtle{font-size:13px;text-align:center}.result-hint{font-size:13px;line-height:1.7;color:#a0a3af;text-align:center;margin:14px 0}.text-button{background:none;color:var(--accent);display:block;width:100%;min-height:48px;font-size:15px}.toast{position:fixed;z-index:40;bottom:calc(25px + var(--safe-bottom));left:50%;transform:translateX(-50%);background:#eeeeef;color:#14151a;padding:12px 20px;border-radius:24px;font-size:14px;max-width:90%;box-shadow:0 8px 32px #0006;text-align:center;line-height:1.5}@media(min-width:700px){.editor{padding-top:40px}.intro{margin-top:40px}.script-card textarea{height:250px}.prompt-text{max-width:760px;margin:auto}.read-marker{max-width:740px;margin:auto}.stage-bottom{max-width:760px;margin:auto}.stage-settings{max-width:650px;margin:auto;border-radius:24px 24px 0 0}}@media(max-height:640px){.intro{margin:15px 0}.editor{padding-top:12px}.prompt-viewport{bottom:130px}.stage-bottom{padding-top:5px}.stage-hint{display:none}.stage-controls{margin-top:8px}.play-button{min-height:52px}.camera-mode .prompt-viewport{height:38vh}}@media(orientation:landscape) and (max-height:550px){.stage-header{height:52px;padding-top:5px}.prompt-viewport{top:52px;bottom:108px}.camera-mode .prompt-viewport{height:calc(100% - 164px);max-width:600px;margin:auto}.prompt-text{padding-top:25px;font-size:min(var(--font-size),42px)}.read-marker{top:78px}.stage-bottom{padding-bottom:calc(8px + var(--safe-bottom))}.stage-side{min-height:50px}.stage-side small{display:none}.stage-controls{margin-top:5px}.play-button{min-height:48px}.stage-settings{max-height:90vh;overflow-y:auto}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
:root .editor{padding-bottom:calc(125px + var(--safe-bottom))}
.editor .launch-actions{position:fixed;bottom:calc(14px + var(--safe-bottom));left:50%;transform:translateX(-50%);width:calc(100% - 44px);max-width:576px;z-index:6;margin:0;padding-top:14px;background:linear-gradient(transparent 0,#111214 14px);box-shadow:0 15px 0 15px #111214}

/* Keep controls inside iPhone safe areas, including landscape. */
:root{--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px)}
.editor{padding-left:calc(22px + var(--safe-left));padding-right:calc(22px + var(--safe-right))}
.editor .launch-actions{width:calc(100% - 44px - var(--safe-left) - var(--safe-right));left:calc(50% + (var(--safe-left) - var(--safe-right))/2)}
.stage{height:100vh;height:100dvh}
.stage-header{padding-left:calc(14px + var(--safe-left));padding-right:calc(14px + var(--safe-right))}
.stage-bottom{padding-left:calc(22px + var(--safe-left));padding-right:calc(22px + var(--safe-right))}
.prompt-text{padding-left:calc(35px + var(--safe-left));padding-right:calc(35px + var(--safe-right))}
.read-marker{left:calc(12px + var(--safe-left));right:calc(12px + var(--safe-right))}
.stage-settings{padding-left:calc(24px + var(--safe-left));padding-right:calc(24px + var(--safe-right))}
.restore-controls{right:calc(20px + var(--safe-right))}
.switch-label{position:relative}.switch-label input{right:0;margin:0}
.text-actions:focus-within{outline:2px solid var(--accent);outline-offset:2px;border-radius:8px}
