/* 知效 · 纸与墨
   设计取向：暖纸底色、宋体标题、墨绿强调、细线分隔。
   界面框架（侧栏/顶栏/输入区/卡片）叠一层「雾面纸玻璃」：
   半透明暖白 + 背景模糊 + 内侧高光，像压在纸上的磨砂亚克力。
   不做通用玻璃拟态：没有霓虹、没有紫渐变，内容区始终保持纸面可读。 */

:root {
  --paper: #f4f1ea;
  --surface: #fbf9f4;
  --surface-2: #eee9df;
  --ink: #1e221d;
  --ink-soft: #33382f;
  --muted: #666b61;
  --line: #ded8cb;
  --line-strong: #c9c2b2;
  --accent: #2f5d4a;
  --accent-soft: #e4ece6;
  --danger: #a33a2a;
  /* 宋体优先；Windows 上没有 Songti，退回思源宋体，最后才是 SimSun */
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Noto Serif CJK SC",
    "Source Han Serif SC", "Source Han Serif CN", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 18px 50px -36px rgba(30, 34, 29, .45);

  /* 液态纸玻璃 */
  --glass: rgba(251, 249, 244, .58);
  --glass-strong: rgba(251, 249, 244, .78);
  --glass-line: rgba(255, 255, 255, .72);
  --glass-edge: rgba(201, 194, 178, .62);
  --glass-blur: 20px;
  --glass-sat: 140%;
  --glass-shadow: 0 26px 60px -44px rgba(30, 34, 29, .55);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, .84),
                 inset 0 -1px 0 rgba(30, 34, 29, .045);
  --ease-glass: cubic-bezier(.16, 1, .3, 1);
}

/* 氛围层：给玻璃一点可以「折射」的背景 */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 560px at 2% -10%, rgba(47, 93, 74, .20), transparent 64%),
    radial-gradient(820px 620px at 102% -2%, rgba(197, 154, 92, .22), transparent 62%),
    radial-gradient(680px 540px at 72% 110%, rgba(47, 93, 74, .12), transparent 62%);
}
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
.auth-page .ambient {
  background:
    radial-gradient(460px 380px at 38% 26%, rgba(47, 93, 74, .15), transparent 68%),
    radial-gradient(420px 360px at 64% 72%, rgba(197, 154, 92, .17), transparent 68%),
    radial-gradient(720px 560px at 0% -10%, rgba(47, 93, 74, .10), transparent 64%),
    radial-gradient(820px 620px at 102% -2%, rgba(197, 154, 92, .12), transparent 62%);
}
.has-ambient { background: var(--paper); }
.has-ambient > *:not(.ambient) { position: relative; z-index: 1; }

/* 玻璃基底：不支持 backdrop-filter 时退回实色纸面 */
.glass-panel {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-inner), var(--glass-shadow);
}
@supports ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .glass-panel {
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  }
}
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .sidebar, .topbar, .composer-box, .agent-card, .auth { background: var(--surface); }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
[v-cloak] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------------- 应用骨架 ---------------- */

.app {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 16px 16px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(255, 255, 255, .55), transparent 58%),
    linear-gradient(160deg, rgba(251, 249, 244, .66), rgba(246, 242, 233, .44));
  border-right: 1px solid var(--glass-edge);
  box-shadow: var(--glass-inner);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px 20px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
}
.brand-mark.has-logo {
  background: transparent;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
}
.brand-mark.has-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .08em;
}
.brand small {
  display: block;
  margin-top: 1px;
  font-size: 8px;
  letter-spacing: .16em;
  color: var(--muted);
}

.new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  background: rgba(251, 249, 244, .42);
  color: var(--ink-soft);
  font-size: 14px;
  text-align: left;
  transition: border-color .18s ease, background .18s ease;
}
.new-chat:hover { border-color: var(--accent); background: rgba(47, 93, 74, .05); }
.new-chat .plus { font-size: 18px; line-height: 1; color: var(--accent); }

