/* ============ 消费政策智能体 · 暖纸 × 朱砂 ============ */

:root {
  --bg: #FBFAF8;
  --surface: #FFFFFF;
  --surface-2: #F4F2EE;
  --surface-3: #ECE9E3;
  --ink: #201E1B;
  --ink-2: #625E57;
  --ink-3: #9B958B;
  --line: #E9E6E0;
  --line-strong: #D9D5CC;
  --accent: #B23A2A;
  --accent-deep: #962F22;
  --accent-soft: #F6E8E5;
  --accent-wash: #FAF1EF;
  --accent-contrast: #FFFFFF;
  --ok: #3E8B60;
  --warn: #A8761F;
  --shadow: 0 1px 2px rgba(43, 36, 26, .04), 0 6px 24px rgba(43, 36, 26, .06);
  --shadow-lg: 0 8px 24px rgba(43, 36, 26, .10), 0 32px 80px rgba(43, 36, 26, .16);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171512;
    --surface: #1E1C18;
    --surface-2: #24211D;
    --surface-3: #2C2823;
    --ink: #ECE9E4;
    --ink-2: #A8A399;
    --ink-3: #736D62;
    --line: #2B2823;
    --line-strong: #3B372F;
    --accent: #D9695A;
    --accent-deep: #E37E6F;
    --accent-soft: #3B2723;
    --accent-wash: #2C211E;
    --accent-contrast: #FFF8F6;
    --ok: #5CBF8A;
    --warn: #D8A252;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .32);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .42), 0 32px 80px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --bg: #171512;
  --surface: #1E1C18;
  --surface-2: #24211D;
  --surface-3: #2C2823;
  --ink: #ECE9E4;
  --ink-2: #A8A399;
  --ink-3: #736D62;
  --line: #2B2823;
  --line-strong: #3B372F;
  --accent: #D9695A;
  --accent-deep: #E37E6F;
  --accent-soft: #3B2723;
  --accent-wash: #2C211E;
  --accent-contrast: #FFF8F6;
  --ok: #5CBF8A;
  --warn: #D8A252;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .32);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .42), 0 32px 80px rgba(0, 0, 0, .5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

#app { display: flex; height: 100vh; overflow: hidden; }

/* ============ 侧栏 ============ */
#sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 22px 14px 14px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark {
  position: relative;
  width: 36px; height: 36px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 9px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 30%, transparent);
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 3px;
  border: 1px solid color-mix(in srgb, var(--accent-contrast) 45%, transparent);
  border-radius: 6px;
  pointer-events: none;
}
.brand-text h1 { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.brand-text p { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.btn-new {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 0;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  transition: background .15s;
}
.btn-new:hover { background: var(--surface-2); }

.session-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 2px; }
.session-item {
  display: flex; align-items: center;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap; overflow: hidden;
  transition: background .12s, color .12s;
}
.session-item:hover { background: var(--surface-2); }
.session-item.active { background: var(--surface-3); color: var(--ink); font-weight: 500; }
.session-item .s-title { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.session-item .s-del {
  opacity: 0; flex-shrink: 0; padding: 2px 5px; color: var(--ink-3);
  border-radius: 6px; font-size: 11px; line-height: 1;
}
.session-item:hover .s-del { opacity: 1; }
.session-item .s-del:hover { color: var(--accent); }

.user-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
}
.user-row .user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn {
  flex-shrink: 0;
  font-size: 12px; font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 13px;
  transition: background .12s, color .12s;
}
.user-btn:hover { background: var(--accent); color: var(--accent-contrast); }

.sidebar-about {
  padding: 0 8px;
  margin-top: -6px;
  font-size: 11px;
  line-height: 1.75;
  color: var(--ink-3);
}
.privacy-note {
  margin-top: -8px;
  padding: 0 8px;
  font-size: 10.5px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.5;
}

.sidebar-about .about-team { color: var(--ink-2); font-weight: 600; }
.sidebar-about a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: color .12s, border-color .12s;
}
.sidebar-about a:hover { color: var(--accent); border-color: var(--accent); }

