/* 问渠 AskFlow —— 全局样式 */

:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1f2430;
  --ink-2: #5b6472;
  --ink-3: #98a1b0;
  --line: #e6e9f0;
  --brand: #4f6ef7;
  --brand-soft: #eef1fe;
  --green: #2eb872;
  --green-soft: #e8f7ef;
  --red: #e5484d;
  --red-soft: #fdecec;
  --amber: #d97706;
  --amber-soft: #fdf3e3;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(31, 36, 48, 0.06);
  --shadow-lg: 0 8px 30px rgba(31, 36, 48, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}

a { color: var(--brand); text-decoration: none; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 20px;
}
.logo { font-weight: 700; font-size: 17px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 6px 14px; border-radius: 999px;
  color: var(--ink-2); font-size: 14px;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand); }
.nav a.active { background: var(--brand); color: #fff; }

.container { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; }

/* ---------- 主页：学习卡片 ---------- */
.home-hero { text-align: center; margin: 18px 0 26px; }
.home-hero h1 { font-size: 26px; letter-spacing: 1px; }
.home-hero p { color: var(--ink-2); margin-top: 6px; font-size: 14px; }

.daily-card {
  background: linear-gradient(165deg, #ffffff 55%, #f3f6ff);
  border: 1px solid #edf0fb;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 30px 36px 28px;
  position: relative;
  overflow: hidden;
}
/* 右侧水印装饰，填充空白区 */
.card-deco {
  position: absolute; right: 30px; top: 26px;
  font-size: 88px; line-height: 1;
  opacity: 0.12; transform: rotate(12deg);
  pointer-events: none; user-select: none;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.daily-card .swap-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px;
  background: #fff; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.daily-card .swap-btn:hover { color: var(--brand); border-color: var(--brand); }
.daily-card .swap-btn:disabled { opacity: .6; cursor: default; }
.daily-card .term {
  font-size: 40px; font-weight: 800; letter-spacing: 0.5px;
  margin: 4px 0 2px;
}
.daily-card .alias { color: var(--ink-3); font-size: 13px; margin-bottom: 8px; }
.daily-card .category-tag {
  display: inline-block; background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 600; padding: 4px 14px; border-radius: 999px;
}
.daily-card .brief {
  font-size: 16px; color: var(--ink-2); margin-top: 10px; max-width: 660px;
}
/* 详细讲解 / 示例区块 */
.card-section { margin-top: 18px; max-width: 720px; }
.card-section h3 {
  font-size: 14px; color: var(--ink);
  margin-bottom: 8px; letter-spacing: 0.5px;
}
.card-section p { font-size: 14.5px; color: var(--ink-2); }
.card-section pre {
  background: #f2f4fa; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px;
  font-size: 13px; line-height: 1.6;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  white-space: pre-wrap; word-break: break-word;
  color: #33415c;
}
/* 代码高亮配色（浅色主题） */
.tok-kw  { color: #8250df; font-weight: 600; }  /* 关键字 */
.tok-str { color: #0a7d33; }                    /* 字符串 */
.tok-cmt { color: #98a1b0; font-style: italic; }/* 注释 */
.tok-num { color: #d97706; }                    /* 数字 */
.tok-fn  { color: #1f6feb; }                    /* 函数调用 */
.tok-dec { color: #b35900; }                    /* 装饰器 */

/* ---------- 富文本（AI 回答 / 知识正文） ---------- */
.rich { white-space: normal; }
.rich p { margin: 4px 0; }
.rich h2, .rich h3, .rich h4 { margin: 12px 0 6px; line-height: 1.4; }
.rich h2 { font-size: 17px; }
.rich h3 { font-size: 15.5px; }
.rich h4 { font-size: 14.5px; }
.rich ul, .rich ol { padding-left: 22px; margin: 6px 0; }
.rich li { margin: 2px 0; }
.rich strong { color: var(--ink); }
.rich .code-block {
  background: #f2f4fa; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; margin: 8px 0;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  color: #33415c;
}
.rich .inline-code {
  background: #eef1fe; color: #4f6ef7;
  border-radius: 5px; padding: 1px 6px;
  font-family: Consolas, monospace; font-size: 0.9em;
}
/* markdown 表格 */
.rich .table-wrap { overflow-x: auto; margin: 8px 0; }
.rich table {
  border-collapse: collapse; width: 100%;
  font-size: 13px; line-height: 1.5;
}
.rich th, .rich td {
  border: 1px solid var(--line);
  padding: 6px 12px; text-align: left;
}
.rich th {
  background: var(--brand-soft); color: var(--ink);
  font-weight: 700; white-space: nowrap;
}
.rich td .inline-code { white-space: nowrap; }

/* ---------- 知识库页 ---------- */
.kb-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.kb-tile {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px 20px; text-align: center; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease;
}
.kb-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kb-tile .tile-icon { font-size: 30px; margin-bottom: 6px; }
.kb-tile b { display: block; font-size: 28px; color: var(--brand); }
.kb-tile span { font-size: 13px; color: var(--ink-2); }

.kb-list-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 30px 0 12px;
}
.kb-list-head h2 { font-size: 18px; }
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-row {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 12px 18px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.kb-row:hover { background: var(--brand-soft); }
.kb-row .row-title { font-size: 14px; font-weight: 600; }
.row-meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* ---------- 详情弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 24, 36, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg);
  width: min(820px, 100%); max-height: 86vh;
  display: flex; flex-direction: column;
  padding: 22px 26px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 17px; }
.modal-close {
  border: none; background: var(--bg); border-radius: 8px;
  width: 30px; height: 30px; cursor: pointer; color: var(--ink-2);
}
.modal-close:hover { background: var(--red-soft); color: var(--red); }
.modal-meta { margin: 8px 0 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.modal-body {
  overflow-y: auto; margin-top: 10px;
  font-size: 14px; color: var(--ink-2);
  border-top: 1px solid var(--line); padding-top: 14px;
}

/* 设置弹窗 */
.modal.small { width: min(560px, 100%); }
.set-tip { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 14px; line-height: 1.7; }
.set-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-2); margin-bottom: 10px;
}
.set-row > span, .set-row { font-weight: 600; }
.set-row select, .set-row input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 13px; font-family: inherit;
  background: var(--bg); outline: none;
}
.set-row select:focus, .set-row input:focus { border-color: var(--brand); background: #fff; }
.set-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }

/* 模拟面试上传 */
.iv-uploads { display: flex; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.iv-file {
  flex: 1; min-width: 220px;
  border: 2px dashed var(--line); border-radius: 14px;
  padding: 16px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg);
}
.iv-file:hover { border-color: var(--brand); }
.iv-file input { display: none; }
.iv-file span { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.iv-meta { box-shadow: var(--shadow); }
.divider { height: 1px; background: var(--line); margin: 22px 0 18px; }
.daily-card .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* 统计条 */
.stat-row { display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 150px;
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 16px 20px; text-align: center;
}
.stat b { display: block; font-size: 26px; color: var(--brand); }
.stat span { font-size: 12px; color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; cursor: pointer;
  padding: 10px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 14px rgba(79, 110, 247, 0.35); }
.btn-ghost { background: var(--brand-soft); color: var(--brand); }
.btn-ghost:hover { background: #e0e6fd; }
.btn-danger-soft { background: var(--red-soft); color: var(--red); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.state-box { text-align: center; color: var(--ink-3); padding: 60px 0; font-size: 14px; }

/* ---------- 对话页 ---------- */
.chat-layout { display: flex; height: calc(100vh - 57px); }
.sidebar {
  width: 240px; flex: none;
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.sidebar-head { display: flex; gap: 8px; padding: 14px 12px 10px; }
.btn-small { padding: 7px 14px; font-size: 13px; flex: 1; }
.icon-btn {
  border: 1px solid var(--line); background: var(--bg); border-radius: 10px;
  width: 36px; cursor: pointer; font-size: 16px;
}
.icon-btn:hover { background: var(--brand-soft); }
.session-list { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.session-mode-label {
  font-size: 11px; color: var(--ink-3); letter-spacing: 1px;
  padding: 6px 6px 4px;
}
.session-item {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  font-size: 13px; color: var(--ink-2); margin-bottom: 2px;
}
.session-item:hover { background: var(--bg); }
.session-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.session-item .s-title {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-item .s-del {
  border: none; background: transparent; cursor: pointer;
  color: var(--ink-3); font-size: 12px; border-radius: 6px;
  width: 20px; height: 20px; visibility: hidden;
}
.session-item:hover .s-del { visibility: visible; }
.session-item .s-del:hover { background: var(--red-soft); color: var(--red); }
.llm-badge {
  border-top: 1px solid var(--line);
  padding: 10px 14px; font-size: 12px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-main { flex: 1; min-width: 0; }
.chat-wrap { display: flex; flex-direction: column; height: 100%; }
.chat-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--card);
}
/* 显眼的当前模型徽标 */
.model-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, var(--brand), #8b5cf6);
  color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: default;
}
.mode-switch { display: flex; background: var(--bg); border-radius: 999px; padding: 3px; }
.mode-switch button {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 18px; border-radius: 999px; font-size: 13px; color: var(--ink-2);
}
.mode-switch button.active { background: var(--card); color: var(--brand); font-weight: 700; box-shadow: var(--shadow); }

.topic-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.topic-bar .topic-name { font-weight: 700; color: var(--ink); }
.topic-bar .rounds { color: var(--ink-3); }

.msg-list {
  flex: 1; overflow-y: auto;
  max-width: 860px; width: 100%; margin: 0 auto;
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.msg { display: flex; gap: 10px; max-width: 100%; }
.msg.user { flex-direction: row-reverse; }
.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; background: var(--brand-soft);
}
.msg.user .avatar { background: var(--green-soft); }
.bubble {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 16px; max-width: 76%; font-size: 14.5px;
  white-space: pre-wrap; word-break: break-word;
}
.msg.user .bubble { background: var(--brand); color: #fff; }

.sources { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.source-chip {
  font-size: 11px; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px;
}

/* 知识库无资料提示条（检索分数低于阈值，已自动联网补爬） */
.kb-gap-note {
  align-self: flex-start;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--amber-soft); color: var(--amber);
  border: 1px solid var(--amber); border-radius: var(--radius);
  padding: 9px 14px; font-size: 13px; max-width: 76%;
}
.kb-gap-note a { color: var(--amber); font-weight: 600; text-decoration: none; white-space: nowrap; }
.kb-gap-note a:hover { text-decoration: underline; }

/* 评分卡片 */
.eval-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 4px solid var(--brand);
  padding: 16px 18px; max-width: 76%; font-size: 14px;
}
.eval-card h1, .eval-card h2 { font-size: 15px; margin: 12px 0 6px; }
.eval-card h1:first-child, .eval-card h2:first-child { margin-top: 0; }
.eval-card ul { padding-left: 20px; margin: 4px 0; }
.eval-card .score-line { color: var(--brand); font-weight: 800; }

.cursor::after {
  content: "▍"; color: var(--brand);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* 输入区 */
.input-bar {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 14px 20px 18px;
}
.input-inner {
  max-width: 860px; margin: 0 auto;
  display: flex; gap: 10px; align-items: flex-end;
}
.input-inner textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; font-size: 14px; font-family: inherit;
  min-height: 44px; max-height: 140px; outline: none; background: var(--bg);
}
.input-inner textarea:focus { border-color: var(--brand); background: #fff; }
.hint { max-width: 860px; margin: 8px auto 0; font-size: 12px; color: var(--ink-3); }

/* ---------- 登录/注册/忘记密码页 ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, #eef1fe 0%, var(--bg) 55%);
}
.auth-card {
  width: min(440px, 100%);
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 34px 34px 30px;
}
.auth-logo { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.auth-logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.auth-sub { color: var(--ink-3); font-size: 13px; margin: 4px 0 22px; }

.auth-tabs {
  display: flex; background: var(--bg); border-radius: 999px; padding: 3px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  padding: 8px 0; border-radius: 999px; font-size: 13px; color: var(--ink-2);
}
.auth-tab.active { background: var(--card); color: var(--brand); font-weight: 700; box-shadow: var(--shadow); }

.auth-form { display: flex; flex-direction: column; gap: 2px; }
.auth-form .set-row { margin-bottom: 14px; }
.auth-form .set-row > span { flex: none; width: 72px; }
.auth-submit { justify-content: center; margin-top: 6px; }
.auth-msg { font-size: 13px; margin-top: 16px; min-height: 20px; text-align: center; }
.auth-msg.err { color: var(--red); }
.auth-msg.ok { color: var(--green); }

/* 验证码行：输入框 + 发送按钮 */
.code-row input { flex: 1; }
.code-btn { flex: none; white-space: nowrap; padding: 7px 14px; }
.code-btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- 顶栏用户区（topbar-user.js 注入）---------- */
.topbar-user { display: flex; align-items: center; gap: 10px; margin-left: 12px; }
.tu-email {
  font-size: 12.5px; color: var(--ink-2); max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tu-logout {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-2);
  border-radius: 999px; padding: 4px 14px; font-size: 12.5px; cursor: pointer;
}
.tu-logout:hover { background: var(--red-soft); color: var(--red); border-color: var(--red-soft); }

/* ---------- 通知铃铛 + 下拉面板 ---------- */
.tu-bell {
  position: relative; border: none; background: transparent;
  font-size: 17px; cursor: pointer; padding: 3px 6px; border-radius: 8px;
  line-height: 1;
}
.tu-bell:hover { background: var(--brand-soft); }
.tu-dot {
  position: absolute; top: 1px; right: 2px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 2px #fff;
}
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: 340px; max-width: 92vw;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  overflow: hidden;
}
.np-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.np-actions { display: flex; gap: 8px; }
.np-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 3px 12px; font-size: 12px; cursor: pointer;
}
.np-btn:hover { border-color: var(--brand); color: var(--brand); }
.np-danger:hover { border-color: var(--red); color: var(--red); }
.np-list { max-height: 380px; overflow-y: auto; }
.np-empty { padding: 30px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.np-item { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.np-item:last-child { border-bottom: none; }
.np-item:hover { background: var(--brand-soft); }
.np-item.unread { background: #f4f7ff; }
.np-item.unread .np-title { color: var(--ink); font-weight: 700; }
.np-item.read .np-title, .np-item.read .np-body { color: var(--ink-3); }
.np-title { font-size: 13.5px; color: var(--ink); }
.np-body { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.np-time { font-size: 11px; color: var(--ink-3); margin-top: 5px; }

/* ---------- 知识库：全局/我的 tab 与个人知识库 ---------- */
.kb-tabs { width: fit-content; margin: 0 auto 22px; }
.my-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.my-toolbar .row-meta { margin-left: auto; }
.kb-row .row-right { display: flex; align-items: center; gap: 8px; flex: none; }
.btn-mini { padding: 4px 12px; font-size: 12px; }
.set-row textarea {
  flex: 1; min-width: 0; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 13px; font-family: inherit;
  background: var(--bg); outline: none; line-height: 1.6;
}
.set-row textarea:focus { border-color: var(--brand); background: #fff; }

/* 徽标（爬取状态 / 「我的」标记） */
.badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 2px 12px;
  background: var(--bg); color: var(--ink-2);
}
.badge-mine { background: var(--green-soft); color: var(--green); }
.badge-pending { background: var(--bg); color: var(--ink-3); }
.badge-running { background: var(--brand-soft); color: var(--brand); }
.badge-done { background: var(--green-soft); color: var(--green); }
.badge-partial { background: var(--amber-soft); color: var(--amber); }
.badge-failed { background: var(--red-soft); color: var(--red); }

/* 分页条（全局列表 / 我的知识列表共用） */
.kb-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.kb-pager:empty { margin-top: 0; }
.kb-pager button[disabled] { opacity: .45; cursor: not-allowed; }

/* 爬取进度面板（置顶展示，间距留给下方工具栏；支持多任务并行） */
.crawl-panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin: 0 0 18px; font-size: 13px;
}
.crawl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.crawl-head .modal-close { margin-left: auto; }
.crawl-task { padding: 12px 0 4px; border-top: 1px dashed var(--line); }
.crawl-task:first-child { border-top: none; padding-top: 6px; }
.crawl-task-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.crawl-task-head .ct-url {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crawl-task .progress { margin-bottom: 6px; }

/* 弹窗头部右侧按钮组（详情弹窗：翻译 + 关闭） */
.modal-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.progress {
  height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden;
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--brand), #8b5cf6);
  border-radius: 999px; transition: width .4s ease;
}
/* 不定长进度条：检索阶段无页数可算，用流光动画表示「进行中」 */
.progress-bar-indeterminate {
  background: linear-gradient(90deg, var(--brand), #8b5cf6, var(--brand));
  background-size: 200% 100%;
  animation: progress-flow 1.4s linear infinite;
}
@keyframes progress-flow {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}
/* 任务板子题内的补爬进度（第二行，占满整行） */
.board-crawl-progress { flex-basis: 100%; margin-top: 8px; }
.board-crawl-progress .row-meta { margin-top: 4px; white-space: normal; word-break: break-all; }

/* ---------- 任务板：三栏布局 + 抽屉卡片 + Agent/日志面板 ---------- */
.board-layout {
  max-width: 1280px;
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr) 295px;
  gap: 18px; align-items: start;
}
.board-main { min-width: 0; }
.aside-card { padding: 16px 16px 18px; border-radius: 16px; }
.aside-title { font-size: 14px; margin-bottom: 12px; }
@media (max-width: 1200px) {
  .board-layout { grid-template-columns: 1fr; }
  .board-aside { display: none; }   /* 窄屏收起侧栏，中栏照常 */
}

/* 目标卡片（抽屉） */
.goal-card { padding: 0; overflow: hidden; margin-bottom: 16px; }
.goal-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 22px; cursor: pointer;
}
.goal-head:hover { background: var(--brand-soft); }
.goal-title { font-size: 15px; }
.goal-chevron { color: var(--ink-3); transition: transform .25s; display: inline-block; }
.goal-card.open .goal-chevron { transform: rotate(90deg); }
.goal-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.goal-body { padding: 0 22px 16px; }
.goal-card:not(.open) .goal-body { display: none; }
.goal-flash { animation: goalFlash 1.8s ease; }
@keyframes goalFlash {
  0% { box-shadow: 0 0 0 3px var(--brand); }
  100% { box-shadow: var(--shadow); }
}

/* Agent 动态卡片 */
.agent-card {
  background: var(--bg); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px;
}
.agent-card.working { background: var(--brand-soft); }
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; font-weight: 600; }
.ag-desc { font-size: 12px; color: var(--ink-2); margin-top: 4px; word-break: break-all; line-height: 1.5; }
.ag-time { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* work_log 时间线 */
.wl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13.5px; }
.wl-list { max-height: 420px; overflow-y: auto; }
.wl-entry {
  position: relative; margin-left: 5px;
  border-left: 2px solid var(--line);
  padding: 6px 0 10px 14px;
}
.wl-entry::before {
  content: ''; position: absolute; left: -5px; top: 11px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
}
.wl-action { font-size: 12.5px; font-weight: 600; }
.wl-desc { font-size: 12px; color: var(--ink-2); margin-top: 2px; line-height: 1.5; word-break: break-all; }
.wl-time { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.crawl-pages { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.crawl-page-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.crawl-page-row .pg-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-ok { color: var(--green); font-weight: 700; }
.pg-fail { color: var(--red); font-weight: 700; }
.crawl-summary { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }

/* AI 添加对话弹窗 */
.ai-msgs {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 300px; overflow-y: auto;
  margin: 10px 0 14px; padding: 2px;
}
.ai-msg {
  max-width: 86%; padding: 8px 13px; border-radius: 13px;
  font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.ai-msg.user {
  align-self: flex-end; background: var(--brand); color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg.assistant {
  align-self: flex-start; background: var(--bg); color: var(--ink-2);
  border-bottom-left-radius: 4px;
}
.ai-input-row { display: flex; gap: 8px; }
.ai-input-row input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 13px; font-family: inherit;
  background: var(--bg); outline: none;
}
.ai-input-row input:focus { border-color: var(--brand); background: #fff; }

/* ---------- 管理后台：用户总览表 ---------- */
.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  font-size: 13.5px;
}
.admin-table th, .admin-table td {
  padding: 11px 18px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.admin-table thead th {
  background: var(--brand-soft); color: var(--ink);
  font-size: 13px; white-space: nowrap;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg); }
.admin-table .cell-email { font-weight: 600; color: var(--ink); }
.admin-table .cell-dim { color: var(--ink-3); white-space: nowrap; }

/* 未配置模型引导弹窗（顶栏 topbar-user.js 注入） */
.model-prompt { z-index: 90; }
.model-prompt-card { width: min(480px, 100%); gap: 6px; }
.mp-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.8; margin: 12px 0 4px; }
.mp-text b { color: var(--ink); }
.mp-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.mp-btn {
  border: none; border-radius: 10px; padding: 9px 20px;
  font-size: 13.5px; cursor: pointer; font-weight: 600;
}
.mp-btn.mp-later { background: var(--bg); color: var(--ink-2); }
.mp-btn.mp-later:hover { background: var(--line); }
.mp-btn.mp-go { background: var(--brand); color: #fff; }
.mp-btn.mp-go:hover { filter: brightness(1.06); }

/* 气泡里的行内文字按钮（如「打开模型配置」） */
.link-btn {
  border: none; background: none; padding: 0; margin-left: 2px;
  color: var(--brand); font-size: inherit; font-weight: 600;
  cursor: pointer; text-decoration: underline;
}
.link-btn:hover { filter: brightness(1.15); }

/* 向量化失败横幅（知识库详情/重试） */
.vec-error-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid var(--red-soft); border-radius: 8px;
  background: var(--red-soft); color: var(--red);
  font-size: 13px; line-height: 1.5;
}
.vec-error-box b { flex: none; }
.vec-error-box .act-retry { flex: none; color: var(--red); }
