/* ---------- 主题：Gemini 风格的极简浅色 / 深色 ---------- */
:root {
  --bg: #ffffff;
  --surface: #f0f4f9;
  --surface-2: #e9eef6;
  --text: #1f1f1f;
  --muted: #5f6368;
  --line: #e5e9f0;
  --hover: #eaedf3;
  --accent: #4285f4;
  --accent-soft: #d3e3fd;
  --accent-ink: #0b3d91;
  --shadow: 0 1px 3px rgba(60, 64, 67, .08);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1c1d;
    --surface: #2a2b2e;
    --surface-2: #33353a;
    --text: #e3e3e3;
    --muted: #9aa0a6;
    --line: #3c4043;
    --hover: #303134;
    --accent: #8ab4f8;
    --accent-soft: #33445c;
    --accent-ink: #c2d7ff;
    --shadow: 0 1px 3px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  overflow: hidden;
}

body {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
::selection { background: var(--accent-soft); }

/* 固定定位 + 跟着「可视视口」走：键盘弹起时整体上移，输入框始终贴着键盘，
   不会再出现「界面缩到上面、下面空一大块」的情况 */
.app {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vv-top, 0px);
  display: flex;
  height: 100vh;
  height: var(--vvh, 100dvh);
  overflow: hidden;
}

/* ================= 侧边栏 ================= */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 272px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: calc(10px + var(--safe-t)) 10px calc(10px + var(--safe-b));
  transform: translateX(-102%);
  transition: transform .28s cubic-bezier(.32, .72, .28, 1);
  z-index: 30;
}
.sidebar.on { transform: none; }

.side-top { padding: 2px 0 4px; }
.new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  transition: background .15s;
}
.new-chat:hover { background: var(--surface-2); }
.new-chat span { font-size: 16px; line-height: 1; color: var(--muted); }

.side-label {
  font-size: 11px;
  color: var(--muted);
  padding: 18px 12px 6px;
  letter-spacing: .04em;
}

.chat-list {
  list-style: none;
  margin: 0;
  padding: 0 2px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.chat-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}
.chat-list li:hover, .chat-list li.on { background: var(--hover); }
.chat-list li .tt {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chat-list li .del {
  opacity: 0;
  color: var(--muted);
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 6px;
}
.chat-list li:hover .del { opacity: 1; }
.chat-list li .del:hover { background: var(--line); color: var(--text); }
.chat-list .none {
  justify-content: center;
  font-size: 12.5px;
  color: var(--muted);
  padding: 26px 0;
  cursor: default;
}
.chat-list .none:hover { background: none; }

.side-bottom {
  padding: 8px 2px 0;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}
.side-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text);
}
.side-item:hover { background: var(--hover); }
.side-note {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 12px 2px;
  opacity: .85;
}

/* ================= 主区域 ================= */
.main {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background:
    radial-gradient(120% 55% at 50% 100%, rgba(213, 227, 253, .55) 0%, rgba(255, 255, 255, 0) 72%),
    var(--bg);
}

/* 自定义聊天背景：图片单独一层，用浓度控制不透明度，保证字还看得清 */
.main::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bg-img, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--bg-op, .35);
  pointer-events: none;
  z-index: 0;
}
@media (prefers-color-scheme: dark) {
  .main {
    background:
      radial-gradient(120% 55% at 50% 100%, rgba(60, 88, 130, .35) 0%, rgba(27, 28, 29, 0) 72%),
      var(--bg);
  }
}

.topbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: calc(8px + var(--safe-t)) 10px 8px;
  background: transparent;
  position: relative;
  z-index: 5;
}
.brand {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.25;
}
.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.brand-avatar {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background-image: var(--avatar, none), linear-gradient(135deg, #4f8cff, #9b6bff);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  user-select: none;
}
html.has-avatar .brand-avatar,
html.has-avatar .avatar,
html.has-avatar .avatar-preview { color: transparent; }

/* 头像上传区 */
.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.avatar-preview {
  width: 64px; height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  background-image: var(--avatar, none), linear-gradient(135deg, #4f8cff, #9b6bff);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  user-select: none;
}
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.profile-actions .btn {
  padding: 10px 14px;
  font-size: 13.5px;
}
.brand-name { font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.brand-status { font-size: 11px; color: var(--muted); margin-top: 1px; }
.brand-status.typing { color: var(--accent); }

.icon-btn {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  transition: background .15s;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { background: var(--surface-2); }

/* ================= 消息流 ================= */
.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.thread {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 18px 8px;
  scrollbar-width: thin;
}
.thread::-webkit-scrollbar { width: 8px; }
.thread::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.thread::-webkit-scrollbar-track { background: transparent; }

.row {
  width: 100%;
  max-width: 760px;
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  align-items: flex-start;
}
.row.me { justify-content: flex-end; }

.col {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}
.row.me .col { align-items: flex-end; max-width: 82%; }

/* Gemini 的回复默认是纯文本；设了自定义头像之后才显示小头像 */
.avatar {
  display: none;
  width: 26px; height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background-image: var(--avatar, none), linear-gradient(135deg, #4f8cff, #9b6bff);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  margin-top: 3px;
  user-select: none;
}
html.has-avatar .row.ai .avatar { display: grid; }

.bubble {
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}
.row.ai .bubble {
  font-size: 16px;
  line-height: 1.78;
  padding: 1px 0;
}
.row.me .bubble {
  background: var(--surface);
  padding: 11px 16px;
  border-radius: 22px;
  border-bottom-right-radius: 6px;
  font-size: 16px;
  line-height: 1.6;
}

.bubble p { margin: 0 0 .7em; }
.bubble p:last-child { margin-bottom: 0; }
.bubble strong { font-weight: 600; }
.bubble code {
  background: var(--surface);
  padding: 1.5px 5px;
  border-radius: 6px;
  font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.bubble pre.code {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  margin: 8px 0;
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 图片 */
.shot-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 8px;
  max-width: 100%;
}
.row.me .shot {
  display: block;
  max-width: 240px;
  max-height: 240px;
  border-radius: 20px;
  object-fit: cover;
}
.shot-save {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.shot-save:active { background: rgba(0, 0, 0, .7); }

/* AI 生成的图片 */
.gen-shot {
  display: block;
  max-width: min(340px, 100%);
  border-radius: 18px;
  margin-top: 12px;
  background: var(--surface);
}
.gen-fail {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  display: inline-block;
}
.gen-redo {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  align-self: flex-start;
}
.gen-redo:hover { background: var(--surface-2); color: var(--text); }

/* 图表 */
.chart {
  margin-top: 12px;
  padding: 12px 14px 8px;
  background: var(--surface);
  border-radius: 16px;
  max-width: 360px;
}
.chart-title {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.chart-svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .chart-dot { fill: var(--accent); }
.chart .chart-bar { fill: var(--accent); opacity: .82; }
.chart .chart-label { font-size: 8.5px; fill: var(--muted); }
.chart .chart-val {
  font-size: 9px;
  font-weight: 600;
  fill: var(--text);
  opacity: .55;
}

.pie-wrap { display: flex; align-items: center; gap: 16px; }
.pie {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  flex: 0 0 96px;
}
.legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text);
}
.legend-row i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}

/* 参考来源 */
.sources {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 100%;
}
.sources .s-label {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.sources a {
  font-size: 12.5px;
  color: var(--accent);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sources a:hover { text-decoration: underline; }

/* 消息下方的小操作 */
.acts {
  display: flex;
  gap: 2px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity .15s;
}
.row:hover .acts { opacity: 1; }
.acts button {
  font-size: 12.5px;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
}
.acts button:hover { background: var(--hover); color: var(--text); }

/* 思考过程：Gemini 那种小胶囊 */
.think {
  display: inline-block;
  margin-bottom: 10px;
  background: var(--surface);
  border-radius: 14px;
  padding: 7px 12px;
  max-width: 100%;
}
.think[hidden] { display: none; }
.think summary {
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.think summary::-webkit-details-marker { display: none; }
.think summary::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .7;
}
.think-body {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
  line-height: 1.6;
}

/* 等待中的三点 */
.dots { display: inline-flex; gap: 5px; padding: 8px 0; }
.dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .5;
  animation: blink 1.3s infinite;
}
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink {
  0%, 60%, 100% { opacity: .28; transform: translateY(0); }
  30% { opacity: .95; transform: translateY(-2px); }
}

/* ================= 空状态 ================= */
.empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 28px 96px;
  text-align: center;
  pointer-events: none;
}
.empty[hidden] { display: none; }

.sparkle {
  width: 46px;
  height: 46px;
  margin-bottom: 22px;
}

.hello {
  margin: 0;
  font-size: 31px;
  font-weight: 500;
  line-height: 1.34;
  letter-spacing: -.022em;
  color: var(--text);
}
.hello br { display: block; }

.hello-sub {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 26px;
  pointer-events: auto;
}
.chip {
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  transition: background .15s;
}
.chip:hover { background: var(--surface-2); }
.chip:active { background: var(--line); }

/* ================= 输入区 ================= */
.composer-wrap {
  position: relative;
  z-index: 1;
  padding: 6px 14px calc(8px + var(--safe-b));
}
.composer {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 28px;
  padding: 5px 6px;
  transition: box-shadow .18s, background .18s;
}
.composer:focus-within {
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.crow {
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  resize: none;
  font-size: 16px;
  line-height: 1.45;
  padding: 9px 6px 9px 4px;
  max-height: 160px;
}
.composer textarea::placeholder { color: var(--muted); }

.cbtn {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  margin-bottom: 3px;
  transition: background .15s, color .15s;
}
.cbtn:hover { background: var(--hover); color: var(--text); }
.cbtn.rec {
  background: #e5484d;
  color: #fff;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(229, 72, 77, .16); } }

.web-btn {
  width: auto;
  flex: 0 0 auto;
  padding: 0 10px;
  gap: 4px;
}
.web-btn span {
  display: inline;
  font-size: 12px;
}
.web-btn.on {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 500;
}

.csend {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  margin-bottom: 1px;
  transition: background .15s, color .15s, transform .12s;
}
.csend.ready, .csend.stop {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.csend:active { transform: scale(.94); }

.footnote {
  max-width: 760px;
  margin: 10px auto 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  opacity: .85;
}

/* 待发送的图片 */
.attach { padding: 4px 6px 2px; }
.thumb { position: relative; width: 64px; height: 64px; }
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
.thumb-x {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
}

/* 不能真用 display:none，iOS 上那样点不开选择器 */
.file-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ================= 设置面板 ================= */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .32);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
  z-index: 25;
}
.scrim.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: 90vh;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -6px 34px rgba(0, 0, 0, .12);
  transform: translateY(102%);
  transition: transform .3s cubic-bezier(.32, .72, .28, 1);
  z-index: 41;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-b);
}
.sheet.on { transform: translateY(0); }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  flex: 0 0 auto;
}
.sheet-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.01em;
}
.sheet-head .x {
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  padding: 4px 2px;
}
.sheet-body {
  padding: 6px 20px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.field { margin-bottom: 20px; }
.field > label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}
.field > label b { color: var(--accent); font-weight: 600; }
.field .tip {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.55;
}
.field .tip.ok { color: #1a9e5c; }
.field .tip.bad { color: #d94a4a; }

.field input[type="text"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  background: var(--bg);
}
.field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.6;
  font-size: 14px;
}

.row-2 { display: flex; gap: 12px; }
.row-2 > * { flex: 1; min-width: 0; }

.mini { font-size: 12.5px; color: var(--muted); }

.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: background .15s, color .15s;
}
.preset:hover { background: var(--surface-2); }
.preset.on {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row b {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  min-width: 32px;
  text-align: right;
}
input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  padding: 0;
  border: 0;
  background: transparent;
  min-width: 0;
}

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; width: 46px; height: 27px; flex: 0 0 46px; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch span {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  border-radius: 20px;
  transition: background .2s;
  pointer-events: none;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .2s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(19px); }

.sheet-actions { display: flex; gap: 10px; margin-top: 6px; }

.backup-link {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}

.version {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  opacity: .85;
}
.btn {
  padding: 13px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  flex: 1;
  transition: opacity .15s, background .15s;
}
.btn:active { opacity: .82; }
.btn.primary { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.btn.ghost { background: var(--surface); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.full { width: 100%; flex: none; }

/* ================= toast ================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + var(--safe-b));
  transform: translate(-50%, 10px);
  max-width: 86vw;
  background: #303134;
  color: #fff;
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 60;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ================= 响应式 ================= */
.only-mobile { display: none; }

@media (hover: none) {
  .acts { opacity: 1; }
  .chat-list li .del { opacity: .5; }
}

@media (min-width: 900px) {
  .only-mobile { display: none; }
  .sidebar {
    position: relative;
    transform: none;
    width: 268px;
    flex: 0 0 268px;
  }
  .scrim { display: none; }
  .thread { padding: 22px 28px 16px; }
  .composer-wrap { padding-bottom: calc(16px + var(--safe-b)); }
  .hello { font-size: 36px; }
  .sparkle { width: 54px; height: 54px; }

  .sheet {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 580px;
    max-height: 86vh;
    border-radius: 28px;
    transform: translate(-50%, -46%);
    opacity: 0;
    pointer-events: none;
  }
  .sheet.on {
    transform: translate(-50%, -50%);
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 899px) {
  .only-mobile { display: grid; }
}

@media (max-width: 420px) {
  .hello { font-size: 27px; }
  .thread { padding: 12px 16px 8px; }
  .row.me .col { max-width: 86%; }
  .composer-wrap { padding-left: 10px; padding-right: 10px; }
}