.sidebar-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-top: -8px;
}
.foot-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-2);
  padding: 5px 9px; border-radius: 999px;
}
.foot-btn:hover { background: var(--surface-3); color: var(--ink); }
.foot-model {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  background: var(--surface-3);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 128px;
}

/* ============ 主区 ============ */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
#chat-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
#messages, #welcome { max-width: 768px; margin: 0 auto; padding: 30px 26px 12px; }

/* 欢迎页 */
#welcome { padding-top: 16vh; text-align: center; }
#welcome h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .02em;
  text-wrap: balance;
}
.hero-sub { color: var(--ink-3); font-size: 14.5px; margin-top: 9px; }
.example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 38px;
  text-align: left;
}
.example-card {
  display: flex; flex-direction: column; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.example-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(43, 36, 26, .08);
}
.ex-tag {
  align-self: flex-start;
  font-size: 11px; font-weight: 600;
  letter-spacing: .06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2.5px 9px; border-radius: 999px;
}
.ex-text { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.hero-credit {
  margin-top: 46px;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .02em;
}
@media (max-width: 760px) { .example-grid { grid-template-columns: 1fr; } }

/* 消息 */
.msg { margin-bottom: 30px; }
.msg-user { display: flex; justify-content: flex-end; }
.msg-user .bubble {
  max-width: 80%;
  background: var(--surface-2);
  border-radius: 18px 18px 5px 18px;
  padding: 11px 17px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
}

.msg-assistant { display: flex; flex-direction: column; gap: 12px; }

/* 过程时间线 */
.process {
  background: var(--surface-2);
  border-radius: 14px;
  overflow: hidden;
  font-size: 12.5px;
}
.process-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 10px 15px;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .03em;
  text-align: left;
}
.process-head:hover { color: var(--ink); }
.process-head .chev { transition: transform .18s; margin-left: auto; color: var(--ink-3); }
.process.open .process-head .chev { transform: rotate(90deg); }
.process-steps { display: none; padding: 2px 15px 13px; flex-direction: column; gap: 7px; }
.process.open .process-steps { display: flex; }

