/* ============================================================
   财税知识引擎 · 现代 SaaS 清爽风设计系统
   设计 token 统一 → 柔和阴影层次 → 自定义控件 → SVG 图标 → 空状态
   ============================================================ */
:root {
  /* 新能源知识引擎同款视觉体系（navy + amber + grid） */
  --bg: #eef1f6;
  --card: #ffffff;
  --ink: #1a2433;
  --ink-2: #3d4a52;
  --muted: #5c6b80;
  --line: #dfe5ee;
  --line-2: #c9d3e0;
  /* 主色（navy + blue） */
  --brand: #1f6feb;
  --brand-d: #1554b8;
  --brand-l: #e8f0fe;
  --brand-l2: #d0e2fc;
  /* 强调/热度色（amber） */
  --hot: #e8930c;
  --hot-l: #fdf3e0;
  --hot-b: #f2ddb4;
  /* 语义色 */
  --teal: #1f9d61;   --teal-l: #e6f6ee;   --teal-b: #b8e6d0;
  --amber: #e8930c;  --amber-l: #fdf3e0;  --amber-b: #f2ddb4;
  --red: #d64545;    --red-l: #fdeaea;    --red-b: #f3c9c2;
  --gray-l: #f2efe9;
  --navy: #0d2137;
  --navy2: #123a5c;
  /* 阴影 */
  --sh-xs: 0 1px 2px rgba(13, 33, 55, .05);
  --sh-sm: 0 1px 4px rgba(13, 33, 55, .07);
  --sh-md: 0 4px 14px rgba(13, 33, 55, .08), 0 2px 4px rgba(13, 33, 55, .04);
  --sh-lg: 0 14px 38px rgba(13, 33, 55, .12), 0 4px 10px rgba(13, 33, 55, .05);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 999px;
  --bar-h: 48px;
  --shadow: var(--sh-sm);
  --radius: var(--r-md);
  --serif: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #b9c4d6; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }
* { scrollbar-width: thin; scrollbar-color: #b9c4d6 var(--bg); }
body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% -4%, rgba(31,111,235,.06), transparent 42%),
    radial-gradient(circle at 92% 0%, rgba(232,147,12,.05), transparent 40%),
    linear-gradient(rgba(13,33,55,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,33,55,.025) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--brand-l2); }

/* ---------- 顶栏（清爽白底 + 精致品牌） ---------- */
.topbar {
  background: linear-gradient(115deg, var(--navy), var(--navy2) 55%, #1c5a94);
  color: #fff;
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  border-bottom: none;
  box-shadow: 0 2px 14px rgba(13,33,55,.28);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 13px; }
.logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(140deg, var(--amber), #f6b93d);
  color: #fff; display: grid; place-items: center;
  font-size: 18px; font-weight: 700;
  box-shadow: 0 2px 10px rgba(232,147,12,.5);
}
.brand h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: .02em; color: #fff; }
.brand .sub { margin: 2px 0 0; font-size: 12px; color: rgba(255,255,255,.7); }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.92); padding: 2px 11px; border-radius: var(--r-full);
  font-size: 11.5px; white-space: nowrap; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge.ok { background: var(--teal-l); border-color: var(--teal-b); color: #0b7268; }
.badge.bad { background: var(--red-l); border-color: var(--red-b); color: #b42318; }
.badge.warn { background: var(--amber-l); border-color: var(--amber-b); color: #b7791f; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 2px; padding: 0 28px;
  background: linear-gradient(115deg, var(--navy), var(--navy2) 55%, #1c5a94);
  border-bottom: none;
  position: sticky; top: 62px; z-index: 49;
}
.tab {
  border: none; background: transparent; cursor: pointer;
  padding: 10px 18px; font-size: 13.5px; color: rgba(255,255,255,.72); font-weight: 500;
  border-bottom: 3px solid transparent; transition: .18s; font-family: inherit;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.06); }
.tab.active { color: #fff; border-bottom-color: var(--amber); font-weight: 600; }
.tab .icon { width: 17px; height: 17px; }

/* ---------- 主体 ---------- */
.topbar::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 82% 120%, rgba(232,147,12,.22), transparent 55%),
  repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 56px); }
main { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 26px 24px 48px; }
.panel { display: none; animation: fade .2s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; } }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; margin: 0 0 12px; }

/* ---------- 通用图标（SVG 替 emoji） ---------- */
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.icon-btn {
  border: none; background: transparent; cursor: pointer; color: var(--muted);
  padding: 5px; border-radius: var(--r-sm); display: inline-grid; place-items: center; transition: .15s;
}
.icon-btn:hover { background: var(--gray-l); color: var(--ink); }
.icon-btn .icon { width: 17px; height: 17px; }
.icon-btn.faved { color: #f59e0b; }

/* ---------- 按钮体系 ---------- */
button { font-family: inherit; }
button.primary {
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  padding: 10px 22px; border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: .16s; box-shadow: 0 1px 2px rgba(23, 107, 117, .22);
  display: inline-flex; align-items: center; gap: 7px;
}
button.primary:hover { background: var(--brand-d); box-shadow: 0 4px 12px rgba(23, 107, 117, .24); transform: translateY(-1px); }
button.primary:active { transform: translateY(0); }
button.primary:disabled { background: #b3b8e8; cursor: not-allowed; box-shadow: none; transform: none; }
button.ghost {
  background: var(--card); color: var(--ink-2); border: 1px solid var(--line-2); cursor: pointer;
  padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 500; transition: .16s;
  display: inline-flex; align-items: center; gap: 7px;
}
button.ghost:hover { color: var(--ink); border-color: #c3ccda; background: #fafbfd; box-shadow: var(--sh-xs); }
button.small { padding: 7px 14px; font-size: 13px; }
button.block { width: 100%; margin-top: 6px; justify-content: center; }
button.danger-text { color: var(--red); }
button.danger-text:hover { border-color: var(--red-b); background: var(--red-l); }

/* ---------- 表单控件（自定义，去原生感） ---------- */
input, select, textarea { font-family: inherit; color: var(--ink); }
input[type="text"], input[type="number"], textarea, select {
  border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 13px;
  font-size: 14px; background: var(--card); transition: .16s; width: 100%;
}
input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 107, 117, .14);
}
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7880' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
/* 单选/复选美化 */
input[type="radio"], input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 17px; height: 17px;
  border: 1.8px solid var(--line-2); background: #fff; cursor: pointer;
  transition: .15s; flex-shrink: 0; position: relative; margin: 0;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"] { border-radius: 5px; }
input[type="radio"]:checked { border-color: var(--brand); border-width: 5px; }
input[type="checkbox"]:checked { border-color: var(--brand); background: var(--brand); }
input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* ---------- 问答（多轮对话） ---------- */
.conv-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.conv-select { flex: 1; min-width: 0; }
.conv-messages {
  display: flex; flex-direction: column; gap: 18px;
  max-height: 52vh; overflow-y: auto; padding: 6px 2px 14px; margin-bottom: 16px;
}
.conv-empty { text-align: center; color: var(--muted); padding: 48px 16px; font-size: 14px; line-height: 2; }
.msg { display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg.ai { align-items: flex-start; }
.bubble { max-width: 86%; padding: 13px 16px; border-radius: 16px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.msg.user .bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 2px 8px rgba(23, 107, 117, .20); }
.msg.ai .bubble { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--sh-sm); }
.msg-cites { width: 86%; margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.msg-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
body.modal-open { overflow: hidden; }

.ask-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-sm); }
#question { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 15px; font-size: 15px; resize: vertical; line-height: 1.6; }
#question:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 107, 117, .14); }
.ask-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.hint { font-size: 12.5px; color: var(--muted); }

.samples { margin-top: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.samples-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.chip {
  background: var(--card); border: 1px solid var(--line-2); color: var(--brand-d);
  padding: 7px 14px; border-radius: var(--r-full); font-size: 13px; cursor: pointer; transition: .16s; font-weight: 500;
}
.chip:hover { background: var(--brand-l); border-color: var(--brand-l2); transform: translateY(-1px); box-shadow: var(--sh-xs); }

.ask-result { margin-top: 20px; }
.answer-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--sh-sm); }
.card-title { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .5px; margin-bottom: 10px; text-transform: uppercase; }
.answer { font-size: 15px; white-space: pre-wrap; word-break: break-word; line-height: 1.8; }
.answer .cursor { display: inline-block; width: 7px; height: 16px; background: var(--brand); animation: blink 1s steps(2) infinite; vertical-align: text-bottom; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0; } }
sup.cite { color: var(--brand); cursor: pointer; font-weight: 700; padding: 0 1px; }
sup.cite:hover { text-decoration: underline; }

