/* ===== 医考百问AI · 医疗考务庄重风格 ===== */
:root {
  --primary: #3a5a7b;
  --primary-dark: #2e4863;
  --primary-light: #5c7d9c;
  --bg: #f7f5f0;
  --card: #ffffff;
  --text: #2c3440;
  --muted: #7a8494;
  --border: #e3ded4;
  --ok: #3d7a52;
  --warn: #b8892a;
  --err: #a94438;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(44, 52, 64, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
code, pre {
  font-family: Consolas, "Courier New", monospace;
  background: #f0ede6;
  border-radius: 6px;
}
pre { padding: 8px 10px; overflow-x: auto; font-size: 12px; line-height: 1.5; margin: 4px 0; }
code { padding: 1px 5px; font-size: 12px; }

/* ===== 语音激活提示条 ===== */
.audio-banner {
  background: #fdf3dc;
  color: #7a5c17;
  border-bottom: 1px solid #ecd9a8;
  text-align: center;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

/* ===== 顶部栏 ===== */
.topbar {
  height: 54px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.app-title { font-size: 18px; font-weight: 600; flex: 1; text-align: center; letter-spacing: 1px; cursor: pointer; user-select: none; }
.icon-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  white-space: nowrap;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.26); }
.drawer-btn, .drawer-close { display: none; }

/* ===== 布局 ===== */
.layout { flex: 1; display: flex; min-height: 0; }

/* ===== 左侧词条导航 ===== */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-head { padding: 10px; border-bottom: 1px solid var(--border); display: flex; gap: 6px; }
.sidebar-head input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fbfaf7;
  min-width: 0;
}
.sidebar-head input:focus { outline: 2px solid var(--primary-light); }
.nav-list { flex: 1; overflow-y: auto; padding: 8px; }
.nav-loading, .nav-empty { padding: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.nav-cat { margin-bottom: 4px; }
.nav-cat-head {
  width: 100%;
  background: #eef1f5;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}
.nav-cat-head .arrow { transition: transform 0.2s; font-size: 11px; color: var(--muted); }
.nav-cat.collapsed .nav-cat-head .arrow { transform: rotate(-90deg); }
.nav-cat-items { overflow: hidden; }
.nav-cat.collapsed .nav-cat-items { display: none; }
.nav-entry {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 8px 10px 8px 20px;
  font-size: 13px;
  color: var(--text);
  border-radius: 6px;
  line-height: 1.4;
}
.nav-entry:hover { background: #f0f3f7; color: var(--primary-dark); }
.nav-entry.active { background: #e4ecf3; color: var(--primary-dark); font-weight: 600; }
.nav-entry { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.nav-entry-title { flex: 1; min-width: 0; }
.nav-entry-cat { font-size: 11px; color: var(--muted); flex-shrink: 0; font-weight: 400; }

/* 轻提示 toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: rgba(44, 52, 64, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 86vw;
  text-align: center;
  z-index: 300;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

/* 不支持语音输入时的置灰按钮（保留可点击以提示原因） */
.voice-btn.voice-off { opacity: 0.45; cursor: not-allowed; }

/* 错误卡内操作按钮 */
.error-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.camera-error-action { margin-top: 8px; padding: 6px 14px; font-size: 13px; }

/* ===== 主区 ===== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* ===== 回答区 ===== */
.answer-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.history { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border: 1px solid var(--border);
}
.welcome h2 { font-size: 17px; color: var(--primary-dark); margin-bottom: 8px; }
.welcome p { font-size: 14px; color: var(--muted); line-height: 1.7; }

.qa-round .user-q {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 3px solid var(--primary-light);
  word-break: break-all;
}
.qa-round .user-q img { max-height: 60px; border-radius: 6px; margin-top: 4px; display: block; }
.answer-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.answer-title { font-size: 17px; font-weight: 700; color: var(--primary-dark); flex: 1; min-width: 120px; }
.badge {
  font-size: 12px;
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}
.badge.local { background: #e6f0ea; color: var(--ok); border: 1px solid #bcd6c5; }
.badge.ai { background: #eef1f6; color: var(--primary); border: 1px solid #c6d2e0; }
.badge.score { background: #f5f1e8; color: var(--warn); border: 1px solid #e0d3b0; }
.answer-cat { font-size: 12px; color: var(--muted); }

.block-card {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.block-card h4 { font-size: 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.block-card p { font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.block-scene { background: #faf3f2; }
.block-scene h4 { color: #9a4a3c; }
.block-cause { background: #fdf8f1; }
.block-cause h4 { color: #8a6a2f; }
.block-solution { background: #f2f7f3; }
.block-solution h4 { color: var(--ok); }
.block-prevention { background: #f1f5f9; }
.block-prevention h4 { color: var(--primary); }

/* 折叠区块（异常现象 / 原因分析）：summary 模拟 h4 样式，默认收起，点击展开 */
.block-fold { padding: 0; }
.block-fold summary {
  font-size: 14px; font-weight: bold; padding: 12px 14px;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; list-style: none; user-select: none;
}
.block-fold summary::-webkit-details-marker { display: none; }
.block-fold summary::after {
  content: '▸'; margin-left: auto; font-size: 12px; color: var(--muted);
  transition: transform 0.15s ease;
}
.block-fold[open] summary::after { transform: rotate(90deg); }
.block-fold p { padding: 0 14px 12px; margin: 0; }
.block-scene.block-fold summary { color: #9a4a3c; }
.block-cause.block-fold summary { color: #8a6a2f; }
.block-prevention.block-fold summary { color: var(--primary); }

/* 正文内联图片（[图N] 标记渲染） */
.inline-entry-img {
  display: block; max-width: 100%; max-height: 320px;
  margin: 8px 0; border-radius: 8px; border: 1px solid var(--border);
  cursor: zoom-in;
}

.ai-answer { font-size: 14px; line-height: 1.8; word-break: break-word; }
.ai-answer h1, .ai-answer h2, .ai-answer h3, .ai-answer h4 {
  color: var(--primary-dark); margin: 10px 0 6px; font-size: 15px;
}
.ai-answer ul, .ai-answer ol { padding-left: 22px; margin: 6px 0; }
.ai-answer p { margin: 6px 0; }
.ai-answer strong { color: var(--primary-dark); }

.entry-images { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.entry-images img {
  height: 84px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  box-shadow: var(--shadow);
}
.entry-source { font-size: 12px; color: var(--muted); margin-top: 8px; }
/* 图片 OCR 识别文字行（v3.6）：答案卡/专家卡片内小字展示 */
.ocr-line { font-size: 12px; color: #888; margin: 4px 0; word-break: break-all; }

.answer-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.speak-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
}
.speak-btn:hover { background: var(--primary-dark); }
.speak-btn:disabled { background: #b6bdc7; cursor: not-allowed; }
.speak-btn.speaking { background: var(--warn); }
.autoread { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 38px; height: 20px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: #ccd2da;
  border-radius: 20px;
  transition: 0.2s;
}
.slider::before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.error-card { border-color: #e5c1bb; background: #fdf3f1; }
.error-card .err-title { color: var(--err); font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.error-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* 思考中动画 */
.thinking { display: flex; align-items: center; gap: 6px; padding: 14px 4px; }
.thinking .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: bounce 1.2s infinite ease-in-out;
}
.thinking .dot:nth-child(2) { animation-delay: 0.15s; }
.thinking .dot:nth-child(3) { animation-delay: 0.3s; }
.thinking-text { margin-left: 8px; font-size: 13px; color: var(--muted); }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-7px); opacity: 1; }
}

/* ===== 提问区 ===== */
.ask-area {
  margin: 0 16px 16px;
  padding: 12px;
  flex-shrink: 0;
}
.ask-row { display: flex; align-items: flex-end; gap: 8px; }
.ask-row textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  background: #fbfaf7;
  min-width: 0;
}
.ask-row textarea:focus { outline: 2px solid var(--primary-light); }
.round-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #f2f5f8;
  font-size: 18px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.round-btn:hover { background: #e2e9f0; }
.round-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.voice-btn.recording {
  background: #f8e3df;
  border-color: var(--err);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(169, 68, 56, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(169, 68, 56, 0); }
}
.send-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 18px;
  height: 42px;
  font-size: 15px;
  flex-shrink: 0;
}
.send-btn:hover { background: var(--primary-dark); }
.send-btn:disabled { background: #b6bdc7; cursor: not-allowed; }
.voice-hint { font-size: 12px; color: var(--warn); margin-top: 6px; }

.img-preview-bar { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.img-thumb { position: relative; }
.img-thumb img { height: 64px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.img-thumb .del {
  position: absolute;
  top: -7px; right: -7px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--err);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

/* ===== 模态层 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 38, 48, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--primary);
  color: #fff;
}
.modal-head h3 { font-size: 15px; }
.camera-box video {
  width: 100%;
  background: #1c222b;
  max-height: 50vh;
  object-fit: contain;
}
.camera-error { padding: 12px 16px; color: var(--err); font-size: 13px; line-height: 1.6; }
.camera-actions { display: flex; gap: 10px; padding: 14px 16px; justify-content: center; }
.primary-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 14px;
}
.primary-btn:hover { background: var(--primary-dark); }
.ghost-btn {
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* ===== 图片放大 ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 34, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  cursor: zoom-out;
}
.lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 8px; }

/* ===== 权限帮助 ===== */
.perm-box { max-width: 640px; }
.perm-body { padding: 16px; overflow-y: auto; font-size: 13px; line-height: 1.7; }
.perm-body h4 { color: var(--primary-dark); margin: 14px 0 8px; font-size: 14px; }
.perm-body h4:first-child { margin-top: 0; }
.perm-status { list-style: none; }
.perm-status li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot.green { background: var(--ok); }
.status-dot.yellow { background: var(--warn); }
.status-dot.red { background: var(--err); }
.https-warning {
  background: #fdf3dc;
  border: 1px solid #e8d49a;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  color: #6b5518;
}
.https-warning ol { padding-left: 20px; margin: 6px 0; }
.https-warning li { margin: 6px 0; }
.perm-steps { display: flex; flex-direction: column; gap: 10px; }
/* 分平台授权步骤标签页 */
.perm-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.perm-tab {
  border: 1px solid var(--border);
  background: #f2f0ea;
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 13px;
}
.perm-tab:hover { border-color: var(--primary-light); color: var(--primary-dark); }
.perm-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.step-block {
  background: #f4f6f9;
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
}
.step-block h5 { color: var(--primary); font-size: 13px; margin-bottom: 4px; }
.step-block ol { padding-left: 20px; }
.perm-tts { padding-left: 20px; }
.perm-tts li { margin: 3px 0; }

/* ===== 移动端抽屉 ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 38, 48, 0.45);
  z-index: 80;
}

/* ===== 响应式：≤768px 移动端 ===== */
@media (max-width: 768px) {
  .drawer-btn { display: block; }
  .app-title { font-size: 15px; }
  .perm-btn { font-size: 12px; padding: 6px 8px; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 18px rgba(0, 0, 0, 0.2);
  }
  .sidebar.open { transform: translateX(0); }
  .drawer-close { display: block; }
  .answer-area { padding: 10px; }
  .ask-area { margin: 0 10px 10px; padding: 10px; }
  .round-btn { width: 38px; height: 38px; font-size: 16px; }
  .send-btn { height: 38px; padding: 0 14px; }
  .answer-title { font-size: 15px; }
  .modal { padding: 10px; }
  /* 适配深色手机状态栏：顶部栏保持深主色 */
  .topbar { padding-top: env(safe-area-inset-top, 0); height: auto; min-height: 54px; }
}

/* ===== 答案评价按钮 ===== */
.rate-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.rate-btn {
  border: 1px solid var(--border);
  background: #f7f5f0;
  color: var(--text);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  transition: background 0.2s, border-color 0.2s;
}
.rate-btn:hover { background: #eceae2; border-color: var(--primary-light); }
.rate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f0ede6;
}

/* ===== 专家登录弹窗 ===== */
.expert-login-box { max-width: 400px; }
.expert-login-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.expert-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.expert-field input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fbfaf7;
}
.expert-field input:focus { outline: 2px solid var(--primary-light); }
.expert-login-error {
  color: var(--err);
  font-size: 13px;
  background: #fdf3f1;
  border: 1px solid #e5c1bb;
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.5;
}
.expert-login-submit { width: 100%; padding: 11px 0; font-size: 15px; letter-spacing: 4px; }
.expert-login-submit:disabled { background: #b6bdc7; cursor: not-allowed; }

/* ===== 专家面板（全屏遮罩层） ===== */
.expert-panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 150;
  display: flex;
  flex-direction: column;
}
.expert-panel-head {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.expert-panel-title { font-size: 16px; font-weight: 600; letter-spacing: 1px; }
.expert-user { font-size: 13px; opacity: 0.9; }
.expert-head-spacer { flex: 1; }
.expert-logout-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
}
.expert-logout-btn:hover { background: rgba(255, 255, 255, 0.26); }
.expert-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  padding: 4px 6px;
}
.expert-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
  flex-shrink: 0;
}
.expert-tab {
  border: 1px solid var(--border);
  border-bottom: none;
  background: #f2f0ea;
  color: var(--muted);
  border-radius: 10px 10px 0 0;
  padding: 9px 22px;
  font-size: 14px;
}
.expert-tab.active {
  background: var(--card);
  color: var(--primary-dark);
  font-weight: 600;
  border-color: var(--border);
}
.expert-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
  min-height: 0;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.expert-list { display: flex; flex-direction: column; gap: 14px; max-width: 860px; margin: 0 auto; }
.expert-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 40px 0; }
.expert-item { padding: 14px 16px; }
.expert-item-q { font-size: 14px; color: var(--text); line-height: 1.6; word-break: break-all; }
/* 提问内容编辑：问题文字本身可点击进入编辑，虚线下划线作提示 */
.expert-q-text {
  cursor: text;
  border-bottom: 1px dashed #b9b2a4;
  padding-bottom: 1px;
  transition: background 0.2s, border-color 0.2s;
}
.expert-q-text:hover { background: #f5f2ea; border-bottom-color: var(--primary); }
.expert-q-edit-btn {
  border: 1px solid var(--border); background: #f7f5f0; color: var(--muted);
  border-radius: 6px; padding: 2px 10px; font-size: 12px; margin-left: 8px;
  vertical-align: middle; transition: background 0.2s, color 0.2s;
}
.expert-q-edit-btn:hover { background: #eceae2; color: var(--primary); }
.expert-q-ta {
  width: 100%; box-sizing: border-box; margin-top: 6px;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font-size: 14px; font-family: inherit; line-height: 1.6; background: #fbfaf7;
}
.expert-q-ta:focus { outline: 2px solid var(--primary-light); }
.expert-item-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 8px 0;
  flex-wrap: wrap;
}
.expert-rating {
  font-size: 12px;
  border-radius: 20px;
  padding: 3px 10px;
  background: #f5f1e8;
  color: var(--warn);
  border: 1px solid #e0d3b0;
  white-space: nowrap;
}
.expert-time { font-size: 12px; color: var(--muted); }
.expert-item-orig {
  background: #f4f6f9;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.expert-item-orig h5 { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.expert-item-orig p { font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.expert-correct-ta {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  background: #fbfaf7;
}
.expert-correct-ta:focus { outline: 2px solid var(--primary-light); }
.expert-item-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.expert-item-actions .primary-btn:disabled { background: #b6bdc7; cursor: not-allowed; }
/* 忽略此问题：低调的灰色描边按钮，置于保存修正左侧 */
.expert-ignore-btn {
  border: 1px solid var(--border);
  background: #f7f5f0;
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.expert-ignore-btn:hover { background: #f3ecec; color: #9a4a3c; border-color: #d8bcb4; }
.expert-ignore-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ===== 专家修正图片上传 ===== */
.expert-img-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.expert-img-btn {
  border: 1px solid var(--border);
  background: #f7f5f0;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  transition: background 0.2s, border-color 0.2s;
}
.expert-img-btn:hover { background: #eceae2; border-color: var(--primary-light); }
.expert-img-tip { font-size: 12px; color: var(--muted); align-self: center; }
/* 缩略图上的「插入到正文」按钮 */
.expert-img-ins {
  position: absolute; left: 4px; bottom: 4px;
  border: none; border-radius: 4px;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 11px; padding: 2px 6px; line-height: 1.4;
  transition: background 0.2s;
}
.expert-img-ins:hover { background: rgba(0, 0, 0, 0.8); }
.expert-img-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.expert-img-thumb {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f2f0ea;
}
.expert-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.expert-img-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  padding: 0;
}
.expert-img-del:hover { background: rgba(0, 0, 0, 0.75); }
.expert-img-uploading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  background: #eeeee8;
}

/* ===== 响应式：≤768px 移动端（专家面板 / 评价按钮） ===== */
@media (max-width: 768px) {
  .expert-panel-head { padding: 10px 12px; gap: 8px; }
  .expert-panel-title { font-size: 15px; }
  .expert-user { font-size: 12px; }
  .expert-tabs { padding: 8px 10px 0; }
  .expert-tab { padding: 8px 14px; font-size: 13px; flex: 1; text-align: center; }
  .expert-panel-body { padding: 10px 10px 20px; }
  .rate-btn { padding: 6px 10px; font-size: 12px; }
}

/* ===== 统计面板（v4） ===== */
.stats-btn { }
.stats-box { max-width: 720px; width: 94vw; max-height: 86vh; display: flex; flex-direction: column; }
.stats-body { overflow-y: auto; padding: 14px 18px 20px; }
.stats-loading { text-align: center; color: #999; padding: 40px 0; font-size: 14px; }
.stats-sec-title { margin: 14px 0 8px; font-size: 15px; color: #333; border-left: 3px solid #5b9e6d; padding-left: 8px; }
.stats-sec-title:first-child { margin-top: 0; }

.stats-res { display: flex; flex-direction: column; gap: 10px; }
.stats-res-row { display: flex; align-items: center; gap: 10px; }
.stats-res-label { width: 44px; font-size: 14px; color: #555; flex-shrink: 0; }
.stats-res-track { flex: 1; height: 14px; background: #f0ece6; border-radius: 7px; overflow: hidden; }
.stats-res-fill { height: 100%; border-radius: 7px; transition: width .5s ease; }
.stats-res-val { width: 150px; font-size: 14px; color: #333; flex-shrink: 0; }
.stats-res-detail { display: block; font-size: 11px; color: #999; }

.stats-num-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stats-num-card { background: #faf8f5; border: 1px solid #ece6dd; border-radius: 10px; padding: 12px 8px; text-align: center; }
.stats-num-value { font-size: 24px; font-weight: 700; color: #3d6b4f; }
.stats-num-label { font-size: 12px; color: #777; margin-top: 4px; }
.stats-num-sub { font-size: 11px; color: #aaa; margin-top: 2px; }

.stats-chart-row { display: flex; gap: 14px; margin-top: 12px; align-items: flex-start; flex-wrap: wrap; }
.stats-chart-box { background: #faf8f5; border: 1px solid #ece6dd; border-radius: 10px; padding: 10px; }
.stats-chart-box h5 { margin: 0 0 8px; font-size: 13px; color: #666; font-weight: 600; }
.stats-chart-wide { flex: 1; min-width: 260px; }
.stats-chart-wide canvas { width: 100%; height: auto; }

@media (max-width: 768px) {
  .stats-box { width: 96vw; max-height: 90vh; }
  .stats-body { padding: 10px 12px 16px; }
  .stats-num-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-res-val { width: 110px; font-size: 13px; }
  .stats-chart-row { flex-direction: column; }
  .stats-chart-wide { min-width: 0; width: 100%; }
}
