/* 准信 · 界面样式
   配色与形态参考 Gemini：浅色 / 深色 / 跟随系统三套主题靠 CSS 变量切换。
   字体跟随系统，不引外部字体（离线可用）。 */

/* Vue 挂载前先隐藏模板，避免刷新时闪出「未渲染」的内容（如置顶钉子） */
[v-cloak] { display: none !important; }

:root {
  --brand-1: #4285f4;
  --brand-2: #9b72cb;
  --brand-3: #d96570;
  --grad: linear-gradient(74deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  --radius-lg: 28px;
  --radius: 16px;
  --font: "Google Sans", Roboto, "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* ============ 主题变量 ============ */
html[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f0f4f9;
  --bg-soft-2: #e9eef6;
  --bg-elev: #ffffff;
  --side: #f0f4f9;
  --text: #1f1f1f;
  --text-2: #444746;
  --text-3: #5f6368;
  --line: #dde3ea;
  --line-2: #c4c7c5;
  --accent: #0b57d0;
  --accent-soft: #d3e3fd;
  --accent-text: #0b57d0;
  --ok: #146c2e;
  --ok-bg: #d7f0dd;
  --warn: #8f5000;
  --warn-bg: #ffe0b2;
  --danger: #b3261e;
  --danger-bg: #fde3e1;
  --shadow-1: 0 1px 2px rgba(60, 64, 67, .14), 0 2px 6px rgba(60, 64, 67, .08);
  --shadow-2: 0 4px 12px rgba(60, 64, 67, .14), 0 12px 32px rgba(60, 64, 67, .1);
  --scrim: rgba(32, 33, 36, .42);
}

html[data-theme="dark"] {
  --bg: #131314;
  --bg-soft: #1e1f20;
  --bg-soft-2: #282a2c;
  --bg-elev: #1e1f20;
  --side: #1e1f20;
  --text: #e3e3e3;
  --text-2: #c4c7c5;
  --text-3: #9aa0a6;
  --line: #303134;
  --line-2: #444746;
  --accent: #a8c7fa;
  --accent-soft: #004a77;
  --accent-text: #a8c7fa;
  --ok: #6dd58c;
  --ok-bg: #0f3d20;
  --warn: #fdd663;
  --warn-bg: #4a3a10;
  --danger: #f2b8b5;
  --danger-bg: #4a1f1c;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 24px rgba(0, 0, 0, .55);
  --scrim: rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--accent-text); }

.appear { animation: appear .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.spacer { flex: 1; }

/* 顶栏左侧始终保留一个"打开侧栏"按钮：侧栏收起后仍然能重新展开 */
.side-toggle { display: inline-flex; }

/* 右侧滑出面板打开时，主区向左让位（缩放 + 位移），形成 Gemini 式推拉 */
.shell.right-open .gmain { transform: scale(.982) translateX(-10px); }
.shell .gmain { transform-origin: center right; }

/* 会话条目：置顶标记 + 右键菜单 + 拖拽 */
.conv.pinned { background: var(--bg-soft-2); }
.conv .pin-ic { color: var(--accent-text); flex: 0 0 auto; display: inline-flex; }
.conv .pin-ic svg { width: 14px; height: 14px; }
.conv.dragging { opacity: .45; }
.conv.drop-before { box-shadow: inset 0 2px 0 0 var(--accent); }
.conv.drop-after { box-shadow: inset 0 -2px 0 0 var(--accent); }

.ctx-menu {
  position: fixed; z-index: 95; min-width: 180px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px;
  animation: appear .14s ease both;
}
.ctx-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px; border-radius: 8px; text-align: left; font-size: 14px; color: var(--text);
}
.ctx-menu button:hover { background: var(--bg-soft); }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover { background: var(--danger-bg); }
.ctx-menu svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* 消息操作条：鼠标移上去才出现，模仿 Gemini */
.msg-ops {
  display: flex; gap: 2px; margin-top: 6px;
  opacity: 0; transition: opacity .16s ease;
}
.turn.user:hover .msg-ops, .turn.assistant:hover .msg-ops { opacity: 1; }
.turn.user .msg-ops { justify-content: flex-end; }
.msg-ops button {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 8px; font-size: 12.5px; color: var(--text-3);
}
.msg-ops button:hover { background: var(--bg-soft-2); color: var(--text); }
.msg-ops svg { width: 14px; height: 14px; }

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

/* ============ 顶栏 ============ */
.gb {
  display: flex; align-items: center; gap: 10px;
  height: 60px; padding: 0 14px;
  border-bottom: 1px solid transparent;
  flex: 0 0 auto;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 19px; letter-spacing: .01em; }
.brand img { width: 26px; height: 26px; }
.brand .gtext {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* 站标按钮：收起 / 展开侧栏都点它，图标本身就是准信 logo */
.brand-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  transition: background .18s ease, transform .18s ease;
}
.brand-btn:hover { background: var(--bg-soft); transform: scale(1.04); }
.brand-btn img { width: 30px; height: 30px; display: block; }

/* 顶栏中间的当前对话名 */
.chat-title {
  font-size: 15px; color: var(--text-2); font-weight: 500;
  max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.icon-round {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: background .18s ease, color .18s ease;
}
.icon-round:hover { background: var(--bg-soft); color: var(--text); }
.icon-round svg { width: 20px; height: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid transparent;
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-soft-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; }
html[data-theme="dark"] .btn.primary { background: #a8c7fa; color: #062e6f; }
.btn.primary:hover { box-shadow: var(--shadow-1); filter: brightness(1.04); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.wide { width: 100%; }
.btn.sm { padding: 6px 14px; font-size: 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-2);
  border: 1px solid var(--line);
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.chip:hover { background: var(--bg-soft-2); color: var(--text); transform: translateY(-1px); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-3);
  font-size: 13px; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill svg { width: 14px; height: 14px; flex: 0 0 auto; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-weight: 600; font-size: 15px;
  flex: 0 0 auto;
}
.avatar.lg { width: 48px; height: 48px; font-size: 20px; }

/* ============ 布局 ============ */
.shell { display: flex; height: 100vh; overflow: hidden; }
.page { height: 100vh; overflow-y: auto; background: var(--bg); }

/* ============ 侧栏 ============ */
.gside {
  width: 288px; flex: 0 0 288px;
  background: var(--side);
  display: flex; flex-direction: column;
  padding: 10px 12px 12px;
  overflow: hidden;
  transition: margin-left .26s cubic-bezier(.2, .8, .2, 1);
}
.gside.hidden { margin-left: -288px; }

.side-head { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.new-chat {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 999px;
  background: var(--bg-elev); box-shadow: var(--shadow-1);
  color: var(--text); margin: 6px 0 12px;
  transition: box-shadow .18s ease, transform .12s ease;
}
.new-chat:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.new-chat svg { width: 18px; height: 18px; }

.conv-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px;
  /* 长按拖动排序时不要让浏览器选中文字，否则原生框选会吞掉鼠标事件 */
  user-select: none; -webkit-user-select: none;
}
.side-label { font-size: 13px; color: var(--text-3); margin: 10px 8px 6px; }
.conv {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px; border-radius: 999px;
  color: var(--text-2); cursor: pointer;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.conv.drag-ready { cursor: grabbing; }
.conv.dragging { cursor: grabbing; }
/* 长按拖动时的操作提示气泡（固定定位，不挤压列表） */
.drag-hint-float {
  position: fixed; left: 18px; bottom: 90px; z-index: 60;
  max-width: 260px; padding: 8px 12px; border-radius: 10px;
  background: var(--bg-elev); color: var(--accent-text); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2); font-size: 12px; line-height: 1.5;
}
.conv:hover { background: var(--bg-soft-2); }
.conv.active { background: var(--accent-soft); color: var(--text); }
.conv-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.conv .del { opacity: 0; color: var(--text-3); }
.conv:hover .del { opacity: 1; }
.side-empty { color: var(--text-3); font-size: 13px; padding: 8px; }

.side-bottom { flex: 0 0 auto; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.side-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 10px 14px; border-radius: 999px; color: var(--text-2); text-align: left;
}
.side-item:hover { background: var(--bg-soft-2); color: var(--text); }
.side-item svg { width: 18px; height: 18px; flex: 0 0 auto; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 4px; }
.me-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.role-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
}

/* ============ 主区 ============ */
.gmain { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; position: relative; }
.stream { flex: 1; overflow-y: auto; padding: 12px 16px 8px; }
.stream-inner { max-width: 820px; margin: 0 auto; }

.hero { text-align: center; padding: 11vh 20px 0; }
.hero h1 {
  font-size: clamp(30px, 4.4vw, 50px); font-weight: 500; margin: 0 0 8px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: -.01em;
}
.hero p { color: var(--text-3); margin: 0 auto; max-width: 640px; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }

/* 首页卖点：突出"比别人准、比别人新" */
.hero-lead { font-size: 16px; line-height: 1.85; }
.hero-lead b { color: var(--text); font-weight: 600; }
.hero-lead em { color: var(--danger); font-style: normal; font-weight: 600; }
/* 首页主张：把「比通用 AI 更准更新」放在最显眼的位置 */
.hero-claim {
  font-size: 17px; line-height: 1.8; color: var(--text-2);
  max-width: 720px; margin: 22px auto 0 !important;
  padding: 14px 20px; border-radius: 16px;
  background: var(--accent-soft);
}
.hero-claim b { color: var(--text); font-weight: 700; font-size: 18px; }
.hero-claim em { color: var(--accent-text); font-style: normal; font-weight: 600; }
.hero-points {
  display: flex; flex-direction: column; gap: 10px;
  max-width: 620px; margin: 20px auto 0; text-align: left;
}
.hero-points .hp {
  display: block; background: var(--bg-soft); border-left: 3px solid var(--brand-1);
  border-radius: 12px; padding: 11px 16px; font-size: 14.5px; color: var(--text-2);
}
.hero-points .hp b { color: var(--text); }

/* 消息 */
.turn { display: flex; gap: 14px; padding: 14px 0; }
.turn.user { justify-content: flex-end; }
.turn.user .turn-body {
  background: var(--bg-soft); border-radius: 20px; padding: 10px 18px;
  max-width: 82%; white-space: pre-wrap; word-break: break-word;
}
.turn-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-soft);
}
.turn-avatar img { width: 20px; height: 20px; }
.turn-body { max-width: 100%; min-width: 0; }
.turn.assistant .turn-body { flex: 1; }
.body-text { white-space: pre-wrap; word-break: break-word; }
.att-thumb { max-width: 260px; border-radius: 14px; display: block; margin: 6px 0; }

/* 结论卡片 */
.verdict {
  border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 14px; padding: 14px 18px; margin: 10px 0;
  background: var(--bg-elev); box-shadow: var(--shadow-1);
}
.verdict.valid { border-left-color: #34a853; }
.verdict.changed { border-left-color: #f9ab00; }
.verdict.fallback { border-left-color: #ab47bc; }
.verdict-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 4px; }
.verdict-head .badge {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px; color: #fff;
}
.verdict.valid .badge { background: #34a853; }
.verdict.changed .badge { background: #f9ab00; }
.verdict.fallback .badge { background: #ab47bc; }
.verdict-sub { font-size: 13px; color: var(--text-3); }

/* 依据时点：准信的核心卖点是「时效性」，所以最新依据的日期要用强调色顶出来，
   而不是跟在文号后面当一个不起眼的小字。 */
.freshness {
  margin-top: 8px; font-size: 13px; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent-border, var(--line));
}
.freshness b { color: var(--accent); font-weight: 600; letter-spacing: .01em; }
.freshness.muted { background: var(--bg-soft-2); border-color: var(--line); }

/* 依据条目上的「施行 / 发布」年月徽标 */
.eff-date {
  font-style: normal; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 6px; margin-right: 6px;
  background: var(--accent-soft); color: var(--accent);
  letter-spacing: .02em; white-space: nowrap;
}
.evi .eff-date { vertical-align: 1px; }

.lanes { display: grid; gap: 12px; margin: 12px 0; }
@media (min-width: 860px) { .lanes { grid-template-columns: 1fr 1fr; } }
.lane {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-elev); padding: 14px 16px;
}
.lane-head {
  display: inline-block; font-size: 13px; font-weight: 600;
  padding: 3px 12px; border-radius: 999px; margin-bottom: 8px;
}
.lane-head.exam { background: var(--accent-soft); color: var(--accent-text); }
.lane-head.curr { background: var(--ok-bg); color: var(--ok); }
.lane p { margin: 6px 0; }

.basis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ref a, .ref > span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 3px 10px; border-radius: 999px;
  background: var(--bg-soft); text-decoration: none;
}
.ref a:hover { background: var(--accent-soft); }

.tag { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.muted { background: var(--bg-soft-2); color: var(--text-3); }

.fold { border-radius: 12px; background: var(--bg-soft); padding: 10px 14px; margin: 10px 0; }
.fold summary { cursor: pointer; color: var(--text-2); font-size: 14px; }
.evi { margin: 10px 0 2px; padding-left: 22px; font-size: 13px; }
.evi li { margin-bottom: 8px; color: var(--text-2); }
.small { font-size: 13px; }
.muted { color: var(--text-3); }
.ai-lead { font-size: 16px; margin: 6px 0; }
.disclaimer {
  font-size: 12.5px; color: var(--text-3);
  background: var(--bg-soft); border-radius: 10px; padding: 8px 12px; margin-top: 10px;
}
.asof { font-size: 13px; color: var(--text-3); }
.ok-text { color: var(--ok); }

.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.think { display: flex; flex-direction: column; gap: 4px; padding: 2px 0; }
.think .typing { padding: 2px 0; }
.think-stage { font-size: 13px; color: var(--text-2); }
.think-tip { font-size: 12px; color: var(--text-3); }
.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--line-2);
  animation: bounce 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ============ 输入区 ============ */
.composer-wrap { padding: 8px 16px 18px; flex: 0 0 auto; }
.composer {
  max-width: 820px; margin: 0 auto;
  background: var(--bg-soft); border: 1.5px solid transparent;
  border-radius: var(--radius-lg); padding: 8px 8px 6px 18px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.composer:focus-within { background: var(--bg-elev); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.composer.drag { border-color: var(--brand-1); border-style: dashed; background: var(--bg-elev); }

.composer textarea {
  width: 100%; border: none; outline: none; background: transparent;
  resize: none; max-height: 180px; min-height: 26px; padding: 8px 8px 4px 0;
  line-height: 1.6;
}
.composer-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.att-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 4px 8px; }
.att {
  display: inline-flex; align-items: center; gap: 8px; max-width: 280px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px 10px; font-size: 13px;
}
.att img { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; }
.att .ic { width: 26px; height: 26px; display: grid; place-items: center; color: var(--accent-text); flex: 0 0 auto; }
.att .meta { min-width: 0; }
.att .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.att .st { display: block; font-size: 11.5px; color: var(--text-3); }
.att button { color: var(--text-3); flex: 0 0 auto; }

.composer-hint { max-width: 820px; margin: 8px auto 0; text-align: center; font-size: 12.5px; color: var(--text-3); }
.composer-hint .err { color: var(--danger); }

.tool {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 6px 12px; border-radius: 999px;
  background: transparent; color: var(--text-3); border: 1px solid transparent;
}
.tool:hover { background: var(--bg-elev); color: var(--text); }
.tool.on { background: var(--accent-soft); color: var(--accent-text); }
.tool svg { width: 16px; height: 16px; }

.send-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .14s ease, background .18s ease;
}
.send-btn:disabled { background: var(--bg-soft-2); color: var(--text-3); cursor: not-allowed; }
.send-btn:not(:disabled):hover { transform: scale(1.06); }
.send-btn svg { width: 18px; height: 18px; }
html[data-theme="dark"] .send-btn { background: #a8c7fa; color: #062e6f; }

/* ============ 认证（ChatGPT 风格弹窗）============ */
.auth-mask {
  position: fixed; inset: 0; z-index: 90; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.auth-card {
  width: 100%; max-width: 420px; background: var(--bg-elev);
  border-radius: 22px; padding: 32px 32px 26px;
  box-shadow: var(--shadow-2); animation: appear .28s cubic-bezier(.2, .8, .2, 1) both;
  max-height: 92vh; overflow-y: auto;
}
.auth-logo { width: 44px; height: 44px; display: block; margin: 0 auto 12px; }
.auth-title { text-align: center; font-size: 24px; font-weight: 500; margin: 0 0 4px; }
.auth-sub { text-align: center; color: var(--text-3); font-size: 14px; margin: 0 0 22px; }

.seg {
  display: flex; gap: 4px; background: var(--bg-soft);
  border-radius: 999px; padding: 4px; margin-bottom: 20px;
}
.seg-btn {
  flex: 1; padding: 8px; border-radius: 999px; color: var(--text-2);
  transition: background .2s ease, color .2s ease;
}
.seg.sm { flex-wrap: nowrap; }
.seg.sm .seg-btn { flex: 0 0 auto; white-space: nowrap; }
.seg-btn.on { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-1); font-weight: 500; }

.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span { display: block; font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.auth-field input, .field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg-elev); outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.auth-field input:focus, .field input:focus, .field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { flex: 0 0 auto; }
/* 带「眼睛」开关的密码框 */
.pwd-row { position: relative; display: block; }
.pwd-row > input { padding-right: 44px; }
.pwd-row .pwd-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-3); cursor: pointer;
}
.pwd-row .pwd-eye:hover { background: var(--bg-soft); color: var(--text); }
.pwd-row .pwd-eye svg { width: 19px; height: 19px; }
.auth-field .pwd-row { margin-top: 0; }
.auth-err {
  color: var(--danger); font-size: 13px; text-align: center;
  background: var(--danger-bg); border-radius: 10px; padding: 8px 12px; margin: 10px 0 0;
}
.auth-ok {
  color: var(--ok); font-size: 13px;
  background: var(--ok-bg); border-radius: 10px; padding: 8px 12px; margin: 10px 0 0;
}
.auth-hint { color: var(--text-3); font-size: 12.5px; text-align: center; margin: 12px 0 0; }
.auth-link { display: block; text-align: center; margin: 14px 0 0; font-size: 14px; }
.auth-link button { color: var(--accent-text); text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12.5px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dev-link {
  background: var(--bg-soft); border: 1px dashed var(--line-2); border-radius: 10px;
  padding: 10px 12px; margin-top: 12px; font-size: 12.5px; word-break: break-all;
}

/* ============ 通用弹窗（跟随主题，浅色为主）============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 80; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .18s ease both;
}
.modal {
  width: 100%; max-width: 480px; background: var(--bg-elev);
  border-radius: 20px; box-shadow: var(--shadow-2); overflow: hidden;
  animation: appear .24s cubic-bezier(.2, .8, .2, 1) both;
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; font-size: 16px; }
.modal-icon {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.modal.warn .modal-icon { background: var(--warn-bg); color: var(--warn); }
.modal-head b { flex: 1; font-weight: 600; }
.modal-body { padding: 0 20px 8px; color: var(--text-2); }
.modal-input {
  width: 100%; margin-top: 12px; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg-elev); color: var(--text); outline: none;
}
.modal-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 轻提示（替代浏览器原生 alert） */
.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  max-width: min(420px, 80vw); padding: 12px 18px; border-radius: 14px;
  background: var(--bg-elev); color: var(--text); font-size: 13.5px;
  box-shadow: var(--shadow-2); border: 1px solid var(--line);
}
.toast.warn { border-color: var(--warn); color: var(--warn); }
.toast.ok { border-color: var(--ok); color: var(--ok); }
.toast-enter-active, .toast-leave-active { transition: opacity .22s ease, transform .22s ease; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateY(12px); }
.modal-line { margin: 6px 0; }
.modal-bullets { margin: 10px 0; padding-left: 20px; }
.modal-bullets li { margin-bottom: 6px; }
.modal-note { color: var(--text-3); font-size: 13px; margin-top: 10px; }
.modal-code { display: block; background: var(--bg-soft); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.modal-code span { display: block; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.modal-code code { font-size: 14px; word-break: break-all; color: var(--accent-text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 20px; }

/* ============ 侧滑面板 ============ */
.sheet-mask {
  position: fixed; inset: 0; z-index: 70; background: var(--scrim);
  display: flex; justify-content: flex-end; animation: fade .18s ease both;
}
.sheet {
  width: 100%; max-width: 420px; height: 100%;
  background: var(--bg-elev); display: flex; flex-direction: column;
  border-radius: 24px 0 0 24px;
  animation: sheetIn .34s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes sheetIn {
  from { transform: translateX(60px) scale(.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.sheet-body > * { animation: appear .32s cubic-bezier(.2, .8, .2, 1) both; }
.sheet-body > *:nth-child(2) { animation-delay: .04s; }
.sheet-body > *:nth-child(3) { animation-delay: .08s; }
.sheet-body > *:nth-child(4) { animation-delay: .12s; }

/* 侧滑打开时主界面轻微后退（Gemini 的推拉手感） */
.shell .gmain, .shell .gside { transition: transform .34s cubic-bezier(.2, .8, .2, 1); }
.shell.pushed .gmain { transform: scale(.985) translateX(-6px); }
.sheet-head {
  display: flex; align-items: center; padding: 16px 12px 12px 22px;
  border-bottom: 1px solid var(--line); font-size: 17px;
}
.sheet-head b { flex: 1; font-weight: 600; }
.sheet-body { padding: 18px 22px 30px; overflow-y: auto; }
.sec { margin: 24px 0 10px; font-size: 14px; color: var(--text-3); font-weight: 600; }
.sec:first-child { margin-top: 0; }
.field { display: block; margin-bottom: 14px; font-size: 14px; color: var(--text-2); }
.field input, .field select { margin-top: 6px; display: block; }
.field textarea {
  margin-top: 6px; display: block; width: 100%; box-sizing: border-box;
  padding: 10px 12px; border-radius: 12px; resize: vertical;
  border: 1px solid var(--line-2); background: var(--bg-elev); color: var(--text-1);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px;
}
/* 自定义模型平台（AutoDL / 中转站）：接口地址与模型由用户填 */
.custom-provider {
  border: 1px dashed var(--line-2); border-radius: 14px;
  padding: 12px 14px; margin: 4px 0 14px; background: var(--bg-soft);
}
.hint { color: var(--text-3); font-size: 13px; margin: 6px 0; }
.chain {
  background: var(--bg-soft); border-radius: 10px; padding: 10px 12px;
  font-size: 13px; color: var(--text-2); word-break: break-all; margin: 6px 0 12px;
}
.plain { padding-left: 20px; color: var(--text-2); font-size: 14px; }
.plain li { margin-bottom: 6px; }
.acct-line { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }

/* 准信记忆 */
.mem-add { display: flex; gap: 8px; margin-bottom: 12px; }
.mem-add select {
  flex: 0 0 110px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg-elev);
}
.mem-add input {
  flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg-elev); outline: none;
}
.mem-add input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mem-list { display: flex; flex-direction: column; gap: 8px; }
/* 准信记忆：两类切换 */
.mem-tabs { display: flex; gap: 6px; margin: 10px 0; }
.mem-tab {
  padding: 7px 14px; border-radius: 999px; font-size: 13px;
  background: var(--bg-soft); color: var(--text-2); transition: all .18s ease;
}
.mem-tab.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.mem-tab.lg { font-size: 14px; }
.mem-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft); border-radius: 12px; padding: 9px 12px;
}
.mem-text { flex: 1; min-width: 0; font-size: 14px; word-break: break-word; }

/* 主题切换：三选一 */
.theme-seg { display: flex; gap: 4px; background: var(--bg-soft); border-radius: 999px; padding: 4px; }
.theme-seg button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px; border-radius: 999px; font-size: 13px; color: var(--text-2);
}
.theme-seg button.on { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-1); font-weight: 500; }
.theme-seg svg { width: 16px; height: 16px; }

/* ============ 管理大屏 ============ */
.admin { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.admin-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: var(--bg-elev); position: sticky; top: 0; z-index: 20;
}
.admin-head b { font-size: 17px; font-weight: 600; }
.admin-body { padding: 22px; max-width: 1360px; width: 100%; margin: 0 auto; }

.admin-tabs {
  display: flex; gap: 6px; padding: 10px 22px 0; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); background: var(--bg-elev);
  position: sticky; top: 61px; z-index: 19;
}

/* 整页视图（设置 / 三个核心功能）：在聊天主区内切换，保留左侧栏 */
.page-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.page-body .admin-tabs { position: static; }

/* API Key 一行一个平台，便于阅读与操作 */
.key-row {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 12px; background: var(--bg-soft);
}
.key-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.key-row input, .key-row textarea {
  width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--bg-elev); color: var(--text-1);
  font-size: 13px; font-family: inherit;
}
/* Key 输入框 + 眼睛按钮 */
.key-input { position: relative; display: flex; align-items: center; }
.key-input input { padding-right: 42px; }
.key-input .icon-round { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; }
.key-input .icon-round svg { width: 17px; height: 17px; }
.more-providers { margin: 4px 0 14px; }
.more-list { margin-top: 12px; padding-left: 12px; border-left: 2px solid var(--line-2); }
.key-row textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; }
.key-row .mt6 { margin-top: 6px; }
.key-ops { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.atab {
  padding: 10px 16px; color: var(--text-3); font-size: 14px;
  border-bottom: 2px solid transparent;
}
.atab:hover { color: var(--text); background: var(--bg-soft); }
.atab.on { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 500; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.kpi .v { font-size: 28px; font-weight: 600; line-height: 1.2; }
.kpi .k { font-size: 13px; color: var(--text-3); }

.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; }
.card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.card .cap { font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.grid-2 { display: grid; gap: 18px; }
@media (min-width: 1000px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.tbl-wrap { overflow-x: auto; }
table.dt { width: 100%; border-collapse: collapse; font-size: 14px; }
table.dt th {
  text-align: left; font-weight: 600; color: var(--text-3); font-size: 13px;
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.dt td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.dt tr:last-child td { border-bottom: none; }
table.dt select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-elev); }
.ops { display: flex; gap: 6px; flex-wrap: wrap; }
.mini {
  padding: 4px 10px; border-radius: 8px; font-size: 13px;
  background: var(--bg-soft); color: var(--text-2);
}
.mini:hover { background: var(--bg-soft-2); color: var(--text); }
.mini.danger { color: var(--danger); }
.mini.danger:hover { background: var(--danger-bg); }

.bars { display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 170px; padding: 8px 0 0; }
.bars .bar-col { max-width: 72px; }

/* 用量图表：控制条 + 可伸缩柱状 */
.chart-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-head > div:first-child { flex: 1; min-width: 220px; }
.chart-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.custom-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; font-size: 13px; color: var(--text-2); }
.custom-range input[type="date"] {
  padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-elev); color: var(--text); outline: none;
}