.conv-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}
.conv-wrap { position: relative; }
.conv {
  display: block;
  width: 100%;
  padding: 10px 34px 10px 11px;
  margin-bottom: 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition: background .15s ease, border-color .15s ease;
}
.conv:hover { background: rgba(251, 249, 244, .65); }
.conv.active,
.conv-wrap.active .conv {
  background: var(--surface);
  border-color: var(--line);
}
.conv-del {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease, background .15s ease;
}
.conv-wrap:hover .conv-del,
.conv-wrap.active .conv-del,
.conv-del:focus-visible { opacity: .6; }
.conv-del:hover {
  opacity: 1;
  color: var(--danger);
  background: rgba(163, 58, 42, .08);
}
@media (hover: none) {
  .conv-del { opacity: .5; }
}
.conv-title {
  display: block;
  overflow: hidden;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.conv-meta {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-meta .dot { margin: 0 4px; opacity: .6; }
.conv-empty {
  padding: 18px 10px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 6px 2px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.sidebar-foot .who {
  overflow: hidden;
  color: var(--ink-soft);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.link-btn {
  padding: 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
}
.link-btn:hover { color: var(--danger); }

.scrim { display: none; }

/* ---------------- 主区域 ---------------- */

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
  background: transparent;
}
.main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 300px at 74% -4%, rgba(197, 154, 92, .13), transparent 72%),
    radial-gradient(460px 280px at 8% 2%, rgba(47, 93, 74, .11), transparent 72%);
}
.main > * { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 62px;
  flex: 0 0 62px;
  padding: 0 26px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(255, 255, 255, .55), transparent 58%),
    linear-gradient(160deg, rgba(251, 249, 244, .66), rgba(246, 242, 233, .44));
  border-bottom: 1px solid var(--glass-edge);
  box-shadow: var(--glass-inner);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}
.icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
}
.menu-btn { display: none; }

.model-picker { position: relative; display: inline-flex; align-items: center; }
.model-picker select {
  appearance: none;
  min-width: 168px;
  max-width: 280px;
  padding: 7px 32px 7px 12px;
  border: 1px solid var(--glass-edge);
  border-radius: 9px;
  background: rgba(251, 249, 244, .66);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.model-picker select:focus { outline: none; border-color: var(--accent); }
.model-picker .caret {
  position: absolute;
  right: 10px;
  color: var(--muted);
  pointer-events: none;
}

.quota {
  margin-left: auto;
  padding: 5px 12px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: rgba(251, 249, 244, .62);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.quota b { color: var(--accent); font-weight: 600; }
.quota.low b { color: var(--danger); }

/* ---------------- 对话 ---------------- */

.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 34px max(22px, calc((100% - 760px) / 2)) 26px;
  scroll-behavior: smooth;
}

.empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100dvh - 250px);
  max-width: 560px;
  animation: rise .35s ease-out both;
}
.empty h1 {
  margin: 10px 0 12px;
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.015em;
}
.empty-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.empty-sub b { color: var(--ink-soft); font-weight: 600; }
.prompts {
  display: grid;
  gap: 8px;
  margin-top: 30px;
}
.prompts button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  text-align: left;
  transition: border-color .18s ease, transform .18s ease;
}
.prompts button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.prompts .arrow { color: var(--muted); font-size: 13px; }

.msg {
  margin: 0 0 28px;
  animation: rise .25s ease-out both;
}
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--muted);
}
.msg-who { font-weight: 600; letter-spacing: .02em; }
.msg-time { font-size: 10px; opacity: .8; }
.msg-body {
  font-size: 15.5px;
  line-height: 1.82;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.assistant .msg-body {
  padding-left: 14px;
  border-left: 2px solid var(--accent-soft);
}
.msg.user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 6px;
}
.msg.user .msg-head { flex-direction: row-reverse; }
.msg.user .msg-body {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 12px 12px 4px 12px;
  background: var(--accent-soft);
  color: #20362c;
}
.msg.failed .msg-body { opacity: .6; }
.msg-foot { margin-top: 5px; font-size: 11px; }
.failed-tag { color: var(--danger); }
.degraded-tag { color: var(--muted); }

