/* =========================================================
   青玉智枢 · 工作台（对标专业 AI 对话应用）
   左栏对话管理 + 居中消息流 + 沉浸输入区
   ========================================================= */

:root {
  --crimson: #a5121e;
  --crimson-deep: #7d0b15;
  --crimson-wash: #f7eceb;
  --gold: #b98a3c;
  --gold-soft: #d3a05f;

  --ink: #17130f;
  --ink-70: #4b423b;
  --ink-50: #7a716a;
  --ink-30: #a9a099;

  --paper: #fbf8f2;
  --paper-2: #f5f0e7;
  --white: #fffdfa;

  --line: rgba(23, 19, 15, .10);
  --line-strong: rgba(23, 19, 15, .18);

  --serif: "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;

  --ease: cubic-bezier(.22, .8, .26, .99);
  --side-w: 268px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--crimson); color: #fff; }

.mobile-only { display: none; }

/* ============ 布局 ============ */
/* fixed+inset 替代 100dvh：老 WebView 不支持 dvh 时整页高度不会塌陷 */
.shell { position: fixed; inset: 0; display: flex; }

/* ============ 侧栏 ============ */
.side {
  width: var(--side-w); flex: none;
  display: flex; flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.side-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 10px 18px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand img { width: 30px; height: 30px; border-radius: 6px; }
.brand-name { font-size: 16.5px; font-weight: 700; letter-spacing: .16em; }

.side-collapse, .tb-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: none; border: none; color: var(--ink-30);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.side-collapse:hover, .tb-icon:hover { background: var(--paper-2); color: var(--ink); }

.new-chat {
  margin: 6px 14px 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px;
  border-radius: 11px;
  border: 1px solid rgba(165, 18, 30, .35);
  background: var(--white);
  color: var(--crimson);
  font-size: 14px; font-weight: 600; letter-spacing: .12em;
  transition: background .25s, box-shadow .25s, transform .25s var(--ease);
}
.new-chat:hover {
  background: var(--crimson); color: #fff;
  box-shadow: 0 8px 20px -8px rgba(165, 18, 30, .5);
  transform: translateY(-1px);
}

.side-scroll { flex: 1; overflow-y: auto; padding: 4px 14px; min-height: 0; }

.side-label {
  font-size: 10.5px; letter-spacing: .34em; color: var(--ink-30);
  padding: 8px 6px 6px;
}

.conv-list { display: flex; flex-direction: column; gap: 2px; }

.conv {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  background: none; border: none;
  padding: 9px 10px; border-radius: 9px;
  font-size: 13.5px; color: var(--ink-70); line-height: 1.5;
  transition: background .2s, color .2s;
}
.conv svg { flex: none; opacity: .5; }
.conv span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.conv:hover { background: var(--paper-2); }
.conv.on {
  background: var(--crimson-wash); color: var(--crimson-deep); font-weight: 600;
}
.conv.on svg { opacity: .9; }
.conv .conv-del {
  position: absolute; right: 6px;
  width: 22px; height: 22px; border-radius: 6px;
  border: none; background: none; color: var(--ink-30);
  display: none; align-items: center; justify-content: center;
}
.conv:hover .conv-del { display: inline-flex; }
.conv .conv-del:hover { color: var(--crimson); background: rgba(165, 18, 30, .08); }

.conv-empty {
  padding: 14px 8px; font-size: 12.5px; color: var(--ink-30); line-height: 1.8;
}

/* ---- 额度卡 ---- */
.side-bottom { padding: 12px 14px 14px; border-top: 1px solid var(--line); }

.quota-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 14px 12px;
  margin-bottom: 12px;
}
.qc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.qc-title {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; letter-spacing: .26em; color: var(--ink-50);
}
.qc-title svg { color: var(--gold); }
.qc-refresh {
  width: 24px; height: 24px; border: none; border-radius: 6px;
  background: none; color: var(--ink-30);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .2s, transform .5s var(--ease);
}
.qc-refresh:hover { color: var(--crimson); transform: rotate(180deg); }

.qc-loading { font-size: 12px; color: var(--ink-30); padding: 4px 0; }