/* ===== DeepSeek 风格图表：左侧坐标参考系 + 横排日期 ===== */
.dchart { display: flex; gap: 8px; height: 240px; margin-top: 6px; }
.dchart-y {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 2px 0 22px; text-align: right; flex: 0 0 auto; min-width: 42px;
  font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
.dchart-area { position: relative; flex: 1; min-width: 0; }
.dchart-grid { position: absolute; inset: 2px 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; }
.dchart-grid i { display: block; height: 1px; background: var(--line); opacity: .7; }
.dchart-bars {
  position: absolute; inset: 2px 0 0 0; display: flex; align-items: flex-end;
  justify-content: space-around; gap: 2px; overflow-x: auto; overflow-y: hidden; padding-bottom: 22px;
}
.dchart-bars .dcol {
  flex: 0 0 auto; width: 46px; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px;
}
.dchart-bars .dbar {
  width: 74%; max-width: 40px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--brand-1), var(--brand-2));
  transition: height .2s ease;
}
.dchart-bars .dbar.alt { background: linear-gradient(180deg, #5fa8d3, #7b86e8); }
.dchart-bars .dlabel {
  font-size: 10.5px; color: var(--text-3); white-space: nowrap;
  transform: rotate(0deg);
}
.mini-input {
  padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-elev); color: var(--text); outline: none; font-size: 13px;
}
.mini-input.wide { width: 100%; max-width: 420px; margin: 8px 0 12px; display: block; }
.mini-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ok-pill { background: var(--ok-bg); color: var(--ok); }
.warn-pill { background: var(--warn-bg); color: var(--warn); }
.ok-text { color: var(--ok); }
.err-text { color: var(--danger); }

/* 政策异动雷达：关注关键词的添加与标签 */
.sub-add { display: flex; gap: 10px; align-items: center; margin: 12px 0 4px; }
.sub-add input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); font-size: 14px; }
.sub-add input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
.sub-add .btn { flex: 0 0 auto; }
/* 关注标签（带删除按钮），与首页 hero 的展示型 .chip 区分开 */
.chips.sub-chips, .card .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.card .chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px 6px 14px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-text);
  font-size: 13px; border: 1px solid transparent; }
