:root{font-family:system-ui,-apple-system,"PingFang SC",sans-serif;color:#0f172a;background:#f6f7f9}
*{box-sizing:border-box}
/* .sheet 用了 display:flex，会盖掉浏览器默认的 [hidden]{display:none}，必须显式压回去，
   否则确认面板会一直挂在页面上挡住阅读。 */
[hidden]{display:none!important}
body{margin:0;padding:0 0 32px}
header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px;background:#0f172a;color:#fff;position:sticky;top:0;z-index:2}
header h1{margin:2px 0 0;font-size:22px}
.eyebrow{margin:0;font-size:11px;letter-spacing:.24em;color:#94a3b8}
.status{font-size:12px;padding:6px 10px;border-radius:999px;background:#1e293b;color:#cbd5f5;white-space:nowrap}
.status.ok{background:#14532d;color:#bbf7d0}
.status.bad{background:#7f1d1d;color:#fecaca}
main{padding:20px}
section{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:18px;margin-bottom:16px}
h2{margin:0 0 10px;font-size:17px}
p{line-height:1.7;margin:8px 0;font-size:15px}
.hint{color:#64748b;font-size:13px}
.update{margin:10px 0;padding:12px 14px;border-radius:12px;background:#eff6ff;border:1px solid #bfdbfe;color:#1e3a8a;font-size:14px;line-height:1.6}
.update a{color:#1d4ed8;font-weight:600}
.error{color:#b91c1c;font-size:13px;white-space:pre-wrap}
/* 关键：flex 子项默认 min-width:auto，输入框会撑到自己的固有宽度把按钮挤出卡片；
   给输入框 min-width:0、给按钮 nowrap，窄屏再改成竖排，就不会溢出。 */
form{display:flex;gap:10px;margin-top:12px}
input{flex:1 1 auto;min-width:0;font:inherit;padding:12px;border:1px solid #cbd5e1;border-radius:10px;text-transform:uppercase;letter-spacing:.16em}
button{flex:0 0 auto;white-space:nowrap;font:inherit;border:0;border-radius:10px;padding:12px 18px;background:#1d4ed8;color:#fff;font-weight:600}
button:disabled{opacity:.5}
footer{padding:0 20px;display:grid;gap:12px;text-align:center}
#unbind{background:#e2e8f0;color:#334155;width:100%}
.answers{list-style:none;padding:0;margin:12px 0 0;display:grid;gap:12px}
.card{border:1px solid #e2e8f0;border-radius:14px;padding:14px;background:#fbfcfe}
.card header{display:flex;justify-content:space-between;background:none;color:#475569;padding:0;margin-bottom:8px;position:static;font-size:12px}
.card pre{margin:0;white-space:pre-wrap;word-break:break-word;font:15px/1.7 inherit}
.card.streaming{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(59,130,246,.08)}
.card.error{border-color:#fca5a5;background:#fef2f2}
.badge{display:inline-block;padding:2px 8px;border-radius:999px;background:#e0e7ff;color:#1e40af;font-weight:600}
.badge.image{background:#dcfce7;color:#166534}
.card.pending{border-color:#f0b429;background:#fffbeb}
.card.cancelled{border-color:#e2e8f0;background:#f8fafc;opacity:.75}
.card .cancel{background:#fde68a;color:#78350f;padding:6px 12px;font-size:13px}
.empty{text-align:center;color:#94a3b8;padding:24px 0}
@media (max-width:350px){form{flex-direction:column}button{width:100%}}

/* 待提交确认面板：占屏幕下方至少 30%，浮在所有内容之上 */
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:50;min-height:30vh;display:flex;flex-direction:column;gap:8px;
  padding:20px 20px calc(20px + env(safe-area-inset-bottom));background:#0f172a;color:#fff;
  border-radius:20px 20px 0 0;box-shadow:0 -12px 40px rgba(15,23,42,.45);animation:sheet-in .18s ease-out}
@keyframes sheet-in{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
.sheet-title{margin:0;font-size:16px;color:#cbd5f5}
.sheet-count{margin:0;flex:1;display:flex;align-items:center;justify-content:center;gap:8px}
.sheet-count span{font-size:64px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums}
.sheet-count small{font-size:15px;color:#cbd5f5}
.sheet button{width:100%;min-height:96px;font-size:26px;font-weight:800;border-radius:16px;background:#f8fafc;color:#0f172a}
.sheet button:active{background:#e2e8f0}

/* 底部一排三个等宽等高的按钮：问题回答 / 截图 / 多张截图。
   三条要求：宽度高度都一样、按钮上只写名字、横向铺满底部。
   倒计时面板弹出时整排抬到面板上方，10 秒窗口里还能继续加图。 */
.capture-cluster{position:fixed;left:0;right:0;bottom:0;z-index:45;display:grid;
  grid-template-columns:repeat(3,1fr);gap:8px;
  padding:8px 10px calc(8px + env(safe-area-inset-bottom));
  background:#fff;border-top:1px solid #e2e8f0;transition:bottom .18s ease-out}
.capture{display:grid;place-items:center;width:100%;height:60px;padding:0;
  border-radius:12px;background:#1d4ed8;color:#fff;box-shadow:none}
.capture span{font-size:16px;font-weight:700;line-height:1.2}
/* 小字只在脚本里用来记状态，界面上不显示（按钮上只留名字）。 */
.capture small{display:none}
.capture:active{background:#1e40af}
.capture.busy{background:#475569}
/* 多张截图：深色区分，正在攒这一组时变绿。 */
.capture.multi{background:#334155}
.capture.multi.active{background:#0f766e}
/* 问题回答：绿色，和两条截图链路区分开。 */
.capture.ask{background:#0f766e}
.capture.ask.ok{background:#15803d}
.capture.ask.bad{background:#b91c1c}
body.sheet-open .capture-cluster{bottom:32vh}
.answers{padding-bottom:104px}
/* 一句状态提示，贴在按钮排上方，不遮挡正文。 */
.capture-note{position:fixed;left:10px;right:10px;bottom:calc(80px + env(safe-area-inset-bottom));z-index:44;
  margin:0;padding:8px 12px;border-radius:12px;background:rgba(15,23,42,.92);color:#e2e8f0;font-size:12px;line-height:1.5;
  box-shadow:0 6px 20px rgba(15,23,42,.3)}
body.sheet-open .capture-note{bottom:calc(32vh + 80px)}

/* 按钮设备（配对码角色 ask）：整页就是一个按钮，铺满屏幕——目标越大越好，
   站着用脚踩也能踩到。答案不在这里显示，所以页头、正文、答案提示全都收起来。 */
body.press-mode{overflow:hidden}
body.press-mode header,
body.press-mode .hint-answers{display:none!important}
body.press-mode main{padding:0}
body.press-mode footer{padding:6px 12px calc(8px + env(safe-area-inset-bottom));gap:6px}
body.press-mode footer .hint{font-size:11px;margin:0}
section.press{background:transparent;border:0;padding:0;margin:0}
.press-button{width:100%;height:calc(100vh - 74px);height:calc(100dvh - 74px);min-height:260px;
  display:grid;gap:12px;place-content:center;border-radius:0;
  background:#1d4ed8;color:#fff;font-size:44px;font-weight:800;letter-spacing:.06em;
  transition:background .15s ease-out;-webkit-tap-highlight-color:transparent}
.press-button span{line-height:1.15}
.press-button small{font-size:15px;font-weight:500;letter-spacing:0;color:#dbeafe}
.press-button:active{background:#1e40af}
.press-button:disabled{opacity:1}
.press-button.busy{background:#475569}
.press-button.busy small{color:#e2e8f0}
.press-button.ok{background:#15803d}
.press-button.bad{background:#991b1b}
/* 反馈贴在按钮底部，不占走按钮的面积 */
.press-note{position:fixed;left:0;right:0;bottom:74px;margin:0;padding:10px 18px;
  text-align:center;font-size:15px;line-height:1.6;background:rgba(15,23,42,.82);color:#e2e8f0}
.press-note.bad{color:#fecaca}
.press-note.ok{color:#bbf7d0}
