/* ============================================================
   明明 AI · 暖橙浅色 · 精致版
   ============================================================ */

:root {
  --bg: #fdfaf7;
  --bg-side: #f8f2ea;
  --card: #ffffff;
  --ink: #241c14;
  --ink-2: #5d5245;
  --ink-3: #948674;
  --ink-4: #b8a894;
  --line: #ede3d6;
  --line-soft: #f4ece2;

  --brand: #f97316;
  --brand-2: #ea580c;
  --brand-soft: #fff3e9;
  --brand-line: #ffd9bb;

  --ok: #16a34a;
  --err: #dc2626;

  --shadow-xs: 0 1px 2px rgba(74, 51, 26, .05);
  --shadow-sm: 0 1px 3px rgba(74, 51, 26, .07), 0 4px 12px rgba(74, 51, 26, .04);
  --shadow-md: 0 2px 8px rgba(74, 51, 26, .07), 0 12px 32px rgba(74, 51, 26, .06);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;

  --side-w: 286px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
button:disabled { cursor: default; }

/* ---------------- 登录 ---------------- */

.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(900px 460px at 50% -12%, #ffead7 0%, transparent 62%),
    radial-gradient(600px 300px at 82% 108%, #ffe6d1 0%, transparent 60%),
    var(--bg);
  z-index: 60;
}
.gate[hidden] { display: none; }

.gate-card {
  width: min(94vw, 372px);
  padding: 38px 32px 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.gate-logo { font-size: 36px; line-height: 1; }
.gate-card h1 {
  margin: 14px 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .6px;
}
.gate-sub {
  margin: 0 0 24px;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .2px;
}
.gate-card input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.gate-card input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .1);
}
.gate-card button {
  width: 100%;
  height: 46px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #fb923c, var(--brand));
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(249, 115, 22, .28);
  transition: filter .16s, transform .1s, box-shadow .16s;
}
.gate-card button:hover { filter: brightness(1.05); box-shadow: 0 4px 14px rgba(249,115,22,.34); }
.gate-card button:active { transform: translateY(1px); box-shadow: 0 1px 4px rgba(249,115,22,.3); }
.gate-card button:disabled { opacity: .55; box-shadow: none; }
.gate-err {
  min-height: 17px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--err);
}

/* ---------------- 布局 ---------------- */

.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.app[hidden] { display: none; }

/* ---------------- 侧栏 ---------------- */

.side {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 18px;
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
}
.brand-mark {
  font-size: 18px;
  line-height: 1;
  filter: saturate(1.15);
}
.brand-name {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .4px;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  color: var(--ink-3);
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: #ece2d4; color: var(--ink); }
.side-close { display: none; margin-left: auto; }

.tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #efe6d8;
  border-radius: 12px;
}
.tab {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background .16s, color .16s, box-shadow .16s;
}
.tab:hover { color: var(--ink); }
.tab.active {
  background: var(--card);
  color: var(--brand-2);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label {
  padding-left: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--ink-4);
}

.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px; height: 6px;
  margin-top: -4px;
  border-right: 1.6px solid var(--ink-3);
  border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(45deg);
  pointer-events: none;
}
.select-wrap select, .field select {
  width: 100%;
  height: 39px;
  padding: 0 30px 0 12px;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .16s, box-shadow .16s;
}
.select-wrap select:hover, .field select:hover { border-color: #e2d3bf; }
.select-wrap select:focus, .field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(249,115,22,.1);
}

.hint {
  margin: 0;
  padding-left: 3px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-4);
}