.chip .chip-x { border: none; background: transparent; color: inherit; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 4px; opacity: .65; }
.chip .chip-x:hover { opacity: 1; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.warn-text { color: var(--warn, #b26a00); }
.smtp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 16px; }
.seg.sm { padding: 3px; }
.seg.sm .seg-btn { padding: 5px 10px; font-size: 12.5px; }
.chart-zoom { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.chart-bars { height: 220px; overflow-x: auto; justify-content: flex-start; gap: 4px; }
/* 数据点少时不要把柱子横向拉满整行，保持固定柱宽更好读 */
.chart-bars .bar-col { flex: 0 0 auto; min-width: 34px; max-width: 76px; }
.chart-bars .lb { transform: rotate(-45deg); transform-origin: center; font-size: 10px; }

/* 平台分布条形 */
.dist { display: flex; flex-direction: column; gap: 10px; }
.dist-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dist-name { flex: 0 0 96px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-bar { flex: 1; height: 12px; border-radius: 999px; background: var(--bg-soft-2); overflow: hidden; }
.dist-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
}
.dist-val { flex: 0 0 130px; text-align: right; color: var(--text-3); font-size: 12.5px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; height: 100%; }
.bar {
  width: 100%; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--brand-1), var(--brand-2));
  min-height: 3px;
}
.bar-col .lb { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
/* 空状态：不只一行灰字，给一个弱化图标 + 一句话引导，避免「太干」 */
.empty {
  color: var(--text-3); font-size: 13px; padding: 26px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 1px dashed var(--line); border-radius: 12px; background: var(--bg-soft);
}
.empty::before {
  content: '◍';
  font-size: 22px; color: var(--line-2); line-height: 1;
}
.empty .empty-title { font-size: 14px; color: var(--text-2); font-weight: 500; }
.empty .empty-hint { font-size: 12px; color: var(--text-3); }

.map { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #eef2f8; }
html[data-theme="dark"] .map { background: #1a1c1e; }
.map img { display: block; width: 100%; }
/* 深色主题下把浅色底图整体反相，融入暗色界面 */
html[data-theme="dark"] .map img { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(1.08); }
.pin { position: absolute; transform: translate(-50%, -50%); }
.map .dot {
  display: block; width: 12px; height: 12px; border-radius: 50%;
  background: #ea4335; border: 2px solid #fff;
  animation: ping 2.4s ease-out infinite;
}
html[data-theme="dark"] .map .dot { border-color: #131314; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(234, 67, 53, .5); }
  70% { box-shadow: 0 0 0 14px rgba(234, 67, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 67, 53, 0); }
}
.map .lbl {
  position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%);
  background: var(--bg-elev); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 8px; font-size: 12px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .18s ease;
}
.pin:hover .lbl { opacity: 1; }

/* 中国行政区划地图：可缩放、可拖动 */
.map-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.map-china {
  height: 460px; overflow: hidden; cursor: grab;
  background: #eef2f8; user-select: none;
}
html[data-theme="dark"] .map-china { background: #16181a; }
.map-china:active { cursor: grabbing; }
.map-leaflet { height: 460px; }
.map-leaflet .leaflet-container { background: #eef2f8; font: inherit; }
html[data-theme="dark"] .map-leaflet .leaflet-container { background: #16181a; }
.map-leaflet .leaflet-popup-content { font-size: 12.5px; line-height: 1.6; }
/* 底图切换小分段控件 */
.map-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.map-seg .mini { border-radius: 0; border: none; }
.map-seg .mini.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
/* 聚合气泡与红点 */
.zx-cluster {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-weight: 600; font-size: 13px;
  background: radial-gradient(circle at 35% 30%, #ff7a6b, #ea4335 70%);
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(234, 67, 53, .45);
}
html[data-theme="dark"] .zx-cluster { border-color: #131314; }
.zx-dot-wrap { display: flex; align-items: center; justify-content: center; }
.zx-dot { width: 14px; height: 14px; border-radius: 50%; background: #ea4335; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
html[data-theme="dark"] .zx-dot { border-color: #131314; }
.map-inner { width: 100%; height: 100%; }
.china-svg { width: 100%; height: 100%; display: block; }
.china-svg path {
  fill: #cfdcf0; stroke: #ffffff; stroke-width: 1.6;
  transition: fill .18s ease;
}
html[data-theme="dark"] .china-svg path { fill: #2b3033; stroke: #0e1011; stroke-width: 1.6; }
.china-svg path:hover { fill: #b6cdf0; }
html[data-theme="dark"] .china-svg path:hover { fill: #3a4a63; }
.china-svg .map-dot {
  fill: #ea4335; stroke: #fff; stroke-width: 2;
  animation: ping 2.4s ease-out infinite;
}
html[data-theme="dark"] .china-svg .map-dot { stroke: #131314; }

.read-conv { border: 1px solid var(--line); border-radius: 14px; margin-top: 14px; overflow: hidden; }
.read-conv header { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.read-conv header b { flex: 1; font-size: 14px; }
.read-msgs { max-height: 380px; overflow-y: auto; padding: 10px 14px; }
.rm { padding: 8px 12px; border-radius: 12px; margin-bottom: 8px; white-space: pre-wrap; font-size: 13.5px; }
.rm.user { background: var(--bg-soft); }
.rm.assistant { background: var(--accent-soft); }

/* ============ 移动端 ============ */
.menu-btn { display: none; }

/* ============ 离线横幅 ============ */
.offline-bar {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 8px 14px; font-size: 13px; color: var(--warn);
  background: var(--warn-bg); border-bottom: 1px solid var(--warn);
}

/* ============ 首次使用引导 ============ */
.onboard { max-width: 420px; }
.onboard-title { font-size: 16px; font-weight: 650; margin: 4px 0 8px; }
.onboard-dots { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.onboard-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line, #d5d5d5); transition: background .2s, transform .2s;
}
.onboard-dots span.on { background: var(--accent); transform: scale(1.25); }

/* 模型链步骤列表 */
.chain-steps { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.chain-steps li { margin: 4px 0; }
.chain-steps .small { margin-left: 6px; }

/* 条文知识库统计卡片 */
.kb-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.kb-stat {
  flex: 1 1 120px; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); display: flex; flex-direction: column; gap: 4px;
}
.kb-stat b { font-size: 20px; color: var(--accent-text); }
.kb-stat span { font-size: 12px; color: var(--muted); }
.kb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }

/* ===== 三平台对比（答辩演示） ===== */
.cmp-legend { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; flex-wrap: wrap; }
.cmp-chip { font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.cmp-chip.old { background: var(--bg-soft-2); color: var(--text-3); }
.cmp-chip.new { background: var(--accent-soft); color: var(--accent); }
.cmp-vs { font-size: 12px; color: var(--text-3); }
.cmp-card { margin-top: 14px; }
.cmp-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.cmp-no {
  flex: 0 0 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.cmp-q { font-size: 15px; line-height: 1.6; color: var(--text); font-weight: 600; }
.cmp-grid { display: grid; gap: 12px; }
@media (min-width: 860px) { .cmp-grid { grid-template-columns: 1fr 1fr; } }
.cmp-side { border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; background: var(--bg-soft); }
.cmp-side.old { border-left: 3px solid var(--text-3); }
.cmp-side.new { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.cmp-side-head { font-size: 12.5px; font-weight: 600; margin-bottom: 7px; }
.cmp-side.old .cmp-side-head { color: var(--text-3); }
.cmp-side.new .cmp-side-head { color: var(--accent); }
.cmp-answer { font-size: 15px; font-weight: 600; line-height: 1.7; color: var(--text); margin-bottom: 6px; }
.cmp-side.new .cmp-answer { color: var(--accent-text, var(--text)); }

/* 模型链卡片 */
.chain-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 12px; }
.chain-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  background: var(--panel); display: flex; flex-direction: column; gap: 6px;
}
.chain-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft) inset; }
.chain-card .cc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chain-card .chain-steps { margin: 4px 0 8px; }

/* 意图分布条 */
.intent-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.intent-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.intent-row .it-name { flex: 0 0 84px; color: var(--text-2); }
.intent-row .it-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg-soft-2); overflow: hidden; }
.intent-row .it-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.intent-row .it-num { flex: 0 0 40px; text-align: right; color: var(--muted); }

/* ============ 移动端附件面板（+ 号展开） ============ */
/* 「一眼答案」：学生打开就能抄的结论，放在双轨之上一整条 */
.quick-answer {
  grid-column: 1 / -1;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent);
}
.quick-answer .qa-label {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; color: #fff;
  background: var(--accent); border-radius: 999px; padding: 2px 10px; margin-top: 2px;
}
html[data-theme="dark"] .quick-answer .qa-label { color: #062e6f; }
.quick-answer p { margin: 0; font-weight: 600; color: var(--text); }

/* 每条口径的结论 + 得分点 */
.lane-conclusion { font-weight: 600; margin-bottom: 6px; }
.key-points { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.key-points li { margin: 3px 0; }
.lane-detail { margin-top: 6px; }

.plus-btn { display: none; }
.attach-panel {
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px;
  padding: 10px; background: var(--panel-2, var(--panel));
}
.attach-actions { display: flex; gap: 10px; }
.attach-actions button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text); font-size: 12.5px; cursor: pointer;
  transition: border-color .18s, transform .18s, background .18s;
}
.attach-actions button:active { transform: scale(.96); background: var(--accent-soft); }
.attach-actions .ai {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
}
.attach-recent { margin-top: 10px; }
.attach-recent .ttl { font-size: 12px; color: var(--muted); }
.attach-recent .strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 6px; padding-bottom: 2px; }
.attach-recent .thumb {
  flex: 0 0 auto; width: 60px; height: 60px; padding: 0; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); background: none; cursor: pointer;
}
.attach-recent .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-tip { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .gside { position: fixed; inset: 0 auto 0 0; z-index: 60; box-shadow: var(--shadow-2); }
  .gside.hidden { margin-left: -288px; }
  .stream, .composer-wrap { padding-left: 12px; padding-right: 12px; }
  .admin-body { padding: 16px 12px; }
  .admin-head, .admin-tabs { padding-left: 12px; padding-right: 12px; }
  .admin-tabs { top: 57px; }
  /* 窄屏顶栏：对话名让位给标签，避免被截成「新…」 */
  .chat-title { display: none; }
  .pill { max-width: 150px; }
  .gb { padding: 0 8px; gap: 6px; }
  /* 手机端：+ 号替代回形针，附件面板改为底部抽屉观感 */
  .plus-btn { display: inline-flex; }
  .clip-btn { display: none; }
  .attach-panel { border-radius: 14px; box-shadow: var(--shadow-1); }
  /* 输入区给键盘留出更舒适的高度 */
  .composer textarea { font-size: 16px; }
}

@media (max-width: 430px) {
  /* 更窄的手机：模型标签只留图标，把空间留给主题 / 账号按钮 */
  .pill { max-width: 40px; padding: 5px 9px; }
  .pill { font-size: 0; }
  .pill svg { width: 16px; height: 16px; }
}

/* 更窄的手机（iPhone SE 等）：按钮文字换成图标，避免换行 */
@media (max-width: 400px) {
  .composer-bar .tool span, .composer-bar .tool { font-size: 12px; }
  .attach-actions button { font-size: 11.5px; }
}

/* 平板横屏 / 常见笔记本：中间栏限宽，保证阅读舒适 */
@media (min-width: 901px) and (max-width: 1280px) {
  .stream, .composer-wrap { max-width: 820px; margin-left: auto; margin-right: auto; }
}

/* 无障碍：键盘聚焦时给清晰描边 */
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