/* 等待回答：墨点起伏 + 骨架行，像正在落笔 */
.msg .waiting {
  padding: 9px 0 2px;
  animation: wait-in .3s ease-out .12s both;
}
.waiting-head { display: flex; align-items: center; gap: 9px; }
.ink-dots { display: inline-flex; gap: 5px; }
.ink-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .28;
  animation: ink-wave 1.25s infinite ease-in-out;
}
.ink-dots i:nth-child(2) { animation-delay: .14s; }
.ink-dots i:nth-child(3) { animation-delay: .28s; }
.waiting-label { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }

.skeleton { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.skeleton i {
  display: block;
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(
    90deg,
    rgba(30, 34, 29, .055) 18%,
    rgba(30, 34, 29, .125) 42%,
    rgba(30, 34, 29, .055) 66%
  );
  background-size: 220% 100%;
  animation: sheen 1.8s ease-in-out infinite;
}
.skeleton i:nth-child(1) { width: 100%; }
.skeleton i:nth-child(2) { width: 86%; animation-delay: .12s; }
.skeleton i:nth-child(3) { width: 58%; animation-delay: .24s; }
/* 等久了放慢节奏，别让人以为卡住了 */
.waiting.slow .skeleton i { animation-duration: 3.2s; }
.waiting.slow .ink-dots i { animation-duration: 2s; }

@keyframes wait-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
@keyframes ink-wave {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30% { opacity: .95; transform: translateY(-3px); }
}
@keyframes sheen {
  0% { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}

/* 流式输出时的光标：贴在最后一个字后面 */
.msg-body.is-streaming.has-content::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.16em;
  background: var(--accent);
  animation: caret 1s steps(2) infinite;
  opacity: .85;
}
@keyframes caret {
  0%, 50% { opacity: .85; }
  50.01%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .msg-body.is-streaming.has-content::after { animation: none; }
  .msg .waiting { animation: none; }
  .ink-dots i { animation: none; opacity: .55; }
  .skeleton i { animation: none; }
  .msg .waiting.slow .skeleton i,
  .msg .waiting.slow .ink-dots i { animation: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- 输入区 ---------------- */

.composer {
  flex: 0 0 auto;
  padding: 10px max(22px, calc((100% - 760px) / 2)) 14px;
  border-top: 1px solid rgba(201, 194, 178, .35);
  background: transparent;
}
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, .6), transparent 55%),
    linear-gradient(160deg, rgba(251, 249, 244, .82), rgba(246, 242, 233, .6));
  box-shadow: var(--glass-inner), 0 20px 44px -34px rgba(30, 34, 29, .55);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.composer-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.composer-box.disabled { opacity: .7; }
.composer-box textarea {
  flex: 1;
  min-height: 24px;
  max-height: 180px;
  padding: 8px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  resize: none;
}
.composer-box textarea::placeholder { color: #767b70; }
.send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
  transition: opacity .15s ease, transform .15s ease;
}
.send:hover:not(:disabled) { transform: translateY(-1px); }
.send:disabled { opacity: .3; cursor: default; }
.send.stop { background: var(--ink, #20362c); }
.stop-square {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--paper);
}
.composer-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 0;
  font-size: 11px;
  color: var(--muted);
}
.composer-hint a { color: var(--muted); }
.quota-hint { color: #8a5a12; font-weight: 600; }

/* 额度用尽后的唯一出口：直接去找创始人 */
.quota-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(47, 93, 74, .2);
  background: var(--accent-soft, #e4ece6);
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
}
.quota-bar b { font-weight: 600; }
.quota-bar span { color: var(--muted); }
.quota-bar:hover { text-decoration: none; background: #dae7df; }
@media (max-width: 620px) {
  .quota-bar { flex-direction: column; gap: 2px; padding: 10px 12px; text-align: center; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  z-index: 60;
  transform: translateX(-50%);
  padding: 9px 15px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6);
  animation: rise .2s ease-out both;
}

/* ---------------- 登录 / 注册 ---------------- */

.auth-page {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 28px 0;
  background: transparent;
}
.auth {
  width: min(420px, calc(100% - 36px));
  padding: 34px 32px 30px;
  border: 1px solid var(--glass-edge);
  border-radius: 18px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(255, 255, 255, .7), transparent 58%),
    linear-gradient(160deg, rgba(251, 249, 244, .86), rgba(246, 242, 233, .62));
  box-shadow: var(--glass-inner), 0 32px 70px -44px rgba(30, 34, 29, .55);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
}
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
.auth-about { font-size: 12px; color: var(--muted); }
.auth h1 {
  margin: 8px 0 8px;
  font-family: var(--serif);
  font-size: clamp(30px, 6vw, 38px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.auth-sub {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13.5px;
}
.field { display: block; margin-bottom: 16px; }
.field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .05em;
}
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: #767b70; font-size: 12.5px; }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-error {
  min-height: 20px;
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 12.5px;
}
.primary {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fbf9f4;
  font-weight: 600;
  letter-spacing: .04em;
  transition: opacity .15s ease, transform .15s ease;
}
.primary:hover:not(:disabled) { transform: translateY(-1px); }
.primary:disabled { opacity: .6; cursor: default; }
.auth-hint {
  margin: 0 0 16px;
  padding: 10px 13px;
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.7;
}
.auth-hint[hidden] { display: none; }
.auth-alt {
  margin: 20px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------------- 说明页 ---------------- */

.doc-page { background: var(--paper); }
.doc {
  max-width: 680px;
  margin: 0 auto;
  padding: 54px 24px 90px;
}
.doc .back { display: inline-block; margin-bottom: 34px; font-size: 12px; color: var(--muted); }
.doc h1 {
  margin: 8px 0 22px;
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -.015em;
}
.doc h2 {
  margin: 36px 0 10px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}
.doc p, .doc li { color: var(--ink-soft); font-size: 14.5px; line-height: 1.9; }
.doc ul { padding-left: 18px; }
.doc li { margin-bottom: 6px; }
.doc-foot {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: 82%;
    max-width: 320px;
    transform: translateX(-102%);
    transition: transform .22s cubic-bezier(.22, .61, .36, 1);
    box-shadow: 26px 0 50px -40px rgba(0, 0, 0, .5);
  }
  .is-sidebar-open .sidebar { transform: translateX(0); }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(30, 34, 29, .34);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .is-sidebar-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }
  .topbar { height: 58px; flex-basis: 58px; padding: 0 14px; gap: 10px; }
  .model-picker select { min-width: 132px; max-width: 46vw; }
  .quota { padding: 4px 10px; font-size: 11px; }
  .chat { padding: 24px 18px 16px; }
  .empty { min-height: calc(100dvh - 230px); }
  .msg-body { font-size: 15px; }
  .msg.user .msg-body { max-width: 88%; }
  .composer { padding: 8px 14px 10px; }
  .composer-hint span { display: none; }
  .composer-hint { justify-content: flex-end; }
}

@media (min-width: 861px) {
  .scrim { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------- 智能体列表 ---------------- */

.gallery-app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-x: hidden;
  background: transparent;
}

.gallery-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 22px 28px 10px;
}
.gallery-top .brand { padding: 0; }
.gallery-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}
.gallery-user .quota { margin-left: 0; }
.gallery-user .who {
  max-width: 140px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gallery {
  position: relative;
  width: min(1120px, 100%);
  flex: 1;
  margin: 0 auto;
  padding: 44px 28px 64px;
}
.gallery::before {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  top: 150px;
  height: 480px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(520px 300px at 14% 42%, rgba(47, 93, 74, .10), transparent 70%),
    radial-gradient(520px 320px at 84% 30%, rgba(197, 154, 92, .12), transparent 72%);
}
.gallery > * { position: relative; z-index: 1; }
.gallery-head { max-width: 640px; }
.gallery-head h1 {
  margin: 10px 0 12px;
  font-family: var(--serif);
  font-size: clamp(38px, 5.4vw, 54px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.02em;
}
.gallery-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.agent-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 236px;
  padding: 20px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(255, 255, 255, .5), transparent 60%),
    linear-gradient(160deg, rgba(251, 249, 244, .72), rgba(246, 242, 233, .48));
  box-shadow: var(--glass-inner), 0 22px 50px -44px rgba(30, 34, 29, .5);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  transition: transform .22s var(--ease-glass), border-color .22s ease, box-shadow .22s ease;
}
.agent-card > * { position: relative; z-index: 1; }
/* 掠过卡片表面的一道高光：液态玻璃的「动」在这里，而不是一直晃 */
.agent-card::after {
  content: "";
  position: absolute;
  top: -60%;
  bottom: -60%;
  left: -30%;
  width: 55%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(104deg,
    transparent 0%,
    rgba(255, 255, 255, .55) 42%,
    rgba(255, 255, 255, .18) 55%,
    transparent 100%);
  transform: translateX(-140%) skewX(-8deg);
  opacity: 0;
  transition: transform .75s var(--ease-glass), opacity .3s ease;
}
.agent-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 194, 178, .95);
  box-shadow: var(--glass-inner), 0 30px 60px -40px rgba(30, 34, 29, .55);
}
.agent-card:hover::after {
  opacity: 1;
  transform: translateX(320%) skewX(-8deg);
}
.agent-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.agent-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: #234436;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
}
.agent-avatar.big {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  font-size: 29px;
  margin-bottom: 16px;
}
.agent-type {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.agent-card h2 {
  margin: 15px 0 4px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.agent-code {
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
}
.agent-desc {
  flex: 1;
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}
.agent-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.agent-models { color: var(--muted); font-size: 11px; }
.agent-start {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.agent-start:hover { text-decoration: none; opacity: .8; }
.agent-disabled { color: var(--muted); font-size: 11.5px; }

.gallery-empty {
  margin-top: 48px;
  padding: 46px 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
}
.gallery-empty h2 {
  margin: 8px 0 6px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}
.gallery-empty p { margin: 0; color: var(--muted); font-size: 13.5px; }

.gallery-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 28px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}
.gallery-foot a { color: var(--muted); }

/* ---------------- 对话页：智能体标识 ---------------- */

.back-agents {
  display: block;
  margin: 0 6px 12px;
  color: var(--muted);
  font-size: 12px;
}
.back-agents:hover { color: var(--accent); text-decoration: none; }
.back-link {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.agent-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mini-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #234436;
  font-family: var(--serif);
  font-size: 15px;
}
.agent-identity .agent-name {
  max-width: 150px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.agent-identity .agent-code { background: transparent; padding: 0; }
.agent-empty { max-width: 600px; }

@media (max-width: 980px) {
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .gallery-top { padding: 18px 18px 6px; }
  .gallery-user { gap: 9px; }
  .gallery-user .who { display: none; }
  .gallery { padding: 30px 18px 48px; }
  .gallery-head h1 { font-size: clamp(34px, 10vw, 42px); }
  .gallery-sub { font-size: 14px; }
  .agent-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 28px; }
  .agent-card { min-height: 210px; }
  .gallery-foot { padding: 16px 18px 22px; }
  .back-link { display: none; }
  .agent-identity .agent-name { max-width: 86px; font-size: 15px; }
  .agent-identity .agent-code { display: none; }
  .topbar .model-picker select { min-width: 104px; }
}

/* 工作台补充 */
.gallery-user .home-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.gallery-user .home-link:hover { color: var(--accent); }
.gallery-foot nav { display: flex; gap: 16px; }
.gallery-foot a { color: var(--muted); text-decoration: none; }
.gallery-foot a:hover { color: var(--accent); }
.doc-links { margin: -6px 0 30px; font-size: 13px; }
.doc-links a { color: var(--accent); }

/* 工作台移动端：隐藏「首页」文字链接（其余首页规则在 home.css） */
@media (max-width: 720px) {
  .gallery-user .home-link { display: none; }
}

/* 链接悬停不破坏品牌与按钮 */
.brand:hover,
.brand-mark:hover,
.home-footer a:hover,
.gallery-foot a:hover,
.gallery-user .home-link:hover { text-decoration: none; }

/* ---------------- 工作台搜索 / 对话操作 ---------------- */

.agent-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin-top: 26px;
}
.agent-search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--glass-edge);
  border-radius: 11px;
  background: rgba(251, 249, 244, .68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  color: var(--muted);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.agent-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.agent-search input {
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
}
.agent-search input::placeholder { color: #767b70; }
.agent-search input::-webkit-search-cancel-button { display: none; }
.agent-count {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.clear-search { font-size: 11px; }

.main { position: relative; }

.msg-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px;
}
.copy-btn {
  margin-left: 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  opacity: .65;
  transition: color .16s ease, opacity .16s ease;
}
.copy-btn:hover { color: var(--accent); opacity: 1; }

.msg-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.msg-feedback + .copy-btn { margin-left: 0; }
.feedback-btn {
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  opacity: .75;
  transition: color .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}
.feedback-btn:hover { color: var(--accent); opacity: 1; }
.feedback-btn.on {
  color: var(--accent);
  border-color: #cfdfd5;
  background: var(--accent-soft);
  opacity: 1;
}
.feedback-note { color: var(--muted); font-size: 10.5px; }
.feedback-reasons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 7px 9px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 11px;
  color: var(--muted);
}
.feedback-reason {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
}
.feedback-reason:hover { border-color: var(--accent); color: var(--accent); }

.proof-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .02em;
}
.proof-line b {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.agent-proof {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.agent-proof b {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.scroll-bottom {
  position: absolute;
  right: max(18px, calc((100% - 760px) / 2));
  bottom: 112px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 16px;
  box-shadow: 0 12px 26px -20px rgba(30, 34, 29, .5);
  transition: transform .16s ease, border-color .16s ease;
}
.scroll-bottom:hover { transform: translateY(-2px); border-color: var(--accent); }

@media (max-width: 860px) {
  .agent-tools { max-width: none; }
  .agent-count { display: none; }
  .scroll-bottom { right: 16px; bottom: 96px; }
}

/* 邀请码绑定 */
.invite-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
  padding: 13px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(251, 249, 244, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}
.invite-copy { display: flex; flex-direction: column; gap: 2px; }
.invite-copy strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}
.invite-copy span { color: var(--muted); font-size: 11.5px; }
.invite-panel form { display: flex; gap: 8px; margin-left: auto; }
.invite-panel input {
  width: 150px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: .08em;
}
.invite-panel input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.invite-panel button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: var(--paper);
  font-size: 12.5px;
  font-weight: 600;
}
.invite-panel button:disabled { opacity: .55; cursor: default; }
.invite-error {
  flex-basis: 100%;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}
.invite-bound {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}
.invite-bound b { color: var(--accent); }
.invite-bound code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  font-size: 10.5px;
}
@media (max-width: 720px) {
  .invite-panel { align-items: stretch; }
  .invite-panel form { width: 100%; margin-left: 0; }
  .invite-panel input { flex: 1; width: auto; }
}