/* 分段选择器 */
.seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #efe6d8;
  border-radius: var(--r-sm);
}
.seg button {
  flex: 1;
  height: 30px;
  font-size: 12px;
  color: var(--ink-2);
  border-radius: 7px;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg button:hover { color: var(--ink); }
.seg button.on {
  background: var(--card);
  color: var(--brand-2);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* 折叠面板 */
.collapse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color .16s, color .16s;
}
.collapse-head:hover { border-color: #e2d3bf; color: var(--ink); }
.caret {
  font-size: 10px;
  color: var(--ink-4);
  transition: transform .18s;
}
.caret.open { transform: rotate(90deg); }

.collapse-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  margin-top: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  animation: slideDown .18s ease-out;
}
.collapse-body[hidden] { display: none; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.collapse-body textarea {
  width: 100%;
  min-height: 70px;
  padding: 9px 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  outline: none;
  resize: vertical;
  transition: border-color .16s;
}
.collapse-body textarea:focus { border-color: var(--brand); }
.collapse-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mini {
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--bg-side);
  border-radius: 7px;
  transition: background .15s, color .15s;
}
.mini:hover { background: #ebe0d0; color: var(--ink); }
.mini-note { font-size: 11px; color: var(--ink-4); }

/* 上游状态 */
.upstreams { display: flex; flex-direction: column; gap: 6px; }
.up-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  font-size: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.up-dot {
  flex: 0 0 auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #cbbbad;
}
.up-dot.on {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.up-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.up-num {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-4);
}

.side-foot {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}
.ghost {
  flex: 1;
  height: 35px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: background .15s, color .15s, border-color .15s;
}
.ghost:hover { background: var(--card); color: var(--ink); border-color: #e2d3bf; }

/* ---------------- 主区 ---------------- */

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  height: 52px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(253, 250, 247, .82);
  backdrop-filter: blur(10px);
}
.menu-btn { display: none; }
.topbar-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .3px;
}
.topbar-meta {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.view {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.view[hidden] { display: none; }

.scroll {
  flex: 1 1 auto;
  min-height: 0;         /* ★ flex 子项必须归零，否则内容撑开就不滚了 */
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 28px 22px 16px;
}

/* 欢迎页 */
.welcome {
  max-width: 620px;
  margin: 7vh auto 0;
  text-align: center;
  animation: fadeUp .4s ease-out;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.welcome-mark {
  font-size: 42px;
  line-height: 1;
  filter: saturate(1.15);
}
.welcome h2 {
  margin: 16px 0 8px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .3px;
}
.welcome p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-3);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 26px;
}
.chip {
  padding: 9px 15px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
  transition: border-color .16s, color .16s, transform .1s, box-shadow .16s;
}
.chip:hover {
  color: var(--brand-2);
  border-color: var(--brand-line);
  box-shadow: 0 2px 10px rgba(249,115,22,.1);
}
.chip:active { transform: scale(.97); }

/* ---------------- 消息 ---------------- */

.msg {
  display: flex;
  gap: 13px;
  max-width: 780px;
  margin: 0 auto 26px;
  animation: fadeUp .25s ease-out;
}
.msg.user { flex-direction: row-reverse; }

.avatar {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-2);
  user-select: none;
}
.msg.user .avatar {
  background: #ece3d6;
  color: var(--ink-2);
}

.bubble {
  min-width: 0;
  max-width: calc(100% - 42px);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.msg.user .bubble {
  padding: 10px 15px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 14px 14px 4px 14px;
  white-space: pre-wrap;
}
.msg.assistant .bubble {
  padding-top: 1px;
  white-space: pre-wrap;
}

/* 思考过程 */
.think {
  max-width: 780px;
  margin: -6px auto 12px;
  padding-left: 41px;
  animation: fadeUp .2s ease-out;
}
.think-box {
  display: inline-block;
  max-width: 100%;
}
.think-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--ink-3);
  background: #f6f0e8;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  transition: background .15s, color .15s;
}
.think-head:hover { background: #f1e8db; color: var(--ink-2); }
.think-head .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 1.3s ease-in-out infinite;
}
.think-head.done .dot { animation: none; opacity: .45; }
@keyframes pulse {
  0%, 100% { opacity: .3; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
.think-body {
  max-height: 340px;
  margin-top: 8px;
  padding: 12px 15px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--ink-3);
  white-space: pre-wrap;
  background: #faf6f0;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.think-body[hidden] { display: none; }

/* 正文格式 */
.bubble code {
  padding: 1.5px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .875em;
  background: #f3ebe0;
  border-radius: 5px;
}
.bubble pre {
  position: relative;
  margin: 12px 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: #2c2620;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.bubble pre code {
  padding: 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: #f2ebe1;
  background: transparent;
}
.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  padding: 3px 9px;
  font-size: 11px;
  color: #b9ab99;
  background: rgba(255,255,255,.08);
  border-radius: 6px;
  opacity: 0;
  transition: opacity .16s, background .16s, color .16s;
}
.bubble pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }

.bubble strong { font-weight: 650; }
.bubble ul, .bubble ol { margin: 8px 0; padding-left: 22px; }
.bubble li { margin: 3px 0; }
.bubble h1, .bubble h2, .bubble h3 {
  margin: 16px 0 8px;
  line-height: 1.4;
  font-weight: 650;
}
.bubble h1 { font-size: 18px; }
.bubble h2 { font-size: 16.5px; }
.bubble h3 { font-size: 15px; }
.bubble a { color: var(--brand-2); text-decoration: none; border-bottom: 1px solid rgba(234,88,12,.3); }
.bubble a:hover { border-bottom-color: var(--brand-2); }

/* 打字光标 */
.streaming .bubble::after {
  content: "";
  display: inline-block;
  width: 2px; height: 15px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--brand);
  border-radius: 1px;
  animation: blink .95s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* 错误 */
.msg-error {
  max-width: 780px;
  margin: 0 auto 20px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.65;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--r-md);
}
.msg-error b { font-weight: 650; }

/* ---------------- 输入区 ---------------- */

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  width: calc(100% - 44px);
  max-width: 820px;
  margin: 0 auto 22px;
  padding: 9px 9px 9px 17px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s;
}
.composer:focus-within {
  border-color: #f8c9a4;
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(249,115,22,.06);
}

