/* 新建作业 · 对话式（intake.js） */
.chatpage { display: flex; flex-direction: column; position: relative; }
.chatpage.over::after { content: "松开即可添加原片"; position: absolute; inset: 0; border: 2px dashed var(--accent); border-radius: 16px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 600; z-index: 5; pointer-events: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; min-height: 32px; margin-bottom: 8px; font-size: 13px; }
.chat-log { display: flex; flex-direction: column; gap: 18px; padding: 8px 0 20px; }
.chat-hero { text-align: center; }
.chat-hero h1 { font-size: 28px; margin: 14px 0 8px; letter-spacing: .5px; }
.chat-hero p { margin: 0 auto 4px; max-width: 540px; }
.chat-hero .habit { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.chat-hero .habit .ic { width: 14px; height: 14px; }
.hero-ic { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #7b8cff, #b06bff); box-shadow: 0 8px 24px rgba(123, 140, 255, .35); }
.hero-ic .ic { width: 26px; height: 26px; }
.ex { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.ex-chip { border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.ex-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ex-chip.sm { padding: 5px 12px; font-size: 12.5px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 42px; margin-top: -6px; }
.cmsg { display: flex; gap: 10px; align-items: flex-start; }
.cmsg.me { justify-content: flex-end; }
.cmsg .bubble { padding: 10px 14px; border-radius: 14px; line-height: 1.65; font-size: 14px; max-width: 100%; word-break: break-word; }
.cmsg.me .bubble { background: var(--accent-2); color: #fff; border-bottom-right-radius: 4px; max-width: 78%; }
.cmsg.ai .ai-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cmsg.ai .bubble { background: var(--bg-2); border: 1px solid var(--line); border-top-left-radius: 4px; }
.ai-av { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #7b8cff, #b06bff); }
.ai-av .ic { width: 17px; height: 17px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; vertical-align: middle; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: tdot 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tdot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
#planCard, #jobCard, .scout-wrap { width: 100%; }
.plan { border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; padding: 6px 16px 14px; width: 100%; }
.plan-row { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; font-size: 13.5px; }
.plan-row > span { color: var(--muted); flex: 0 0 40px; }
.plan-row b { font-weight: 500; }
.pf-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border-radius: 6px; padding: 2px 8px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; }
.tag i { font-style: normal; opacity: .7; margin-left: 2px; }
.tag.soft { background: var(--bg-3); color: var(--ink); }
.plan .warnbox { margin-top: 10px; }
.plan details.adv { margin-top: 8px; font-size: 13px; }
.plan-act { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.plan-act .btn[disabled] { opacity: .5; cursor: not-allowed; }
/* 素材分析卡 */
.scout { border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; overflow: hidden; display: flex; gap: 0; }
.scout-th { display: flex; gap: 2px; background: #000; flex: 0 0 auto; }
.scout-th img { display: block; height: 132px; width: auto; object-fit: cover; }
.scout-th.landscape img { height: 96px; }
.scout-b { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.scout-n { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.scout-n .ic { width: 15px; height: 15px; color: var(--accent); }
.scout-n b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scout-q { font-size: 12.5px; color: var(--muted); line-height: 1.6; border-left: 2px solid var(--line-2); padding-left: 8px; }
.plan .scout-th { margin: 10px 0 0; background: transparent; }
.plan .scout-th img { height: 110px; border-radius: 6px; }
/* 作业进度卡 */
.jobc { border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.jobc-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.jobc-m { display: flex; gap: 12px; align-items: center; font-size: 12.5px; }
.jobc-m a { margin-left: auto; }
.jobc .progress { height: 6px; }
/* 审核与交付 */
.rv { padding-top: 12px; }
.rv-h { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.rv-cut { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.75; color: var(--muted); }
.rv-cut li { text-decoration: line-through; text-decoration-color: var(--cut); }
.rv-video { width: 100%; max-height: 420px; background: #000; border-radius: 8px; display: block; }
.outs { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.out { border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; overflow: hidden; width: 200px; }
.out.bad { border-color: var(--warn); }
.out video { display: block; width: 100%; background: #000; }
.out video.v { aspect-ratio: 9 / 16; } .out video.h { aspect-ratio: 16 / 9; }
.out-m { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
/* 输入框 */
.composer-wrap { position: relative; flex: none; }
.composer { border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 16px; padding: 10px 12px 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .08); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea { width: 100%; border: 0; background: transparent; resize: none; outline: none; color: var(--ink); font: inherit; font-size: 14.5px;
  line-height: 1.6; min-height: 26px; max-height: 180px; padding: 4px 2px; box-shadow: none; }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12.5px; }
.composer-bar .btn { margin-left: auto; }
.composer-bar label.icon-btn { cursor: pointer; }
.composer-tip { text-align: center; font-size: 12px; margin-top: 8px; }
.att:empty { display: none; }
.att { margin-bottom: 6px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--bg-3); border-radius: 8px; padding: 4px 6px 4px 8px; font-size: 13px; }
.att-chip .ic { width: 15px; height: 15px; color: var(--accent); }
.att-chip b { font-weight: 500; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.att-chip.in { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .25); color: #fff; display: flex; width: fit-content; }
.att-chip.in:not(:last-child) { margin-bottom: 6px; }
.att-chip.in .ic { color: #fff; }
@media (max-width: 640px) { .scout { flex-direction: column; } .scout-th img { height: 110px; } .out { width: calc(50% - 5px); } }
/* 第二梯队：按钮选择 / 画面预览 / 不确定进度 */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices .btn[disabled] { opacity: .6; cursor: default; }
.choices .btn.primary[disabled] { opacity: 1; }
.pv-row { align-items: flex-start !important; }
.pvs { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.pv { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pv-frame { position: relative; overflow: hidden; border-radius: 8px; background: #000; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.pv-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-cap { position: absolute; left: 6%; right: 6%; text-align: center; line-height: 1.25; white-space: nowrap; }
.pv-sub { color: #fff; font-weight: 600; margin-top: 2px; opacity: .92; }
.pv-title { position: absolute; top: 9%; left: 8%; right: 8%; text-align: center; color: #fff; font-weight: 900; line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7), 0 0 1px #000; }
.pv figcaption { font-size: 12px; }
.progress.indet { height: 6px; overflow: hidden; position: relative; }
.progress.indet > div { position: absolute; width: 30%; left: -30%; animation: indet 1.4s infinite ease-in-out; }
@keyframes indet { to { left: 100%; } }

/* HeyGen 音色卡（intake.js voiceCard） */
.vcard-wrap { width: 100%; }
.vcard { border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; padding: 12px 14px; width: 100%; }
.vc-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.vc-h > b { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.vc-h > b .ic { width: 15px; height: 15px; color: var(--accent); }
.vc-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vc-q { width: 120px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 12.5px; }
.chipbtn { border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-2, var(--ink)); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.chipbtn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.vc-s { font-size: 12.5px; margin: 2px 0 10px; }
.vc-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; padding-right: 2px; }
.vc-t { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.vc-t.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.vc-n { display: flex; flex-direction: column; min-width: 0; }
.vc-n b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-n .dim { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.vc-tags .tag { font-size: 11.5px; padding: 1px 6px; }
.vc-a { display: flex; gap: 6px; flex-wrap: wrap; }
.vc-a .btn .ic { width: 13px; height: 13px; }
.vc-t audio { width: 100%; height: 32px; }
.vc-m { font-size: 11.5px; }
.vc-empty { padding: 14px 4px; }
.vc-f { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; }
.vs-chip { display: inline-flex; align-items: center; gap: 6px; }
.vs-chip .ic { width: 14px; height: 14px; color: var(--accent); }
.vs-chip .dim { font-weight: 400; font-size: 12px; }
.plan-row .btn.ghost.sm { margin-left: auto; }

/* HeyGen 数字人卡（intake.js avatarCard） */
.av-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px; margin: 4px 0 8px; }
.av-mode { text-align: left; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 7px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.av-mode b { font-weight: 600; font-size: 13px; }
.av-mode span { font-size: 12px; color: var(--muted); }
.av-mode.on { border-color: var(--accent); background: var(--accent-soft); }
.av-mode.on b { color: var(--accent); }
.av-opts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 8px; }
.av-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 460px; overflow: auto; padding-right: 2px; }
.av-t { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.av-t.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.av-img { aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--bg-3, var(--bg-2)); display: grid; place-items: center; }
.av-img img, .av-img video { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-ph .ic { width: 28px; height: 28px; color: var(--muted); }
.plan-row b .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; color: var(--accent); }
/* 照片数字人上传（intake.js avatarCard） */
.av-upf { display: flex; gap: 10px; border: 1px dashed var(--line-2); border-radius: 10px; padding: 8px; margin: 4px 0 8px; }
.av-upf img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.av-upf-b { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.av-consent { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }

/* =====================================================================
   AI 助手 · 对话体验 v2（2026-11-02）：简洁、实用；只作用于 .chatpage，深浅色共用变量
   ===================================================================== */
.main:has(.chatpage) { padding: 0; }
.main:has(.chatpage:not(.empty-chat)) { min-height: 0; overflow: clip; }
.chatpage { --chat-width: 80%; max-width: none; }
.chatpage:not(.empty-chat) { height: 100%; }
.chatpage .chat-log, .chatpage .composer-wrap, .chatpage .starters-wrap, .chatpage #wizBar { width: var(--chat-width); margin-inline: auto; }
.chatpage #wizBar { flex: none; }

/* 顶栏固定在消息区上方；空状态下随页面滚动时吸顶 */
.chatpage .chat-head { position: sticky; top: 0; z-index: 6; flex: none; gap: 8px; min-height: 58px;
  width: calc(var(--chat-width) + 20px); margin: 0 auto 4px; padding: 10px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .15s; }
.chatpage.scrolled .chat-head { border-bottom-color: var(--line); }
.chat-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.chat-title b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title .dim { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chat-head .pj-tag { margin-right: 0; }
.chat-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.chat-tools .icon-btn:hover, .chat-tools .icon-btn[aria-expanded="true"] { background: var(--bg-3); color: var(--ink); }
.chat-tools .btn.ghost .ic { width: 15px; height: 15px; }
.chat-more { position: relative; }
.chat-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 236px; padding: 6px; z-index: 20;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop-shadow); }
.chat-menu[hidden] { display: none; }
.chat-menu button { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.chat-menu button:hover, .chat-menu button:focus-visible { background: var(--bg-3); outline: none; }
.chat-menu .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.chat-menu small { display: block; margin-top: 2px; font-size: 12px; color: var(--dim); }

/* 消息流 */
.chatpage:not(.empty-chat) .chat-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chatpage:not(.empty-chat) .chat-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable both-edges;
}
.chat-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.chatpage .chat-log { gap: 16px; padding: 14px 0 28px; }
.chatpage .cmsg { gap: 12px; }
.chatpage .cmsg.new { animation: cmsgIn .24s ease-out; }
@keyframes cmsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chatpage .cmsg.me { flex-direction: column; align-items: flex-end; gap: 2px; }
.chatpage .cmsg.me .bubble { max-width: min(78%, 620px); padding: 10px 15px; border-radius: 18px 18px 6px 18px; font-size: 14.5px;
  background: var(--accent-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); }
.chatpage .cmsg.me .bubble:empty { display: none; }
.chatpage .cmsg.ai .ai-body { gap: 12px; }
.chatpage .cmsg.ai .bubble { padding: 4px 0 0; background: none; border: 0; border-radius: 0; font-size: 14.5px; line-height: 1.75; }
.chatpage .cmsg.ai.cont { margin-top: -4px; }
.chatpage .cmsg.ai.cont .ai-av { visibility: hidden; height: 0; }
.chatpage .ai-av { width: 30px; height: 30px; flex-basis: 30px; border-radius: 50%; box-shadow: 0 2px 8px rgba(123, 140, 255, .28); }
.chatpage .ai-av .ic { width: 16px; height: 16px; }
.chatpage .bubble ul, .chatpage .bubble ol { margin: 4px 0 6px; padding-left: 22px; }
.chatpage .bubble li { margin: 2px 0; }
.chatpage .bubble li::marker { color: var(--dim); }
.chatpage .bubble code { padding: 1px 6px; border-radius: 5px; background: var(--bg-3); color: var(--code-ink); font: .9em/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.chatpage .bubble a { word-break: break-all; }
.chatpage .bubble b { font-weight: 600; }

/* 思考中：阶段 + 已等待时长 */
.chatpage .bubble.thinking { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.think-t { background: linear-gradient(90deg, var(--muted) 30%, var(--ink) 50%, var(--muted) 70%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: thinkShine 2.2s linear infinite; }
@keyframes thinkShine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.think-s { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.chatpage .cmsg.ai .bubble.err { padding: 8px 12px; border-radius: 10px; background: var(--cut-soft); border: 1px solid color-mix(in srgb, var(--cut) 28%, transparent); color: var(--err-ink); }
.chatpage .cmsg.ai .bubble.stopped { color: var(--muted); }

/* 时间 + 复制：悬停出现，触屏常显 */
.msg-meta { display: flex; align-items: center; gap: 4px; min-height: 22px; margin: -8px 0 -6px; font-size: 11.5px; color: var(--dim);
  opacity: 0; transition: opacity .15s; font-variant-numeric: tabular-nums; }
.cmsg.me .msg-meta { margin: 0 0 -6px; }
.chatpage .cmsg.me + .cmsg.me { margin-top: -8px; }
.chatpage .choices .btn.primary[disabled] { opacity: 1; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.chatpage .choices .btn[disabled]:not(.primary) { opacity: .45; }
.cmsg:hover .msg-meta, .msg-meta:focus-within { opacity: 1; }
@media (hover: none) { .msg-meta { opacity: 1; } }
.meta-btn { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--dim); cursor: pointer; }
.meta-btn:hover { background: var(--bg-3); color: var(--ink); }
.meta-btn.ok { color: var(--keep); }
.meta-btn .ic { width: 14px; height: 14px; }

/* 选项按钮 / 快捷回复 */
.chatpage .choices { gap: 8px; }
.chatpage .choices .btn { border-radius: 999px; padding: 6px 14px; }
.chatpage .choices .btn .ic { width: 14px; height: 14px; }
.chatpage .choices .btn.sm { padding: 4px 12px; }
.chatpage .quick { padding-left: 42px; margin-top: -10px; }
.chatpage .ex-chip { display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s, background .15s, color .15s; }
.chatpage .ex-chip .ic { width: 14px; height: 14px; }

/* 卡片统一：圆角、细阴影、标签列加宽 */
.chatpage .plan, .chatpage .jobc, .chatpage .scout, .chatpage .vcard, .chatpage .out { border-radius: 14px; box-shadow: 0 1px 3px rgba(15, 20, 35, .05); }
.chatpage .plan { padding: 4px 18px 16px; }
.chatpage .plan-row { padding: 10px 0; }
.chatpage .plan-row > span { flex: 0 0 52px; }
.chatpage .plan-row .icon-btn.sm { margin-left: auto; width: 28px; height: 28px; }
.chatpage .plan-row .icon-btn.sm:hover { background: var(--bg-3); color: var(--ink); }
.chatpage .plan-row .icon-btn .ic { width: 15px; height: 15px; }
.chatpage .plan-act { margin-top: 16px; }
.chatpage .jobc { padding: 14px 16px; }
.chatpage .jobc .progress { height: 6px; border-radius: 999px; }
.chatpage .jobc .progress > div { border-radius: 999px; transition: width .6s ease; }

/* 输入框 */
.chatpage .composer-wrap { z-index: 5; padding: 12px 0 16px; }
.chatpage.empty-chat .composer-wrap { margin-top: 26px; padding: 0; }
.chatpage .composer { padding: 12px 12px 8px 16px; border-radius: 20px; border-color: var(--line-2);
  box-shadow: 0 10px 30px rgba(15, 20, 35, .08); transition: border-color .15s, box-shadow .15s; }
.chatpage .composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-2)); box-shadow: 0 0 0 4px var(--accent-soft), 0 10px 30px rgba(15, 20, 35, .08); }
.chatpage .composer textarea { font-size: 15px; min-height: 28px; max-height: 200px; padding: 3px 0; }
.chatpage .composer textarea::placeholder { color: var(--dim); }
.chatpage .composer-bar { gap: 6px; margin-top: 6px; }
.chatpage .composer-bar .icon-btn { margin-left: -6px; width: 34px; height: 34px; border-radius: 10px; }
.chatpage .composer-bar .icon-btn:hover { background: var(--bg-3); color: var(--ink); }
.composer-hint { flex: 1; min-width: 0; font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd-hint { font-size: 11.5px; color: var(--dim); white-space: nowrap; opacity: 0; transition: opacity .15s; }
.chatpage .composer:focus-within .kbd-hint { opacity: 1; }
.send-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--accent-2); color: #fff; transition: transform .12s, filter .15s, background .15s; }
.send-btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.send-btn:disabled { background: var(--bg-4); color: var(--dim); cursor: default; }
.send-btn.stop { background: var(--ink); color: var(--bg); }
.send-btn .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.chatpage .composer-tip { margin-top: 8px; font-size: 12px; color: var(--dim); }
.chatpage .composer-tip:empty { display: none; }
.chatpage .dictation-status { font-size: 12px; color: var(--dim); padding-top: 4px; }
.chatpage #chatMic[aria-pressed="true"] { color: var(--bad); }
.to-bottom { flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%; background: var(--bg-2); color: var(--muted); cursor: pointer; }
.to-bottom:hover { background: var(--bg-3); color: var(--ink); }
.to-bottom[hidden] { display: none; }
.to-bottom .ic { width: 16px; height: 16px; }
/* 上传中的附件（传完自动消失） */
.chatpage .att { margin-bottom: 8px; }
.att-chip.up { position: relative; overflow: hidden; padding-bottom: 6px; }
.att-chip.up .dim { white-space: nowrap; font-variant-numeric: tabular-nums; }
.att-chip.up b { max-width: min(360px, 50vw); }
.att-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--bg-4); }
.att-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.chatpage .att-chip.in { background: var(--bg-2); border-color: var(--line); color: var(--ink); margin-bottom: 4px; }
.chatpage .att-chip.in .ic { color: var(--accent); }
.chatpage .att-chip.in:only-child { margin-bottom: 0; }

/* 空状态：标题 → 输入框 → 入口卡片 */
.chatpage.empty-chat .chat-log { padding-top: 8vh; }
.chatpage .chat-hero h1 { font-size: 26px; font-weight: 700; margin: 16px 0 6px; }
.chatpage .chat-hero > p.muted { font-size: 14px; }
.chatpage .hero-ic { width: 48px; height: 48px; border-radius: 15px; }
.starters-wrap:empty { display: none; }
.starters-wrap { margin: 18px 0 40px; }
.starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.starter { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-2); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.starter:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15, 20, 35, .08); }
.starter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.starter .si { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.starter .si .ic { width: 17px; height: 17px; }
.starter b { display: block; margin-bottom: 3px; font-size: 14px; font-weight: 600; }
.starter .d { display: block; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }

@media (prefers-reduced-motion: reduce) { .chatpage .cmsg.new, .think-t { animation: none; } .starter, .send-btn { transition: none; } }
@media (max-height: 500px) {
  .chatpage:not(.empty-chat) .composer-wrap { padding-bottom: 8px; }
  .chatpage:not(.empty-chat) .composer textarea { max-height: max(28px, calc(100vh - 300px)); }
}
@media (max-width: 640px) {
  .chatpage { --chat-width: calc(100% - 24px); }
  .chatpage .chat-head { width: 100%; padding: 8px 12px; }
  .chatpage .cmsg.ai .ai-av { display: none; }
  .chatpage .cmsg.me .bubble { max-width: 88%; }
  .chatpage .quick { padding-left: 0; }
  .kbd-hint { display: none; }
  .starters { grid-template-columns: 1fr 1fr; }
  .starter { padding: 11px; }
  .starter .d { display: none; }
  .chatpage .chat-hero h1 { font-size: 22px; }
}

/* 确认方式：手动确认 / 自动确认 / 无须确认（输入框左下角） */
.appr { position: relative; flex: none; }
.appr-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px 0 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--muted); font: inherit; font-size: 12.5px; white-space: nowrap; cursor: pointer; transition: border-color .15s, color .15s; }
.appr-btn:hover { color: var(--ink); border-color: var(--line-2); }
.appr-btn .ic { width: 15px; height: 15px; }
.appr-btn .ic.chev { width: 12px; height: 12px; opacity: .7; }
.appr-btn.auto { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.appr-btn.skip { color: var(--warn-ink); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.appr-menu { position: absolute; left: -6px; bottom: calc(100% + 12px); width: 312px; padding: 6px; z-index: 30;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop-shadow); }
.appr-menu[hidden] { display: none; }
.appr-h { padding: 6px 10px 4px; font-size: 12px; color: var(--dim); }
.appr-menu button { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.appr-menu button:hover, .appr-menu button:focus-visible { background: var(--bg-3); outline: none; }
.appr-menu button > .ic:first-child { width: 20px; height: 20px; margin-top: 1px; color: var(--ink); }
.appr-menu button.skip > .ic:first-child { color: var(--warn); }
.appr-menu button > span { flex: 1; min-width: 0; }
.appr-menu b { display: block; font-size: 14px; font-weight: 500; }
.appr-menu small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.appr-menu .tick { width: 18px; height: 18px; margin-top: 2px; color: var(--accent); stroke-width: 2.2; }
/* 自动往下走的倒计时条（输入框上方） */
.autogo { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; margin: 0 auto 10px;
  padding: 6px 6px 6px 14px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 999px;
  background: var(--bg-2); box-shadow: 0 6px 20px rgba(15, 20, 35, .1); font-size: 13px; }
.autogo[hidden] { display: none; }
.autogo > .ic { width: 16px; height: 16px; color: var(--accent); }
.autogo.skip { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.autogo.skip > .ic { color: var(--warn); }
.autogo b { font-variant-numeric: tabular-nums; }
.autogo .btn.sm { border-radius: 999px; }
.autogo-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.autogo-bar i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s linear; }
.autogo.skip .autogo-bar i { background: var(--warn); }
/* 方案卡「确认」行 */
.appr-inline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.appr-inline .ic { width: 15px; height: 15px; color: var(--accent); }
.appr-inline.skip .ic { color: var(--warn); }
.appr-inline.manual .ic { color: var(--muted); }
.appr-inline .dim { font-size: 12px; font-weight: 400; }
@media (max-width: 640px) { .appr-btn span { display: none; } .appr-menu { width: min(312px, calc(100vw - 48px)); } .autogo { font-size: 12.5px; } }

/* ===== 输入框 v3：去掉框中框，整块就是一个输入区 =====
   全局 textarea:focus / :hover 会给输入框再套一层圆角描边 + 光圈，这里用更高优先级统一清掉 */
#composer textarea, #composer textarea:hover, #composer textarea:focus, #composer textarea:focus-visible {
  border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none; }
#composer textarea { display: block; width: 100%; padding: 6px 4px 2px; font-size: 15px; line-height: 1.6; caret-color: var(--accent); }
.chatpage .composer { cursor: text; padding: 12px 12px 10px 14px; border-radius: 22px; background: var(--bg-2);
  border-color: color-mix(in srgb, var(--line-2) 70%, transparent); }
.chatpage .composer:hover { border-color: var(--line-2); }
.chatpage .composer:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent), 0 12px 32px rgba(0, 0, 0, .18); }
.chatpage .composer-bar { cursor: default; margin-top: 8px; }
/* 空状态：输入框更像一个"写需求"的地方，默认两行高 */
.chatpage.empty-chat #composer textarea { min-height: 56px; }
.chatpage .composer-bar .icon-btn { margin-left: -4px; }
.chatpage .composer-hint { padding-left: 2px; }

/* 入口卡片：5 张时 3 + 2 居中，不留空位 */
.starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.starter { flex: 0 1 calc((100% - 20px) / 3); min-width: 230px; }
@media (max-width: 820px) { .starter { flex-basis: calc((100% - 10px) / 2); min-width: 0; } }

/* 制作过程：对话任务卡里的步骤时间线 */
.rsteps { border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; }
.rsteps-h, .rstep-h { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: 100%; cursor: pointer; padding: 4px 2px; border-radius: 6px; }
.rsteps-h:hover, .rstep-h:not([disabled]):hover { background: var(--bg-3); }
.rstep-h[disabled] { cursor: default; }
.rsteps-h .dim { margin-left: auto; font-size: 12px; }
.rstep-c { color: var(--muted); transition: transform .15s; font-size: 14px; line-height: 1; }
[data-rstep-wrap].open > button .rstep-c { transform: rotate(90deg); }
.rsteps-b { display: none; list-style: none; margin: 4px 0 0; padding: 0; }
.rsteps.open > .rsteps-b { display: block; }
.rstep { position: relative; padding-left: 2px; }
.rstep:not(:last-child)::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: -4px; width: 1px; background: var(--line); }
.rdot { flex: none; width: 10px; height: 10px; margin: 0 2px 0 3px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--bg-2); box-sizing: border-box; }
.rstep.done .rdot { background: var(--ok-ink); border-color: var(--ok-ink); }
.rstep.cur .rdot { border-color: var(--accent); border-top-color: transparent; animation: s 1s linear infinite; }
.rstep.fail .rdot, .rstep.stop .rdot { background: var(--err-ink); border-color: var(--err-ink); }
.rstep.skip .rdot { border-style: dashed; }
.rstep.todo .rstep-l, .rstep.skip .rstep-l { color: var(--muted); }
.rstep.cur .rstep-l { font-weight: 600; }
.rstep-t { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rstep-w { font-size: 11px; color: var(--warn-ink); background: var(--warn-soft); border-radius: 999px; padding: 0 6px; }
.rstep-b { display: none; margin: 2px 0 6px 24px; padding: 6px 10px; border-radius: 8px; background: var(--bg-1); font-size: 12.5px; }
.rstep.open > .rstep-b { display: block; }
.rev { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; padding: 2px 0; line-height: 1.5; }
.rev-t { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.rev.result .rev-x { font-weight: 500; }
.rev.warn .rev-x { color: var(--warn-ink); }
.rev.fail .rev-x { color: var(--err-ink); }
.rev-items { grid-column: 2; margin: 2px 0 4px; padding-left: 18px; max-height: 180px; overflow: auto; color: var(--muted); }
.rev-items li { padding: 1px 0; }
.rsub { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.rsub span { white-space: nowrap; }
.rsub .progress { flex: 1; height: 4px; }
.rlog { margin: 6px 0 0; padding: 6px 8px; border-radius: 6px; background: var(--bg-3); color: var(--muted); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; max-height: 140px; overflow: auto; }

/* PG-61：本月额度余量 */
.quota-chip { font-size: 12px; color: var(--dim); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line, rgba(127,127,127,.25)); white-space: nowrap; }
.quota-chip.warn { color: #b7791f; border-color: rgba(183,121,31,.45); }
.quota-chip.bad { color: #c53030; border-color: rgba(197,48,48,.5); }
