/* aio-gpt 移动端样式：单列布局，颜色集中在 CSS 变量里，深/浅色自动切换。 */

:root {
  /* 深色为默认（--bg 等），浅色在 prefers-color-scheme 里覆盖 */
  --bg: #0f1115;
  --bg-elev: #171a21;
  --bg-elev-2: #1e2229;
  --bg-input: #1a1e26;
  --fg: #e8eaed;
  --fg-dim: #9aa3af;
  --fg-faint: #6b7480;
  --line: #262b34;
  --line-strong: #343a45;
  --accent: #4c8dff;
  --accent-fg: #ffffff;
  --accent-soft: rgba(76, 141, 255, 0.14);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.14);
  --warn: #f0b429;
  --ok: #3ecf8e;
  --code-bg: #12151b;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --topbar-h: 56px;
  --tap: 44px;
  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --bg-elev: #ffffff;
    --bg-elev-2: #ffffff;
    --bg-input: #ffffff;
    --fg: #16181d;
    --fg-dim: #5c6672;
    --fg-faint: #7d8794;
    --line: #e2e5ea;
    --line-strong: #cdd2da;
    --accent: #1f6feb;
    --accent-fg: #ffffff;
    --accent-soft: rgba(31, 111, 235, 0.1);
    --danger: #d1242f;
    --danger-soft: rgba(209, 36, 47, 0.1);
    --warn: #9a6700;
    --ok: #1a7f37;
    --code-bg: #f0f2f5;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  /* 用 dvh 让移动端地址栏收起/展开时布局稳定，老浏览器退回 100% */
  min-height: 100dvh;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ============================== 登录 ============================== */

.login {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 22px 22px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.login-badge {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 16px;
}

.login-title { margin: 0 0 6px; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.login-sub { margin: 0 0 18px; color: var(--fg-dim); font-size: 14px; }

.login-input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font-size: 16px; /* ≥16px：避免 iOS 聚焦时自动放大 */
  color: var(--fg);
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.login-submit { width: 100%; margin-top: 14px; }

.login-health {
  margin: 14px 0 0;
  min-height: 18px;
  font-size: 12.5px;
  color: var(--fg-faint);
  text-align: center;
}
.login-health.is-ok { color: var(--ok); }
.login-health.is-warn { color: var(--warn); }

/* ============================== 按钮 ============================== */

.btn {
  min-height: var(--tap);
  padding: 0 18px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 560;
  color: var(--fg);
  background: var(--bg-elev-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: var(--danger); }

.icon-btn {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-radius: 12px;
  font-size: 17px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.icon-btn:active { background: var(--bg-elev-2); }

/* 纯 CSS 图标，避免引入任何外部资源 */
.icon-bars, .icon-bars::before, .icon-bars::after {
  display: block;
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.icon-bars { position: relative; }
.icon-bars::before, .icon-bars::after { content: ""; position: absolute; left: 0; }
.icon-bars::before { top: -6px; }
.icon-bars::after { top: 6px; }

.icon-plus { position: relative; width: 18px; height: 18px; }
.icon-plus::before, .icon-plus::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 2px;
}
.icon-plus::before { left: 8px; top: 0; width: 2px; height: 18px; }
.icon-plus::after { top: 8px; left: 0; height: 2px; width: 18px; }

/* ============================== 主视图 ============================== */

.main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: var(--topbar-h);
  padding: var(--safe-top) 8px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-titles {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 2px;
}
.topbar-title {
  margin: 0;
  font-size: 16px;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-meta {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--fg-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 断线提示条 */
.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--bg));
  border-bottom: 1px solid var(--line);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.22s ease, max-height 0.22s ease, padding 0.22s ease;
}
.banner.is-visible {
  opacity: 1;
  max-height: 48px;
  padding: 8px 14px;
}
.banner-dot {
  width: 8px; height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--warn);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.28; }
}

/* ============================== 消息流 ============================== */

.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty {
  margin: auto 0;
  padding: 32px 12px;
  text-align: center;
  color: var(--fg-faint);
}
.empty-title { margin: 0 0 6px; font-size: 17px; color: var(--fg-dim); font-weight: 600; }
.empty-sub { margin: 0; font-size: 14px; }

.msg { display: flex; flex-direction: column; min-width: 0; }

.msg-user { align-items: flex-end; }
.bubble-user {
  max-width: 88%;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 16px 16px 4px 16px;
  overflow-wrap: anywhere;
}
.bubble-user > *:first-child { margin-top: 0; }
.bubble-user > *:last-child { margin-bottom: 0; }
.bubble-user a { color: var(--accent-fg); text-decoration: underline; }
.bubble-user code { background: rgba(255, 255, 255, 0.18); }

.msg-agent { align-items: stretch; }
.msg-note { color: var(--fg-dim); }

.caret {
  display: inline-block;
  width: 7px; height: 14px;
  margin-top: 2px;
  background: var(--accent);
  border-radius: 1px;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================== Markdown ============================== */

.markdown { min-width: 0; overflow-wrap: anywhere; }
.markdown > *:first-child { margin-top: 0; }
.markdown > *:last-child { margin-bottom: 0; }
.markdown p { margin: 0 0 10px; }
.markdown h1, .markdown h2, .markdown h3,
.markdown h4, .markdown h5, .markdown h6 {
  margin: 16px 0 8px;
  line-height: 1.3;
  font-weight: 640;
}
.markdown h1 { font-size: 21px; }
.markdown h2 { font-size: 19px; }
.markdown h3 { font-size: 17px; }
.markdown h4, .markdown h5, .markdown h6 { font-size: 16px; }
.markdown ul, .markdown ol { margin: 0 0 10px; padding-left: 22px; }
.markdown li { margin: 3px 0; }
.markdown li > p { margin: 0; }
.markdown blockquote {
  margin: 0 0 10px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--fg-dim);
}
.markdown hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.markdown a { color: var(--accent); text-decoration: underline; overflow-wrap: anywhere; }

.markdown code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.code-block {
  margin: 0 0 10px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 4px 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--fg) 4%, transparent);
}
.code-lang {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-faint);
  text-transform: lowercase;
}