.slow-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .02em;
}


/* ---------------- 液态纸玻璃：降级 ---------------- */

@media (prefers-reduced-motion: reduce) {
  .agent-card { transition: border-color .18s ease, box-shadow .18s ease; }
  .agent-card:hover { transform: none; }
  .agent-card::after { display: none; }
}

/* 触屏没有 hover：保留静态高光，别让卡片看起来像死板的白块 */
@media (hover: none) {
  .agent-card { background: rgba(251, 249, 244, .72); }
  .agent-card::after { display: none; }
}


/* 键盘焦点：所有可交互元素统一可见 */
:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- 图片输入 ---------------- */

.attach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  margin-bottom: 1px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.attach:hover:not(:disabled) {
  background: rgba(238, 233, 223, .7);
  color: var(--ink-soft);
}
.attach.on { color: var(--accent); border-color: rgba(47, 93, 74, .26); background: var(--accent-soft); }
.attach:disabled { opacity: .38; cursor: not-allowed; }

.image-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.image-chip {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  background: var(--surface);
  box-shadow: var(--glass-inner);
}
.image-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-chip button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(30, 34, 29, .72);
  color: #fff;
  font-size: 14px;
  line-height: 18px;
  cursor: pointer;
}
.image-chip.uploading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  border-style: dashed;
}

