/* ============================================================
   ghx-chat 顾淮序 —— 暗色冷调样式
   设计原则：细线边框优先于重阴影、留白克制、线条发丝级
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --bg: #0a0c0f;
  --bg-elev: #101317;
  --panel: #14171c;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #e9ecf0;
  --text-dim: #969ea9;
  --text-faint: #6b727c;
  --accent: #c8d0dc;
  --accent-soft: rgba(200, 208, 220, .13);
  --bubble-user: rgba(200, 208, 220, .10);
  --bubble-ai: #14171c;
  --danger: #f0a6a6;
  --ok: #7fd6b0;
  --radius: 14px;
  --radius-sm: 10px;
  --col: 760px;
  --dur: 180ms;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

/* ---------- 复位 ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.78;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding-left: 1.25em; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.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;
}
::selection { background: rgba(200, 208, 220, .26); }

/* 细滚动条，冷调 */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 应用骨架 ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.col {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* ---------- 启动态 ---------- */
.boot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.boot-mark, .gate-mark, .welcome-mark {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 22px;
  letter-spacing: 0;
}
.boot-mark img, .gate-mark img, .welcome-mark img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.boot-line { color: var(--text-dim); font-size: 13px; }
.boot-mark { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

/* ---------- 登录闸门 ---------- */
.gate {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 16px calc(24px + var(--safe-b));
}
.gate-card {
  width: 100%;
  max-width: 400px;
  padding: 30px 26px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--bg-elev), var(--panel));
  text-align: center;
  animation: rise 320ms ease-out;
}
.gate-mark { margin: 0 auto 16px; }
.gate-title { font-size: 21px; font-weight: 600; letter-spacing: .06em; }
.gate-sub { margin-top: 6px; color: var(--text-dim); font-size: 13px; }
.gate-form { display: flex; gap: 8px; margin-top: 22px; }
.input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.28);
  caret-color: var(--accent);
}
.input::placeholder { color: var(--text-faint); }
.input:focus { border-color: rgba(200,208,220,.5); outline: none; }
.gate-error {
  margin-top: 12px;
  color: var(--danger);
  font-size: 13px;
  text-align: left;
}
.gate-hint { margin-top: 18px; color: var(--text-faint); font-size: 12px; line-height: 1.6; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 主布局 ---------- */
.shell {
  flex: 1;
  display: flex;
  min-height: 0;
}
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  transition: background var(--dur) ease, border-color var(--dur) ease, color var(--dur) ease, transform 120ms ease;
}
.btn:hover { border-color: rgba(200,208,220,.4); color: var(--text); }
.btn:active { transform: scale(.985); }
.btn-primary {
  border-color: transparent;
  background: var(--accent);
  color: #0d1014;
  font-weight: 600;
}
.btn-primary:hover { background: #d8dde5; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(240,166,166,.3); }
.btn-danger:hover { background: rgba(240,166,166,.1); border-color: rgba(240,166,166,.5); }
.btn.wide { width: 100%; margin-top: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  transition: background var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--text); border-color: var(--line); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  padding-top: calc(8px + var(--safe-t));
  background: rgba(10, 12, 15, .72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-mid {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 0 4px;
}
.conv-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-sub {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions { display: flex; align-items: center; gap: 2px; }

/* 连接 / 生成状态 */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  margin-right: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.02);
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.status-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}
.status-pill[data-kind="idle"] .dot { background: var(--ok); }
.status-pill[data-kind="busy"] .dot { background: var(--accent); animation: pulse 1.3s ease-in-out infinite; }
.status-pill[data-kind="sync"] .dot { background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.status-pill[data-kind="offline"] .dot { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@media (max-width: 520px) { .status-text { display: none; } .status-pill { padding: 0 8px; } }

/* ---------- 会话抽屉 ---------- */
.drawer {
  width: 272px;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
  z-index: 40;
  transition: transform var(--dur) ease;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 10px 16px;
  padding-top: calc(14px + var(--safe-t));
}
.brand { font-size: 14px; font-weight: 600; letter-spacing: .12em; color: var(--text); }
.new-conv { margin: 4px 12px 10px; }
.conv-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 12px; }
.conv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-empty { padding: 14px 8px; color: var(--text-faint); font-size: 12px; }
.conv-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  color: var(--text-dim);
  transition: background var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.conv-item:hover { background: rgba(255,255,255,.03); color: var(--text); }
.conv-item[aria-current="true"] {
  background: var(--accent-soft);
  border-color: rgba(200,208,220,.24);
  color: var(--text);
}
.conv-text { flex: 1; min-width: 0; }
.conv-name {
  display: block;
  font-size: 13.5px;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-meta {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-del {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity var(--dur) ease, color var(--dur) ease, background var(--dur) ease;
}
.conv-item:hover .conv-del, .conv-del:focus-visible { opacity: 1; }
.conv-del:hover { color: var(--danger); background: rgba(240,166,166,.1); }
.drawer-foot { padding: 10px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.usage-line { font-size: 11px; line-height: 1.6; color: var(--text-faint); }

/* 遮罩 */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(4, 6, 10, .58);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) ease, visibility var(--dur) ease;
}
.scrim.open { opacity: 1; visibility: visible; }
/* ---------- 消息区 ---------- */
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 12px;
  scroll-behavior: auto;
}
.msg-list { display: flex; flex-direction: column; gap: 15px; padding: 6px 0 4px; }
.load-hint {
  padding: 12px 0 6px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: .06em;
}

.msg { display: flex; align-items: flex-start; gap: 10px; }
.msg-in { animation: msg-in var(--dur) ease-out both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.avatar {
  flex: none;
  width: 28px; height: 28px;
  margin-top: 3px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1;
  user-select: none;
}
.msg-ai .avatar { border-color: rgba(200,208,220,.28); color: var(--accent); }
.avatar { overflow: hidden; }
.avatar-img { display: block; width: 100%; height: 100%; object-fit: cover; }

.msg-wrap { display: flex; flex-direction: column; min-width: 0; max-width: min(84%, 620px); }
.msg-user { flex-direction: row-reverse; }
.msg-user .msg-wrap { align-items: flex-end; }

.msg-body {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bubble-ai);
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* AI 气泡不对称圆角：左下角收窄 */
.msg-ai .msg-body { border-bottom-left-radius: 4px; }
/* 用户气泡：右上收窄 + 淡蓝底色 */
.msg-user .msg-body {
  background: var(--bubble-user);
  border-color: rgba(200,208,220,.2);
  border-bottom-right-radius: 4px;
}
.msg-user .content { white-space: pre-wrap; }
.msg-body.plain { white-space: pre-wrap; }
.msg-body:empty { display: none; }

.msg-time {
  margin: 5px 4px 0;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: .04em;
  opacity: .8;
}

/* 思考过程 */
.reasoning {
  margin: 0 0 9px;
  padding: 7px 11px;
  border-left: 2px solid rgba(200,208,220,.32);
  border-radius: 0 8px 8px 0;
  background: rgba(200,208,220,.05);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}
.reasoning > summary {
  cursor: pointer;
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: .08em;
  list-style: none;
}
.reasoning > summary::-webkit-details-marker { display: none; }
.reasoning > summary::before { content: "▸ "; color: var(--accent); }
.reasoning[open] > summary::before { content: "▾ "; }
.reasoning-text { margin-top: 5px; white-space: pre-wrap; }

/* 流式光标 */
.caret {
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: caret-blink 1.1s steps(1, end) infinite;
}
@keyframes caret-blink { 0%, 55% { opacity: 1; } 55.01%, 100% { opacity: .12; } }
.thinking { color: var(--text-faint); }

/* 气泡内的附加说明（截断 / 中断 / 出错） */
.note {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: .04em;
}
.note-error { color: var(--danger); }

/* ---------- 正文排版（markdown） ---------- */
.content > *:first-child { margin-top: 0; }
.content > *:last-child { margin-bottom: 0; }
.content p { margin: 0 0 .72em; }
.content p:last-child { margin-bottom: 0; }
.content h1, .content h2, .content h3, .content h4 {
  margin: 1.05em 0 .5em;
  font-size: 1.06em;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .04em;
}
.content h1 { font-size: 1.16em; }
.content ul, .content ol { margin: .4em 0 .8em; }
.content li { margin: .18em 0; }
.content li::marker { color: var(--text-faint); }
.content blockquote {
  margin: .6em 0;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line-strong);
  color: var(--text-dim);
}
.content hr { margin: 1em 0; border: 0; border-top: 1px solid var(--line); }
.content code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255,255,255,.06);
  font-family: var(--mono);
  font-size: .88em;
}
.content pre {
  margin: .7em 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0d1219;
  overflow-x: auto;
  line-height: 1.62;
}
.content pre code { padding: 0; background: none; font-size: 12.8px; }
.content table {
  width: 100%;
  margin: .7em 0;
  border-collapse: collapse;
  font-size: 13.5px;
}
.content th, .content td {
  padding: 6px 9px;
  border: 1px solid var(--line);
  text-align: left;
}
.content th { background: rgba(255,255,255,.03); font-weight: 600; }
.content img { max-width: 100%; border-radius: var(--radius-sm); }
.content a { border-bottom: 1px solid rgba(200,208,220,.35); }