/* 长代码横向滚动，绝不撑破页面 */
.code-block pre,
.mono,
pre.mono {
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.code-block pre {
  padding: 10px 12px;
}
.code-block code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
  overflow-wrap: normal;
}

.copy-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  color: var(--fg-dim);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.copy-btn:active { background: var(--bg-elev-2); }

.table-wrap {
  margin: 0 0 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 14px; }
.table-wrap th, .table-wrap td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table-wrap th { background: var(--bg-elev-2); font-weight: 600; }

/* ============================== 卡片 ============================== */

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-width: 0;
}
.card-failed { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.card-label {
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.card-meta {
  font-size: 12px;
  color: var(--fg-faint);
  overflow-wrap: anywhere;
}

.badge {
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--fg-dim);
}
.badge-running { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.badge-failed { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.badge-completed { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }

pre.mono {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 8px 10px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  white-space: pre;
}
.cmd-text { margin-bottom: 6px; }
.cmd-text code { color: var(--fg); }
.cmd-output { max-height: 320px; overflow-y: auto; white-space: pre; }

.fold {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  overflow: hidden;
}
.fold-summary {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--fg-dim);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.fold-summary::-webkit-details-marker { display: none; }
.fold-summary::after {
  content: "▾";
  margin-left: auto;
  font-size: 11px;
  transition: transform 0.15s ease;
}
.fold[open] > .fold-summary::after { transform: rotate(180deg); }
.fold-body { padding: 10px 12px; }
.fold > pre.mono { border: 0; border-radius: 0; margin: 0; }

.file-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  min-width: 0;
}
.file-kind {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  color: var(--fg-dim);
}
.file-add { color: var(--ok); border-color: var(--ok); }
.file-delete { color: var(--danger); border-color: var(--danger); }
.file-path {
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
pre.diff, .tool-args { margin-top: 6px; max-height: 260px; overflow: auto; }

.pending-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius-sm);
}
.link-btn {
  min-height: var(--tap);
  padding: 0 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ============================== 输入区 ============================== */

.composer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.composer-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--tap);
  max-height: 35dvh;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 16px; /* ≥16px 防 iOS 缩放 */
  line-height: 1.4;
  color: var(--fg);
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  resize: none;
  overflow-y: hidden;
  -webkit-appearance: none;
  appearance: none;
}
.composer-input:focus { border-color: var(--accent); }
.composer-input:disabled { opacity: 0.6; }