.composer-box.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--glass-inner);
}

.msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}
.msg-image {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
  transition: border-color .15s ease, transform .15s ease;
}
.msg-image:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.msg-image img {
  display: block;
  max-width: 240px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(24, 27, 23, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}
.lightbox img {
  max-width: min(1000px, 92vw);
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .msg-image img { max-width: 180px; max-height: 150px; }
  .image-chip { width: 58px; height: 58px; }
  .lightbox { padding: 14px; }
}

/* ---------------- 整窗拖入 ---------------- */

/* 兜底：.has-ambient > * 的 relative 会盖掉 fixed，这里显式提权 */
.has-ambient > .drop-overlay { position: fixed; z-index: 85; }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* 不拦截鼠标事件：真正接收 drop 的是 window 上的监听 */
  pointer-events: none;
  background: rgba(30, 34, 29, .46);
  -webkit-backdrop-filter: blur(7px) saturate(120%);
  backdrop-filter: blur(7px) saturate(120%);
}
.drop-card {
  width: min(380px, 100%);
  padding: 30px 28px 26px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(255, 255, 255, .7), transparent 58%),
    linear-gradient(160deg, rgba(251, 249, 244, .96), rgba(246, 242, 233, .9));
  box-shadow: var(--glass-inner), 0 30px 70px -36px rgba(0, 0, 0, .55);
  color: var(--accent);
}
.drop-card b {
  display: block;
  margin: 12px 0 6px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}