.step-note {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.65;
  padding: 1px 0 1px 28px;
}
.step { display: flex; align-items: flex-start; gap: 9px; }
.step-icon {
  width: 19px; height: 19px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--ink-3);
  margin-top: 2px;
}
.step.running .step-icon { color: var(--accent); }
.step.done .step-icon { color: var(--ok); }
.step.error .step-icon { color: var(--warn); }
.step-body { min-width: 0; flex: 1; }
.step-label { color: var(--ink-2); }
.step-label b { color: var(--ink); font-weight: 600; }
.step-label .step-args { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.step-hits { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.hit-chip {
  font-size: 11.5px;
  background: var(--surface);
  border-radius: 8px;
  padding: 3px 10px;
  color: var(--ink-2);
  max-width: 300px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(20, 22, 26, .06);
  transition: color .12s, transform .12s;
}
.hit-chip:hover { color: var(--accent); transform: translateY(-1px); }
.spin {
  width: 11px; height: 11px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2s; }
  #chat-scroll { scroll-behavior: auto; }
  .btn-new, .example-card, .hit-chip { transition: none; }
}

/* 正文 markdown */
.content { max-width: 72ch; word-break: break-word; font-size: 15px; }
.content > * + * { margin-top: .75em; }
.content h1, .content h2 {
  font-size: 17px;
  font-weight: 700;
  margin-top: 1.35em;
  letter-spacing: .01em;
}
.content h3, .content h4 { font-size: 15.5px; font-weight: 650; margin-top: 1.2em; }
.content ul, .content ol { padding-left: 1.45em; }
.content li + li { margin-top: .3em; }
.content li::marker { color: var(--ink-3); }
.content strong { font-weight: 650; }
.content blockquote {
  border-left: 3px solid var(--line-strong);
  padding: 4px 16px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 0 10px 10px 0;
}
.content code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface-2);
  padding: 1.5px 6px;
  border-radius: 6px;
}
.content pre {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 13px 16px;
  overflow-x: auto;
}
.content pre code { background: none; padding: 0; }
.content .table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.content table { border-collapse: collapse; font-size: 13.5px; width: 100%; }
.content th, .content td { border-bottom: 1px solid var(--line); padding: 8px 13px; text-align: left; vertical-align: top; }
.content th { background: var(--surface-2); font-weight: 600; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.content td:not(:last-child), .content th:not(:last-child) { border-right: 1px solid var(--line); }
.content tr:last-child td { border-bottom: none; }
.content a { color: var(--accent); text-decoration: none; }
.content a:hover { text-decoration: underline; }
.content hr { border: none; border-top: 1px solid var(--line); margin: 1.3em 0; }

/* 引用角标: 序号 + 地区·年份 */
.cite {
  display: inline-flex; align-items: baseline; gap: 4px;
  height: 18px;
  padding: 0 7px;
  margin: 0 2px;
  vertical-align: 2px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 10.5px;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.cite .cn { font-weight: 700; }
.cite .cl { font-weight: 500; opacity: .85; }
.cite:hover { background: var(--accent); color: var(--accent-contrast); }

/* 来源脚注 */
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.source-item {
  display: flex; align-items: baseline; gap: 7px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4.5px 13px;
  max-width: 100%;
  transition: background .12s;
  text-align: left;
}
.source-item:hover { background: var(--surface-3); }
.source-item .sn { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.source-item .st {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px;
}
.source-item .sm { color: var(--ink-3); font-size: 11px; white-space: nowrap; }

/* 用量信息 */
.usage-line {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* 政策解读卡片 */
.policy-card {
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: 8px 0;
  border: 1px solid var(--line);
}
.pc-head {
  padding: 16px 20px 13px;
  display: flex; align-items: flex-start; gap: 12px;
}
.pc-head::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 8px;
  flex-shrink: 0;
}
.pc-title {
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.5;
  flex: 1;
  text-wrap: balance;
}
.pc-open {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 13px;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.pc-open:hover { background: var(--accent); color: var(--accent-contrast); }
.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  border-top: 1px solid var(--line);
}
.pc-field { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.pc-field dt {
  font-size: 11px; font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.pc-field dd { font-size: 13.5px; line-height: 1.65; }
.pc-field dd.empty { color: var(--ink-3); }
.pc-points { padding: 13px 20px 16px; }
.pc-points dt {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  color: var(--ink-3); margin-bottom: 7px;
}
.pc-points li { font-size: 13.5px; margin-left: 1.2em; }
.pc-points li + li { margin-top: 5px; }
.pc-points li::marker { color: var(--accent); }

.msg-error {
  color: var(--warn);
  font-size: 13px;
  background: color-mix(in srgb, var(--warn) 8%, var(--surface));
  border-radius: 12px;
  padding: 10px 15px;
}

/* 光标 */
.caret {
  display: inline-block;
  width: 7px; height: 15px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
  border-radius: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============ 输入区 ============ */
#composer {
  padding: 8px 26px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 40%);
}
.composer-box {
  max-width: 768px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 10px 10px 10px 19px;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.composer-box:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent), var(--shadow);
}
#input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  max-height: 160px;
  padding: 5px 0;
}
#input::placeholder { color: var(--ink-3); }
#btn-send, #btn-stop {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  display: grid; place-items: center;
  transition: opacity .15s, transform .12s, background .15s;
}
#btn-send:hover:not(:disabled), #btn-stop:hover { background: var(--accent-deep); }
#btn-send:hover, #btn-stop:hover { transform: scale(1.06); }
#btn-send:disabled { opacity: .35; cursor: default; transform: none; }
.composer-hint {
  margin: 8px auto 0;
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ 原文抽屉 ============ */
#drawer-mask {
  position: fixed; inset: 0;
  background: rgba(15, 16, 20, .38);
  z-index: 40;
  backdrop-filter: blur(3px);
}
#drawer {
  position: fixed;
  top: 10px; right: 10px; bottom: 10px;
  width: min(640px, calc(94vw - 10px));
  background: var(--surface);
  z-index: 50;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slide-in .24s cubic-bezier(.2, .8, .3, 1);
  overflow: hidden;
}
@keyframes slide-in { from { transform: translateX(36px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #drawer { animation: none; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--accent);
}
#drawer-close { color: var(--ink-3); padding: 6px; border-radius: 999px; }
#drawer-close:hover { color: var(--ink); background: var(--surface-2); }
#drawer-body { flex: 1; overflow-y: auto; padding: 28px 34px 52px; }
.drawer-loading { color: var(--ink-3); text-align: center; padding-top: 60px; }

/* 文档头排版 */
.doc-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .01em;
  text-wrap: balance;
}
.doc-no {
  display: inline-block;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px 12px;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}
.doc-rule { display: none; }
.doc-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px 20px;
  font-size: 13px;
  padding: 18px 0 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.doc-meta span { min-width: 0; }
.doc-meta b {
  display: block;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .1em;
  margin-bottom: 2px;
}
@media (max-width: 560px) { .doc-meta { grid-template-columns: repeat(2, 1fr); } }
.doc-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0 2px; }
.doc-tag {
  font-size: 11.5px;
  background: var(--surface-2);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 3px 11px;
}
.doc-tag.hot { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.doc-tag.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.doc-tag.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.doc-note {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 14px;
}
.doc-text {
  margin-top: 18px;
  font-size: 14.5px;
  line-height: 2.0;
  white-space: pre-wrap;
  word-break: break-word;
}
.clause { transition: background .3s; border-radius: 4px; }
.clause.hl {
  background: var(--accent-wash);
  box-shadow: -3px 0 0 1.5px var(--accent);
  display: inline;
}

/* ============ 登录 ============ */
#login-mask {
  position: fixed; inset: 0;
  background: rgba(15, 16, 20, .38);
  z-index: 60;
  backdrop-filter: blur(3px);
}
#login-modal {
  position: fixed; z-index: 70;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100vw - 48px));
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 36px 34px 30px;
  text-align: center;
}
.login-seal {
  position: relative;
  width: 46px; height: 46px; margin: 0 auto;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 12px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 30%, transparent);
}
.login-seal::after {
  content: "";
  position: absolute; inset: 4px;
  border: 1px solid color-mix(in srgb, var(--accent-contrast) 45%, transparent);
  border-radius: 8px;
  pointer-events: none;
}
#login-modal h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  margin-top: 15px;
  letter-spacing: .04em;
}
.login-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.7; }
#login-form { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
#login-form input {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 15px;
  font-size: 14px;
  font-family: var(--sans);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#login-form input::placeholder { color: var(--ink-3); }
#login-form input:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent);
}
.login-error { font-size: 12.5px; color: var(--accent); }
.login-submit {
  margin-top: 4px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 999px;
  padding: 10.5px 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .3em;
  text-indent: .3em;
  transition: background .15s;
}
.login-submit:hover { background: var(--accent-deep); }
#login-close {
  position: absolute;
  top: 14px; right: 14px;
  color: var(--ink-3);
  padding: 6px;
  border-radius: 999px;
}
#login-close:hover { color: var(--ink); background: var(--surface-2); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: content-box; }

/* 窄屏 */
@media (max-width: 860px) {
  #sidebar { display: none; }
  #messages, #welcome { padding: 20px 14px 8px; }
  #composer { padding-left: 14px; padding-right: 14px; }
  #drawer { top: 0; right: 0; bottom: 0; border-radius: 0; width: 100vw; }
}
