/* ============ DeepSeek 搜索 - 样式 ============ */

:root, [data-theme="dark"] {
  --bg: #0a0c12;
  --bg-soft: #10131d;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(17, 20, 33, 0.88);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ecf5;
  --text-dim: #9aa3b8;
  --text-faint: #667089;
  --accent: #4d6bfe;
  --accent-2: #8b5cf6;
  --grad: linear-gradient(135deg, #4d6bfe, #8b5cf6);
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --topbar-h: 56px;
}
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --panel: rgba(255, 255, 255, 0.8);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #171d31;
  --text-dim: #5c6579;
  --text-faint: #8b93a7;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  transition: background 0.3s ease;
  user-select: none;
}
.answer, .reader-body, .sc-snippet, .sc-title, .query-echo, .hint { user-select: text; }

button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font-family: inherit; color: var(--text); }
.hidden { display: none !important; }

/* ---------- 背景氛围 ---------- */
#bg-fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
[data-theme="light"] .blob { opacity: 0.35; }
.b1 { width: 480px; height: 480px; left: -140px; top: -120px; background: radial-gradient(circle, #2b46d6, transparent 65%); animation: drift 22s ease-in-out infinite alternate; }
.b2 { width: 420px; height: 420px; right: -120px; top: 120px; background: radial-gradient(circle, #6d28d9, transparent 65%); animation: drift 26s ease-in-out -6s infinite alternate-reverse; }
.b3 { width: 380px; height: 380px; left: 34%; bottom: -180px; background: radial-gradient(circle, #1e3a8a, transparent 65%); animation: drift 30s ease-in-out -12s infinite alternate; }
[data-theme="light"] .b1 { background: radial-gradient(circle, #b9c6ff, transparent 65%); }
[data-theme="light"] .b2 { background: radial-gradient(circle, #ddc9ff, transparent 65%); }
[data-theme="light"] .b3 { background: radial-gradient(circle, #c3d4ff, transparent 65%); }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(60px, 40px) scale(1.12); } }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { border-radius: 8px; box-shadow: 0 4px 14px rgba(77, 107, 254, 0.4); }
.brand-name { font-size: 15px; letter-spacing: 0.2px; color: var(--text-dim); }
.brand-name b { color: var(--text); font-weight: 600; }
.badge {
  font-size: 11px; padding: 3px 9px; border-radius: 999px; margin-left: 4px;
  background: linear-gradient(135deg, rgba(77, 107, 254, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid rgba(99, 102, 241, 0.35); color: #a5b4fc;
}
[data-theme="light"] .badge { color: #4338ca; }
.badge-soft { background: var(--panel); border-color: var(--border); color: var(--text-faint); }
.top-actions { display: flex; align-items: center; gap: 4px; position: relative; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); transition: all 0.15s ease; font-size: 18px; line-height: 1;
}
.icon-btn:hover { background: var(--panel); color: var(--text); }

/* ---------- 主区域 ---------- */
.hero {
  position: relative; z-index: 1; height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; max-width: 760px; margin: 0 auto; text-align: center;
  animation: fadeUp 0.5s ease both;
}
.hero-title { font-size: 42px; font-weight: 300; letter-spacing: 0.5px; }
.hero-title strong {
  font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 12px; color: var(--text-dim); font-size: 14.5px; }

.searchbox {
  margin-top: 34px; width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 18px; border-radius: 999px;
  background: var(--panel-strong); border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
[data-theme="light"] .searchbox { box-shadow: 0 10px 34px rgba(15, 23, 42, 0.1); }
.searchbox:focus-within {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 4px rgba(77, 107, 254, 0.14), 0 14px 44px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}
.sb-icon { color: var(--text-faint); flex: none; }
.searchbox input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  font-size: 16px; padding: 10px 0; color: var(--text);
}
.searchbox input::placeholder { color: var(--text-faint); }
#btn-go {
  flex: none; padding: 11px 26px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: #fff;
  background: var(--grad); box-shadow: 0 6px 18px rgba(77, 107, 254, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
#btn-go:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(77, 107, 254, 0.45); filter: brightness(1.06); }
#btn-go:active { transform: translateY(0); }

.chips { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  padding: 8px 15px; border-radius: 999px; font-size: 13px; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--border);
  transition: all 0.18s ease;
}
.chip:hover { color: var(--text); border-color: rgba(99, 102, 241, 0.55); background: rgba(99, 102, 241, 0.1); transform: translateY(-1px); }

/* ---------- 结果页 ---------- */
.results {
  position: relative; z-index: 1; height: 100vh; overflow-y: auto;
  padding: calc(var(--topbar-h) + 14px) 28px 90px; max-width: 1240px; margin: 0 auto;
  animation: fadeUp 0.35s ease both;
}
/* ---------- 结果页：左右分栏 ---------- */
.results-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(330px, 36%, 440px);
  gap: 18px; align-items: start;
}
.col-side { position: sticky; top: calc(var(--topbar-h) + 10px); }
.col-side .answer-card { max-height: calc(100vh - var(--topbar-h) - 62px); }
.results-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.results-head .searchbox.compact { flex: 1; min-width: 260px; }
.results.side-hidden .results-layout { grid-template-columns: 1fr; }
.results.side-hidden .col-side { display: none; }
@media (max-width: 920px) {
  .results-layout { grid-template-columns: 1fr; }
  .col-side { position: static; order: -1; }
  .col-side .answer-card { max-height: none; }
  .answer-scroll { overflow: visible; }
}

/* 结果页顶部常驻搜索框（紧凑版） */
.searchbox.compact {
  margin-top: 0; padding: 5px 5px 5px 14px; gap: 8px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: none; max-width: 780px;
}
[data-theme="light"] .searchbox.compact { background: rgba(255, 255, 255, 0.72); }
.searchbox.compact:focus-within {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(77, 107, 254, 0.12);
}
[data-theme="light"] .searchbox.compact:focus-within { background: #fff; }
.searchbox.compact .sb-icon { width: 18px; height: 18px; }
.searchbox.compact input { font-size: 14px; padding: 7px 0; }
.searchbox.compact .go-compact {
  flex: none; padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--grad); box-shadow: 0 4px 12px rgba(77, 107, 254, 0.3);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.searchbox.compact .go-compact:hover { filter: brightness(1.08); transform: translateY(-1px); }

.query-echo { font-size: 15px; font-weight: 600; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ghost {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9px;
  font-size: 13px; color: var(--text-dim); background: var(--panel); border: 1px solid var(--border);
  transition: all 0.15s ease;
}
.ghost:hover { color: var(--text); border-color: var(--border-strong); }

.answer-card {
  background: var(--panel-strong); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28); backdrop-filter: blur(14px);
  display: flex; flex-direction: column; min-height: 220px;
}
[data-theme="light"] .answer-card { box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08); }
.answer-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex: none; }
.answer-scroll { overflow-y: auto; min-height: 48px; padding-right: 4px; overscroll-behavior: contain; }
.ai-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; background: var(--grad);
  box-shadow: 0 4px 14px rgba(77, 107, 254, 0.4);
}
.answer-head-text { flex: 1; min-width: 0; }
.answer-title { font-size: 14px; font-weight: 700; }
.answer-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.stop-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  font-size: 12.5px; color: var(--text-dim); background: var(--panel); border: 1px solid var(--border-strong);
  transition: all 0.15s ease;
}
.stop-btn:hover { color: var(--bad); border-color: var(--bad); }

.thinking {
  margin: 10px 0 4px; padding: 10px 14px; border-left: 2px dashed rgba(139, 92, 246, 0.55);
  max-height: 150px; overflow-y: auto; font-size: 12.5px; line-height: 1.7; color: var(--text-faint); font-style: italic;
  white-space: pre-wrap;
}

.answer { font-size: 14.5px; line-height: 1.85; min-height: 24px; }
.answer.streaming::after {
  content: ""; display: inline-block; width: 7px; height: 16px; margin-left: 3px; vertical-align: -2px;
  background: var(--accent); border-radius: 2px; animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* markdown */
.answer h1, .answer h2, .answer h3, .answer h4 { margin: 14px 0 8px; line-height: 1.4; }
.answer h1 { font-size: 20px; } .answer h2 { font-size: 17px; } .answer h3 { font-size: 15.5px; } .answer h4 { font-size: 14.5px; }
.answer p { margin: 8px 0; }
.answer ul, .answer ol { margin: 8px 0; padding-left: 22px; }
.answer li { margin: 4px 0; }
.answer a { color: #8ea2ff; text-decoration: none; border-bottom: 1px dashed rgba(142, 162, 255, 0.5); }
.answer a:hover { color: #b3c1ff; }
.answer code {
  font-family: "Cascadia Code", Consolas, monospace; font-size: 13px;
  background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 1.5px 6px; border-radius: 6px;
}
.answer pre {
  margin: 12px 0; padding: 14px 16px; border-radius: 10px; overflow-x: auto;
  background: #0d1017; border: 1px solid var(--border);
}
[data-theme="light"] .answer pre { background: #101321; }
.answer pre code { background: none; border: none; padding: 0; color: #dbe2f4; font-size: 13px; line-height: 1.7; }
.answer blockquote {
  margin: 10px 0; padding: 8px 16px; border-left: 3px solid var(--accent);
  background: rgba(77, 107, 254, 0.07); border-radius: 0 8px 8px 0; color: var(--text-dim);
}
.answer hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.answer strong { font-weight: 700; }

sup.cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px; margin: 0 2px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; font-style: normal; cursor: pointer;
  color: #c7d2fe; background: rgba(99, 102, 241, 0.16); border: 1px solid rgba(99, 102, 241, 0.35);
  vertical-align: super; line-height: 1; transition: all 0.15s ease;
}
sup.cite:hover { background: var(--grad); color: #fff; transform: translateY(-1px); }
[data-theme="light"] sup.cite { color: #4338ca; }

/* ---------- 来源卡片 ---------- */
.sources { margin-top: 0; }
.sources-title { font-size: 14px; font-weight: 700; color: var(--text-dim); margin-bottom: 12px; display: flex; gap: 8px; align-items: baseline; }
.sources-title span { font-size: 12px; font-weight: 400; color: var(--text-faint); }
.sources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.source-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 15px;
  background: var(--panel-strong); border: 1px solid var(--border); border-radius: 12px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  animation: fadeUp 0.4s ease both; cursor: default;
}
.source-card:hover { transform: translateY(-2px); border-color: rgba(99, 102, 241, 0.5); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.sc-top { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-faint); }
.sc-avatar {
  width: 16px; height: 16px; border-radius: 5px; flex: none; object-fit: cover;
  background: var(--grad); color: #fff; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.sc-site { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-auth {
  flex: none; font-size: 10px; padding: 1.5px 7px; border-radius: 999px;
  color: #6ee7b7; background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.35);
}
.sc-title { font-size: 13.5px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-snippet { font-size: 12.5px; line-height: 1.65; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sc-foot { margin-top: auto; padding-top: 4px; display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-faint); }
.sc-actions { display: flex; gap: 4px; }
.sc-btn { padding: 4px 10px; border-radius: 7px; font-size: 11.5px; color: var(--text-dim); background: var(--panel); border: 1px solid var(--border); transition: all 0.15s ease; }
.sc-btn:hover { color: var(--text); border-color: rgba(99, 102, 241, 0.5); }
.sc-btn:disabled { opacity: 0.5; cursor: wait; }

/* 骨架屏 */
.skel { border-radius: 12px; border: 1px solid var(--border); padding: 14px 15px; display: flex; flex-direction: column; gap: 10px; }
.skel i { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--panel) 25%, rgba(255,255,255,0.1) 50%, var(--panel) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
[data-theme="light"] .skel i { background: linear-gradient(90deg, #eceef5 25%, #f7f8fc 50%, #eceef5 75%); background-size: 200% 100%; }
.skel i:nth-child(1) { width: 45%; height: 12px; } .skel i:nth-child(2) { width: 90%; height: 14px; } .skel i:nth-child(3) { width: 75%; height: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- 历史面板 ---------- */
.panel {
  position: absolute; top: 46px; right: 0; width: 320px; max-height: 420px; overflow-y: auto;
  background: var(--panel-strong); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); backdrop-filter: blur(18px); z-index: 60; padding: 10px;
  animation: fadeUp 0.2s ease both;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 10px; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.panel-head .ghost { padding: 4px 10px; font-size: 12px; }
.history-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text-dim); cursor: pointer; transition: all 0.12s ease;
}
.history-item:hover { background: rgba(99, 102, 241, 0.1); color: var(--text); }
.history-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item time { font-size: 11px; color: var(--text-faint); flex: none; }
.empty-history { padding: 18px; text-align: center; font-size: 12.5px; color: var(--text-faint); }

/* ---------- 状态栏 ---------- */
.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 30px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  font-size: 11.5px; color: var(--text-faint);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--border);
}
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 7px; vertical-align: 1px; }
.dot.busy { background: var(--warn); animation: pulse 1.2s ease infinite; }
.dot.bad { background: var(--bad); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- 对话框 ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 7, 12, 0.6); backdrop-filter: blur(6px); animation: fadeIn 0.18s ease both;
  padding: 24px;
}
.dialog {
  width: 620px; max-width: 100%; max-height: 86vh; overflow-y: auto;
  background: var(--panel-strong); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--shadow); padding: 20px 22px; animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.dialog-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel); border-radius: 10px; border: 1px solid var(--border); margin-bottom: 16px; }
.tab { flex: 1; padding: 8px; border-radius: 7px; font-size: 13.5px; color: var(--text-dim); transition: all 0.15s ease; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(77, 107, 254, 0.3); }

.login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .login-grid { grid-template-columns: 1fr; } }
.login-card {
  padding: 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px; transition: border-color 0.2s ease;
}
.login-card:hover { border-color: var(--border-strong); }
.login-card h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.login-card p { font-size: 12px; line-height: 1.7; color: var(--text-dim); flex: 1; }
.tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 600; color: #fff; background: var(--grad); }
.tag-soft { background: rgba(251, 191, 36, 0.15); color: var(--warn); border: 1px solid rgba(251, 191, 36, 0.4); }
.row { display: flex; align-items: center; gap: 8px; }
.row input[type="password"], .row input[type="text"] {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 9px; font-size: 13px;
  background: var(--bg-soft); border: 1px solid var(--border); outline: none; transition: border-color 0.15s ease;
}
.row input:focus { border-color: rgba(99, 102, 241, 0.6); }
.primary {
  padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--grad); box-shadow: 0 4px 14px rgba(77, 107, 254, 0.3);
  transition: all 0.15s ease;
}
.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary:disabled { opacity: 0.55; cursor: wait; transform: none; }
.hint { font-size: 12px; color: var(--text-faint); }
.hint.ok { color: var(--good); } .hint.bad { color: var(--bad); }
.login-note { margin-top: 14px; font-size: 12px; color: var(--text-faint); line-height: 1.7; }

.pref-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pref-row > label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.pref-row select, .pref-row input[type="range"] { width: 100%; }
.pref-row select {
  padding: 9px 12px; border-radius: 9px; font-size: 13px;
  background: var(--bg-soft); border: 1px solid var(--border); outline: none;
}
input[type="range"] { accent-color: var(--accent); height: 6px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.seg button { flex: 1; padding: 8px; border-radius: 7px; font-size: 13px; color: var(--text-dim); transition: all 0.15s ease; }
.seg button.active { background: var(--grad); color: #fff; font-weight: 600; }

/* ---------- 深读 ---------- */
.reader {
  width: 860px; max-width: 100%; height: 86vh;
  background: var(--panel-strong); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
  animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.reader-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.reader-title { flex: 1; font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-actions { display: flex; align-items: center; gap: 8px; }
.reader-body { flex: 1; overflow-y: auto; padding: 22px 28px; font-size: 14px; line-height: 1.9; }
.reader-body.loading { display: flex; align-items: center; justify-content: center; color: var(--text-faint); gap: 10px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
#toast-box { position: fixed; bottom: 46px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 10px; font-size: 13px; max-width: 70vw;
  background: var(--panel-strong); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); animation: fadeUp 0.25s ease both;
}
.toast.ok { border-color: rgba(52, 211, 153, 0.5); }
.toast.bad { border-color: rgba(248, 113, 113, 0.5); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(140, 150, 180, 0.28); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(140, 150, 180, 0.5); background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