.drop-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.drop-card .drop-warn {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: #8a5a12;
  font-size: 12px;
}
.drop-hint {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.drop-hint span { margin-right: 5px; color: var(--accent); }

@media (hover: none) {
  .drop-hint { display: none; }
}

/* 文字按钮：工作台、首页、共创页共用 */
.btn-text {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink-soft) !important;
  font-size: 13.5px;
  text-decoration: none;
  transition: border-color .18s ease, color .18s ease;
}
.btn-text:hover { border-color: var(--accent); color: var(--accent) !important; }

/* ---------------- AI 标识 / 账号操作 ---------------- */

.ai-chip {
  margin-left: 8px;
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .02em;
  line-height: 1.7;
  white-space: nowrap;
}

.sidebar-account {
  display: flex;
  gap: 14px;
  padding: 8px 11px 2px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}
.sidebar-account .link-btn {
  padding: 6px 0;
  font-size: 11.5px;
}
.link-btn.danger { color: #8a3a2a; }
.link-btn.danger:hover { color: var(--danger); }

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 27, 23, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.account-card {
  width: min(430px, 100%);
  padding: 26px 26px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .6);
}
.account-card h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}
.account-card p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}
.account-card p b { color: var(--danger); }
.account-hint { color: var(--muted) !important; font-size: 12px !important; }
.account-field {
  display: block;
  margin: 16px 0 18px;
}
.account-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11.5px;
}
.account-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}
.account-field input:focus { border-color: var(--accent); outline: none; }
.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}
.danger-btn {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 13.5px;
  cursor: pointer;
  transition: opacity .15s ease;
}
.danger-btn:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 640px) {
  .account-card { padding: 22px 18px 16px; }
  .account-actions { gap: 12px; }
  .account-actions .danger-btn { flex: 1; }
}