/* ---------- 欢迎 / 空态 ---------- */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12vh 8px 24px;
  text-align: center;
  animation: rise 320ms ease-out;
}
.welcome-title { font-size: 17px; font-weight: 600; letter-spacing: .1em; }
.welcome-text { color: var(--text-dim); font-size: 13.5px; max-width: 300px; }

/* 回到最新 */
.scroll-bottom {
  position: absolute;
  right: 18px;
  bottom: 108px;
  z-index: 15;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--text-dim);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
  animation: rise 200ms ease-out;
}
.scroll-bottom:hover { color: var(--accent); border-color: rgba(200,208,220,.4); }

/* ---------- 输入区 ---------- */
.composer {
  position: relative;
  z-index: 18;
  padding: 10px 0 calc(8px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: rgba(10, 13, 18, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.composer-input {
  flex: 1;
  min-width: 0;
  max-height: 200px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(0,0,0,.26);
  color: var(--text);
  line-height: 1.7;
  resize: none;
  overflow-y: auto;
  caret-color: var(--accent);
  transition: border-color var(--dur) ease;
}
.composer-input::placeholder { color: var(--text-faint); }
.composer-input:focus { outline: none; border-color: rgba(200,208,220,.45); }
.composer-side { display: flex; align-items: center; gap: 6px; flex: none; }
.send, .btn-stop {
  width: 42px; height: 42px;
  padding: 0;
  border-radius: var(--radius);
}
.btn-stop {
  border-color: rgba(240,166,166,.4);
  background: rgba(240,166,166,.08);
  color: var(--danger);
}
.btn-stop:hover { background: rgba(240,166,166,.16); }
.composer-hint {
  margin-top: 6px;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: .04em;
}
@media (max-width: 520px) { .composer-hint { display: none; } }

/* 生成本地提示：输入框只读但不失焦样式 */
.composer.streaming .composer-input { border-color: rgba(200,208,220,.3); }

/* ---------- 设置抽屉 ---------- */
.settings {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 45;
  width: min(340px, 88vw);
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--bg-elev);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 220ms cubic-bezier(.22,.61,.36,1), visibility 220ms ease;
}
.settings.open { transform: none; visibility: visible; }
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 12px 18px;
  padding-top: calc(14px + var(--safe-t));
  border-bottom: 1px solid var(--line);
}
.settings-title { font-size: 15px; font-weight: 600; letter-spacing: .1em; }
.settings-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 18px calc(24px + var(--safe-b));
}
.field {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.field:last-child { border-bottom: 0; }
.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12.5px;
  letter-spacing: .08em;
}
.field-value { color: var(--accent); margin-left: 4px; }
.field-hint {
  margin-top: 7px;
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.62;
}
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.field-col { min-width: 0; }
.select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.26);
  color: var(--text);
  appearance: none;
  background-image: none;
}
.select:focus { outline: none; border-color: rgba(200,208,220,.45); }
.range {
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}
.range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,.14);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0a0c0f;
}
.range::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(255,255,255,.14); }
.range::-moz-range-thumb { width: 13px; height: 13px; border: 2px solid #0a0c0f; border-radius: 50%; background: var(--accent); }

/* 开关 */
.switch { flex: none; display: inline-flex; align-items: center; cursor: pointer; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative;
  width: 42px; height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  transition: background var(--dur) ease, border-color var(--dur) ease;
}
.switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform var(--dur) ease, background var(--dur) ease;
}
.switch-input:checked + .switch-track { background: var(--accent-soft); border-color: rgba(200,208,220,.5); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(18px); background: var(--accent); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 气泡提示 ---------- */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-b));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  max-width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(19, 26, 36, .96);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  animation: toast-in 200ms ease-out;
  pointer-events: auto;
  cursor: pointer;
}
.toast-error { border-color: rgba(240,166,166,.42); color: #f8d7d7; }
.toast-ok { border-color: rgba(127,214,176,.4); }
.toast.leaving { animation: toast-out 180ms ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- 响应式 ---------- */
@media (max-width: 899px) {
  .drawer {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    height: 100dvh;
    width: min(290px, 84vw);
    transform: translateX(-102%);
    box-shadow: 0 0 40px rgba(0,0,0,.5);
  }
  .drawer.open { transform: none; }
}
@media (min-width: 900px) {
  #btnMenu, #btnDrawerClose { display: none; }
  .msg-wrap { max-width: min(78%, 620px); }
}
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .col { padding-left: 12px; padding-right: 12px; }
  .msg-wrap { max-width: 88%; }
  .avatar { width: 25px; height: 25px; font-size: 11px; }
  .welcome { padding-top: 9vh; }
}

/* ---------- 无障碍：尊重减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .caret { animation: none !important; opacity: 1 !important; }
  .boot-mark { animation: none !important; opacity: 1 !important; }
}
/* ============================================================
   补丁层：会话行的删除按钮与占位文字
   （结构：li.conv-row > button.conv-item + button.conv-del）
   ============================================================ */
.conv-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.conv-row .conv-item { flex: 1; min-width: 0; }
.conv-row:hover .conv-del,
.conv-row:focus-within .conv-del { opacity: 1; }
.conv-del { width: 28px; height: 28px; }

/* 空内容占位 */
.empty { color: var(--text-faint); }