/* 设计系统 —— 兽研 VetScope UI PRD v1.0
   Token: 主色 #166A86 / 背景 #F6F8FA / 描边 #DCE3E8 / 文本 #172B3A
   原则：实色、1px 描边、6-8px 圆角、极弱阴影、无渐变无玻璃 */

:root {
  --brand: #166A86;
  --brand-hover: #10556D;
  --teal: #167C78;
  --bg: #F6F8FA;
  --surface: #FFFFFF;
  --border: #DCE3E8;
  --text: #172B3A;
  --text-2: #60717F;
  --danger: #B94040;
  --warning: #A76C19;
  --success: #27724C;
  --radius-btn: 6px;
  --radius-box: 8px;
  --shadow: 0 1px 3px rgba(23, 43, 58, 0.06);
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ===== 顶栏 ===== */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.logo-img { width: 30px; height: 30px; display: block; }
.logo span { color: var(--brand); font-weight: 500; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover { color: var(--brand); background: var(--bg); }
.nav a.active { color: var(--brand); font-weight: 600; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  min-height: 36px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ===== 页面结构 ===== */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.page-head p { color: var(--text-2); margin-top: 8px; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 18px; font-weight: 600; }
.section-head a { color: var(--brand); text-decoration: none; font-size: 13px; }

/* ===== 首页工作台 ===== */
.workbench { margin-top: 16px; }
.search-box { position: relative; }
.search-box input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
}
.search-box input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.search-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  max-height: 420px;
  overflow-y: auto;
  z-index: 50;
}
.search-suggest-item, .search-suggest-more {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.search-suggest-item:hover { background: var(--bg, #f6f7f9); }
.search-suggest-more { justify-content: center; color: var(--brand); border-bottom: none; font-size: 13px; }
.search-list { display: flex; flex-direction: column; gap: 8px; }
.search-item { display: flex; align-items: flex-start; gap: 12px; text-decoration: none; color: var(--text); }
.search-item:hover { border-color: var(--brand); }
.search-item-body { display: flex; flex-direction: column; gap: 3px; }
.search-item-body strong { font-size: 15px; }
.quick-entries {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.entry-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  min-height: 118px;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.entry-card:hover { border-color: var(--brand); }
.entry-card strong { font-size: 16px; font-weight: 600; }
.entry-card span { font-size: 13px; color: var(--text-2); }
.entry-primary { background: var(--brand); border-color: var(--brand); }
.entry-primary strong, .entry-primary:hover strong { color: #fff; }
.entry-primary span { color: rgba(255, 255, 255, 0.82); }
.entry-primary:hover { border-color: var(--brand-hover); background: var(--brand-hover); }

/* ===== 首页轮播 ===== */
.carousel { position: relative; margin-top: 16px; border-radius: var(--radius-box); overflow: hidden; }
.carousel-track { display: flex; transition: transform 0.45s ease; }
.carousel-slide {
  flex: 0 0 100%;
  min-height: 240px;
  display: flex;
  align-items: center;
  padding: 32px 48px;
  text-decoration: none;
  background-size: cover;
  background-position: center;
}
.slide-brand { background: var(--brand); }
.slide-teal { background: #0f7c74; }
.slide-dark { background: #2c3e50; }
.slide-text { display: flex; flex-direction: column; gap: 10px; color: #fff; max-width: 60%; }
.slide-text strong { font-size: 26px; font-weight: 600; }
.slide-text span { font-size: 15px; opacity: 0.88; }
.slide-text em { font-style: normal; font-size: 14px; margin-top: 6px; border: 1px solid rgba(255,255,255,0.5); border-radius: 999px; padding: 6px 16px; align-self: flex-start; }
.carousel-slide:hover .slide-text em { background: rgba(255,255,255,0.14); }
.carousel-dots { position: absolute; bottom: 14px; left: 48px; display: flex; gap: 8px; }
.carousel-dots button { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,0.4); cursor: pointer; padding: 0; }
.carousel-dots button.on { background: #fff; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.22); color: #fff; font-size: 20px; line-height: 1;
}
.carousel-arrow:hover { background: rgba(255,255,255,0.36); }
.carousel-arrow.prev { left: 12px; }
.carousel-arrow.next { right: 12px; }

/* ===== 计算器卡片 ===== */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.calc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.calc-card:hover { border-color: var(--brand); }
.calc-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.calc-card-top strong { font-size: 15px; font-weight: 600; }
.calc-card p { font-size: 13px; color: var(--text-2); flex: 1; }
.calc-card .meta { font-size: 12px; color: var(--text-2); }

.tag {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}
.tag-warn { border-color: var(--warning); color: var(--warning); }

/* ===== 计算器详情 ===== */
.tool-layout {
  display: grid;
  grid-template-columns: 42% 58%;
  gap: 16px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  padding: 20px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field label em { color: var(--danger); font-style: normal; }
.field-input { display: flex; align-items: center; }
.field-input input {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-btn) 0 0 var(--radius-btn);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--surface);
}
.field-input input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.field-input .unit {
  padding: 0 12px;
  height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
  background: var(--bg);
  color: var(--text-2);
  font-size: 13px;
  min-width: 64px;
  justify-content: center;
}
.hint { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.form-actions { display: flex; gap: 8px; margin-top: 20px; }
.form-errors {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--danger);
  border-left-width: 3px;
  border-radius: var(--radius-btn);
  color: var(--danger);
  font-size: 13px;
  background: #FBF3F3;
}
.form-errors li { margin-left: 18px; }

.result-panel h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.result-main-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  margin-bottom: 8px;
}
.result-main-item.emphasis { border-color: var(--teal); background: #F0F7F7; }
.result-main-item .label { font-size: 14px; color: var(--text-2); }
.result-main-item .value {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--teal);
}
.result-main-item.emphasis .value { color: var(--brand); }
.steps { margin-top: 14px; }
.steps summary { font-size: 13px; color: var(--brand); cursor: pointer; }
.steps .formula { margin: 10px 0 4px; font-size: 13px; font-family: ui-monospace, monospace; background: var(--bg); padding: 8px 10px; border-radius: 4px; }
.steps .formula-note { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.steps ol { margin-left: 20px; font-size: 13px; color: var(--text-2); }
.steps ol li { margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.warnings { margin-top: 14px; }
.warnings .warn-item {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--warning);
  border: 1px solid var(--warning);
  border-left-width: 3px;
  border-radius: var(--radius-btn);
  background: #FAF5EE;
  margin-bottom: 8px;
}
.warnings .warn-item::before { content: "⚠"; flex-shrink: 0; }

.tool-meta { margin-top: 16px; }
.tool-meta h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.refs { margin-left: 18px; font-size: 13px; color: var(--text-2); }
.refs li { margin-bottom: 2px; }
.tool-meta .meta { margin-top: 10px; font-size: 12px; color: var(--text-2); }

/* ===== 空状态 ===== */
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-box);
}

/* ===== 页脚 ===== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 48px;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ===== 诊疗路径列表 ===== */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.flow-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.flow-card-head strong { font-size: 15px; }
.flow-card p { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.flow-species { display: flex; gap: 8px; margin-bottom: 10px; }
.flow-card .meta { font-size: 12px; color: var(--text-2); }
.flow-card-disabled {
  padding: 16px 18px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-box);
  color: var(--text-2);
  font-size: 13px;
}
.flow-card-disabled p { margin: 6px 0 0; }

/* ===== 问诊页 ===== */
.consult-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
}
.consult-side, .consult-aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  padding: 16px;
}
.consult-species {
  font-size: 15px;
  font-weight: 600;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.prog-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  padding: 6px 0;
}
.prog-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.prog-item.done { color: var(--success); }
.prog-item.done .prog-dot { background: var(--success); }
.prog-item.active { color: var(--brand); font-weight: 600; }
.prog-item.active .prog-dot { background: var(--brand); }
.btn-restart { margin-top: 16px; width: 100%; font-size: 13px; }

.consult-aside h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0 10px;
}
.consult-aside h4 + .known-list, .consult-aside h4 + .risk-list { margin-bottom: 20px; }
.known-item {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
  line-height: 1.5;
}
.known-item:last-child { border-bottom: none; }
.known-q { display: block; color: var(--text-2); }
.known-a { display: block; color: var(--text); font-weight: 500; }
.risk-item {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-btn);
  margin-bottom: 8px;
  line-height: 1.5;
}
.risk-critical { background: #FBF3F3; border: 1px solid var(--danger); color: var(--danger); }
.risk-high { background: #FAF5EE; border: 1px solid var(--warning); color: var(--warning); }

/* 危急警示条 */
.alert-box {
  border: 1px solid var(--danger);
  border-left-width: 4px;
  border-radius: var(--radius-box);
  background: #FBF3F3;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.alert-box strong { color: var(--danger); font-size: 14px; display: block; margin-bottom: 4px; }
.alert-box p { font-size: 14px; color: var(--text); }
.alert-box .alert-esc { color: var(--danger); font-weight: 500; margin-top: 4px; }
.alert-box.alert-high { border-color: var(--warning); background: #FAF5EE; }
.alert-box.alert-high strong, .alert-box.alert-high .alert-esc { color: var(--warning); }

/* 问题卡 */
.q-section { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.q-label { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.q-label + .hint { margin-bottom: 14px; }
.opt-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.opt-btn {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.12s, background 0.12s;
}
.opt-btn:hover { border-color: var(--brand); background: #F0F6F8; }
.opt-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
}
.opt-check:hover { border-color: var(--brand); }
.opt-check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* 结果卡 */
.result-lead { color: var(--text-2); font-size: 14px; margin-bottom: 20px; max-width: 720px; }
.result-h { font-size: 16px; font-weight: 600; margin: 24px 0 12px; }
.dir-card { margin-bottom: 12px; }
.dir-card.dir-high { border-left: 3px solid var(--brand); }
.dir-card.dir-mid { border-left: 3px solid var(--border); }
.dir-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dir-head strong { font-size: 15px; }
.tag-danger { border-color: var(--brand); color: var(--brand); }
.dir-desc { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.dir-sub { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 12px; margin-bottom: 4px; }
.dir-list { margin-left: 18px; font-size: 13px; }
.dir-list li { margin-bottom: 2px; }
.dir-against li { color: var(--text-2); }
.dir-need li { color: var(--warning); }
.rec-card {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.rec-card strong { font-size: 14px; white-space: nowrap; }
.rec-reason { font-size: 13px; color: var(--text-2); }

/* ===== 登录/注册 ===== */
.auth-wrap { max-width: 400px; margin: 32px auto 0; }
.auth-panel { padding: 24px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.auth-tabs button {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 0;
  font-size: 15px;
  color: var(--text-2);
  cursor: pointer;
}
.auth-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.auth-msg { font-size: 13px; min-height: 20px; margin-bottom: 10px; }
.auth-msg-err { color: var(--danger); }
.code-row { display: flex; gap: 8px; }
.code-row input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 15px;
  letter-spacing: 2px;
}
.code-row input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.code-btn { white-space: nowrap; min-width: 108px; }
@media (max-width: 767px) {
  .auth-wrap { margin: 16px auto 0; }
}

@media (max-width: 1023px) {
  .consult-layout { grid-template-columns: 1fr; }
  .consult-side { display: flex; align-items: center; gap: 16px; }
  .consult-species { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
  .consult-progress { display: flex; gap: 12px; flex: 1; overflow-x: auto; }
  .btn-restart { margin-top: 0; width: auto; }
  .consult-aside { order: 3; }
}
@media (max-width: 767px) {
  .consult-side { padding: 12px; flex-wrap: wrap; }
}
/* ===== 管理后台 ===== */
.admin-layout { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; }
.admin-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  padding: 12px;
  position: sticky;
  top: 80px;
}
.admin-title { font-size: 12px; color: var(--text-2); padding: 4px 8px 10px; }
.admin-side a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-btn);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
}
.admin-side a:hover { background: var(--bg); color: var(--brand); }
.admin-side a.active { background: var(--brand); color: #fff; font-weight: 500; }
.admin-main h1 { font-size: 20px; margin-bottom: 12px; }
.admin-main h2 { font-size: 15px; margin: 24px 0 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-k { font-size: 12px; color: var(--text-2); }
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  font-size: 13px;
}
.tbl th, .tbl td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { background: var(--bg); font-weight: 500; color: var(--text-2); font-size: 12px; }
.tbl tr:last-child td { border-bottom: none; }
.btn-sm { padding: 4px 10px; min-height: 28px; font-size: 12px; }
.sel {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
  padding: 0 6px;
}
.role-form { display: flex; gap: 6px; align-items: center; }
.sel-full { width: 100%; height: 42px; }
.issue { font-size: 12px; margin-top: 6px; }
.issue-err { color: var(--danger); }
.issue-warn { color: var(--warning); }
.admin-flow { margin-bottom: 12px; }
.reflist { margin-left: 16px; font-size: 12px; color: var(--text-2); line-height: 1.8; }
.reflist code { background: var(--bg); padding: 1px 5px; border-radius: 3px; font-size: 11px; }
.pager { margin-top: 12px; font-size: 13px; }
.pager a { color: var(--brand); text-decoration: none; margin: 0 8px; }
@media (max-width: 767px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; display: flex; gap: 4px; overflow-x: auto; }
  .admin-side a { white-space: nowrap; }
}

/* ===== 文献中心 ===== */
.lit-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.lit-tabs .tag { text-decoration: none; padding: 5px 14px; }
.lit-tabs .tag-active { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.lit-item { margin-bottom: 10px; padding: 14px 16px; }
.lit-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.lit-title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  line-height: 1.5;
  margin-bottom: 4px;
}
.lit-title:hover { color: var(--brand); }
.lit-zh { font-size: 13px; color: var(--brand); margin: 4px 0 2px; }
.lit-orig { font-size: 12px; color: var(--text-2); margin: 2px 0 2px; line-height: 1.5; }
.tag-mt { margin-left: 8px; font-size: 11px; vertical-align: 2px; }
.lit-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-chip { text-decoration: none; }
.tag-chip:hover { border-color: var(--brand); color: var(--brand); }
.tag-chip em { font-style: normal; opacity: 0.6; margin-left: 3px; font-size: 11px; }
.lit-tagbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-box); }
.lit-abs { font-size: 14px; line-height: 1.75; margin-bottom: 10px; color: var(--text); }
.lit-detail-title { font-size: 20px !important; line-height: 1.5 !important; max-width: 860px; }
.lit-meta { margin-top: 8px; }

@media (max-width: 1023px) {
  .quick-entries { grid-template-columns: 1fr 1fr; }
  .entry-primary { grid-column: 1 / -1; }
  .tool-layout { grid-template-columns: 1fr; }
}
.nav .nav-short { display: none; }

/* ---- 移动端悬浮导航球 ---- */
.fab, .fab-menu { display: none; }

/* ---- 论坛发图 ---- */
.img-picker-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-picker-row input[type=file] { flex: 0 1 auto; width: auto; max-width: 280px; }
.img-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.img-thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb-del {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(23, 43, 58, 0.72); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.img-thumb-del:hover { background: rgba(200, 48, 48, 0.9); }
.case-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.case-img { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2, #f5f7f8); }
.case-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.case-img:hover img { transform: scale(1.03); }
.reply-item .case-imgs { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

/* ---- 首页问题反馈卡 ---- */
.feedback-card { padding: 18px 20px; }
.feedback-card textarea { width: 100%; resize: vertical; }
.feedback-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.feedback-head strong { font-size: 15px; }
.feedback-row { display: flex; gap: 10px; margin-top: 8px; }
.feedback-row input { flex: 1; }
@media (max-width: 767px) { .feedback-row { flex-direction: column; } }

@media (max-width: 767px) {
  .topbar { height: 56px; }
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .nav { display: none; } /* 导航收进悬浮球 */
  .topbar-actions { display: flex; flex-shrink: 0; margin-left: auto; }
  .topbar-actions .btn { padding: 6px 12px; font-size: 13px; white-space: nowrap; }

  .fab {
    display: flex; position: fixed; right: 18px; bottom: 26px;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--brand); color: #fff;
    align-items: center; justify-content: center;
    border: none; cursor: pointer;
    box-shadow: 0 4px 16px rgba(22, 106, 134, 0.4);
    z-index: 90;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .fab:hover { box-shadow: 0 6px 20px rgba(22, 106, 134, 0.5); }
  .fab.open { transform: rotate(45deg); }
  .fab-menu {
    display: flex; flex-direction: column;
    position: fixed; right: 18px; bottom: 92px;
    min-width: 132px; padding: 6px;
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(23, 43, 58, 0.18);
    z-index: 89;
    animation: dropIn 0.18s ease;
  }
  .fab-menu[hidden] { display: none; }
  .fab-menu a {
    padding: 11px 16px; font-size: 14px;
    color: var(--text, #172b3a); text-decoration: none;
    border-radius: 9px;
  }
  .fab-menu a.active { color: var(--brand); background: rgba(22, 106, 134, 0.07); font-weight: 600; }
  .page { padding: 20px 16px 48px; }
  .quick-entries { grid-template-columns: 1fr 1fr; }
  .entry-card { padding: 14px 16px; min-height: 88px; }
  .search-box input { font-size: 16px; } /* 防 iOS 缩放 */
  body { font-size: 15px; }
}

/* ===== 鉴别诊断图库 ===== */
.atlas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.atlas-card { display: block; text-decoration: none; color: var(--text); padding: 0; overflow: hidden; transition: border-color 0.15s; }
.atlas-card:hover { border-color: var(--brand); }
.atlas-thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2, #f5f7f8); display: flex; align-items: center; justify-content: center; }
.atlas-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.atlas-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.atlas-card-body strong { font-size: 15px; }
.atlas-card-meta { display: flex; align-items: center; gap: 8px; }
.atlas-viewer { padding: 16px; }
.atlas-viewer img { width: 100%; height: auto; display: block; border: 1px solid var(--border); border-radius: var(--radius-box, 8px); }
.atlas-cross { margin-top: 16px; }
.crumbs { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.crumbs a { color: var(--brand); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ===== 知识库 ===== */
.kb-search { display: flex; gap: 8px; margin: 14px 0; max-width: 640px; }
.kb-search input[type="search"] { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-box, 8px); font-size: 15px; background: var(--surface); color: var(--text); }
.kb-search input[type="search"]:focus { outline: none; border-color: var(--brand); }
.kb-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.kb-item { display: flex; align-items: center; gap: 10px; padding: 14px 16px; text-decoration: none; color: var(--text); transition: border-color 0.15s; }
.kb-item:hover { border-color: var(--brand); }
.kb-item strong { flex: 1; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.kb-cat { flex-shrink: 0; font-size: 11.5px; }

/* ===== Markdown 正文 ===== */
.md-body { padding: 24px 28px; line-height: 1.75; font-size: 15px; max-width: 980px; }
.md-doc-title { font-size: 18px !important; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 6px; }
.md-body h1 { font-size: 20px; margin: 22px 0 10px; }
.md-body h2 { font-size: 17px; margin: 22px 0 10px; padding-left: 10px; border-left: 3px solid var(--brand); }
.md-body h3 { font-size: 15.5px; margin: 16px 0 8px; }
.md-body h4 { font-size: 14.5px; margin: 14px 0 6px; color: var(--text-2); }
.md-body p { margin: 8px 0; }
.md-body ul, .md-body ol { margin: 8px 0; padding-left: 22px; }
.md-body li { margin: 4px 0; }
.md-body ul ul, .md-body ol ol, .md-body ul ol, .md-body ol ul { margin: 4px 0; }
.md-body blockquote { margin: 12px 0; padding: 10px 14px; background: #fdf6ec; border-left: 3px solid #d9a441; border-radius: 0 6px 6px 0; color: #7a5b1e; }
.md-body code { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 13px; }
.md-body pre { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px; overflow-x: auto; margin: 12px 0; }
.md-body pre code { border: none; background: none; padding: 0; }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.md-table-wrap { overflow-x: auto; margin: 12px 0; }
.md-body table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; line-height: 1.5; }
.md-body th { background: var(--surface); font-weight: 600; white-space: nowrap; }
.md-body tr:hover td { background: rgba(22, 106, 134, 0.03); }

@media (max-width: 1023px) {
  .atlas-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .atlas-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kb-list { grid-template-columns: 1fr; }
  .md-body { padding: 18px 16px; }
  .kb-search { flex-direction: row; }
}

/* ===== 融合：建议检查 + 沟通要点 ===== */
.dir-workup { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; font-size: 14px; }
.dir-workup > div { display: flex; gap: 8px; align-items: baseline; }
.wu-k { flex-shrink: 0; display: inline-block; width: 34px; text-align: center; font-size: 11.5px; color: var(--brand); border: 1px solid var(--brand); border-radius: 4px; padding: 0 4px; }
.comm-card { border-left: 3px solid var(--brand); }
.comm-h { font-size: 14px; margin: 12px 0 4px; color: var(--text); }

/* ===== 文献分页 ===== */
.lit-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0; }
.lit-pager-bottom { border-top: 1px solid var(--border); padding-top: 14px; justify-content: center; }
.lit-pager-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pager-dots { align-self: center; color: var(--text-2); font-size: 13px; }

/* ===== 病例论坛 ===== */
.case-list { display: flex; flex-direction: column; gap: 10px; }
.case-card { display: block; text-decoration: none; color: var(--text); transition: border-color 0.15s; }
.case-card:hover { border-color: var(--brand); }
.case-hidden { opacity: 0.55; }
.case-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-card-head strong { font-size: 15.5px; flex: 1; min-width: 200px; }
.tag-pin { color: #b8860b; border-color: #d9a441; background: #fdf6ec; }
.tag-ok { color: #1e7a46; border-color: #3d9970; }
.tag-vet { color: var(--brand); border-color: var(--brand); background: rgba(22,106,134,0.06); font-size: 11px; margin-left: 4px; }
.case-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }
.case-foot { display: flex; gap: 16px; margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--border); }
.case-body { line-height: 1.8; }
.case-sec { margin-bottom: 14px; }
.case-sec h4 { margin: 0 0 6px; padding-left: 8px; border-left: 3px solid var(--brand); font-size: 14.5px; }
.case-sec p { margin: 0; white-space: normal; }
.reply-list { display: flex; flex-direction: column; gap: 8px; }
.reply-item p { margin: 4px 0; line-height: 1.7; }
.reply-item .meta { color: var(--text-2); margin-bottom: 4px; }
.reply-form textarea, .case-form textarea, .case-form input, .case-form select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-box, 8px);
  font-size: 14.5px; font-family: inherit; background: var(--surface); color: var(--text); box-sizing: border-box;
}
.reply-form textarea:focus, .case-form textarea:focus, .case-form input:focus, .case-form select:focus { outline: none; border-color: var(--brand); }
.case-form { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.case-form .field { display: flex; flex-direction: column; gap: 4px; }
.case-form .field label { font-size: 13.5px; color: var(--text-2); }
.case-form .field label em { color: #c0392b; font-style: normal; }
.field-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 767px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .case-card-head strong { min-width: 100%; }
}

/* ===== 移动端补充（375px 审计） ===== */
@media (max-width: 767px) {
  /* 表格不撑破屏幕：块级化 + 横向滚动 */
  .tbl { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .admin-main { min-width: 0; overflow-x: hidden; }
  .page-head h1 { font-size: 20px; flex-wrap: wrap; }
  .lit-detail-title { font-size: 18px !important; }
  .consult-side, .consult-aside { position: static; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .search-suggest { max-height: 55vh; }
  .field-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .carousel-slide { min-height: 170px; padding: 22px 24px; }
  .slide-text { max-width: 100%; }
  .slide-text strong { font-size: 20px; }
  .slide-text span { font-size: 13px; }
  .carousel-dots { left: 24px; }
}

/* ===== 个人看板 ===== */
.me-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 12px; }
.me-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-box); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.me-stat-main { background: var(--brand); border-color: var(--brand); }
.me-stat-main .me-stat-v, .me-stat-main .me-stat-k { color: #fff; }
.me-stat-v { font-size: 20px; font-weight: 600; }
.me-stat-k { font-size: 12px; color: var(--text-2); }
.em.pt { font-style: normal; font-size: 11px; color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.tag-featured { color: #b8860b; border-color: #d9a521; background: #fdf6e3; }
.agree-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); margin: 4px 0 10px; }
.agree-row input { margin-top: 2px; }
.agree-row a { color: var(--brand); }
@media (max-width: 767px) {
  .me-stats { grid-template-columns: 1fr 1fr 1fr; }
  .me-stat-v { font-size: 16px; }
}

/* ===== 独立后台壳 ===== */
.admin-body { background: var(--bg, #f2f4f6); }
.admin-topbar { background: #17232e; height: 54px; display: flex; align-items: center; }
.admin-topbar-inner { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.admin-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 15px; text-decoration: none; }
.admin-brand strong { color: #6db3f2; font-weight: 600; }
.admin-top-actions { display: flex; align-items: center; gap: 14px; }
.admin-top-actions a { color: #b9c6d2; font-size: 13px; text-decoration: none; }
.admin-top-actions a:hover { color: #fff; }
.admin-top-actions .btn { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.admin-top-actions .btn:hover { border-color: #fff; background: rgba(255, 255, 255, 0.12); color: #fff; }
.admin-wrap { max-width: 1280px; margin: 20px auto 0; padding: 0 20px 60px; display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; }
.admin-body .admin-side { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-box); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 767px) {
  .admin-wrap { grid-template-columns: 1fr; padding: 0 12px 40px; }
  .admin-body .admin-side { position: static; flex-direction: row; overflow-x: auto; }
  .admin-body .admin-side a { white-space: nowrap; }
}

/* 操作列：多个按钮表单横向排列 */
.tbl td form.role-form { display: inline-block; margin: 0 6px 6px 0; }
.tbl td form.role-form .btn { white-space: nowrap; }

/* ================================================================
   UI 重构统一层 —— 去原生控件 / 高度体系 / 交互动效
   :where() 零特异性兜底：裸控件获得统一样式，已有类规则不受影响
   ================================================================ */

/* ---- 输入控件全局兜底（42px 体系） ---- */
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]):not([type=hidden]):not([type=range])) {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
:where(textarea) {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.6;
  transition: border-color 0.15s, box-shadow 0.15s;
}
:where(select) {
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2367798a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
:where(input):focus, :where(textarea):focus, :where(select):focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22, 106, 134, 0.12);
}
:where(input)::placeholder, :where(textarea)::placeholder { color: #9aa8b5; }
/* 数字输入去掉原生 spinner */
:where(input)[type=number]::-webkit-inner-spin-button, :where(input)[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
:where(input)[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ---- 自定义复选框（注册协议等） ---- */
:where(input[type=checkbox]) {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
  flex: none;
  position: relative;
}
:where(input[type=checkbox]):checked {
  background: var(--brand);
  border-color: var(--brand);
}
:where(input[type=checkbox]):checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1.5px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}
:where(input[type=checkbox]):focus-visible { box-shadow: 0 0 0 3px rgba(22, 106, 134, 0.15); }

/* ---- 文件选择（认证材料照片） ---- */
:where(input[type=file]) {
  height: auto;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg, #f6f8fa);
  color: var(--text-2);
  font-size: 13px;
  width: 100%;
  cursor: pointer;
}
:where(input[type=file])::file-selector-button {
  margin-right: 12px;
  padding: 7px 16px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
:where(input[type=file])::file-selector-button:hover { background: rgba(22, 106, 134, 0.06); }

/* ---- .sel 行内小尺寸也换自定义箭头（简写 background 会覆盖箭头，单独补） ---- */
.sel {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2367798a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}

/* ---- 按钮动效 ---- */
.btn {
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(23, 43, 58, 0.1); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }
.btn-primary { box-shadow: 0 1px 3px rgba(22, 106, 134, 0.25); }
.btn[disabled] { transform: none; box-shadow: none; }

/* ---- 卡片 hover 浮起（统一） ---- */
.calc-card, .case-card, .atlas-card, .kb-item, .search-item, .entry-card, .stat, .me-stat {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.15s;
}
.calc-card:hover, .case-card:hover, .atlas-card:hover, .kb-item:hover, .search-item:hover, .entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(23, 43, 58, 0.09);
}

/* ---- 页面入场 ---- */
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page, .admin-main { animation: pageIn 0.28s ease; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.search-suggest:not([hidden]) { animation: dropIn 0.16s ease; }

/* ---- 顶栏导航底线动画 ---- */
.nav a { position: relative; transition: color 0.15s; }
.nav a::after {
  content: '';
  position: absolute;
  left: 50%; right: 50%; bottom: -4px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
  transition: left 0.2s ease, right 0.2s ease;
}
.nav a:hover::after, .nav a.active::after { left: 10px; right: 10px; }
.nav a.active { color: var(--brand); }

/* ---- 表格行 hover 高亮 ---- */
.tbl tbody tr { transition: background 0.12s; }
.tbl tbody tr:hover { background: rgba(22, 106, 134, 0.035); }

/* ---- 链接下划线过渡 ---- */
.md-body a, .hint a { transition: opacity 0.15s; }
.md-body a:hover { opacity: 0.75; }

/* ---- 减少动效偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- 文献 OA 全文排版 ---- */
.lit-fulltext { font-size: 14px; line-height: 1.75; color: var(--text-1, #172b3a); }
.lit-fulltext h3 { font-size: 15px; margin: 16px 0 6px; color: var(--text-1, #172b3a); }
.lit-fulltext p { margin: 8px 0; }
.lit-fulltext li { margin: 4px 0 4px 18px; }
.lit-fulltext .ft-omitted { color: var(--text-2, #67798a); font-size: 12.5px; }

/* 论坛板块 tab */
.section-tabs { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
:where(.section-tab) {
  padding: 7px 16px; border-radius: 8px; font-size: 14px;
  color: var(--text-2); background: var(--bg-2, #f5f5f5); border: 1px solid transparent;
  text-decoration: none; transition: all .15s;
}
:where(.section-tab:hover) { color: var(--text-1); }
:where(.section-tab.active) { color: var(--brand); background: var(--bg-1, #fff); border-color: var(--brand); font-weight: 600; }
/* 发帖板块选择器 */
.section-picker { display: flex; gap: 8px; flex-wrap: wrap; }
:where(.sec-opt input) { position: absolute; opacity: 0; pointer-events: none; }
:where(.sec-opt span) {
  display: inline-block; padding: 8px 18px; border-radius: 8px; font-size: 14px;
  color: var(--text-2); background: var(--bg-2, #f5f5f5); cursor: pointer; border: 1px solid transparent;
  transition: all .15s;
}
:where(.sec-opt input:checked + span) { color: var(--brand); background: var(--bg-1, #fff); border-color: var(--brand); font-weight: 600; }

/* 认证徽章：盾牌对勾 + 品牌色胶囊（细线性图标，克制风） */
.vet-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px 2px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px; line-height: 1.5;
  color: var(--brand); background: rgba(22,106,134,0.08);
  border: 1px solid rgba(22,106,134,0.32);
  vertical-align: 1px; margin-left: 4px; white-space: nowrap;
}
.vet-badge svg { width: 11px; height: 11px; flex: none; }
.vet-badge:hover { background: rgba(22,106,134,0.14); }

/* 后台访问统计 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
:where(.stat-card) { background: var(--bg-1, #fff); border: 1px solid var(--line, #e5e9ee); border-radius: 10px; padding: 14px 16px; }
:where(.stat-num) { font-size: 24px; font-weight: 700; margin: 0; color: var(--text-1, #172b3a); }
:where(.stat-label) { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2, #67798a); }
:where(.v-delta) { margin-left: 6px; font-weight: 600; }
:where(.v-up) { color: #c0392b; } :where(.v-down) { color: #1e8e5a; }
.vbars { display: flex; align-items: flex-end; gap: 8px; padding-top: 8px; flex-wrap: wrap; }
:where(.vbar) { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 34px; }
:where(.vbar-pv) { width: 16px; background: var(--brand, #166a86); border-radius: 3px 3px 0 0; }
:where(.vbar-uv) { width: 16px; background: rgba(22,106,134,0.35); border-radius: 3px 3px 0 0; }
:where(.vbar-date) { font-size: 10.5px; color: var(--text-2, #67798a); }
:where(.v-ip) { font-family: ui-monospace, Menlo, monospace; }
:where(.v-path) { color: var(--text-2, #67798a); font-size: 12.5px; }
:where(.v-time) { color: var(--text-2, #67798a); font-variant-numeric: tabular-nums; }
:where(.v-idx) { color: var(--text-2, #67798a); width: 28px; }

/* 后台通用表格（此前缺失，一直是裸样式） */
:where(.admin-table) { width: 100%; border-collapse: collapse; font-size: 13.5px; }
:where(.admin-table th) {
  text-align: left; font-weight: 600; color: var(--text-2, #67798a);
  padding: 10px 14px; border-bottom: 2px solid var(--line, #e5e9ee);
  white-space: nowrap; font-size: 12.5px;
}
:where(.admin-table td) { padding: 10px 14px; border-bottom: 1px solid var(--line, #e5e9ee); vertical-align: middle; }
:where(.admin-table tbody tr:hover) { background: rgba(22,106,134,0.04); }
/* 访问统计表列宽分配 */
:where(.admin-table.v-table) { table-layout: fixed; }
:where(.v-table .v-idx) { width: 44px; }
:where(.v-table th:nth-child(2), .v-table .v-ip) { width: 180px; }
:where(.v-table th:nth-child(3)) { width: 100px; }
:where(.v-table th:nth-child(5), .v-table .v-time) { width: 110px; }
:where(.v-table .v-path) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; }

/* ===== 轮播移动端适配 ===== */
@media (max-width: 767px) {
  .carousel { margin-top: 12px; }
  .carousel-slide { min-height: 176px; padding: 20px; }
  .slide-text { max-width: 100%; gap: 7px; }
  .slide-text strong { font-size: 19px; }
  .slide-text span { font-size: 13px; }
  .slide-text em { font-size: 12px; padding: 5px 12px; margin-top: 2px; }
  .carousel-dots { left: 20px; bottom: 10px; }
  .carousel-arrow { display: none; } /* 手机用滑动切换，箭头隐藏 */
}

/* 悬浮球：汉堡 ↔ 关闭 切换动画 */
.fab .fab-l { transition: transform .25s ease, opacity .2s ease; transform-box: fill-box; transform-origin: center; }
.fab.open .fab-l1 { transform: translateY(5px) rotate(45deg); }
.fab.open .fab-l2 { opacity: 0; }
.fab.open .fab-l3 { transform: translateY(-5px) rotate(-45deg); }

/* 带图轮播：手机端按图片原始比例(1600:500)完整显示，不裁剪 */
@media (max-width: 767px) {
  .carousel-slide.slide-img { min-height: 0; height: auto; aspect-ratio: 16 / 5; padding: 0; }
}

/* 后台分页与搜索 */
:where(.admin-pager) { display: flex; align-items: center; gap: 14px; margin: 14px 0; font-size: 13.5px; }
:where(.admin-pager a) { color: var(--brand); text-decoration: none; font-weight: 500; }
:where(.admin-pager .dis) { color: var(--text-2, #67798a); opacity: .5; }
:where(.admin-search) { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
/* 文献解读状态筛选链接 */
.flink { color: var(--text-2, #67798a); text-decoration: none; font-size: 13.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; }
.flink-on { color: var(--brand); background: rgba(45,124,201,.08); border-color: rgba(45,124,201,.25); font-weight: 600; }
:where(.admin-head) { margin-bottom: 14px; }
:where(.admin-head h1) { margin: 0; }

/* ===== 后台外壳改版：专业布局（深色侧栏 + 分组菜单 + 角色徽章） ===== */
.admin-body { display: flex; min-height: 100vh; background: #eef2f6; }
.admin-side {
  width: 216px; flex: none; background: #1c2733; color: #b9c6d2;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  border-radius: 0; border: none; padding: 0;
}
.side-brand {
  display: flex; align-items: center; gap: 9px; padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 15px; color: #fff;
}
.side-brand .logo-img { width: 26px; height: 26px; }
.side-brand strong { color: var(--brand); font-weight: 600; margin-left: 4px; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.side-group { font-size: 11px; color: #5f7183; padding: 14px 10px 6px; letter-spacing: 1px; }
.side-nav a {
  display: block; padding: 9px 12px; border-radius: 8px; color: #b9c6d2;
  text-decoration: none; font-size: 13.5px; margin-bottom: 2px;
  border-left: 3px solid transparent; transition: background .15s;
}
.side-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.side-nav a.active { background: rgba(22,106,134,0.28); color: #fff; border-left-color: var(--brand); font-weight: 600; }
.side-user {
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12.5px;
}
.side-uname { margin: 0 0 6px; color: #e6edf3; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-urole { margin: 0; display: flex; align-items: center; justify-content: space-between; }
.role-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  background: rgba(22,106,134,0.35); color: #9fd4e8; font-weight: 500;
}
.role-badge.rb-admin { background: rgba(217,164,65,0.25); color: #e8c982; }
.side-logout {
  background: none; border: none; color: #5f7183; cursor: pointer; font-size: 12px; padding: 0;
}
.side-logout:hover { color: #ff8f8f; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: 12px 24px; border-bottom: 1px solid #dde4ea;
  position: sticky; top: 0; z-index: 10;
}
.admin-topbar .crumb { font-size: 14px; color: #172b3a; font-weight: 500; }
.admin-topbar .crumb em { font-style: normal; color: #9aa9b6; margin: 0 6px; }
.back-site { font-size: 12.5px; color: var(--text-2, #67798a); text-decoration: none; }
.back-site:hover { color: var(--brand); }
.admin-content { flex: 1; padding: 20px 24px 40px; max-width: 1280px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.dash-panel { background: #fff; border: 1px solid #dde4ea; border-radius: 12px; padding: 16px 18px; }
.todo-item {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 9px;
  background: #fdf6ec; border: 1px solid #f0dfc0; color: #8a6d3b; font-size: 13.5px;
  text-decoration: none; margin-bottom: 8px;
}
.todo-item strong { font-size: 16px; color: #b8860b; }
.todo-item span { margin-left: auto; color: #b8860b; }
.todo-item.todo-empty { background: #f0f7f2; border-color: #cfe6d8; color: #3e7d5a; }
.dash-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.dash-row span { color: var(--text-2, #67798a); flex: 1; overflow: hidden; text-overflow: ellipsis; }
.dash-row em { font-style: normal; color: var(--text-2, #67798a); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .admin-body { flex-direction: column; }
  .admin-side { width: 100%; height: auto; position: static; flex-direction: column; }
  .side-nav { display: flex; overflow-x: auto; padding: 6px 10px; gap: 2px; }
  .side-group { display: none; }
  .side-nav a { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; }
  .side-nav a.active { border-bottom-color: var(--brand); }
  .side-user { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 14px; }
}
@media (max-width: 767px) {
  .carousel-slide { min-height: 176px; }
}

/* ===== 人工文章富文本编辑器 ===== */
.art-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .art-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .art-grid { grid-template-columns: 1fr; } }
.art-label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--text-1, #22303c); }
.art-label em { color: #d64545; font-style: normal; }
.art-label .meta { font-weight: 400; }
.ipt { padding: 8px 10px; border: 1px solid var(--line, #d8e0e8); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; }
.ipt:focus { outline: none; border-color: var(--brand, #2d7cc9); }
.ed-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--line, #d8e0e8); border-bottom: none; border-radius: 8px 8px 0 0; background: #f5f7f9; }
.ed-toolbar button {
  padding: 5px 10px; border: 1px solid var(--line, #d8e0e8); border-radius: 6px; background: #fff;
  font-size: 13px; cursor: pointer; color: var(--text-1, #22303c); font-family: inherit;
}
.ed-toolbar button:hover { border-color: var(--brand, #2d7cc9); color: var(--brand, #2d7cc9); }
.ed-body {
  min-height: 320px; padding: 14px; border: 1px solid var(--line, #d8e0e8); border-radius: 0 0 8px 8px;
  background: #fff; font-size: 15px; line-height: 1.8; outline: none;
}
.ed-body:focus { border-color: var(--brand, #2d7cc9); }
.ed-body:empty::before { content: attr(data-ph); color: #9aa8b5; }
.ed-body h3 { font-size: 17px; margin: 14px 0 8px; }
.ed-body h4 { font-size: 15.5px; margin: 12px 0 6px; }
.ed-body p { margin: 0 0 10px; }
.ed-body blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--brand, #2d7cc9); background: #f5f7f9; color: var(--text-2, #67798a); border-radius: 0 6px 6px 0; }
.ed-body ul, .ed-body ol { margin: 0 0 10px; padding-left: 22px; }
.ed-body a { color: var(--brand, #2d7cc9); }

/* ===== 社区互动：顶栏图标 / 站内信 / 通知 / 点赞 / 举报 ===== */
.top-ico { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; color: var(--text-2, #67798a); }
.top-ico svg { width: 19px; height: 19px; }
.top-ico:hover { background: rgba(0,0,0,.05); color: var(--brand, #2d7cc9); }
.ico-badge { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #e5484d; color: #fff; font-size: 10.5px; font-weight: 600; line-height: 16px; text-align: center; }
.ico-heart { width: 14px; height: 14px; vertical-align: -2px; }
.like-n svg { fill: transparent; }
/* 详情页操作行 */
.case-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.like-btn svg { fill: transparent; transition: fill .15s; }
.like-btn.on { color: #e5484d; border-color: #f3b9bb; }
.like-btn.on svg { fill: #e5484d; stroke: #e5484d; }
.msg-mini { color: var(--brand, #2d7cc9); }
/* 举报 / 新私信下拉 */
.report-drop { position: relative; display: inline-block; }
.report-drop > summary { list-style: none; cursor: pointer; }
.report-drop > summary::-webkit-details-marker { display: none; }
.report-drop[open] .report-form { display: block; }
.report-form { display: none; position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: min(320px, 84vw); padding: 12px; text-align: left; box-shadow: 0 8px 28px rgba(0,0,0,.12); }
.report-form label { display: block; font-size: 12.5px; color: var(--text-2, #67798a); margin-bottom: 6px; }
.report-form textarea, .report-form .ipt { width: 100%; box-sizing: border-box; border: 1px solid #dde5ec; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px; resize: vertical; }
.report-form .form-actions { margin: 8px 0 0; }
/* 站内信 */
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-thread { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; }
.msg-avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--brand, #2d7cc9); color: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.msg-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msg-last { font-size: 13px; color: var(--text-2, #67798a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.msg-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.msg-dialog { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; }
.msg-row { display: flex; flex-direction: column; align-items: flex-start; }
.msg-row.mine { align-items: flex-end; }
.msg-bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: #f0f3f6; font-size: 14px; word-break: break-word; }
.msg-bubble.mine { background: var(--brand, #2d7cc9); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg-time { font-size: 11px; margin-top: 2px; }
.msg-send textarea { width: 100%; box-sizing: border-box; border: 1px solid #dde5ec; border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 14px; resize: vertical; }
/* 通知中心 */
.notice-list { display: flex; flex-direction: column; gap: 8px; }
.notice-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.notice-item.unread { border-left: 3px solid var(--brand, #2d7cc9); }
.notice-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #f0f3f6; color: var(--brand, #2d7cc9); display: inline-flex; align-items: center; justify-content: center; }
.notice-mid { flex: 1; min-width: 0; }
.notice-mid p { margin: 0 0 2px; font-size: 14px; }
.page-head form { display: inline-block; }
@media (max-width: 640px) {
  .top-ico { width: 30px; height: 30px; }
  .report-form { position: fixed; left: 50%; top: auto; bottom: 12px; transform: translateX(-50%); width: min(92vw, 400px); }
  .msg-bubble { max-width: 88%; }
}

/* ===== 顶栏用户区：头像胶囊 + 图标化退出 ===== */
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-actions .top-sep { width: 1px; height: 22px; background: var(--border, #e3e8ee); margin: 0 6px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; text-decoration: none; color: var(--text, #1c2b3a); font-weight: 500; font-size: 14px; line-height: 1; transition: background .15s; white-space: nowrap; }
.user-chip:hover { background: rgba(0, 0, 0, .05); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand, #166A86); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 600; flex: none; }
.ico-out svg { width: 18px; height: 18px; }
.ico-out:hover { color: #e5484d; }
@media (max-width: 640px) {
  .user-chip { padding: 2px; gap: 0; }
  .user-name { display: none; }
  .topbar-actions .top-sep { margin: 0 2px; }
}

/* ===== 工作人员标识 ===== */
.tag-staff { font-weight: 600; font-size: 11.5px; padding: 1px 7px; }
.tag-staff-admin { background: var(--brand, #166A86); color: #fff; }
.tag-staff-reviewer, .tag-staff-editor, .tag-staff-operator { background: rgba(22, 106, 134, .09); color: var(--brand, #166A86); border: 1px solid rgba(22, 106, 134, .28); }

/* ===== 全文内嵌表格 ===== */
.lit-fulltext .ft-table { margin: 14px 0; overflow-x: auto; }
.lit-fulltext .ft-table table { border-collapse: collapse; width: 100%; font-size: 13px; background: #fff; }
.lit-fulltext .ft-table th, .lit-fulltext .ft-table td { border: 1px solid #cfd8e0; padding: 6px 9px; text-align: left; vertical-align: top; }
.lit-fulltext .ft-table th { background: #f0f4f7; font-weight: 600; }
.lit-fulltext .ft-table tr:nth-child(even) td { background: #fafcfd; }
.lit-fulltext .ft-cap { font-size: 13px; color: var(--text-2, #67798a); margin: 0 0 6px; font-weight: 600; }
/* 文献详情页底部操作按钮：等宽对齐 */
.lit-actions .btn { flex: 1; min-width: 0; }

/* ---- 文献收藏按钮 + toast ---- */
.btn-faved {
  border-color: #d4a017; color: #b8860b;
  background: color-mix(in srgb, #d4a017 8%, transparent);
}
.fav-toast {
  position: fixed; left: 50%; bottom: 88px; transform: translate(-50%, 8px);
  background: #1c1e21; color: #fff; font-size: 13.5px;
  padding: 9px 16px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.18);
  opacity: 0; transition: opacity .25s ease, transform .25s ease; z-index: 999;
  pointer-events: none; max-width: 86vw;
}
.fav-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- 「查看英文原文」折叠按钮（文献详情页） ---- */
.lit-en { margin-top: 16px; }
.lit-en > summary {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 16px; border: 1.5px solid var(--brand, #166a86);
  border-radius: 10px; background: color-mix(in srgb, var(--brand, #166a86) 6%, transparent);
  color: var(--brand, #166a86); font-size: 14px; font-weight: 600;
  cursor: pointer; user-select: none; list-style: none;
  transition: background .15s ease;
}
.lit-en > summary::-webkit-details-marker { display: none; }
.lit-en > summary:hover { background: color-mix(in srgb, var(--brand, #166a86) 12%, transparent); }
.lit-en-arrow { margin-left: 2px; font-size: 11px; transition: transform .2s ease; }
.lit-en[open] > summary .lit-en-arrow { transform: rotate(180deg); }
.lit-en[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.lit-en[open] > .lit-fulltext { border: 1px solid var(--brand, #166a86); border-top: none; border-radius: 0 0 10px 10px; padding: 12px; }

/* ---- 返回顶部悬浮球（全站） ---- */
.back-top {
  display: flex; align-items: center; justify-content: center;
  position: fixed; right: 18px; bottom: 26px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface, #fff); color: var(--brand, #166a86);
  border: 1px solid var(--border); cursor: pointer;
  box-shadow: 0 4px 14px rgba(23, 43, 58, 0.14);
  z-index: 88; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s, border-color 0.15s;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { border-color: var(--brand); }
.back-top:active { transform: scale(0.94); }
@media (max-width: 767px) {
  .back-top { right: 22px; bottom: 92px; width: 42px; height: 42px; }
  .fab-menu { bottom: 150px; } /* 展开菜单给回顶球让位 */
}

/* ---- 文献全文配图 ---- */
.lit-fulltext .ft-fig { margin: 14px 0; text-align: center; }
.lit-fulltext .ft-fig img { max-width: 100%; height: auto; border: 1px solid #dbe4ec; border-radius: 8px; background: #fff; }