/* ---------------- 店铺门面（B 端装修） ---------------- */

/* 卡片圆角跟随门面设置；没配就是原来的 14px */
.agent-card { border-radius: var(--brand-radius, 14px); }

.brand-welcome {
  margin: 12px 0 0;
  padding: 10px 14px;
  max-width: 560px;
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}
body.has-brand .gallery-head .eyebrow { color: var(--accent); }


/* 对话记录共享开关（C 端工作台） */
.privacy-strip {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin: 26px 0 0; padding: 16px 18px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--brand-radius, 14px); background: var(--surface);
}
.privacy-copy { flex: 1; min-width: 240px; }
.privacy-copy b { font-family: var(--serif); font-size: 14px; letter-spacing: .04em; }
.privacy-copy p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.privacy-switch {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none; position: relative;
}
.privacy-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.privacy-switch .track {
  width: 38px; height: 22px; border-radius: 999px;
  background: var(--line-strong); position: relative; transition: background .18s;
}
.privacy-switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); transition: transform .18s;
}
.privacy-switch input:checked + .track { background: var(--accent); }
.privacy-switch input:checked + .track::after { transform: translateX(16px); }
.privacy-switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.privacy-switch .switch-text { font-size: 12px; color: var(--muted); min-width: 3.2em; }
.privacy-switch.disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 720px) {
  .privacy-strip { align-items: flex-start; }
}