.composer textarea {
  flex: 1;
  min-height: 25px;
  max-height: 190px;
  padding: 7px 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  overflow-y: auto;
}
.composer textarea::placeholder { color: var(--ink-4); }

.send-btn {
  flex: 0 0 38px;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #fb923c, var(--brand));
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(249,115,22,.26);
  transition: filter .16s, transform .1s, box-shadow .16s, opacity .16s;
}
.send-btn:hover { filter: brightness(1.06); box-shadow: 0 3px 12px rgba(249,115,22,.34); }
.send-btn:active { transform: scale(.94); }
.send-btn:disabled { opacity: .45; box-shadow: none; filter: none; }

.composer-img { flex-wrap: wrap; }
.img-opts {
  order: -1;
  display: flex;
  gap: 7px;
  width: 100%;
  padding-bottom: 8px;
  margin-bottom: 2px;
  border-bottom: 1px dashed var(--line);
}
.img-opts select {
  height: 29px;
  padding: 0 10px;
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--bg-side);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

/* ---------------- 生图结果 ---------------- */

.img-card {
  max-width: 620px;
  margin: 0 auto 24px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  animation: fadeUp .3s ease-out;
}
.img-card .img-prompt {
  padding: 12px 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg-side);
  border-bottom: 1px solid var(--line-soft);
}
.img-card img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-side);
}
.img-card .img-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 11.5px;
  color: var(--ink-4);
}
.img-card .img-foot a {
  margin-left: auto;
  font-weight: 600;
  color: var(--brand-2);
  text-decoration: none;
}
.img-card .img-foot a:hover { text-decoration: underline; }

.img-loading {
  padding: 44px 20px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}
.spinner {
  width: 26px; height: 26px;
  margin: 0 auto 14px;
  border: 2.5px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Toast ---------------- */

.toast {
  position: absolute;
  left: 50%;
  bottom: 96px;
  z-index: 40;
  max-width: min(88vw, 460px);
  padding: 11px 17px;
  font-size: 13px;
  line-height: 1.55;
  color: #fff;
  background: #3a2f24;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(40,28,16,.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 滚动条 ---------------- */

.scroll::-webkit-scrollbar,
.side::-webkit-scrollbar,
.think-body::-webkit-scrollbar,
.composer textarea::-webkit-scrollbar { width: 7px; height: 7px; }
.scroll::-webkit-scrollbar-track,
.side::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb,
.side::-webkit-scrollbar-thumb,
.think-body::-webkit-scrollbar-thumb,
.composer textarea::-webkit-scrollbar-thumb {
  background: #e6d9c7;
  border-radius: 99px;
}
.scroll::-webkit-scrollbar-thumb:hover,
.side::-webkit-scrollbar-thumb:hover { background: #d8c7b0; }

/* ---------------- 遮罩 ---------------- */

.scrim {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(40, 28, 16, .32);
  backdrop-filter: blur(2px);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  :root { --side-w: 260px; }
  .msg, .think, .msg-error { max-width: 100%; }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr; }

  .side {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    z-index: 30;
    width: min(84vw, 300px);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(40,28,16,.16);
    transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
  }
  .side.open { transform: translateX(0); }
  .side-close { display: grid; }
  .scrim.show { display: block; }

  .menu-btn { display: grid; }
  .topbar { height: 50px; padding: 0 14px; }
  .scroll { padding: 20px 14px 10px; }
  .composer { width: calc(100% - 24px); margin-bottom: 12px; }
  .welcome { margin-top: 4vh; }
  .welcome h2 { font-size: 19px; }
  .msg { gap: 10px; margin-bottom: 22px; }
  .avatar { flex-basis: 26px; width: 26px; height: 26px; font-size: 12px; }
  .bubble { font-size: 14px; }
  .think { padding-left: 36px; }
  .toast { bottom: 88px; }
}

/* ---------------- 会话列表 ---------------- */

.new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 38px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-2);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--r-sm);
  transition: background .15s, box-shadow .15s, transform .1s;
}
.new-chat:hover {
  background: #ffe9d8;
  box-shadow: 0 2px 10px rgba(249,115,22,.12);
}
.new-chat:active { transform: scale(.985); }

.conv-wrap { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.conv-wrap[hidden] { display: none; }
.conv-head {
  padding-left: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--ink-4);
}
.conv-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 2px;
}

.conv-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 28px 8px 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.conv-item:hover { background: #efe5d6; color: var(--ink); }
.conv-item.active {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.conv-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-del {
  position: absolute;
  right: 5px;
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  font-size: 14px;
  line-height: 1;
  color: var(--ink-4);
  border-radius: 5px;
  opacity: 0;
  transition: opacity .14s, background .14s, color .14s;
}
.conv-item:hover .conv-del { opacity: 1; }
.conv-del:hover { background: #f3d4d4; color: var(--err); }

.conv-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--ink-4);
  text-align: center;
}
