:root{--ink:#18232e;--muted:#667583;--line:#d9e1e7;--paper:#f6f8fa;--white:#fff;--navy:#101f2c;--accent:#5b49e8;--accent-dark:#4a3bc9;--blue:#dcecf5;--shadow:0 20px 55px rgba(20,39,57,.08)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--paper)}button,input,textarea,select{font:inherit}button{cursor:pointer}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #6d5df0;outline-offset:2px}
.top{height:68px;background:var(--white);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 clamp(20px,4vw,70px);gap:20px}.brand{font-size:20px;font-weight:800;letter-spacing:-.05em}.brand b{color:var(--accent)}.topnav{display:flex;gap:24px;color:#50606e;font-size:14px}.topnav a:hover,.topnav .active{color:var(--accent-dark)}.pill,.primary,.ghost{border-radius:10px;padding:11px 18px;font-weight:650;border:1px solid var(--line);background:#fff}.primary{background:var(--accent);border-color:var(--accent);color:#fff}.primary:hover{background:var(--accent-dark)}.primary:disabled{opacity:.45;cursor:not-allowed}.ghost:hover,.pill:hover{background:#f4f8fa}.small{font-size:13px;color:var(--muted)}.eyebrow{font-size:12px;letter-spacing:.14em;text-transform:uppercase;font-weight:800;color:var(--accent-dark)}.page{max-width:1180px;margin:auto;padding:56px 24px 90px}.hero{max-width:850px;margin:0 auto 36px;text-align:center}.hero h1{font-size:clamp(34px,4vw,56px);letter-spacing:-.06em;margin:10px 0 16px;line-height:1.16}.hero p{font-size:16px;color:var(--muted);line-height:1.8}.card{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.composer{max-width:870px;margin:0 auto;padding:28px}.mode-tabs{display:inline-flex;background:#eef2f5;border-radius:12px;padding:4px;gap:4px}.mode-tabs button{border:0;background:transparent;padding:10px 20px;border-radius:9px;color:#5b6875;font-weight:700}.mode-tabs button.active{background:#fff;color:var(--ink);box-shadow:0 3px 10px #1a29351c}.prompt-label{display:block;font-weight:700;margin:22px 0 11px}textarea{display:block;width:100%;resize:vertical;min-height:160px;padding:17px;border:1px solid var(--line);border-radius:12px;line-height:1.7;color:var(--ink);background:#fcfdff}textarea:focus{border-color:#8b7bff}.composer-foot{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:18px}.composer-foot .spacer{flex:1}.seg{display:flex;border:1px solid var(--line);border-radius:10px;padding:3px}.seg button{background:transparent;border:0;border-radius:7px;padding:8px 12px;font-size:13px}.seg button.active{background:var(--navy);color:#fff}.message{min-height:23px;margin:16px 0;color:#b42318}.message:empty{display:none}.examples{max-width:870px;margin:50px auto}.examples h2{font-size:22px;letter-spacing:-.03em}.example-list{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.example-list button{text-align:left;background:white;border:1px solid var(--line);padding:18px;border-radius:12px;line-height:1.6;color:#344451}.example-list button:hover{border-color:var(--accent)}.tool-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:32px}.tool-list{align-self:start;position:sticky;top:24px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px}.tool-list a{display:block;padding:11px;border-radius:8px;font-size:14px;color:#536371}.tool-list a.active,.tool-list a:hover{background:#efedfb;color:#5b49e8}.tool-main .hero{text-align:left;margin-left:0}.tool-main .composer{margin:0}.output{max-width:870px;margin:28px auto}.output-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}.output-head h2{margin:0 auto 0 0;font-size:20px}.stage{position:relative;aspect-ratio:16/9;background:#111f2b;border-radius:13px;overflow:hidden}.stage.portrait{aspect-ratio:9/16;max-height:620px;margin:auto}.stage iframe,.record-overlay iframe{width:100%;height:100%;border:0}.source{display:none;max-height:420px;overflow:auto;white-space:pre-wrap;word-break:break-all;background:#122331;color:#deecf4;padding:18px;border-radius:10px;font:12px/1.6 Consolas,monospace}.source.show{display:block}.record-options{display:none;gap:10px;align-items:center;flex-wrap:wrap;padding:16px;margin-top:12px;background:#f5f8fa;border:1px solid var(--line);border-radius:10px}.record-options.show{display:flex}.record-options select{border:1px solid var(--line);padding:9px;border-radius:8px;background:white}.workspace{height:calc(100vh - 68px);min-height:560px;display:grid;grid-template-columns:230px minmax(340px,1fr) minmax(350px,440px)}.history{background:#f5f7f9;border-right:1px solid var(--line);padding:20px;overflow:auto}.history-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.history-head strong{font-size:14px}.history-list{display:grid;gap:6px}.history-list button{text-align:left;background:transparent;border:0;border-radius:9px;padding:12px;color:var(--ink)}.history-list button.active,.history-list button:hover{background:#e7eef3}.history-list span{display:block;font-size:12px;color:var(--muted);margin-top:5px}.preview-pane{padding:28px;overflow:auto;background:#e9eef2}.preview-pane .stage{box-shadow:0 18px 42px #15324932}.chat{background:white;border-left:1px solid var(--line);display:flex;flex-direction:column;min-width:0}.chat-head{padding:20px 24px;border-bottom:1px solid var(--line)}.chat-head h2{font-size:18px;margin:0}.turns{padding:24px;flex:1;overflow:auto}.turn{margin-bottom:18px;padding:14px;border-radius:12px;background:#f1f5f7;font-size:14px;line-height:1.6;white-space:pre-wrap}.turn b{display:block;color:var(--accent-dark);font-size:12px;margin-bottom:5px}.chat-form{border-top:1px solid var(--line);padding:18px}.chat-form textarea{min-height:105px}.chat-form .composer-foot{margin-top:10px}.record-overlay{position:fixed;inset:0;z-index:100;background:#0a1721}.record-overlay iframe{display:block}.record-overlay .rec-tip{position:absolute;right:16px;top:16px;background:#162b3a;color:white;padding:8px 12px;border-radius:8px;font-size:12px;pointer-events:none}.record-overlay .rec-tip.hidden{display:none}
@media(max-width:950px){.workspace{height:auto;min-height:calc(100vh - 68px);grid-template-columns:1fr}.history{position:static;border-right:0;border-bottom:1px solid var(--line);max-height:180px}.preview-pane{min-height:360px}.chat{min-height:460px;border-left:0}.tool-layout{grid-template-columns:1fr}.tool-list{position:static;display:flex;overflow:auto}.tool-list a{white-space:nowrap}}@media(max-width:650px){.topnav{display:none}.page{padding:36px 16px}.composer{padding:18px}.hero h1{font-size:36px}.example-list{grid-template-columns:1fr}.output-head{gap:6px}.output-head button{padding:8px 10px}.preview-pane{padding:16px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* ===== 方案 A：SSE 生成态 · 胶囊状态条（ea-html-app 共享，tool/create/workspace 三页通用） ===== */
@keyframes pulsedot{0%{box-shadow:0 0 0 0 rgba(242,121,68,.5)}70%{box-shadow:0 0 0 9px rgba(242,121,68,0)}100%{box-shadow:0 0 0 0 rgba(242,121,68,0)}}
@keyframes shimmer{0%{background-position:-160px 0}100%{background-position:calc(100% + 160px) 0}}
@keyframes caret{0%,49%{opacity:1}50%,100%{opacity:0}}
.llm-status{margin:16px auto 0;max-width:870px;font-family:inherit}
.llm-status .cap{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.llm-status .dot{width:11px;height:11px;border-radius:50%;background:var(--accent);animation:pulsedot 1.6s infinite;flex:none}
.llm-status .dot.done{background:#2f9e63;animation:none}
.llm-status .dot.cancelled{background:#b42318;animation:none}
.llm-status .txt{font-weight:650;font-size:14.5px}
.llm-status .meta{color:var(--muted);font-size:13px}
.llm-status .cancel{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 13px;font-size:12.5px;color:#b42318;cursor:pointer}
.llm-status .cancel:hover{background:#fdf1ef;border-color:#eab6b0}
.llm-status .cancel[hidden]{display:none}
.llm-status .toggle{margin-left:auto;border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 13px;font-size:12.5px;color:#536371;display:flex;align-items:center;gap:6px}
.llm-status .toggle:hover{background:#f4f8fa}
.llm-status .toggle .chev{transition:transform .22s}
.llm-status .toggle[aria-expanded=true] .chev{transform:rotate(180deg)}
.llm-status .bar{height:3px;border-radius:999px;background:#eef2f5;margin-top:12px;overflow:hidden}
.llm-status .bar.hide{display:none}
.llm-status .bar span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#6d5df0,#9384ff);background-size:160px 100%;animation:shimmer 1.2s linear infinite;transition:width .25s}
.llm-status .panel{margin-top:12px;border:1px solid var(--line);border-radius:12px;background:#fbfcfd;padding:14px 16px;display:none;max-height:260px;overflow:auto}
.llm-status .panel.open{display:block}
.llm-status .seg{margin-bottom:12px}
.llm-status .seg:last-child{margin-bottom:0}
.llm-status .seg .lbl{font-size:11.5px;font-weight:800;letter-spacing:.08em;color:var(--muted);text-transform:uppercase;margin-bottom:6px}
.llm-status .seg.reason .v{color:#7a8794;font-size:13px;line-height:1.75;white-space:pre-wrap;word-break:break-word}
.llm-status .seg.out .v{font:12.5px/1.7 Consolas,"SFMono-Regular",monospace;color:#2a3a48;white-space:pre-wrap;word-break:break-word}
.llm-status .caret{display:inline-block;width:7px;height:15px;background:var(--accent);vertical-align:-2px;animation:caret 1s steps(1) infinite;margin-left:1px}