.qc-item { padding: 5px 0; }
.qc-item + .qc-item { border-top: 1px dashed var(--line); margin-top: 5px; padding-top: 9px; }
.qi-head { display: flex; align-items: baseline; justify-content: space-between; }
.qi-head b { font-size: 12.5px; letter-spacing: .05em; }
.qi-remain { font-size: 12px; color: var(--crimson); font-weight: 700; }
.qi-bar {
  height: 4px; border-radius: 3px; margin: 6px 0 4px;
  background: var(--paper-2); overflow: hidden;
}
.qi-bar i { display: block; height: 100%; border-radius: 3px; background: var(--crimson); transition: width .6s var(--ease); }
.qi-bar i.warn { background: var(--gold); }
.qi-bar i.ok { background: #2b6b5c; }
.qi-foot { font-size: 10.5px; color: var(--ink-30); letter-spacing: .04em; }
.qi-foot .exhausted { color: var(--crimson); font-weight: 600; }

.qc-empty { font-size: 12px; color: var(--ink-30); line-height: 1.8; padding: 2px 0; }

.qc-buy {
  margin-top: 10px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: none; color: var(--ink-70);
  font-size: 12.5px; letter-spacing: .14em;
  transition: background .25s, color .25s, border-color .25s;
}
.qc-buy:hover { background: var(--crimson); border-color: var(--crimson); color: #fff; }

/* ---- 用户 ---- */
.user-row { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  background: var(--crimson); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.user-meta { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.user-meta strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout {
  margin-left: auto; border: none; background: none;
  font-size: 11.5px; color: var(--ink-30); letter-spacing: .1em;
  transition: color .2s;
}
.logout:hover { color: var(--crimson); }

.side-mask {
  display: none; position: fixed; inset: 0; z-index: 210;
  background: rgba(23, 19, 15, .4); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
body.side-open .side-mask { opacity: 1; pointer-events: auto; }

/* ============ 主区 ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--white); }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 58px; flex: none;
  border-bottom: 1px solid var(--line);
}
.tb-title {
  font-size: 14.5px; font-weight: 600; letter-spacing: .06em;
  color: var(--ink-70);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 46%;
}
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-quota {
  font-size: 11.5px; letter-spacing: .08em; color: var(--ink-30);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px;
}
.tb-quota b { color: var(--crimson); font-weight: 700; }

/* ============ 对话区 ============ */
.chat { flex: 1; overflow-y: auto; min-height: 0; scroll-behavior: smooth; }

/* ---- 空状态 ---- */
/* 上下弹性占位替代 justify-content:center：内容超高时顶部不会被裁掉 */
.empty {
  min-height: 100%; display: flex; flex-direction: column;
  align-items: center;
  padding: 24px 24px 110px;
  animation: fadeUp .8s var(--ease);
}
.empty::before, .empty::after { content: ""; flex: 1 0 0; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.empty-seal {
  width: 62px; height: 62px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(165, 18, 30, .5); border-radius: 14px;
  color: var(--crimson); font-size: 30px; font-weight: 900;
  transform: rotate(-4deg);
  margin-bottom: 26px;
  box-shadow: 0 14px 34px -14px rgba(165, 18, 30, .35);
}
.empty h1 {
  margin: 0 0 34px;
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 900; letter-spacing: .1em;
}

.sug-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; width: 100%; max-width: 620px; }
.sug {
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 13.5px; color: var(--ink-70); line-height: 1.6;
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
}
.sug:hover {
  border-color: rgba(165, 18, 30, .35);
  box-shadow: 0 10px 26px -12px rgba(165, 18, 30, .25);
  transform: translateY(-2px);
}
.sug em {
  flex: none; font-style: normal;
  font-size: 11px; letter-spacing: .1em;
  color: var(--crimson);
  background: var(--crimson-wash);
  border-radius: 6px; padding: 3px 8px;
}

/* ---- 消息流 ---- */
.stream {
  max-width: 760px; margin: 0 auto;
  padding: 30px 24px 40px;
  display: flex; flex-direction: column; gap: 26px;
}

.msg { animation: fadeUp .5s var(--ease); }

.msg.user { display: flex; justify-content: flex-end; }
.msg.user .u-bubble {
  max-width: 82%;
  background: var(--crimson-wash);
  border: 1px solid rgba(165, 18, 30, .16);
  color: var(--ink);
  border-radius: 14px 4px 14px 14px;
  padding: 11px 16px;
  font-size: 15px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word;
}

.msg.ai { display: flex; gap: 13px; align-items: flex-start; }
.msg.ai .avatar {
  width: 30px; height: 30px; font-size: 13px; border-radius: 8px;
  margin-top: 3px;
}
.ai-body { flex: 1; min-width: 0; }

/* Markdown 排版 */
.md { font-size: 15.5px; line-height: 1.95; word-break: break-word; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h1, .md h2, .md h3, .md h4 { margin: 20px 0 10px; font-weight: 900; letter-spacing: .04em; line-height: 1.5; }
.md h1 { font-size: 21px; } .md h2 { font-size: 19px; } .md h3 { font-size: 17px; } .md h4 { font-size: 15.5px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 24px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--crimson); }
.md strong { font-weight: 700; }
.md blockquote {
  margin: 12px 0; padding: 8px 16px;
  border-left: 2.5px solid var(--crimson);
  background: var(--paper); color: var(--ink-70);
  border-radius: 0 8px 8px 0;
}
.md code {
  font-family: "Noto Sans Mono CJK SC", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 5px; padding: 1.5px 6px;
}
.md pre {
  margin: 12px 0; padding: 14px 16px;
  background: #201a16; color: #f0e9df;
  border-radius: 10px; overflow-x: auto;
  font-size: 13px; line-height: 1.7;
}
.md pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
.md table { border-collapse: collapse; margin: 12px 0; width: 100%; font-size: 13.5px; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 12px; text-align: left; }
.md th { background: var(--paper-2); font-weight: 700; letter-spacing: .05em; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* 流式光标 */
.stream-caret {
  display: inline-block; width: 8px; height: 1.05em;
  background: var(--crimson); vertical-align: -.18em; margin-left: 2px;
  animation: blink 1s steps(1) infinite;
  border-radius: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

.thinking { display: inline-flex; gap: 5px; padding: 8px 0; }
.thinking i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--crimson);
  opacity: .35; animation: th 1.2s ease-in-out infinite;
}
.thinking i:nth-child(2) { animation-delay: .18s; }
.thinking i:nth-child(3) { animation-delay: .36s; }
@keyframes th { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.ai-error {
  border: 1px solid rgba(165, 18, 30, .3);
  background: var(--crimson-wash);
  color: var(--crimson-deep);
  border-radius: 10px; padding: 12px 16px;
  font-size: 14px;
}

.msg-meta {
  margin-top: 10px;
  font-size: 11px; letter-spacing: .12em; color: var(--ink-30);
  display: flex; align-items: center; gap: 6px;
}
.msg-meta::before {
  content: ""; width: 14px; height: 1px; background: var(--line-strong);
}

/* ============ 输入区 ============ */
.composer-zone { flex: none; padding: 6px 24px calc(14px + env(safe-area-inset-bottom)); }

.composer {
  max-width: 760px; margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 6px 30px -14px rgba(23, 19, 15, .18);
  transition: border-color .3s, box-shadow .3s;
}
.composer:focus-within {
  border-color: rgba(165, 18, 30, .45);
  box-shadow: 0 10px 36px -14px rgba(165, 18, 30, .3);
}

#input {
  display: block; width: 100%;
  border: none; outline: none; resize: none;
  background: none;
  font-family: inherit; font-size: 15.5px; line-height: 1.75;
  color: var(--ink);
  padding: 15px 18px 4px;
  max-height: 180px;
}
#input::placeholder { color: var(--ink-30); }

.composer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px 10px 12px;
}
.cb-left, .cb-right { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* 模型选择 */
.model-pick { position: relative; }
.model-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; background: none;
  padding: 7px 10px; border-radius: 9px;
  font-size: 13px; letter-spacing: .06em; color: var(--ink-70);
  transition: background .2s, color .2s;
}
.model-btn:hover, .model-pick.open .model-btn { background: var(--paper-2); color: var(--ink); }
.model-btn svg:first-child { color: var(--crimson); }
.model-btn #modelName { font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.model-menu {
  position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 60;
  min-width: 230px;
  background: var(--white);
  border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 24px 50px -20px rgba(23, 19, 15, .35);
  padding: 6px;
  animation: menuIn .25s var(--ease);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.model-menu button {
  width: 100%; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: none; background: none;
  padding: 10px 12px; border-radius: 9px;
  font-size: 13.5px; color: var(--ink-70);
  transition: background .15s;
}
.model-menu button:hover { background: var(--paper-2); }
.model-menu button b { font-weight: 600; letter-spacing: .05em; }
.model-menu button small { font-size: 10.5px; color: var(--ink-30); letter-spacing: .08em; }
.model-menu button.on { background: var(--crimson-wash); color: var(--crimson-deep); }
.model-menu button.on .ck { color: var(--crimson); }
.model-menu .ck { visibility: hidden; }
.model-menu button.on .ck { visibility: visible; }

.draft-note {
  font-size: 11px; color: var(--ink-30); letter-spacing: .06em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.send-btn {
  width: 38px; height: 38px; flex: none;
  border: none; border-radius: 12px;
  background: var(--crimson); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px -6px rgba(165, 18, 30, .55);
  transition: background .25s, transform .25s var(--ease), opacity .25s, box-shadow .25s;
}
.send-btn:hover:not(:disabled) { background: var(--crimson-deep); transform: translateY(-2px); }
.send-btn:active:not(:disabled) { transform: none; }
.send-btn:disabled { opacity: .35; box-shadow: none; cursor: default; }

.foot-note {
  margin: 10px 0 0; text-align: center;
  font-size: 11px; letter-spacing: .18em; color: var(--ink-30);
}

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 110px; z-index: 400;
  transform: translate(-50%, 16px);
  background: rgba(23, 19, 15, .92); color: #f5f0e7;
  font-size: 13px; letter-spacing: .08em;
  padding: 10px 20px; border-radius: 999px;
  box-shadow: 0 16px 40px -12px rgba(23, 19, 15, .5);
  opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
  max-width: 80vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="ok"] { background: rgba(23, 66, 56, .94); }
.toast[data-kind="err"] { background: rgba(125, 11, 21, .94); }

/* ============ 购买弹窗 ============ */
.modal-mask[hidden] { display: none; }
.modal-mask {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(23, 19, 15, .45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: maskIn .25s;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 480px;
  background: var(--white); border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 40px 100px -30px rgba(23, 19, 15, .5);
  overflow: hidden;
  animation: modalIn .35s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .12em; }
.modal-close {
  width: 30px; height: 30px; border: none; border-radius: 8px;
  background: none; color: var(--ink-30);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.modal-close:hover { background: var(--paper-2); color: var(--ink); }
.modal-body { padding: 20px 22px 24px; }
.modal-tip { margin: 0 0 16px; font-size: 13px; color: var(--ink-50); line-height: 1.8; }
.modal-loading { font-size: 13px; color: var(--ink-30); padding: 12px 0; }

.pkg-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.pkg {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 13px 15px; cursor: pointer;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.pkg:hover { border-color: rgba(165, 18, 30, .4); }
.pkg:has(input:checked) {
  border-color: var(--crimson);
  background: var(--crimson-wash);
  box-shadow: 0 8px 22px -12px rgba(165, 18, 30, .35);
}
.pkg input { margin-top: 5px; accent-color: var(--crimson); }
.pkg-main b { display: block; font-size: 14.5px; letter-spacing: .08em; }
.pkg-main span { display: block; font-size: 12px; color: var(--ink-50); margin-top: 2px; }
.pkg-meta { margin-top: 6px; font-size: 12px; color: var(--crimson); font-weight: 700; letter-spacing: .04em; }

.btn-block {
  width: 100%;
  border: none; border-radius: 12px;
  background: var(--crimson); color: #fff;
  font-size: 15px; font-weight: 600; letter-spacing: .2em;
  padding: 13px;
  transition: background .25s, transform .25s var(--ease);
}
.btn-block:hover { background: var(--crimson-deep); transform: translateY(-1px); }

/* ============ 模型选择面板 ============ */
.mp-mask { align-items: flex-end; padding: 0; }
.mp-modal {
  max-width: none; width: 100%;
  border-radius: 20px 20px 0 0;
  max-height: 82dvh;
  display: flex; flex-direction: column;
  animation: sheetUp .35s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.mp-head { padding: 16px 20px 12px; }
.mp-list {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 4px 14px 10px;
  display: flex; flex-direction: column; gap: 7px;
}
.mp-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--white);
  border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 14px;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.mp-item:hover { border-color: rgba(165, 18, 30, .35); box-shadow: 0 8px 22px -12px rgba(165, 18, 30, .2); }
.mp-item.on { border-color: var(--crimson); background: var(--crimson-wash); }
.mp-badge {
  width: 40px; height: 40px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  font-size: 17px; font-weight: 900;
  background: hsl(var(--h), 48%, 95%);
  color: hsl(var(--h), 55%, 34%);
  border: 1px solid hsl(var(--h), 45%, 86%);
  transform: rotate(-3deg);
}
.mp-main { flex: 1; min-width: 0; }
.mp-main b { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: .05em; }
.mp-main small {
  display: block; margin-top: 2px;
  font-size: 11px; color: var(--ink-30); letter-spacing: .04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-rate {
  flex: none;
  font-size: 13.5px; font-weight: 700; color: var(--gold);
  border: 1px solid rgba(185, 138, 60, .35);
  background: rgba(211, 160, 95, .1);
  border-radius: 8px; padding: 3px 9px;
  letter-spacing: .02em;
}
.mp-rate i { font-style: normal; font-size: 10.5px; margin-left: 1px; }
.mp-ck { flex: none; color: var(--crimson); visibility: hidden; }
.mp-item.on .mp-ck { visibility: visible; }
.mp-foot {
  flex: none;
  padding: 10px 20px calc(12px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11px; letter-spacing: .14em; color: var(--ink-30);
  border-top: 1px solid var(--line);
}
@media (min-width: 701px) {
  .mp-mask { align-items: center; padding: 20px; }
  .mp-modal {
    max-width: 470px; width: 100%;
    border-radius: 18px;
    max-height: 78vh;
    animation: modalIn .35s var(--ease);
  }
  .mp-list { max-height: 56vh; }
}

/* ============ 滚动条 ============ */
.chat::-webkit-scrollbar, .side-scroll::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-thumb, .side-scroll::-webkit-scrollbar-thumb {
  background: rgba(23, 19, 15, .14); border-radius: 4px; border: 2px solid transparent; background-clip: content-box;
}
.chat::-webkit-scrollbar-thumb:hover, .side-scroll::-webkit-scrollbar-thumb:hover { background-color: rgba(165, 18, 30, .3); }
.chat::-webkit-scrollbar-track, .side-scroll::-webkit-scrollbar-track { background: transparent; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .mobile-only { display: inline-flex; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 220;
    transform: translateX(-100%);
    transition: transform .35s var(--ease);
    box-shadow: 0 0 60px rgba(23, 19, 15, .25);
    width: 300px;
  }
  body.side-open .side { transform: none; }
  .side-mask { display: block; }
  .tb-title { max-width: 56%; }
  .stream { padding: 22px 16px 30px; }
  .composer-zone { padding: 4px 14px calc(12px + env(safe-area-inset-bottom)); }
  .sug-grid { grid-template-columns: 1fr; }
  .msg.user .u-bubble { max-width: 92%; }
  .tb-quota { display: none; }
  .empty h1 { margin-bottom: 22px; font-size: 26px; }
  .empty-seal { margin-bottom: 18px; }
}

@media (max-width: 480px) {
  .brand-name { display: none; }
  .side { width: 84vw; }
  .model-btn #modelName { max-width: 84px; }
  .draft-note { display: none; }
}