.auth-note {
  margin: 2px 0 10px; font-size: 11.5px; line-height: 1.65; color: var(--muted);
}
.auth-note a { color: var(--accent); }


/* ---------------- C 端落地：先问再说 ----------------
   空态压扁、长答折叠、答完给追问、访客用完给一张墙。 */

.agent-empty.is-tight {
  justify-content: flex-start;
  padding-top: 14px;
  min-height: 0;
  max-width: 600px;
}
.agent-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.agent-intro__body { min-width: 0; }
.agent-intro__body h1 {
  margin: 0 0 6px;
  font-size: 21px;
  line-height: 1.35;
}
.agent-intro__body .empty-sub { margin: 0; }
.empty-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.empty-hint b { color: var(--accent); font-weight: 600; }

.msg-body.is-clamped {
  position: relative;
  max-height: calc(1.82em * 6);
  overflow: hidden;
}
.msg-body.is-clamped::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.8em;
  background: linear-gradient(to bottom, rgba(244, 241, 234, 0), var(--paper, #f4f1ea) 88%);
}
.expand-btn {
  margin-top: 8px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12.5px;
  cursor: pointer;
}
.expand-btn:hover { text-decoration: underline; }

.followups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}
.followups__label { color: var(--muted); font-size: 11px; }
.followups button {
  padding: 6px 11px;
  border: 1px solid var(--glass-edge, rgba(0, 0, 0, .12));
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
}
.followups button:hover { border-color: var(--accent); color: var(--accent); }

.guest-wall {
  margin: 0 0 10px;
  padding: 14px 16px;
  border: 1px solid var(--glass-edge, rgba(0, 0, 0, .12));
  border-radius: 12px;
  background: var(--accent-soft);
}
.guest-wall p {
  margin: 0 0 10px;
  color: #20362c;
  font-size: 13px;
  line-height: 1.7;
}
.guest-wall__actions { display: flex; align-items: center; gap: 14px; }
.guest-wall__primary {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #f8f5ec;
  font-size: 13px;
  text-decoration: none;
}
.guest-wall__link { color: var(--muted); font-size: 12.5px; text-decoration: none; }

.quota.guest { color: var(--accent); }

.card-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 30, 26, .62);
}
.card-modal__box {
  width: min(420px, 100%);
  max-height: 92dvh;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: var(--paper, #f4f1ea);
  text-align: center;
}
.card-modal__box img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.card-modal__box p {
  margin: 10px 2px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.card-modal__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.card-modal__download {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #f8f5ec;
  font-size: 13px;
  text-decoration: none;
}
