/* ============================================================
   教培咨询助手 — 样式
   ============================================================ */
:root {
  --primary: #3b6cf6;
  --primary-dark: #2f57d6;
  --primary-soft: #eef2ff;
  --bg: #f4f6fb;
  --card: #ffffff;
  --border: #e5e8f0;
  --text: #1f2430;
  --text-2: #6b7280;
  --danger: #e5484d;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(30, 41, 59, 0.08);
}
* { box-sizing: border-box; }
/* 关键修复：确保 hidden 属性始终生效，防止 display:flex 等规则覆盖它
   （否则设置弹窗等元素永远关不掉） */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  background: #f1f3f9;
  color: var(--text);
  padding: 9px 14px;
  font-size: 14px;
  transition: background .15s, color .15s, border-color .15s;
}
button.primary { background: var(--primary); color: #fff; }
button.primary:hover { background: var(--primary-dark); }
button:disabled { opacity: .5; cursor: not-allowed; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3d8e3; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #b9c0cf; }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ---------- 侧栏 ---------- */
.sidebar {
  width: 264px;
  flex: 0 0 264px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px;
  padding: 4px 6px 14px;
  cursor: pointer;
}
.brand-name { flex: 1; line-height: 1.35; word-break: break-all; }
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #5b8cff, #3b6cf6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex: 0 0 34px;
}
.btn-new {
  width: 100%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  border: 1px dashed #c6d3ff;
}
.btn-new:hover { background: #e2e9ff; border-color: var(--primary); }
.conv-list { flex: 1; overflow-y: auto; margin-top: 10px; }
.conv-item {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 2px;
  font-size: 14px;
  color: var(--text-2);
}
.conv-item:hover { background: #f1f3f9; }
.conv-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.conv-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-del {
  border: none; background: transparent; color: #b6bcc9;
  cursor: pointer; font-size: 12px; padding: 2px 7px; border-radius: 6px;
  visibility: hidden; line-height: 1;
}
.conv-item:hover .conv-del, .conv-item.active .conv-del { visibility: visible; }
.conv-del:hover { color: var(--danger); background: #fdecec; }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: 10px; }
.btn-foot { width: 100%; background: transparent; text-align: left; }
.btn-foot:hover { background: #f1f3f9; }
.ver { text-align: center; font-size: 11.5px; color: #aab0bd; margin-top: 8px; user-select: none; }
.conv-tools { display: flex; gap: 6px; }
.conv-tools button { flex: 1; padding: 7px 4px; font-size: 12px; background: #f1f3f9; }
.conv-tools button:hover { background: var(--primary-soft); color: var(--primary-dark); }
/* 消息操作按钮（悬停显示） */
.msg-acts { display: flex; gap: 2px; margin-top: 2px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-acts, .msg-acts:focus-within { opacity: 1; }
.msg-act {
  background: transparent; border: none;
  font-size: 13px; color: #b6bcc9;
  padding: 4px 8px; border-radius: 8px;
  line-height: 1;
}
.msg-act:hover { background: #f1f3f9; color: var(--text); }

/* 轻提示 */
.toast {
  position: fixed; top: 18%; left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  z-index: 300;
  pointer-events: none;
  white-space: nowrap;
}

.mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 20;
  display: none;
}

/* ---------- 主区域 ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar .title {
  flex: 1; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: transparent;
  font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.icon-btn:hover { background: #f1f3f9; }
#btnMenu { display: none; }
.key-warn {
  font-size: 12px; color: #b45309;
  background: #fef3c7;
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}

/* ---------- 消息区（豆包风格） ---------- */
.chat { flex: 1; overflow-y: auto; padding: 18px 16px 10px; }

/* 消息行：AI 带头像居左，用户气泡居右 */
.msg { display: flex; gap: 10px; margin-bottom: 20px; }
.msg.user { justify-content: flex-end; align-items: flex-end; max-width: 82%; margin-left: auto; }
.msg.ai { justify-content: flex-start; align-items: flex-start; }

/* AI 头像 */
.msg-avatar {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b8cff, #3b6cf6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(59, 108, 246, 0.25);
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 消息内容列 */
.msg-content {
  max-width: min(660px, 82%);
  display: flex; flex-direction: column; align-items: flex-start;
  min-width: 0;
}

.bubble {
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.8;
  font-size: 15px;
  max-width: 100%;
  word-break: break-word;
  white-space: normal;
}
/* 用户：右侧渐变气泡（豆包风格） */
.msg.user .bubble {
  background: linear-gradient(135deg, #4a7bff, #3b6cf6);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 14px rgba(59, 108, 246, 0.22);
}
/* AI：无气泡卡片，头像 + 纯文字（豆包风格） */
.msg.ai .bubble {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 2px 0;
  font-size: 15.5px;
}

/* Markdown 内容 */
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble pre {
  background: #0f172a; color: #e2e8f0;
  padding: 12px; border-radius: 10px;
  overflow-x: auto; font-size: 13px; line-height: 1.6;
}
.bubble code { font-family: "SFMono-Regular", Consolas, "Courier New", monospace; }
.bubble :not(pre) > code {
  background: #eef1f6; padding: 2px 6px; border-radius: 6px; font-size: 13px;
}
.bubble ul, .bubble ol { margin: 6px 0; padding-left: 22px; }
.bubble blockquote {
  margin: 8px 0; padding: 6px 12px;
  border-left: 3px solid var(--primary);
  background: #f8faff; color: var(--text-2);
  border-radius: 0 8px 8px 0;
}
.bubble table { border-collapse: collapse; margin: 8px 0; display: block; overflow-x: auto; }
.bubble th, .bubble td { border: 1px solid var(--border); padding: 6px 10px; }
.bubble h1, .bubble h2, .bubble h3 { margin: 10px 0 6px; line-height: 1.4; }
.bubble a { color: var(--primary); }

/* 图片消息 */
.msg-media {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 6px; margin-bottom: 6px;
  max-width: 100%;
}
.msg-img {
  max-width: 260px; max-height: 240px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.ocr-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-2);
  width: 100%;
}
.ocr-box summary { cursor: pointer; }
.ocr-box pre {
  margin: 8px 0 0;
  white-space: pre-wrap; word-break: break-all;
  max-height: 200px; overflow-y: auto;
  font-family: inherit; font-size: 13px;
  color: var(--text);
}

/* 思考过程（R1） */
.reasoning {
  background: #fff8e6;
  border: 1px solid #f5e3b3;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: #8a6d1f;
  margin-bottom: 6px;
  max-width: 100%;
}
.reasoning summary { cursor: pointer; }
.reasoning-body {
  white-space: pre-wrap; word-break: break-word;
  max-height: 240px; overflow-y: auto;
  margin-top: 6px; font-size: 12.5px;
  color: #7a6218;
}

.cursor { display: inline-block; animation: blink 1s steps(1) infinite; color: var(--primary); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 空状态 ---------- */
.empty-state { max-width: 560px; margin: 7vh auto 0; text-align: center; padding: 0 16px; }
.empty-logo { font-size: 54px; }
.empty-state h1 { font-size: 23px; margin: 14px 0 8px; }
.empty-state p { color: var(--text-2); line-height: 1.75; font-size: 14.5px; }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--primary-dark);
}
.chip:hover { background: var(--primary-soft); border-color: var(--primary); }
.hint { font-size: 12.5px; color: #9aa1ae; }

/* ---------- 图片识别草稿面板 ---------- */
.draft {
  max-width: 820px; margin: 0 auto 10px; width: calc(100% - 36px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.draft-head {
  font-weight: 600; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 10px;
}
.draft-status { font-weight: 400; font-size: 12.5px; color: var(--text-2); text-align: right; }
.draft-body { display: flex; gap: 12px; }
.draft-body img {
  max-width: 150px; max-height: 200px;
  border-radius: 10px; object-fit: contain;
  border: 1px solid var(--border);
}
.draft-right { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.draft-right textarea, .draft-right input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.draft-right textarea { min-height: 110px; resize: vertical; }
.draft-right input:focus, .draft-right textarea:focus { border-color: var(--primary); }
.draft-actions { display: flex; justify-content: flex-end; gap: 8px; }
.progress { height: 6px; background: #eef1f6; border-radius: 999px; margin-top: 10px; overflow: hidden; }
.progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #5b8cff, #3b6cf6);
  border-radius: 999px;
  transition: width .2s;
}

/* ---------- 输入区 ---------- */
.composer {
  max-width: 820px; width: calc(100% - 36px);
  margin: 0 auto;
  padding: 6px 0 18px;
  display: flex; gap: 8px; align-items: flex-end;
}
.composer textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.6;
  resize: none;
  max-height: 160px;
  background: var(--card);
  outline: none;
}
.composer textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 108, 246, 0.12);
}
.voice-btn {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.voice-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.voice-btn.recording { background: var(--danger); border-color: var(--danger); animation: voicePulse 1s ease-in-out infinite; }
@keyframes voicePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.voice-status {
  max-width: 820px; width: calc(100% - 36px);
  margin: 0 auto;
  padding: 6px 14px;
  background: #fff3e0;
  border: 1px solid #ffd591;
  border-radius: 10px;
  font-size: 13.5px;
  color: #ad6800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.send {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.send:hover { background: var(--primary-dark); }
.send.stop { background: var(--danger); font-size: 14px; }
.send.stop:hover { background: #cf3f44; }

/* ---------- 设置弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  background: var(--card);
  border-radius: 18px;
  padding: 22px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.modal label {
  display: block; margin-bottom: 14px;
  font-size: 13.5px; color: var(--text-2);
}
.modal label > * { display: block; margin-top: 6px; width: 100%; }
.modal input, .modal select, .modal textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
}
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--primary); }
.modal textarea { resize: vertical; min-height: 130px; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.spacer { flex: 1; }
.key-hint { font-size: 12px; color: var(--danger); min-height: 16px; margin-top: 2px; line-height: 1.5; }
.logo-upload { margin-bottom: 14px; font-size: 13.5px; color: var(--text-2); }
.logo-upload-title { margin-bottom: 6px; }
.logo-upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo-upload-row input[type="file"] { font-size: 12.5px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: #fff; max-width: 220px; }
.brand .logo img { width: 100%; height: 100%; border-radius: 10px; object-fit: contain; }
.empty-logo img { width: 64px; height: 64px; border-radius: 14px; object-fit: contain; }
/* 访客对话日志 */
.log-panel { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 14px; background: #fbfcfe; }
.log-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-weight: 600; font-size: 13.5px; color: var(--text); }
.log-actions button { padding: 4px 10px; font-size: 12px; }
.log-stats { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.log-box { max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.log-empty { text-align: center; color: #9aa1ae; font-size: 13px; padding: 14px; }
.log-entry { border-bottom: 1px dashed var(--border); padding: 8px 2px; font-size: 13px; }
.log-entry:last-child { border-bottom: none; }
.log-meta { color: var(--text-2); font-size: 12px; margin-bottom: 3px; }
.log-user { margin-bottom: 3px; word-break: break-all; line-height: 1.6; }
.log-reply summary { cursor: pointer; color: var(--primary-dark); font-size: 12.5px; }
.log-reply div { white-space: pre-wrap; word-break: break-word; margin-top: 4px; max-height: 160px; overflow-y: auto; font-size: 12.5px; color: var(--text); }
.log-error { color: var(--danger); font-size: 12.5px; }
/* 技能库 */
.skills-panel { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 14px; background: #fbfcfe; }
.skills-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; font-size: 13.5px; color: var(--text); }
.skills-head button { padding: 4px 10px; font-size: 12px; }
.skills-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.skill-item { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: #fff; }
.skill-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.skill-enable { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.skill-enable input { width: auto; margin: 0; }
.skill-top input[data-role="name"] { flex: 1; min-width: 140px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; outline: none; }
.skill-top input[data-role="name"]:focus { border-color: var(--primary); }
.skill-item input.skill-desc { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; font-family: inherit; outline: none; margin-bottom: 6px; color: var(--text-2); }
.skill-item input.skill-desc:focus { border-color: var(--primary); color: var(--text); }
.skill-top button[data-role="del"] { padding: 5px 10px; font-size: 12px; background: #fdecec; color: var(--danger); }
.skill-top button[data-role="del"]:hover { background: #f8d7d7; }
.skill-item textarea[data-role="content"] { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; min-height: 70px; resize: vertical; outline: none; }
.skill-item textarea[data-role="content"]:focus { border-color: var(--primary); }
/* 知识库 */
.kb-panel { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 14px; background: #fbfcfe; }
.kb-head { font-weight: 600; font-size: 13.5px; color: var(--text); margin-bottom: 8px; }
.kb-upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.kb-upload-row select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 13px; font-family: inherit; background: #fff; }
.kb-upload-row button { padding: 6px 12px; font-size: 13px; }
.kb-cats { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.kb-cat { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: #fff; }
.kb-cat-name { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.kb-empty { font-size: 12.5px; color: #9aa1ae; padding: 4px 2px; }
.kb-file { display: flex; align-items: center; gap: 8px; padding: 5px 2px; border-bottom: 1px dashed var(--border); font-size: 13px; }
.kb-file:last-child { border-bottom: none; }
.kb-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-file-meta { color: #9aa1ae; font-size: 12px; }
.kb-del { padding: 3px 8px; font-size: 12px; background: #fdecec; color: var(--danger); }
.kb-del:hover { background: #f8d7d7; }
#kbEditor { border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-top: 8px; background: #fff; }
#kbEditor input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; margin-bottom: 6px; outline: none; }
#kbEditor input:focus { border-color: var(--primary); }
#kbEditor textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; font-family: inherit; min-height: 140px; resize: vertical; outline: none; }
#kbEditor textarea:focus { border-color: var(--primary); }
#testResult { font-size: 13px; margin-top: 12px; color: var(--text-2); white-space: pre-wrap; word-break: break-all; }
input[type="range"] { accent-color: var(--primary); padding: 0; }

/* 访客访问码门禁 */
.gate { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.gate-box { background: var(--card); border-radius: 18px; padding: 26px; width: 100%; max-width: 320px; box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3); }
.gate-title { font-weight: 700; font-size: 17px; margin-bottom: 14px; text-align: center; }
.gate-box input { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; font-size: 15px; font-family: inherit; outline: none; margin-bottom: 8px; text-align: center; letter-spacing: 2px; }
.gate-box input:focus { border-color: var(--primary); }
.key-warn-banner { background: #fdecec; border: 1px solid #f5c6c7; color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; line-height: 1.6; }

/* ---------- 响应式（手机自适应） ---------- */
@media (max-width: 760px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.2);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .mask { display: block; }
  #btnMenu { display: inline-flex; }
  .draft-body { flex-direction: column; }
  .draft-body img { max-width: 100%; max-height: 160px; }
  .topbar { padding: 8px 10px; }
  .chat { padding: 12px 10px 6px; }
  .msg { gap: 8px; margin-bottom: 16px; }
  .msg-avatar { width: 32px; height: 32px; flex: 0 0 32px; font-size: 16px; }
  .msg-content { max-width: 78%; }
  .msg.user { max-width: 88%; }
  .bubble { font-size: 15px; line-height: 1.75; padding: 10px 14px; }
  .msg.ai .bubble { font-size: 15px; padding: 2px 0; }
  .composer {
    width: 100%; padding: 6px 10px 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    gap: 6px;
  }
  .composer textarea { font-size: 16px; padding: 11px 14px; border-radius: 22px; }
  .voice-btn, #btnUpload, .send { width: 40px; height: 40px; flex: 0 0 40px; }
  .voice-status { width: calc(100% - 20px); }
  .empty-state { margin-top: 5vh; }
  .empty-state h1 { font-size: 20px; }
  .reasoning { max-width: 100%; }
  .msg-acts { opacity: 1; } /* 触屏无悬停，按钮常显 */
}

/* 小屏微调 */
@media (max-width: 380px) {
  .voice-btn, #btnUpload { display: none; } /* 小屏收起语音/上传按钮，保持输入框空间 */
}
