:root{
  --bg:#ffffff;
  --bg-soft:#f7f7f8;
  --bg-rail:#fafafa;
  --line:#e8e8ea;
  --line-soft:#f0f0f2;
  --txt:#1c1c1e;
  --txt-2:#6b6b73;
  --txt-3:#9a9aa2;
  --accent:#3d5afe;
  --accent-soft:#eef1ff;
  --accent-deep:#2b41c8;
  --teal:#0e9f8f;
  --warn:#b45309;
  --danger:#d92d20;
  --radius:14px;
  --shadow:0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--txt);
  font-family:system-ui,-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased;
}
button,input,textarea,select{font-family:inherit;font-size:inherit;color:inherit}
button{cursor:pointer;border:0;background:none}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:#d9d9de;border-radius:8px;border:3px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:#c2c2c9;background-clip:content-box}

.app{display:flex;height:100vh;overflow:hidden}

/* ---------------- 左侧栏 ---------------- */
.rail{
  width:252px;flex:0 0 252px;background:var(--bg-rail);border-right:1px solid var(--line);
  display:flex;flex-direction:column;padding:14px 12px 8px;
}
.brand{display:flex;align-items:center;gap:10px;padding:4px 6px 14px}
.brand-mark{
  width:32px;height:32px;border-radius:9px;flex:0 0 32px;
  background:linear-gradient(145deg,#3d5afe,#7a5cff);color:#fff;
  display:grid;place-items:center;font-weight:700;font-size:16px;
  box-shadow:0 4px 12px rgba(61,90,254,.32);
}
.brand-name{font-weight:650;font-size:14.5px;letter-spacing:.2px}
.brand-sub{font-size:11px;color:var(--txt-3);margin-top:-1px}

.new-btn{
  height:38px;border-radius:11px;background:var(--accent);color:#fff;
  font-weight:600;display:flex;align-items:center;justify-content:center;gap:6px;
  box-shadow:0 4px 14px rgba(61,90,254,.25);transition:.16s;margin-bottom:10px;
}
.new-btn:hover{background:var(--accent-deep);transform:translateY(-1px)}
.new-btn .plus{font-size:16px;line-height:1;margin-top:-1px}

.rail-search{margin-bottom:8px}
.rail-search input{
  width:100%;height:32px;border-radius:9px;border:1px solid transparent;background:#f0f0f2;
  padding:0 10px;outline:none;font-size:12.5px;transition:.15s;
}
.rail-search input:focus{background:#fff;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}

.rail-scroll{flex:1;overflow-y:auto;margin:0 -4px;padding:0 4px}
.rail-group{font-size:11px;color:var(--txt-3);padding:10px 8px 4px;font-weight:600;letter-spacing:.4px}
.sess{
  display:flex;align-items:center;gap:8px;padding:8px 9px;border-radius:9px;cursor:pointer;
  font-size:13px;color:#3c3c43;position:relative;transition:.12s;
}
.sess:hover{background:#efeff2}
.sess.active{background:#fff;box-shadow:0 1px 2px rgba(16,24,40,.06);font-weight:600;color:var(--txt)}
.sess.active::before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:2.5px;border-radius:2px;background:var(--accent)}
.sess-t{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sess-del{opacity:0;font-size:12px;color:var(--txt-3);padding:2px 4px;border-radius:5px}
.sess:hover .sess-del{opacity:1}
.sess-del:hover{background:#e6e6ea;color:var(--danger)}
.rail-empty{font-size:12px;color:var(--txt-3);padding:14px 10px;line-height:1.7}

.rail-foot{border-top:1px solid var(--line-soft);padding-top:6px;margin-top:6px}
.foot-item{
  display:flex;align-items:center;gap:8px;width:100%;padding:7px 9px;border-radius:8px;
  font-size:12.5px;color:#4a4a52;transition:.12s;
}
.foot-item:hover{background:#efeff2}
.fi-icon{font-size:13px;color:var(--txt-3);width:14px;text-align:center}
.foot-item b{margin-left:auto;font-size:11px;color:var(--txt-3);font-weight:600}
.soon{margin-left:auto;font-size:10.5px;color:var(--teal);background:#e6f7f4;padding:1px 6px;border-radius:20px}

/* ---------------- 对话区 ---------------- */
.chat{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--bg)}
.chat-head{
  height:58px;flex:0 0 58px;border-bottom:1px solid var(--line-soft);
  display:flex;align-items:center;gap:10px;padding:0 16px;background:rgba(255,255,255,.86);backdrop-filter:blur(8px);
}
.chat-title-wrap{min-width:0;flex:1}
.chat-title{font-weight:650;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-meta{font-size:11.5px;color:var(--txt-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.head-right{display:flex;align-items:center;gap:8px}
.skill-pill{
  font-size:12px;font-weight:600;color:var(--accent);background:var(--accent-soft);
  padding:4px 10px;border-radius:20px;white-space:nowrap;
}
.model-select{
  height:30px;border-radius:8px;border:1px solid var(--line);background:#fff;padding:0 8px;
  font-size:12px;color:var(--txt-2);outline:none;max-width:170px;
}
.icon-btn{
  width:30px;height:30px;border-radius:8px;display:grid;place-items:center;color:var(--txt-2);
  font-size:14px;transition:.12s;
}
.icon-btn:hover{background:#f0f0f2;color:var(--txt)}
.only-mobile{display:none}

.messages{flex:1;overflow-y:auto;padding:26px 0 12px;scroll-behavior:smooth}
.msg{max-width:760px;margin:0 auto 22px;padding:0 26px;display:flex;gap:12px}
.msg.user{justify-content:flex-end}
.avatar{
  width:28px;height:28px;flex:0 0 28px;border-radius:8px;display:grid;place-items:center;
  font-size:12px;font-weight:700;margin-top:2px;
}
.avatar.bot{background:linear-gradient(145deg,#3d5afe,#7a5cff);color:#fff}
.bubble{min-width:0;max-width:100%}
.msg.user .bubble{
  background:#f2f2f5;padding:10px 14px;border-radius:14px 14px 4px 14px;max-width:78%;
  white-space:pre-wrap;word-break:break-word;
}
.md{font-size:14px;line-height:1.78;color:#26262b;word-break:break-word}
.md p{margin:0 0 10px}
.md p:last-child{margin-bottom:0}
.md h1,.md h2,.md h3{font-size:14.5px;margin:16px 0 8px;font-weight:660}
.md h1:first-child,.md h2:first-child,.md h3:first-child{margin-top:0}
.md ul,.md ol{margin:6px 0 12px;padding-left:20px}
.md li{margin:3px 0}
.md code{
  font-family:var(--mono);font-size:12.5px;background:#f3f3f6;padding:1.5px 5px;border-radius:5px;color:#b4295b;
}
.md pre{background:#1c1c22;color:#e8e8ee;padding:12px 14px;border-radius:10px;overflow:auto;font-size:12.5px}
.md strong{font-weight:650}
.md blockquote{border-left:2.5px solid #dcdce2;margin:8px 0;padding:2px 0 2px 12px;color:var(--txt-2)}
.cursor{display:inline-block;width:7px;height:15px;background:var(--accent);border-radius:2px;vertical-align:-2px;animation:blink 1s steps(2) infinite}
@keyframes blink{50%{opacity:0}}

/* 消息内的结构化卡片 */
.ask-card{
  border:1px solid var(--line);border-radius:13px;padding:14px;background:#fff;box-shadow:var(--shadow);
  margin-top:12px;max-width:560px;
}
.ask-q{font-weight:650;font-size:13.5px;margin-bottom:10px}
.ask-opts{display:flex;flex-wrap:wrap;gap:8px}
.ask-opt{
  border:1px solid var(--line);border-radius:10px;padding:8px 12px;text-align:left;
  transition:.14s;background:#fff;min-width:120px;
}
.ask-opt:hover{border-color:var(--accent);background:var(--accent-soft);transform:translateY(-1px)}
.ask-opt b{display:block;font-size:13px;font-weight:600}
.ask-opt span{display:block;font-size:11.5px;color:var(--txt-3);margin-top:1px}
.ask-opt[disabled]{opacity:.45;cursor:default;transform:none;border-color:var(--line);background:#fafafa}

.cw-card{
  display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:13px;
  padding:11px 13px;background:linear-gradient(180deg,#fff,#fafaff);margin-top:12px;cursor:pointer;
  box-shadow:var(--shadow);transition:.14s;max-width:460px;
}
.cw-card:hover{border-color:#c9d0ff;transform:translateY(-1px)}
.cw-thumb{
  width:52px;height:32px;border-radius:6px;background:linear-gradient(140deg,#1e293b,#334155);
  flex:0 0 52px;display:grid;place-items:center;color:#93a6c8;font-size:13px;
}
.cw-info{flex:1;min-width:0}
.cw-name{font-size:13px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cw-sub{font-size:11.5px;color:var(--txt-3)}
.cw-open{font-size:12px;color:var(--accent);font-weight:600;white-space:nowrap}

.skeleton-card{
  margin-top:12px;border:1px dashed #cfd6ff;border-radius:13px;padding:14px;background:#f8f9ff;max-width:460px;
}
.sk-line{height:9px;border-radius:5px;background:linear-gradient(90deg,#e6e9fb 25%,#f2f4ff 37%,#e6e9fb 63%);background-size:400% 100%;animation:shine 1.4s ease infinite;margin-bottom:8px}
.sk-line.w60{width:60%}
.sk-line.w80{width:80%}
@keyframes shine{0%{background-position:100% 50%}100%{background-position:0 50%}}
.sk-tip{font-size:12px;color:var(--accent);font-weight:600;display:flex;align-items:center;gap:6px}

/* 首屏 */
.welcome{padding:18px 26px 0;max-width:760px;margin:0 auto}
.wc-hero{font-size:24px;font-weight:680;letter-spacing:-.3px;margin-bottom:6px}
.wc-hero span{background:linear-gradient(120deg,#3d5afe,#7a5cff 60%,#0e9f8f);-webkit-background-clip:text;background-clip:text;color:transparent}
.wc-sub{color:var(--txt-2);font-size:13.5px;margin-bottom:20px}
.skill-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:18px}
.skill-card{
  border:1px solid var(--line);border-radius:13px;padding:13px 14px;text-align:left;background:#fff;
  transition:.15s;position:relative;overflow:hidden;
}
.skill-card:hover{border-color:#c9d0ff;box-shadow:var(--shadow);transform:translateY(-1px)}
.skill-card.on{border-color:var(--accent);background:linear-gradient(180deg,#fff,#f6f7ff);box-shadow:0 0 0 3px var(--accent-soft)}
.sc-ico{font-size:16px;margin-bottom:6px;display:block}
.sc-name{font-weight:650;font-size:13px;margin-bottom:3px}
.sc-desc{font-size:11.5px;color:var(--txt-3);line-height:1.5}
.starter-item{
  display:flex;align-items:center;gap:8px;padding:9px 12px;border-radius:10px;border:1px solid var(--line-soft);
  margin-bottom:8px;font-size:13px;background:#fff;transition:.14s;width:100%;text-align:left;
}
.starter-item:hover{border-color:#d5d9f0;background:#fbfbff}
.starter-item .arr{margin-left:auto;color:var(--txt-3);font-size:12px}

/* 输入框 */
.composer-wrap{padding:6px 26px 14px;max-width:812px;margin:0 auto;width:100%}
.composer{
  border:1px solid var(--line);border-radius:16px;background:#fff;padding:10px 10px 8px 14px;
  transition:.16s;box-shadow:0 2px 10px rgba(16,24,40,.04);
}
.composer:focus-within{border-color:#c3caff;box-shadow:0 0 0 4px rgba(61,90,254,.08),0 2px 12px rgba(16,24,40,.06)}
.composer textarea{
  width:100%;border:0;outline:none;resize:none;background:transparent;font-size:14px;line-height:1.6;
  max-height:180px;padding:2px 0 6px;
}
.composer-bar{display:flex;align-items:center;justify-content:space-between;gap:8px}
.left-tools{display:flex;align-items:center;gap:8px;min-width:0}
.chip-btn{
  font-size:12px;color:var(--txt-2);border:1px solid var(--line);border-radius:20px;padding:3px 10px;
  display:flex;align-items:center;gap:4px;transition:.12s;background:#fff;
}
.chip-btn:hover{border-color:#c9d0ff;color:var(--accent)}
.hint-key{font-size:11px;color:var(--txt-3);white-space:nowrap}
.send-btn{
  width:32px;height:32px;border-radius:10px;background:var(--accent);color:#fff;font-size:15px;font-weight:700;
  display:grid;place-items:center;transition:.14s;flex:0 0 32px;
}
.send-btn:hover{background:var(--accent-deep)}
.send-btn.stop{background:#fff;color:var(--danger);border:1px solid #f3c6c2;font-size:12px}
.legal{text-align:center;font-size:10.5px;color:var(--txt-3);margin-top:6px}

/* ---------------- 右侧制品面板 ---------------- */
.stage{
  width:46%;flex:0 0 46%;max-width:900px;min-width:360px;border-left:1px solid var(--line);
  display:flex;flex-direction:column;background:var(--bg-soft);
}
.stage.hidden{display:none}
.stage-head{
  height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;
  padding:0 10px 0 14px;border-bottom:1px solid var(--line);background:#fff;
}
.tabs{display:flex;gap:2px;background:#f3f3f5;padding:3px;border-radius:9px}
.tab{font-size:12.5px;padding:4px 12px;border-radius:7px;color:var(--txt-2);transition:.12s;font-weight:500}
.tab.active{background:#fff;color:var(--txt);font-weight:600;box-shadow:0 1px 2px rgba(16,24,40,.08)}
.stage-actions{display:flex;gap:2px}
.stage-body{flex:1;position:relative;overflow:hidden;display:flex;flex-direction:column}
.stage-empty{
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:40px;text-align:center;color:var(--txt-3);
}
.se-icon{font-size:28px;margin-bottom:12px;opacity:.35}
.se-title{font-size:13.5px;font-weight:600;color:var(--txt-2);margin-bottom:6px}
.se-desc{font-size:12px;line-height:1.7;max-width:280px}
.preview{flex:1;width:100%;border:0;background:#0f172a}
.pane{flex:1;overflow:auto;padding:16px 18px;background:#fff}
.pane.code{font-family:var(--mono);font-size:11.5px;line-height:1.65;color:#3b3b45;white-space:pre-wrap;word-break:break-all;margin:0}

.note-item{border:1px solid var(--line);border-radius:11px;padding:12px 14px;margin-bottom:10px;background:#fff}
.note-h{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.note-p{font-size:11px;font-weight:700;color:#fff;background:var(--accent);border-radius:5px;padding:1px 6px}
.note-t{font-weight:650;font-size:13px}
.note-m{margin-left:auto;font-size:11.5px;color:var(--txt-3)}
.note-body{font-size:12.8px;line-height:1.75;color:#3a3a42}
.note-ask{margin-top:8px;font-size:12px;color:var(--teal);background:#f0fbf9;border-radius:8px;padding:7px 10px}
.note-empty{color:var(--txt-3);font-size:12.5px;padding:20px 4px;text-align:center}

/* 浮层 */
.sheet-mask{
  position:fixed;inset:0;background:rgba(16,24,40,.32);backdrop-filter:blur(2px);
  display:none;align-items:center;justify-content:center;z-index:50;padding:20px;
}
.sheet-mask.on{display:flex}
.sheet{
  width:100%;max-width:480px;background:#fff;border-radius:16px;box-shadow:0 24px 64px rgba(16,24,40,.22);
  overflow:hidden;animation:pop .16s ease-out;
}
@keyframes pop{from{transform:scale(.97);opacity:.6}to{transform:scale(1);opacity:1}}
.sheet-head{display:flex;align-items:center;justify-content:space-between;padding:14px 12px 12px 18px;border-bottom:1px solid var(--line-soft)}
.sheet-head b{font-size:14px}
.sheet-body{padding:14px 18px 18px;max-height:70vh;overflow-y:auto}
.sk-row{
  display:flex;gap:12px;padding:11px;border-radius:11px;border:1px solid var(--line-soft);margin-bottom:8px;
  cursor:pointer;transition:.14s;width:100%;text-align:left;background:#fff;
}
.sk-row:hover{border-color:#c9d0ff;background:#fbfbff}
.sk-row.on{border-color:var(--accent);background:var(--accent-soft)}
.sk-ico{width:34px;height:34px;flex:0 0 34px;border-radius:9px;background:#f2f3f7;display:grid;place-items:center;font-size:15px}
.sk-row.on .sk-ico{background:#fff}
.sk-n{font-weight:650;font-size:13px}
.sk-d{font-size:11.5px;color:var(--txt-3);line-height:1.5;margin-top:2px}
.plug-card{display:flex;gap:12px;align-items:flex-start;padding:12px;border:1px solid var(--line-soft);border-radius:11px;margin-bottom:8px}
.plug-ico{width:34px;height:34px;flex:0 0 34px;border-radius:9px;background:#f2f3f7;display:grid;place-items:center}
.plug-card b{font-size:13px}
.plug-card p{margin:2px 0 0;font-size:11.5px;color:var(--txt-3);line-height:1.5}
.plug-badge{font-size:10.5px;color:var(--txt-3);background:#f3f3f5;padding:2px 7px;border-radius:20px;white-space:nowrap}
.plug-note{font-size:11.5px;color:var(--txt-3);line-height:1.7;margin:10px 0 0}
.field{margin-bottom:16px}
.field label{display:block;font-size:12px;font-weight:650;color:var(--txt-2);margin-bottom:6px}
.field input,.field textarea{
  width:100%;border:1px solid var(--line);border-radius:9px;padding:8px 11px;outline:none;
  font-size:13px;background:#fff;transition:.14s;resize:vertical;
}
.field input:focus,.field textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.field input+label{margin-top:12px}
.field-tip{font-size:11.5px;color:var(--txt-3);margin:6px 0 0;line-height:1.6}
.seg{display:flex;gap:4px;background:#f3f3f5;padding:3px;border-radius:9px}
.seg button{flex:1;padding:6px 8px;border-radius:7px;font-size:12px;color:var(--txt-2)}
.seg button.active{background:#fff;font-weight:600;color:var(--txt);box-shadow:0 1px 2px rgba(16,24,40,.08)}
.primary-btn{width:100%;height:38px;border-radius:10px;background:var(--accent);color:#fff;font-weight:600}

.toast{
  position:fixed;left:50%;bottom:34px;transform:translate(-50%,14px);opacity:0;pointer-events:none;
  background:#1c1c22;color:#fff;padding:9px 16px;border-radius:10px;font-size:12.5px;
  transition:.22s;z-index:99;box-shadow:0 8px 28px rgba(0,0,0,.22);max-width:80vw;text-align:center;
}
.toast.on{opacity:1;transform:translate(-50%,0)}

.banner{
  margin:0 auto 14px;max-width:760px;padding:0 26px;
}
.banner-in{
  display:flex;gap:8px;align-items:flex-start;font-size:12.5px;line-height:1.6;
  background:#fff8ed;border:1px solid #fbe0bd;color:#8a5108;border-radius:10px;padding:9px 12px;
}
.banner-in b{font-weight:650}

@media (max-width:1180px){
  .stage{width:42%;flex-basis:42%;min-width:320px}
}
@media (max-width:960px){
  .rail{position:fixed;inset:0 auto 0 0;z-index:40;transform:translateX(-100%);transition:.2s}
  .rail.open{transform:none;box-shadow:0 0 40px rgba(0,0,0,.18)}
  .only-mobile{display:grid}
  .stage{position:fixed;inset:58px 0 0 0;width:100%;flex-basis:100%;z-index:30}
  .stage.hidden{display:none}
}

/* ---- 思考中状态（对齐 WorkBuddy 回复机制） ---- */
.thinking{display:flex;align-items:center;gap:5px;padding:4px 0}
.thinking span{width:6px;height:6px;border-radius:50%;background:var(--txt-3);animation:thb 1.2s ease-in-out infinite}
.thinking span:nth-child(2){animation-delay:.15s}
.thinking span:nth-child(3){animation-delay:.3s}
.thinking em{font-style:normal;font-size:12px;color:var(--txt-3);margin-left:5px}
@keyframes thb{0%,60%,100%{opacity:.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* ---- 消息悬浮操作条：复制 / 重新生成 ---- */
.msg{position:relative}
.msg-acts{
  position:absolute;left:58px;bottom:-24px;z-index:5;
  display:flex;flex-direction:row;flex-wrap:nowrap;gap:6px;
  opacity:0;transition:opacity .15s;
}
.msg:hover .msg-acts{opacity:1}
.msg-acts button{
  flex:0 0 auto;white-space:nowrap;height:26px;line-height:24px;
  border:1px solid var(--line);background:#fff;color:var(--txt-2);
  font-size:12px;padding:0 10px;border-radius:8px;cursor:pointer;
  transition:color .12s,border-color .12s;
}
.msg-acts button:hover{color:var(--accent);border-color:var(--accent)}
@media (hover:none){.msg-acts{opacity:1}}

/* ---- 执行过程面板：每一步任务与实时进度 ---- */
.proc{border:1px solid var(--line);border-radius:12px;background:var(--bg-soft);margin:0 0 10px;overflow:hidden}
.proc-h{display:flex;align-items:center;gap:7px;padding:9px 12px;font-size:12.5px;color:var(--txt-2);cursor:pointer;user-select:none}
.proc-h b{color:var(--txt);font-weight:600}
.proc-meta{margin-left:auto;font-size:11.5px;color:var(--txt-3);white-space:nowrap}
.proc-ico{width:13px;height:13px;flex:0 0 13px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:#e7f7ec;color:#16a34a;font-size:9px}
.proc-ico.live{background:transparent;border:1.6px solid var(--accent);border-right-color:transparent;animation:spin .75s linear infinite}
.proc-caret{font-size:9px;color:var(--txt-3);transition:transform .18s;flex:0 0 auto;margin-left:2px}
.proc.open .proc-caret{transform:rotate(180deg)}
.proc-body{max-height:0;overflow:hidden;transition:max-height .24s ease}
.proc.open .proc-body{max-height:280px;overflow:auto;border-top:1px solid var(--line-soft)}
.step{display:flex;align-items:flex-start;gap:8px;padding:7px 12px;font-size:12.5px;line-height:1.5}
.step+.step{border-top:1px dashed var(--line-soft)}
.step-i{width:13px;flex:0 0 13px;text-align:center;font-size:10px;color:var(--txt-3);line-height:1.7}
.step.run .step-i{width:10px;flex:0 0 10px;height:10px;margin-top:4px;border:1.6px solid var(--accent);border-right-color:transparent;border-radius:50%;animation:spin .75s linear infinite;font-size:0}
.step.done .step-i{color:#16a34a}
.step.run .step-name{color:var(--txt);font-weight:600}
.step.wait .step-i{color:#d97706}
.step.wait .step-detail{color:#d97706}
.step.err .step-i,.step.err .step-name{color:#dc2626}
.step.skip{opacity:.6}
.step-name{color:var(--txt-2);flex:0 0 auto}
.step-detail{margin-left:auto;color:var(--txt-3);font-size:11.5px;text-align:right;max-width:56%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.step.run .step-detail{color:var(--accent)}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---- 思考过程块 ---- */
.think{margin:0 0 8px;padding-left:9px;border-left:2px solid var(--line)}
.think-h{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--txt-3);cursor:pointer;user-select:none}
.think-ico{color:var(--accent);font-size:11px}
.think-h .caret{margin-left:auto;font-size:9px;transition:transform .18s}
.think.open .caret{transform:rotate(180deg)}
.think-body{max-height:0;overflow:hidden;font-size:12px;color:var(--txt-3);line-height:1.7;white-space:pre-wrap;transition:max-height .2s}
.think.open .think-body{max-height:190px;overflow:auto;margin:5px 0 2px}
@media (max-width:720px){.step-detail{max-width:46%}}

/* ---- 视觉风格选择 ---- */
.style-head{font-size:12px;color:var(--txt-3);font-weight:600;margin:18px 0 8px}
.style-head span{margin-left:8px;font-weight:400}
.style-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:18px}
.style-chip{
  text-align:left;border:1.5px solid var(--line);background:#fff;border-radius:12px;
  padding:10px 12px;cursor:pointer;transition:border-color .12s,box-shadow .12s,transform .12s;
}
.style-chip b{display:block;font-size:13px;color:var(--txt)}
.style-chip span{display:block;font-size:11px;color:var(--txt-3);margin-top:3px;line-height:1.5}
.style-chip:hover{border-color:var(--accent);transform:translateY(-1px)}
.style-chip.on{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.style-chip.on b{color:var(--accent)}
@media (max-width:720px){.style-row{grid-template-columns:1fr}}

/* ---- 预览区：风格切换与自检提示 ---- */
.stage-style{
  height:26px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--txt-2);
  font-size:12px;padding:0 6px;cursor:pointer;font-family:inherit;margin-right:2px;
}
.stage-style:hover{border-color:var(--accent);color:var(--accent)}
.stage-warn{
  position:absolute;left:0;right:0;top:0;z-index:6;
  padding:7px 12px;font-size:12px;line-height:1.5;
  color:#8a5a00;background:#fff8e6;border-bottom:1px solid #f2e0b5;
}

/* ---- 附件：上传按钮 / 待发送条 / 消息内缩略图 ---- */
.attach-btn{
  width:26px;height:26px;padding:0;justify-content:center;border-radius:50%;
  font-size:16px;font-weight:500;line-height:1;color:var(--txt-2);flex:0 0 26px;
}
.attach-btn:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
.attach-strip{display:none;flex-wrap:wrap;gap:8px;padding:8px 10px 2px}
.attach-strip.on{display:flex}
.att-chip{
  position:relative;display:flex;align-items:center;gap:7px;
  border:1px solid var(--line);background:var(--bg-soft);border-radius:10px;
  padding:5px 24px 5px 6px;max-width:230px;
}
.att-chip img{width:30px;height:30px;object-fit:cover;border-radius:6px;flex:0 0 30px}
.att-ico{
  width:30px;height:30px;border-radius:6px;flex:0 0 30px;
  display:flex;align-items:center;justify-content:center;
  background:#eef2ff;color:var(--accent);font-size:11px;font-weight:600;
}
.att-meta{min-width:0}
.att-name{display:block;font-size:12px;color:var(--txt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:160px}
.att-sub{display:block;font-size:10.5px;color:var(--txt-3);margin-top:1px}
.att-x{
  position:absolute;right:4px;top:4px;width:16px;height:16px;border:0;border-radius:50%;
  background:transparent;color:var(--txt-3);font-size:11px;line-height:1;cursor:pointer;padding:0;
}
.att-x:hover{background:#fee2e2;color:#dc2626}
.msg-imgs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:7px}
.msg-img{max-width:190px;max-height:150px;border-radius:10px;border:1px solid var(--line);object-fit:cover;display:block}
.msg.user .bubble{white-space:pre-wrap}
.composer.drop{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}

/* ---- 项目工作区（文件 / 版本 / 检索） ---- */
.files-pane{padding:14px 16px 24px;overflow:auto}
.fp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.fp-title{font-size:13px;font-weight:600;color:var(--txt)}
.fp-sub{display:block;font-size:11px;font-weight:400;color:var(--txt-3);margin-top:3px}
.fp-search{margin-bottom:12px}
.fp-search input{
  width:100%;height:32px;border:1px solid var(--line);border-radius:9px;padding:0 10px;
  font-size:12.5px;font-family:inherit;background:#fff;outline:none;
}
.fp-search input:focus{border-color:#c3caff;box-shadow:0 0 0 3px rgba(61,90,254,.08)}
.fp-results{margin-top:6px;display:flex;flex-direction:column;gap:5px}
.fp-hit{
  text-align:left;border:1px solid var(--line);background:#fff;border-radius:9px;padding:7px 9px;cursor:pointer;
}
.fp-hit:hover{border-color:var(--accent);background:var(--accent-soft)}
.fp-hit b{display:block;font-size:12px;color:var(--txt)}
.fp-hit span{display:block;font-size:10.5px;color:var(--txt-3);margin-top:2px}
.fp-hit em{display:block;font-style:normal;font-size:11px;color:var(--txt-2);margin-top:3px;line-height:1.5}
.fp-h{font-size:11px;color:var(--txt-3);font-weight:600;margin:14px 0 6px;letter-spacing:.02em}
.fp-list,.fp-vers{display:flex;flex-direction:column;gap:4px}
.fp-file{
  display:flex;align-items:center;gap:8px;padding:7px 9px;border-radius:9px;
  border:1px solid var(--line-soft);background:var(--bg-soft);cursor:pointer;
}
.fp-file:hover{border-color:#c9d0ff;background:#fff}
.fp-ico{
  width:24px;height:24px;flex:0 0 24px;border-radius:6px;display:flex;align-items:center;justify-content:center;
  background:#eef2ff;color:var(--accent);font-size:10px;font-weight:600;
}
.fp-ico.html{background:#e8f5ee;color:#16a34a}
.fp-ico.json{background:#fff4e5;color:#b45309}
.fp-ico.img{background:#f1ecff;color:#7c3aed}
.fp-name{flex:1;min-width:0;font-size:12px;color:var(--txt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fp-size,.fp-time{font-size:10.5px;color:var(--txt-3);flex:0 0 auto}
.fp-ver{display:flex;align-items:center;gap:8px;padding:6px 9px;border-radius:9px;border:1px solid var(--line-soft)}
.fp-vtag{font-size:10px;color:var(--accent);background:var(--accent-soft);border-radius:5px;padding:1px 5px;flex:0 0 auto}
.fp-vtime{font-size:11px;color:var(--txt-2);flex:1}
.fp-vsize{font-size:10.5px;color:var(--txt-3)}
.fp-vbtn{
  border:1px solid var(--line);background:#fff;color:var(--txt-2);border-radius:7px;
  font-size:10.5px;padding:3px 7px;cursor:pointer;font-family:inherit;
}
.fp-vbtn:hover{color:var(--accent);border-color:var(--accent)}
.fp-empty{font-size:12px;color:var(--txt-3);padding:10px 2px}
.fp-note{font-size:10.5px;color:var(--txt-3);margin-top:14px;line-height:1.6}

/* ---- 左侧：课件内容命中 ---- */
.rail-hits{margin-top:12px;padding-top:10px;border-top:1px dashed var(--line)}
.rail-hits-h{font-size:10.5px;color:var(--txt-3);font-weight:600;margin-bottom:6px}
.rail-hit{
  display:block;width:100%;text-align:left;border:1px solid var(--line-soft);background:#fff;
  border-radius:8px;padding:6px 8px;margin-bottom:5px;cursor:pointer;font-family:inherit;
}
.rail-hit:hover{border-color:var(--accent);background:var(--accent-soft)}
.rail-hit b{display:block;font-size:11.5px;color:var(--txt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rail-hit span{display:block;font-size:10px;color:var(--txt-3);margin-top:2px}

/* ---- 设置面板：应用与数据 ---- */
.set-sec{margin-top:18px;padding-top:14px;border-top:1px solid var(--line-soft)}
.set-sec-h{font-size:12px;font-weight:600;color:var(--txt-3);letter-spacing:.04em;margin-bottom:8px}
.app-row{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.app-url{
  flex:1;min-width:0;display:block;
  font-size:11.5px;color:var(--accent);text-decoration:none;
  background:var(--bg-soft);border:1px solid var(--line-soft);border-radius:8px;
  padding:7px 9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.app-url:hover{border-color:#c9d0ff;text-decoration:underline}
.mini-btn{
  border:1px solid var(--line);background:#fff;color:var(--txt-2);
  font-family:inherit;font-size:11.5px;padding:6px 11px;border-radius:8px;cursor:pointer;
  transition:color .12s,border-color .12s,background .12s;
}
.mini-btn:hover{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
.mini-btn:disabled{opacity:.6;cursor:default}
.mini-btn.danger{color:#b91c1c;border-color:#f3d0d0}
.mini-btn.danger:hover{color:#dc2626;border-color:#dc2626;background:#fef2f2}
.data-line{
  font-size:11.5px;color:var(--txt-2);line-height:1.6;
  background:var(--bg-soft);border:1px solid var(--line-soft);border-radius:8px;
  padding:7px 9px;margin-bottom:8px;word-break:break-all;
}

/* ---- 设置面板：服务端已配置模型提示 ---- */
.server-tip{
  font-size:11.5px;line-height:1.6;color:#15803d;
  background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;
  padding:7px 9px;margin-bottom:10px;
}

/* ============================================================
   账号 / 积分 / 计费
   ============================================================ */

/* ---- 顶栏积分胶囊 ---- */
.credits-pill{
  display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;
  border:1px solid var(--line);border-radius:999px;background:#fff;
  font-size:12px;color:var(--txt-2);white-space:nowrap;
  transition:border-color .12s,color .12s,background .12s;
}
.credits-pill:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
.credits-pill .cp-dot{width:6px;height:6px;border-radius:50%;background:var(--teal);flex:0 0 6px}
.credits-pill .cp-unit{color:var(--txt-3);font-size:11px}
.credits-pill.need-login{border-color:var(--accent);color:var(--accent)}
.credits-pill.need-login .cp-dot{background:var(--accent)}
.credits-pill.low{border-color:#f3d0d0;color:var(--danger)}
.credits-pill.low .cp-dot{background:var(--danger)}

/* ---- 登录浮层 ---- */
.login-sheet{max-width:392px}
.login-hero{display:flex;align-items:center;gap:11px;margin-bottom:16px}
.lh-mark{
  width:42px;height:42px;flex:0 0 42px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(140deg,var(--accent),#7b61ff);color:#fff;
  font-size:19px;font-weight:700;letter-spacing:-.5px;
  box-shadow:0 6px 16px rgba(61,90,254,.22);
}
.lh-title{font-size:14.5px;font-weight:600;color:var(--txt)}
.lh-sub{font-size:11.5px;color:var(--txt-3);margin-top:2px}
.lh-sub b{color:var(--accent);font-weight:600}
.phone-row{display:flex;gap:7px}
.phone-row input{flex:1;min-width:0}
.phone-row .mini-btn{flex:0 0 auto;white-space:nowrap;height:38px}
.login-legal{font-size:10.5px;color:var(--txt-3);line-height:1.65;margin:12px 0 0;text-align:center}

/* ---- 账户面板 ---- */
.account-sheet{max-width:452px}
.acct-head{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.acct-avatar{
  width:38px;height:38px;flex:0 0 38px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--accent-soft);color:var(--accent);font-size:13px;font-weight:600;
}
.acct-id{flex:1;min-width:0}
.acct-phone{font-size:13.5px;font-weight:600;color:var(--txt);display:flex;align-items:center;gap:6px}
.acct-badge{
  font-size:9.5px;font-weight:500;color:var(--accent);background:var(--accent-soft);
  border-radius:4px;padding:1px 5px;
}
.acct-since{font-size:11px;color:var(--txt-3);margin-top:1px}

.acct-balance{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  background:linear-gradient(135deg,#f4f6ff,#eef1ff 60%,#f7f4ff);
  border:1px solid #e3e8ff;border-radius:12px;padding:13px 15px;margin-bottom:10px;
}
.ab-num{font-size:27px;font-weight:650;color:var(--accent-deep);line-height:1.15;letter-spacing:-.6px}
.ab-label{font-size:11px;color:var(--txt-2);margin-top:1px}
.ab-side{text-align:right;font-size:11.5px;color:var(--txt-2);line-height:1.7}
.ab-side b{color:var(--txt);font-weight:600}
.ab-tip{font-size:10.5px;color:var(--txt-3)}

.acct-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-bottom:14px}
.acct-card{
  border:1px solid var(--line-soft);border-radius:10px;padding:9px 10px;background:var(--bg-soft);
}
.acct-card-v{font-size:16px;font-weight:600;color:var(--txt);line-height:1.3}
.acct-card-l{font-size:10.5px;color:var(--txt-2);margin-top:1px}
.acct-card-s{font-size:9.5px;color:var(--txt-3)}

.acct-tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:10px}
.acct-tab{
  font-size:12px;color:var(--txt-2);padding:6px 9px;border-radius:7px 7px 0 0;
  border-bottom:2px solid transparent;margin-bottom:-1px;transition:color .12s;
}
.acct-tab:hover{color:var(--txt)}
.acct-tab.on{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}
.acct-pane{min-height:120px}

.acct-plan{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  border:1px solid var(--line);border-radius:12px;padding:13px 14px;background:#fff;
}
.plan-name{font-size:12px;color:var(--txt-2)}
.plan-price{font-size:22px;font-weight:650;color:var(--txt);line-height:1.2;letter-spacing:-.5px}
.plan-credits{font-size:11px;color:var(--txt-3);margin-top:1px}
.plan-btn{width:auto;padding:8px 16px;flex:0 0 auto}
.acct-order-hint{
  font-size:11.5px;color:var(--txt-2);line-height:1.65;margin-top:9px;
  background:var(--bg-soft);border-radius:8px;padding:8px 10px;
}
.acct-order-hint b{color:var(--danger)}
.acct-note{font-size:10.5px;color:var(--txt-3);line-height:1.65;margin:12px 0 0}

.lastorder-box{
  border:1px dashed #c9d0ff;background:var(--accent-soft);border-radius:10px;
  padding:10px 12px;margin-top:10px;
}
.lo-label{font-size:11px;color:var(--txt-2)}
.lo-no{
  font-family:var(--mono);font-size:14px;font-weight:600;color:var(--accent-deep);
  letter-spacing:.4px;margin:4px 0 7px;word-break:break-all;
}
.lo-actions{display:flex;gap:6px}
.lo-tip{font-size:10.5px;color:var(--txt-2);line-height:1.6;margin-top:7px}

.acct-list{display:flex;flex-direction:column;gap:1px}
.acct-row{
  display:flex;align-items:center;gap:10px;padding:8px 2px;
  border-bottom:1px solid var(--line-soft);
}
.acct-row:last-child{border-bottom:0}
.ar-l{flex:1;min-width:0}
.ar-t{font-size:12.5px;color:var(--txt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ar-s{font-size:10.5px;color:var(--txt-3);margin-top:1px}
.ar-r{text-align:right;flex:0 0 auto}
.ar-v{font-size:12.5px;font-weight:600;color:var(--txt)}
.ar-v span{font-size:10px;font-weight:400;color:var(--txt-3)}
.ar-v.plus{color:var(--teal)}
.ar-c{font-size:10.5px;color:var(--txt-3);margin-top:1px}

.acct-pager{display:flex;align-items:center;justify-content:center;gap:9px;margin-top:11px}
.acct-pager span{font-size:11px;color:var(--txt-3)}
.acct-empty{font-size:12px;color:var(--txt-3);line-height:1.8;padding:18px 4px;text-align:center}
.acct-loading{font-size:12px;color:var(--txt-3);padding:22px 0;text-align:center}
.server-tip.warn{color:#92400e;background:#fffbeb;border-color:#fde68a}
#modeSeg button:disabled{opacity:.5;cursor:not-allowed}
