/* ============================================================
 * 【前端 · UI 样式】【不可删】 sidebar-custom.css
 * 覆盖 AdminLTE 默认左侧菜单样式：
 *   - 一级菜单项背景半透明白 + 圆角 6px + 蓝底
 *   - 二级子菜单统一缩进 1.5rem
 *   - 折叠时布局不错位
 * index.html 中 <link> 引入；所有 iframe 内的页面也通过相同 <head> 继承。
 * ============================================================ */
/* 一级父菜单背景加深区分层级 */
.sidebar-menu>.nav-item>.nav-link {
  background: rgba(255, 255, 255, 0.08) !important;
  margin-bottom: 4px;
  border-radius: 6px;
}
/* 二级菜单外层统一缩进 */
.nav-treeview {
  padding-left: 1.5rem !important;
}
/* 二级链接自身缩进 */
.nav-treeview .nav-link {
  padding-left: 1rem !important;
  background: transparent !important;
  margin-bottom: 2px;
}
/* 一级菜单图标放大高亮 */
.sidebar-menu > .nav-item > .nav-link .nav-icon {
  font-size: 1.25rem;
  opacity: 1;
}
/* 二级菜单图标缩小淡化 */
.nav-treeview .nav-icon {
  font-size: 1rem;
  opacity: 0.7;
}
/* 浅色模式侧边栏蓝色主题 */
html[data-bs-theme="light"] .app-sidebar {
  background: #0d6efd !important;
}
html[data-bs-theme="light"] .app-sidebar .nav-link {
  color: #fff !important;
}
html[data-bs-theme="light"] .app-sidebar .nav-link:hover,
html[data-bs-theme="light"] .app-sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.15) !important;
}
html[data-bs-theme="light"] .sidebar-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* ============================================================
   原生 <select> / <option> 选中与 hover 颜色（亮色主题友好）
   Windows Chrome/Edge 下原生下拉的 hover 条受 OS 管控，
   但 option:checked（当前已选中项）、下拉面板背景、聚焦态
   都可以改，替换掉默认的灰色高亮。
   ============================================================ */
html[data-bs-theme="light"] select.form-control,
html[data-bs-theme="light"] select.form-select,
html[data-bs-theme="light"] select.custom-select {
  background-color: #ffffff;
  color: #1f2937;
}

/* 下拉列表背景（浏览器支持时生效） */
html[data-bs-theme="light"] select.form-control option,
html[data-bs-theme="light"] select.form-select option,
html[data-bs-theme="light"] select.custom-select option {
  background-color: #ffffff;
  color: #1f2937;
  padding: 6px 10px;
}

/* 已选中选项：替换灰色为蓝色高亮 + 白字 */
html[data-bs-theme="light"] select.form-control option:checked,
html[data-bs-theme="light"] select.form-select option:checked,
html[data-bs-theme="light"] select.custom-select option:checked {
  background-color: #0d6efd !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 1px #0d6efd inset;
}

/* hover 态（Firefox 直接生效；基于 Chromium 的浏览器悬停 OS 条会盖住文字，这里尽可能同步蓝色底白字） */
html[data-bs-theme="light"] select.form-control option:hover,
html[data-bs-theme="light"] select.form-select option:hover,
html[data-bs-theme="light"] select.custom-select option:hover {
  background-color: #e7f1ff;
  color: #0a58ca;
}

/* select 本身被聚焦时的蓝色外框（配合图中蓝色 focus ring） */
html[data-bs-theme="light"] select.form-control:focus,
html[data-bs-theme="light"] select.form-select:focus,
html[data-bs-theme="light"] select.custom-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 深色模式下拉同样做一次同步（避免默认灰） */
html[data-bs-theme="dark"] select.form-control option:checked,
html[data-bs-theme="dark"] select.form-select option:checked,
html[data-bs-theme="dark"] select.custom-select option:checked {
  background-color: #0d6efd !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 1px #0d6efd inset;
}

/* ============================================================
   全局原生 <select> 强制显示下拉箭头（亮色/深色主题都有）
   - 使用 SVG 内嵌的 V 形箭头，取代 OS 默认"有时没箭头"的表现
   - appearance:none 去掉 OS 原生 select 外观后，再统一画
   ============================================================ */
html[data-bs-theme="light"] select.form-control,
html[data-bs-theme="light"] select.form-select,
html[data-bs-theme="light"] select.custom-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'><path fill='none' stroke='%230d6efd' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3 6l5 5 5-5'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
  padding-right: 36px !important;
}
html[data-bs-theme="light"] select.form-control:focus,
html[data-bs-theme="light"] select.form-select:focus,
html[data-bs-theme="light"] select.custom-select:focus {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'><path fill='none' stroke='%230d6efd' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3 6l5 5 5-5'/></svg>") !important;
}

html[data-bs-theme="dark"] select.form-control,
html[data-bs-theme="dark"] select.form-select,
html[data-bs-theme="dark"] select.custom-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'><path fill='none' stroke='%239ec5fe' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3 6l5 5 5-5'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
  padding-right: 36px !important;
}

/* ============================================================
 * 题干富文本深色主题文字色归一化（2026-09-15）
 * 题干来自 wangEditor：纯文本题继承主题浅色；Word 粘贴/旧数据题带内联
 * color:#000（内联样式优先级最高）→ 深色下同一页面题干有的黑有的白。
 * 仅深色主题统一强制为主题文字色（!important 压内联），浅色主题不动。
 * .q-rich = paper/review/approval 题干容器；其余为题库/归档预览。
 * ============================================================ */
html[data-bs-theme="dark"] .q-rich,
html[data-bs-theme="dark"] .q-rich *,
html[data-bs-theme="dark"] .ar-q-content,
html[data-bs-theme="dark"] .ar-q-content *,
html[data-bs-theme="dark"] .qb-content-preview,
html[data-bs-theme="dark"] .qb-content-preview * {
  color: var(--bs-body-color) !important;
}
/* 富文本段落/图片排版归一化（深浅主题通用，避免选项 <p> 产生多余行距） */
.q-rich p { margin: 0 0 .35rem; }
.q-rich p:last-child { margin-bottom: 0; }
.q-rich img { max-width: 100%; height: auto; }