.send-btn {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: var(--tap);
  padding: 0 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 620;
  color: var(--accent-fg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.send-btn:disabled { opacity: 0.5; }
.send-btn.is-stop {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger);
}

/* ============================== 抽屉 ============================== */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.45);
  animation: fade-in 0.18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  z-index: 41;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, 340px);
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  transform: translateX(-102%);
  transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
  visibility: hidden;
}
.drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .drawer, .sheet, .banner, .toast { transition: none !important; animation: none !important; }
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer-title { flex: 1 1 auto; margin: 0; font-size: 16px; font-weight: 640; }

.drawer-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
}
.drawer-empty { margin: 20px 12px; color: var(--fg-faint); font-size: 14px; }

.thread-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  min-height: var(--tap);
  text-align: left;
  font-family: inherit;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.thread-item.is-active { background: var(--accent-soft); }
.thread-item:active { background: var(--bg-elev-2); }

.thread-line { display: flex; align-items: center; gap: 6px; }
.thread-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-dot {
  flex: 0 0 auto;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
}
.thread-meta { font-size: 11.5px; color: var(--fg-faint); }
.thread-preview {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--fg-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drawer-new {
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-row { display: flex; gap: 8px; }
.field { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.field-label { font-size: 11px; color: var(--fg-faint); }
.field-select {
  min-height: var(--tap);
  padding: 0 8px;
  font-family: inherit;
  font-size: 16px; /* 移动端 select 同样避免缩放 */
  color: var(--fg);
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-faint) 50%),
    linear-gradient(135deg, var(--fg-faint) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 24px;
  text-overflow: ellipsis;
}

/* ============================== 底部弹层 ============================== */

.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: fade-in 0.18s ease;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px calc(16px + var(--safe-bottom));
  background: var(--bg-elev);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-top: 1px solid var(--line);
  animation: sheet-up 0.24s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes sheet-up { from { transform: translateY(18px); opacity: 0.4; } to { transform: none; opacity: 1; } }

.sheet-handle {
  width: 38px; height: 4px;
  margin: 8px auto 4px;
  border-radius: 2px;
  background: var(--line-strong);
}
.sheet-title { margin: 4px 0 10px; font-size: 17px; font-weight: 640; }
.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.sheet-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 9px;
  font-size: 12px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
}
.sheet-reason { margin: 8px 0 0; font-size: 14px; color: var(--fg-dim); }
.sheet-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
}

.question-block {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}
.question-head {
  padding: 0;
  font-size: 12px;
  font-weight: 620;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.question-text { margin: 4px 0 10px; font-size: 15px; }

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: var(--tap);
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.option-row:active { background: var(--bg-elev-2); }
.option-row input { flex: 0 0 auto; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.option-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.option-label { font-size: 15px; }
.option-desc { font-size: 12.5px; color: var(--fg-faint); overflow-wrap: anywhere; }

.sheet-input {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--fg);
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  resize: vertical;
}

/* ============================== Toast ============================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  z-index: 60;
  max-width: min(88vw, 420px);
  padding: 10px 16px;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg-elev-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, 8px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow-wrap: anywhere;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ============================== 宽屏 ============================== */

@media (min-width: 720px) {
  .messages, .composer { padding-left: max(16px, calc((100vw - 820px) / 2)); padding-right: max(16px, calc((100vw - 820px) / 2)); }
  .bubble-user { max-width: 70%; }
  .sheet { left: 50%; transform: translateX(-50%); max-width: 620px; border-radius: 20px 20px 0 0; }
}