.citations { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.cite-card { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: var(--r-md); padding: 13px 15px; cursor: pointer; transition: .16s; }
.cite-card:hover { box-shadow: var(--sh-md); border-color: var(--line-2); transform: translateY(-1px); }
.cite-ref { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--teal); color: #fff; font-size: 12.5px; font-weight: 700; margin-right: 8px; }
.cite-title { font-weight: 600; font-size: 14px; }
.cite-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.cite-snip { font-size: 13px; color: var(--ink-2); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- 检索 ---------- */
.search-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-sm); }
#search-input { flex: 1; min-width: 240px; border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 14px; font-size: 15px; }
#search-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 107, 117, .14); }
.scope { display: flex; gap: 16px; font-size: 13.5px; color: var(--ink-2); align-items: center; }
.scope label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.result-meta { margin: 16px 2px 10px; font-size: 13px; color: var(--muted); font-weight: 500; }

.results { display: flex; flex-direction: column; gap: 10px; }
.result-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 17px; cursor: pointer; transition: .16s; }
.result-item:hover { box-shadow: var(--sh-md); border-color: var(--line-2); transform: translateY(-1px); }
.r-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.r-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.r-no { font-size: 12px; color: var(--brand-d); background: var(--brand-l); padding: 2px 9px; border-radius: 6px; font-weight: 600; }
.tag { font-size: 11.5px; color: var(--muted); background: var(--gray-l); padding: 2px 9px; border-radius: var(--r-full); }
.tag.st-abolished { color: #b42318; background: var(--red-l); }
.r-snip { font-size: 13.5px; color: var(--ink-2); margin-top: 7px; line-height: 1.65; }
mark { background: #fef08a; color: inherit; padding: 0 2px; border-radius: 3px; }
.fz-note { font-size: 12px; color: var(--brand-d); background: var(--brand-l); padding: 2px 10px; border-radius: var(--r-full); margin-left: 8px; display: inline-block; font-weight: 500; }
.docno-note { font-weight: 700; color: #0b7268; background: var(--teal-l); }

/* ---------- 浏览 ---------- */
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 18px; cursor: pointer; transition: .18s; text-align: left; position: relative; overflow: hidden; }
.cat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); opacity: 0; transition: .18s; }
.cat-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); border-color: var(--line-2); }
.cat-card:hover::before { opacity: 1; }
.cat-name { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.cat-count { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.back-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 14px; color: var(--brand); cursor: pointer; font-size: 13.5px; font-weight: 500; }
.back-link:hover { text-decoration: underline; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .18s ease; }
.modal-card { background: #fff; width: 100%; max-width: 780px; max-height: 86vh; border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--sh-lg); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.close { border: none; background: var(--gray-l); width: 32px; height: 32px; border-radius: var(--r-sm); font-size: 20px; cursor: pointer; color: var(--muted); flex-shrink: 0; transition: .15s; display: grid; place-items: center; }
.close:hover { background: #e5e9f0; color: var(--ink); }
.modal-meta { padding: 11px 22px; font-size: 12.5px; color: var(--muted); background: #fafbfd; border-bottom: 1px solid var(--line); display: flex; gap: 14px; flex-wrap: wrap; }
.modal-body { padding: 20px 22px; overflow-y: auto; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.85; }
.modal-actions { padding: 12px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; background: #fafbfd; }
.modal-actions:empty { display: none; }
.clause-block { padding: 11px 0; border-bottom: 1px dashed var(--line); }
.clause-no { font-weight: 700; color: var(--brand-d); margin-right: 6px; }

/* ---------- 页脚 / 空状态 / 错误 ---------- */
.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 18px 20px 28px; border-top: 1px solid var(--line); background: var(--card); }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; font-size: 14px; }
.empty-state { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty-state .es-icon { width: 52px; height: 52px; margin: 0 auto 16px; color: #c3ccda; }
.empty-state .es-title { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.empty-state .es-desc { font-size: 13.5px; line-height: 1.7; }
.err { background: var(--red-l); color: #b42318; border: 1px solid var(--red-b); padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; }

/* ---------- 效力状态徽章（语义统一） ---------- */
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 10px; border-radius: var(--r-full); border: 1px solid transparent; white-space: nowrap; font-weight: 600; }
.st-active { color: #0b7268; background: var(--teal-l); border-color: var(--teal-b); }
.st-abolished { color: #b42318; background: var(--red-l); border-color: var(--red-b); }
.st-partial { color: #b7791f; background: var(--amber-l); border-color: var(--amber-b); }
.st-superseded { color: #52606d; background: var(--gray-l); border-color: var(--line-2); }
.eff-chain { font-size: 12.5px; color: #b42318; background: var(--red-l); border: 1px solid var(--red-b); border-radius: var(--r-sm); padding: 7px 11px; margin-top: 7px; line-height: 1.5; }
.eff-detail { color: #7a271a; margin-top: 2px; word-break: break-all; }
.pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 7px; border-radius: var(--r-full); background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; margin-left: 6px; }

/* ---------- 更新工作台 ---------- */
.wb-intro { font-size: 13px; color: var(--ink-2); background: var(--brand-l); border: 1px solid var(--brand-l2); border-radius: var(--r-md); padding: 12px 15px; margin-bottom: 18px; line-height: 1.65; display: flex; gap: 9px; align-items: flex-start; }
.wb-intro .icon { color: var(--brand); margin-top: 1px; }
.wb-grid { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.wb-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.wb-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-sm); }
.wb-form { display: flex; flex-direction: column; gap: 13px; margin-top: 8px; }
.wb-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.target-preview { font-size: 12.5px; color: var(--ink-2); background: #fafbfd; border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; min-height: 20px; }
.target-preview:empty { display: none; }

.change-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.change-item { border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; background: #fff; transition: .15s; }
.change-item:hover { box-shadow: var(--sh-sm); }
.change-item.pending { border-left: 3px solid var(--amber); }
.change-item.confirmed { border-left: 3px solid var(--teal); }
.change-item.rejected, .change-item.reverted { border-left: 3px solid #c3ccda; opacity: .8; }
.ch-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-type { font-size: 12px; font-weight: 700; color: #fff; background: var(--muted); padding: 2px 10px; border-radius: 6px; }
.ch-type.abolish_partial, .ch-type.abolish_all { background: var(--red); }
.ch-type.supersede { background: var(--muted); }
.ch-type.amend, .ch-type.new_doc { background: var(--brand); }
.ch-target { font-size: 14px; font-weight: 600; }
.ch-state { font-size: 11.5px; padding: 2px 9px; border-radius: var(--r-full); font-weight: 600; }
.ch-state.pending { color: #b7791f; background: var(--amber-l); }
.ch-state.confirmed { color: #0b7268; background: var(--teal-l); }
.ch-state.rejected { color: #8a94a0; background: var(--gray-l); }
.ch-state.reverted { color: #52606d; background: var(--gray-l); }
.ch-meta { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.ch-desc { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.6; }
.ch-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.btn-sm { border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); border-radius: var(--r-sm); padding: 6px 14px; font-size: 13px; cursor: pointer; transition: .15s; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.btn-sm:hover { border-color: #c3ccda; background: #fafbfd; }
.btn-sm.ok { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-sm.ok:hover { filter: brightness(.95); }
.btn-sm.danger { background: #fff; color: var(--red); border-color: var(--red-b); }
.btn-sm.danger:hover { background: var(--red-l); }
.btn-sm.brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-sm.brand:hover { background: var(--brand-d); }
.btn-sm:disabled { opacity: .42; cursor: not-allowed; }
.btn-sm:disabled:hover { filter: none; background: var(--teal); transform: none; box-shadow: none; }
.ch-link { color: var(--brand); text-decoration: none; font-size: 12.5px; font-weight: 500; }
.ch-link:hover { text-decoration: underline; }

/* ---------- 例题审核（并入工作台） ---------- */
.exam-review-item { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; background: #fff; transition: .15s; border-left: 3px solid var(--brand); }
.exam-review-item:hover { box-shadow: var(--sh-sm); }
.exam-review-item.v-failed { border-left-color: var(--red); }
.exam-review-item.v-passed { border-left-color: var(--teal); }
.er-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.er-tag { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: var(--r-full); background: var(--brand-l); color: var(--brand-d); }
.er-tag.verify-passed { background: var(--teal-l); color: #0b7268; }
.er-tag.verify-failed { background: var(--red-l); color: #b42318; }
.er-stem { font-size: 13.5px; color: var(--ink); line-height: 1.65; margin-bottom: 8px; }
.er-detail { font-size: 12.5px; color: var(--muted); background: #fafbfd; border-radius: var(--r-sm); padding: 9px 11px; margin-bottom: 8px; line-height: 1.6; max-height: 120px; overflow-y: auto; }
.er-ans { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.er-ans b { color: var(--brand-d); }
.er-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 相关例题（法条辅助理解） ---------- */
.related-exam { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.re-item { background: var(--brand-l); border: 1px solid var(--brand-l2); border-radius: var(--r-md); padding: 13px 15px; margin-bottom: 10px; }
.re-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.re-badge { font-size: 11.5px; font-weight: 700; color: #fff; background: var(--brand); padding: 2px 9px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.re-stem { font-size: 13.5px; color: var(--ink); line-height: 1.65; }
.re-toggle { font-size: 12.5px; color: var(--brand); cursor: pointer; font-weight: 600; margin-top: 7px; display: inline-flex; align-items: center; gap: 4px; }
.re-toggle:hover { text-decoration: underline; }
.re-body { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--brand-l2); font-size: 13px; color: var(--ink-2); line-height: 1.7; white-space: pre-wrap; }

/* ---------- 问答历史 ---------- */
.hist-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #eceff4; border-radius: 10px; padding: 3px; }
.seg-btn { border: none; background: transparent; padding: 7px 18px; border-radius: 8px; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: .15s; font-weight: 500; }
.seg-btn.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: var(--sh-xs); }
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; cursor: pointer; transition: .16s; }
.hist-item:hover { box-shadow: var(--sh-md); border-color: var(--line-2); transform: translateY(-1px); }
.hist-q { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.hist-meta { font-size: 12px; color: var(--muted); margin-top: 7px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-meta .hm-chip { background: var(--gray-l); padding: 2px 9px; border-radius: var(--r-full); font-weight: 500; }
.hist-ops { margin-left: auto; display: flex; gap: 4px; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; right: 20px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #1e293b; color: #fff; padding: 12px 18px; border-radius: var(--r-md); font-size: 13.5px; box-shadow: var(--sh-lg); animation: slidein .22s ease; max-width: 340px; display: flex; align-items: center; gap: 8px; }
.toast.ok { background: var(--teal); }
.toast.err { background: var(--red); }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; } }

/* ---------- 加载 ---------- */
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 例题练习（做题系统已隐藏，样式保留） ---------- */
.exam-stem { font-size: 14.5px; line-height: 1.75; margin: 10px 0; white-space: pre-wrap; }
.exam-opts { display: flex; flex-direction: column; gap: 9px; margin: 12px 0; }
.exam-opts .clause-block { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin: 0; }
.exam-opts .clause-block:hover { background: #fafbfd; border-color: var(--line-2); }
.exam-result { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.exam-ok { color: var(--teal); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.exam-bad { color: var(--red); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.exam-ref-ans { background: var(--brand-l); border-left: 3px solid var(--brand); padding: 11px 13px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.65; margin-bottom: 9px; white-space: pre-wrap; }
.exam-analysis { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; margin-bottom: 6px; white-space: pre-wrap; }
#panel-exam .wb-card { margin-bottom: 14px; }

/* ---------- 热点 & 简报 ---------- */
.hot-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.hot-filters select, .hot-filters input { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; background: #fff; }
.hot-filters input:focus, .hot-filters select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.hot-card { display: flex; gap: 14px; padding: 13px 16px; border-bottom: 1px solid #eef1f6; cursor: pointer; transition: .12s; }
.hot-card:hover { background: var(--brand-l); }
.hot-date { width: 86px; flex-shrink: 0; font-size: 12px; color: var(--muted); font-family: monospace; padding-top: 2px; }
.hot-body { flex: 1; min-width: 0; }
.brief-subs, .brief-digest, .brief-alerts { margin-bottom: 24px; padding: 18px; background: #fafbfd; border: 1px solid var(--line); border-radius: var(--r-md); }
.sub-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef1f6; font-size: 13px; }
.sub-name { font-weight: 600; color: var(--ink); }
.sub-kw { color: var(--brand-d); font-size: 12px; }
.sub-scope { color: var(--muted); font-size: 11px; margin-left: auto; }
.alert-item { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid #eef1f6; cursor: pointer; font-size: 13px; }
.alert-item:hover { background: var(--amber-l); }
.alert-sub { background: var(--amber-l); color: #b45309; padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.alert-title { flex: 1; font-weight: 500; }
.alert-date { color: var(--muted); font-size: 11px; font-family: monospace; }
.digest-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.digest-stat { padding: 12px 18px; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-align: center; font-size: 12px; color: var(--muted); }
.digest-stat b { display: block; font-size: 22px; color: var(--navy); font-family: var(--serif); }
.digest-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.digest-cat { padding: 3px 10px; background: var(--brand-l); border-radius: 12px; font-size: 12px; color: var(--brand-d); }
.digest-cat b { margin-left: 4px; }
.digest-items { max-height: 400px; overflow-y: auto; }
.digest-item { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f0f2f7; font-size: 13px; }
.di-date { width: 82px; flex-shrink: 0; color: var(--muted); font-family: monospace; font-size: 11.5px; }
.di-title { cursor: pointer; font-weight: 500; }
.di-title:hover { color: var(--brand); }
.btn-sm { padding: 3px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-size: 11px; }
.pill { background: var(--amber-l); color: #b45309; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.hl { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- 政策匹配 ---------- */
.evcard { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; background: #fff; transition: .15s; }
.evcard:hover { border-color: var(--brand); box-shadow: var(--sh-sm); }
.etop { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.scorebadge { background: linear-gradient(135deg, var(--amber), #f6b93d); color: #fff; font-weight: 700; padding: 2px 10px; border-radius: 6px; font-size: 12px; }
.catbadge { background: var(--brand-l); color: var(--brand-d); padding: 1px 8px; border-radius: 4px; font-size: 11px; }
.etitle { font-weight: 600; font-size: 14px; line-height: 1.5; cursor: pointer; color: var(--ink); }
.etitle:hover { color: var(--brand); }
.emeta { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ---------- 覆盖看板 ---------- */
.cov-section { margin-bottom: 24px; padding: 18px; background: #fafbfd; border: 1px solid var(--line); border-radius: var(--r-md); }
.cov-bars { display: flex; flex-direction: column; gap: 8px; }
.cov-bar-row { display: flex; align-items: center; gap: 10px; }
.cov-label { width: 110px; flex-shrink: 0; font-size: 12.5px; color: var(--ink-2); text-align: right; }
.cov-track { flex: 1; height: 18px; background: #eef1f6; border-radius: 5px; overflow: hidden; }
.cov-fill { height: 100%; border-radius: 5px; transition: width .5s ease; }
.cov-val { width: 70px; font-size: 12px; color: var(--muted); font-family: monospace; }
.cov-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cov-table th { text-align: left; padding: 8px 10px; background: #f0f2f7; color: var(--muted); font-size: 11.5px; border-bottom: 1px solid var(--line); }
.cov-table td { padding: 8px 10px; border-bottom: 1px solid #eef1f6; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .wb-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  main { padding: 18px 14px 36px; }
  .tabs { padding: 0 12px; overflow-x: auto; }
  .tab { padding: 12px 13px; font-size: 13.5px; white-space: nowrap; }
  .tab .tab-text { display: none; }
  .brand h1 { font-size: 16px; }
  .cat-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ---------- 最新资讯 ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.news-card {
  background: var(--card, #fff); border: 1px solid var(--line, #e3e8ef); border-radius: 10px;
  padding: 12px 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
.news-card .card-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.news-kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13px; }
.news-kv span { color: var(--muted, #667085); }
.news-kv b { font-weight: 600; text-align: right; }
.news-foot { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line, #e3e8ef); font-size: 13px; }
.news-err { grid-column: 1 / -1; border-left: 3px solid var(--red); }
.badge.ok { background: #e7f6ec; color: #13733d; }
.badge.bad { background: #fdeceb; color: #b42318; }
.badge.warn { background: #fff4e5; color: #974c05; }

/* ============================================================
   首屏「动态」时间线（版式取自 AIHOT 开源站：按天分组 + 时间轨 + 卡片，
   见 docs/AIHOT移植规格-前端.md 与 docs/NOTICE-AIHOT.md）
   ============================================================ */
.tl-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 2px 0 14px; }
.tl-seg { display: inline-flex; background: var(--gray-l); border-radius: var(--r-full); padding: 3px; gap: 2px; }
.tl-seg button {
  border: 0; background: transparent; color: var(--ink-2); font-size: 13px; cursor: pointer;
  padding: 5px 13px; border-radius: var(--r-full); transition: .14s;
}
.tl-seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--sh-xs); font-weight: 600; }
.tl-q { flex: 1 1 200px; min-width: 160px; }
.tl-q input {
  width: 100%; padding: 8px 12px; font-size: 13.5px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--card); color: var(--ink);
}
.tl-note { font-size: 12.5px; color: var(--muted); margin: -6px 0 12px; }
.tl-day { margin-bottom: 18px; }
.tl-daybar {
  position: sticky; top: var(--bar-h); z-index: 3; display: flex; align-items: baseline; gap: 9px;
  background: var(--bg); padding: 9px 2px; cursor: pointer; border: 0; width: 100%;
  text-align: left; font-family: inherit; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.tl-daybar .d { font-size: 15px; font-weight: 700; letter-spacing: -.1px; }
.tl-daybar .w { font-size: 12.5px; color: var(--muted); }
.tl-daybar .n { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.tl-daybar .chev { font-size: 11px; color: var(--muted); }
.tl-track { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 56px 22px 1fr; align-items: start; }
.tl-time { font-size: 12px; color: var(--muted); padding-top: 15px; text-align: right; }
.tl-dot { position: relative; height: 100%; }
.tl-dot::before {
  content: ""; position: absolute; left: 10px; top: 20px; bottom: -6px; width: 2px; background: var(--line-2);
}
.tl-item:last-child .tl-dot::before { display: none; }
.tl-dot::after {
  content: ""; position: absolute; left: 6px; top: 18px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--card); border: 2.5px solid var(--brand);
}
.tl-item.k-change .tl-dot::after { border-color: var(--hot); }
.tl-item.k-effective .tl-dot::after { border-color: var(--amber); }
.tl-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; margin: 6px 0; box-shadow: var(--sh-xs); transition: .14s;
}
.tl-card:hover { box-shadow: var(--sh-sm); border-color: var(--line-2); }
.tl-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.tl-k { font-size: 11px; padding: 2px 8px; border-radius: var(--r-full); background: var(--brand-l); color: var(--brand-d); font-weight: 600; }
.tl-k.change { background: var(--hot-l); color: var(--hot); }
.tl-k.effective { background: var(--amber-l); color: var(--amber); }
.tl-lv { font-size: 11px; padding: 2px 8px; border-radius: var(--r-full); border: 1px solid var(--line-2); color: var(--ink-2); }
.tl-lv.top { background: var(--hot); color: #fff; border-color: var(--hot); }
.tl-title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.5; cursor: pointer; }
.tl-title:hover { color: var(--brand); }
.tl-title.plain { cursor: default; }
.tl-title.plain:hover { color: var(--ink); }
.tl-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tl-sub code { font-family: inherit; color: var(--ink-2); }
.tl-empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.tl-more { text-align: center; margin: 4px 0 20px; }
.sec-title {
  font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .4px;
  margin: 22px 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line);
}
@media (max-width: 640px) {
  .tl-item { grid-template-columns: 44px 18px 1fr; }
  .tl-daybar { top: calc(var(--bar-h) - 2px); }
  .tl-title { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-card, .tl-seg button { transition: none; }
}
