:root {
  --ink: #12212f;
  --muted: #6b7d90;
  --line: #e4eaf0;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --navy: #0d1d2b;
  --navy-2: #12283c;
  --teal: #0f766e;
  --teal-soft: #e3f4f1;
  --red: #c0392b;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.app { display: grid; grid-template-columns: 246px 1fr; height: 100vh; }

/* ---------------- sidebar ---------------- */
.sidebar {
  background: linear-gradient(180deg, #0d1d2b 0%, #10263a 100%);
  color: #dbe6f1;
  display: flex;
  flex-direction: column;
  padding: 22px 18px 16px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 4px 20px; }
.mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #14b8a6, #0e7490);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; letter-spacing: .5px; color: #fff;
}
.brand h1 { margin: 0; font-size: 15px; letter-spacing: .3px; }
.brand p { margin: 3px 0 0; font-size: 11px; color: #8ba3b8; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  color: #a9bccd; text-decoration: none; font-size: 13px;
  padding: 9px 11px; border-radius: 9px;
}
.nav-item span { width: 16px; text-align: center; opacity: .8; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #e8f1f8; }
.nav-item.active { background: rgba(20,184,166,.16); color: #7fe3d4; }

.side-block { margin-top: 24px; }
.side-title {
  font-size: 11px; letter-spacing: .12em; color: #6f879b;
  text-transform: uppercase; padding: 0 4px 9px;
}
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mini-stats div { background: rgba(255,255,255,.05); border-radius: 9px; padding: 9px 8px; }
.mini-stats b { display: block; font-size: 18px; color: #eaf4fb; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 10px; color: #8ba3b8; }

.region-list { display: flex; flex-direction: column; gap: 1px; }
.region-item {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #a9bccd; padding: 7px 9px; border-radius: 8px; cursor: pointer;
}
.region-item:hover { background: rgba(255,255,255,.06); color: #e8f1f8; }
.region-item.on { background: rgba(255,255,255,.09); color: #fff; }
.region-item em { font-style: normal; font-size: 11px; color: #7e97ab; }

.side-link {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 10px; text-decoration: none; font-size: 12.5px;
  color: #cfe2ea; background: rgba(45,212,191,.12);
  border: 1px solid rgba(45,212,191,.25);
}
.side-link:hover { background: rgba(45,212,191,.2); }

.side-foot {
  margin-top: auto; display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: #6f879b; padding: 14px 4px 0;
}
.dot-ok { width: 6px; height: 6px; border-radius: 50%; background: #34d399; }
.side-icp { display: block; padding: 6px 4px 0; font-size: 11px; color: #6f879b; text-decoration: none; }
.side-icp:hover { color: #cfe0e6; text-decoration: underline; }

/* ---------------- main ---------------- */
.main { padding: 26px 30px 18px; display: flex; flex-direction: column; overflow: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.topbar h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; }
.search {
  display: flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 10px; height: 38px; width: 270px;
}
.search span { color: #93a4b5; font-size: 14px; }
.search input { border: none; outline: none; width: 100%; font-size: 13px; background: transparent; }
select, input[type="date"], input[type="url"] {
  height: 38px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 0 10px; font-size: 13px; color: var(--ink); outline: none;
}
select:focus, input:focus, textarea:focus { border-color: #9ed3cb; box-shadow: 0 0 0 3px rgba(15,118,110,.08); }

button { font-family: inherit; cursor: pointer; }
.primary {
  height: 38px; padding: 0 16px; border: none; border-radius: 10px;
  background: var(--teal); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 18px -10px rgba(15,118,110,.8);
}
.primary:hover { background: #0d6b63; }
.ghost {
  height: 34px; padding: 0 13px; border-radius: 9px; font-size: 13px;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.ghost:hover { color: var(--ink); border-color: #c9d6e2; }
.ghost.danger { color: var(--red); border-color: #f0d6d2; }
.ghost.danger:hover { background: #fdf2f0; }
.danger-solid { background: var(--red); box-shadow: none; }
.danger-solid:hover { background: #a93226; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden; flex: 1;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.panel-head .hint { color: #9aabbb; font-size: 11.5px; }

.table-scroll { overflow-y: auto; flex: 1; }
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid thead th { position: sticky; top: 0; z-index: 1; }
.grid th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: #7b8ea1;
  letter-spacing: .04em; padding: 10px 14px; background: #fbfcfe;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.grid td { padding: 13px 14px; border-bottom: 1px solid #eef2f6; vertical-align: top; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: #f8fbfd; }
.grid tbody tr:last-child td { border-bottom: none; }

.cell-title { font-weight: 600; color: #17364f; line-height: 1.45; }
.cell-sum { margin-top: 4px; color: #6b7d90; font-size: 12px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.region-tag { font-size: 12px; color: #4a6275; white-space: nowrap; }
.topic {
  display: inline-block; font-size: 11px; color: #2c6285; background: #eaf2f9;
  border-radius: 5px; padding: 2px 7px; margin: 0 4px 4px 0;
}
.date { color: #6b7d90; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.pill { display: inline-block; font-size: 11.5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.published { color: #0b6b5c; background: #e2f5f0; }
.pill.draft { color: #7a6a2f; background: #f6efd8; }
.ops { display: flex; gap: 6px; }
.op {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  font-size: 12px; color: #4a6275; padding: 4px 9px;
}
.op:hover { border-color: #b9ccdc; color: #12324d; }
.op.del:hover { border-color: #e8c3bd; color: var(--red); background: #fdf5f3; }

.empty { padding: 50px 0; text-align: center; color: #8a9aab; }
.empty p { margin: 0 0 5px; font-size: 14px; color: #5c6e80; }
.empty span { font-size: 12px; }

.statusbar {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: #93a4b5; padding: 12px 2px 0;
}

/* ---------------- drawer ---------------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(9,20,31,.42); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 92vw;
  background: #fff; z-index: 21; display: flex; flex-direction: column;
  box-shadow: -24px 0 60px -30px rgba(9,20,31,.55);
}
.drawer-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 22px 14px; border-bottom: 1px solid var(--line);
}
.drawer-head h3 { margin: 0; font-size: 17px; }
.drawer-head p { margin: 5px 0 0; font-size: 11.5px; color: #8a9aab; font-family: ui-monospace, Menlo, monospace; }
.icon { border: none; background: transparent; color: #8a9aab; font-size: 16px; padding: 4px 8px; border-radius: 7px; }
.icon:hover { background: #f1f5f9; color: var(--ink); }

.form { padding: 16px 22px 8px; overflow-y: auto; flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field > span { font-size: 12px; color: #5c6e80; }
.field i { color: var(--red); font-style: normal; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; font-size: 13px; font-family: inherit; color: var(--ink);
  background: #fff; outline: none;
}
.field textarea { resize: vertical; line-height: 1.6; }
.row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.row .field { margin-bottom: 13px; }

.drawer-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfcfe;
}
.spacer { flex: 1; }
.drawer-foot .primary { height: 36px; }

/* ---------------- modal / toast ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(9,20,31,.45); z-index: 30; display: grid; place-items: center; }
.modal { background: #fff; border-radius: 14px; width: 380px; padding: 22px; box-shadow: 0 30px 70px -30px rgba(0,0,0,.5); }
.modal h4 { margin: 0 0 8px; font-size: 16px; }
.modal p { margin: 0; font-size: 13px; color: #5c6e80; line-height: 1.6; word-break: break-all; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 14px);
  background: #10202e; color: #eaf4fb; font-size: 13px; padding: 10px 18px;
  border-radius: 10px; opacity: 0; pointer-events: none; transition: all .22s ease; z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #a93226; }

/* ---------------- QA / RAG ---------------- */
.qa-main { padding: 26px 30px 14px; }
.pill-live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: #0b6b5c; background: #e2f5f0;
  border-radius: 999px; padding: 7px 13px;
}
.pill-live i { width: 7px; height: 7px; border-radius: 50%; background: #10b981; }
.pill-live.off { color: #8a6a1f; background: #f8f0da; }
.pill-live.off i { background: #d9a441; }

.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 6px 4px 18px; }

.welcome {
  max-width: 720px; margin: 34px auto; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px 34px;
}
.welcome-mark {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 13px;
  background: linear-gradient(135deg, #14b8a6, #0e7490); color: #fff;
  display: grid; place-items: center; font-size: 20px;
}
.welcome h3 { margin: 0 0 8px; font-size: 18px; }
.welcome p { margin: 0 auto 18px; max-width: 560px; font-size: 13px; line-height: 1.7; color: #66788b; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  border: 1px solid #dbe4ec; background: #f8fbfd; color: #33566f;
  border-radius: 999px; padding: 8px 13px; font-size: 12px;
}
.chip:hover { border-color: #9ed3cb; background: #f1faf8; color: #0f766e; }

.msg { display: flex; gap: 12px; margin: 18px 0; }
.msg.user { justify-content: flex-end; }
.msg .avatar {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #14b8a6, #0e7490); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.bubble {
  max-width: 78%; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 16px; font-size: 14px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
}
.msg.user .bubble {
  background: #0f766e; color: #fff; border-color: #0f766e;
  border-bottom-right-radius: 5px; max-width: 66%;
}
.msg.bot .bubble { border-bottom-left-radius: 5px; max-width: 78%; }
.msg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bubble.typing::after {
  content: "▌"; color: #0f766e; margin-left: 2px; animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.cite {
  color: #0b6b5c; background: #e2f5f0; border-radius: 4px;
  padding: 0 4px; font-size: 11px; cursor: pointer; vertical-align: 1px;
}
.cite:hover { background: #c9ece4; }

.sources { margin-top: 14px; border-top: 1px dashed #e2e9f0; padding-top: 12px; }
.sources-head { font-size: 11.5px; color: #7b8ea1; margin-bottom: 8px; letter-spacing: .04em; }
.source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.source-card {
  display: block; text-decoration: none; color: inherit;
  background: #f9fbfd; border: 1px solid #e4ebf2; border-radius: 10px;
  padding: 10px 12px; transition: border-color .15s, background .15s;
}
.source-card:hover { border-color: #9ed3cb; background: #f4fbf9; }
.source-card.flash { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,.1); }
.source-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.source-no { font-size: 11.5px; font-weight: 700; color: #0f766e; }
.source-score { font-size: 10.5px; color: #8a9aab; font-variant-numeric: tabular-nums; }
.source-title {
  font-size: 12.5px; font-weight: 600; color: #17364f; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.source-date { font-size: 11px; color: #93a4b5; margin-top: 3px; }
.source-snippet {
  margin: 7px 0 0; font-size: 11.5px; line-height: 1.55; color: #6b7d90;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.composer-wrap { border-top: 1px solid var(--line); padding: 12px 2px 4px; background: var(--bg); }
.composer {
  display: flex; gap: 10px; align-items: flex-end;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px;
}
.composer:focus-within { border-color: #9ed3cb; box-shadow: 0 0 0 3px rgba(15,118,110,.07); }
.composer textarea {
  flex: 1; border: none; outline: none; resize: none; font-family: inherit;
  font-size: 14px; line-height: 1.6; padding: 7px 6px; max-height: 120px; background: transparent;
}
.composer .primary { height: 38px; }
.composer-hint {
  display: flex; justify-content: space-between;
  font-size: 11px; color: #93a4b5; padding: 7px 6px 0;
}

.kb-card { background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px 12px; }
.kb-row { display: flex; justify-content: space-between; font-size: 11.5px; color: #9fb4c7; padding: 3px 0; }
.kb-row b { color: #e6f1f9; font-weight: 600; font-size: 11.5px; text-align: right; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.flow { margin: 0; padding-left: 18px; color: #9fb4c7; font-size: 11.5px; line-height: 1.9; }
.flow li::marker { color: #4b6a83; }

/* ---------------- portal ---------------- */
.portal-main { display: flex; flex-direction: column; min-height: 0; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding-right: 2px; }
#view-qa { overflow: hidden; }
.nav-item { background: transparent; border: none; width: 100%; text-align: left; cursor: pointer; font-family: inherit; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat-card b { display: block; font-size: 26px; color: #12324d; font-variant-numeric: tabular-nums; }
.stat-card span { font-size: 12px; color: #7b8ea1; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.feature { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; cursor: pointer; font-family: inherit; }
.feature:hover { border-color: #9ed3cb; box-shadow: 0 8px 20px -14px rgba(15,118,110,.55); }
.f-icon { width: 34px; height: 34px; border-radius: 9px; background: #e3f4f1; color: #0f766e; display: grid; place-items: center; margin-bottom: 10px; font-size: 16px; }
.feature h4 { margin: 0 0 5px; font-size: 14px; color: #17364f; }
.feature p { margin: 0; font-size: 11.5px; color: #7b8ea1; line-height: 1.55; }

.pipeline { padding: 16px 18px; flex: none; }
.recent { flex: none; }
.recent-list { padding: 4px 16px 10px; }
.recent-row {
  display: grid; grid-template-columns: 92px 1fr 130px; gap: 12px; align-items: center;
  padding: 9px 2px; border-bottom: 1px dashed #eef2f6; text-decoration: none; color: inherit;
}
.recent-row:last-child { border-bottom: none; }
.recent-row:hover .recent-title { color: #0f766e; }
.recent-date { font-size: 11.5px; color: #8a9aab; font-variant-numeric: tabular-nums; }
.recent-title { font-size: 13px; color: #17364f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-region { font-size: 11.5px; color: #7b8ea1; text-align: right; }
.link-more { font-size: 11.5px; color: #0f766e; text-decoration: none; }
.pipeline-head { font-size: 12px; color: #7b8ea1; letter-spacing: .06em; margin-bottom: 12px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.step { background: #f8fbfd; border: 1px solid #e8eef4; border-radius: 10px; padding: 12px; }
.step i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: #0f766e; color: #fff; font-size: 11px; display: grid; place-items: center; margin-bottom: 8px; }
.step b { display: block; font-size: 12.5px; color: #17364f; margin-bottom: 3px; }
.step span { font-size: 11px; color: #7b8ea1; line-height: 1.5; }

.mini-search { height: 34px; width: 260px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font-size: 12.5px; outline: none; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #4a6275; }
.muted { color: #8a9aab; font-size: 12px; }
.kind-tag { display: inline-block; font-size: 10px; background: #eef4fa; color: #33566f; border-radius: 4px; padding: 1px 5px; margin-right: 5px; }

.translate-bar { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.translate-bar select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 12.5px; }
.swap-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: #5c6e80; cursor: pointer; }
.swap-btn:hover { color: #0f766e; border-color: #9ed3cb; }

.translate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 220px; }
.tpane { background: #fff; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.tpane-head { display: flex; justify-content: space-between; padding: 9px 12px; font-size: 11.5px; color: #7b8ea1; border-bottom: 1px solid #eef2f6; background: #fbfcfe; }
.tpane textarea { flex: 1; border: none; outline: none; resize: none; padding: 12px; font-family: inherit; font-size: 14px; line-height: 1.7; min-height: 150px; }
.tpane.out { background: #fbfdfe; }
.tgt-text { flex: 1; padding: 12px; font-size: 14px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.tgt-text:empty::before { content: attr(data-placeholder); color: #9aabbb; }
.tgt-text.streaming::after { content: "▌"; color: #0f766e; margin-left: 2px; animation: blink 1s steps(2) infinite; }

.tpane-tools { display: flex; align-items: center; gap: 10px; }
.mic-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: #fff; color: var(--teal);
  border-radius: 7px; padding: 3px 8px; font-size: 11px; cursor: pointer;
}
.mic-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mic-btn:hover { background: var(--teal-soft); }
.mic-btn.listening { color: #fff; background: var(--red); border-color: var(--red); animation: micPulse 1.2s infinite; }
.mic-btn.listening:hover { background: var(--red); }
.mic-btn:disabled { opacity: .5; cursor: not-allowed; }
.mic-status { font-size: 11px; color: var(--muted); }
.mic-status.err { color: var(--red); }
.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--teal-dark, #0f766e);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.speak-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.speak-btn:hover { background: var(--teal-soft); }
.speak-btn.speaking { color: #fff; background: var(--teal, #0f766e); border-color: var(--teal, #0f766e); }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .35); }
  50% { box-shadow: 0 0 0 6px rgba(192, 57, 43, 0); }
}

.sources-panel { flex: none; }
.trans-sources { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.empty-line { margin: 0; color: #9aabbb; font-size: 12.5px; }
.src-group h5 { margin: 0 0 8px; font-size: 12px; color: #5c6e80; font-weight: 600; }
.src-group h5 em { font-style: normal; color: #0f766e; margin-left: 4px; }
.term-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.term-chip { font-size: 12px; background: #f1faf8; border: 1px solid #cdece6; color: #0f5f57; border-radius: 7px; padding: 5px 9px; }
.term-chip b { color: #0f766e; }
.term-chip i { font-style: normal; color: #7b8ea1; margin-left: 5px; font-size: 10.5px; }
.pair-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.pair-card { background: #f9fbfd; border: 1px solid #e6edf4; border-radius: 9px; padding: 10px 11px; }
.pair-score { font-size: 10.5px; color: #8a9aab; margin-bottom: 5px; }
.pair-en { margin: 0 0 5px; font-size: 11.5px; line-height: 1.5; color: #44586b; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pair-zh { margin: 0; font-size: 11.5px; line-height: 1.5; color: #17364f; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pair-doc { margin-top: 6px; font-size: 10.5px; color: #9aabbb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.news-card { display: block; text-decoration: none; color: inherit; background: #f9fbfd; border: 1px solid #e6edf4; border-radius: 9px; padding: 10px 11px; }
.news-card:hover { border-color: #9ed3cb; background: #f4fbf9; }
.news-top { display: flex; justify-content: space-between; font-size: 10.5px; color: #8a9aab; margin-bottom: 4px; }
.news-title { font-size: 12px; font-weight: 600; color: #17364f; line-height: 1.45; }
.news-snippet { margin: 5px 0 0; font-size: 11px; color: #6b7d90; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.backend-banner {
  background: #fff4e5; border: 1px solid #f0c98a; color: #7a5b12;
  border-radius: 10px; padding: 10px 14px; font-size: 12.5px; line-height: 1.6;
  margin-bottom: 12px;
}
.backend-banner code {
  background: #fff; border: 1px solid #ead9b8; border-radius: 4px;
  padding: 1px 5px; font-size: 11.5px;
}

/* ---------------- filters, term detail, highlights ---------------- */
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mini-select {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 6px 8px; font-size: 12.5px; color: var(--ink);
}
.btn-outline {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 9px; padding: 8px 12px; font-size: 13px; cursor: pointer;
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.highlight-preview {
  margin-top: 8px; padding: 10px 12px; border: 1px dashed #cfe0dc;
  border-radius: 10px; background: #f7fbfa; font-size: 13px;
  line-height: 1.8; color: #33475b; white-space: pre-wrap;
}
.highlight-preview .preview-label {
  display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px;
}
mark.term-mark {
  background: #dff3ee; color: #0b5c55; padding: 0 2px;
  border-radius: 4px; font-weight: 600;
}
.term-dialog {
  border: none; border-radius: 16px; padding: 0; width: min(620px, 92vw);
  box-shadow: 0 24px 60px rgba(13, 29, 43, 0.28);
}
.term-dialog::backdrop { background: rgba(13, 29, 43, 0.45); }
.term-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.term-dialog-head h3 { margin: 0; font-size: 16px; }
.term-dialog-body { padding: 18px 20px; font-size: 13.5px; line-height: 1.8; }
.term-dialog-body dl { display: grid; grid-template-columns: 92px 1fr; gap: 8px 14px; margin: 0; }
.term-dialog-body dt { color: var(--muted); }
.term-dialog-body dd { margin: 0; word-break: break-word; }
.icon-btn {
  border: none; background: transparent; font-size: 20px; line-height: 1;
  color: var(--muted); cursor: pointer;
}
