:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-muted: #f0f3f4;
  --border: #e2e7e8;
  --text: #1d2b2a;
  --muted: #6b7c7a;
  --brand: #0f766e;
  --brand-dark: #0b5d57;
  --brand-soft: #e6f3f1;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 24, .04);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ========== Admin 左侧导航栏 ========== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 220px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.sidebar-main {
  margin-left: 220px;
  min-height: 100vh;
  background: var(--bg);
}

/* 品牌 */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand:hover { text-decoration: none; background: var(--surface-muted); }
.sidebar-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.sidebar-brand-text strong { display: block; font-size: 14px; }
.sidebar-brand-text span { font-size: 11px; color: var(--muted); }

/* 学期切换 */
.sidebar-batch { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.sidebar-batch-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--brand-soft);
  border: 1px solid rgba(15,118,110,.2);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.sidebar-batch-btn:hover { border-color: var(--brand); }
.sidebar-batch-current { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sidebar-batch-current .batch-term { font-weight: 600; color: var(--brand-dark); }
.batch-status {
  font-size: 11px; padding: 1px 7px; border-radius: 10px;
}
.batch-status.is-open { background: #d1fae5; color: #047857; }
.batch-status.is-closed { background: #e2e7e8; color: var(--muted); }
.sidebar-batch .caret { color: var(--muted); font-size: 11px; }

.sidebar-batch-menu {
  display: none;
  position: absolute;
  top: calc(100% - 4px);
  left: 14px; right: 14px;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16,24,24,.1);
  overflow: hidden;
  z-index: 30;
  max-height: 360px; overflow-y: auto;
}
.sidebar-batch.open .sidebar-batch-menu { display: block; }
.sidebar-batch.open .sidebar-batch-btn .caret { transform: rotate(180deg); }
.sidebar-batch-head { padding: 8px 12px 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.sidebar-batch-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  border-top: 1px solid var(--surface-muted);
}
.sidebar-batch-menu a:hover { background: var(--surface-muted); text-decoration: none; }
.sidebar-batch-menu a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.sidebar-batch-menu a.active .batch-status { background: var(--brand); color: #fff; }
.sidebar-batch-more { color: var(--muted); font-size: 12px; }
.sidebar-batch-new { background: var(--surface-muted); color: var(--brand); font-size: 12px; justify-content: center !important; border-top: 2px solid var(--border); }

/* 导航菜单 */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}
.sidebar-nav-group {
  padding: 10px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 1px 0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: background .15s;
}
.sidebar-nav a:hover { background: var(--surface-muted); text-decoration: none; }
.sidebar-nav a.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}
.sidebar-nav .nav-icon { width: 18px; text-align: center; font-size: 14px; }

/* 底部用户区 */
.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}
.sidebar-foot-link {
  display: block;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 6px;
  text-align: center;
  margin-bottom: 8px;
}
.sidebar-foot-link:hover { background: var(--surface); color: var(--brand); text-decoration: none; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 8px;
}
.sidebar-user .nav-avatar {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 600;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 13px; }
.sidebar-user-info span { font-size: 11px; color: var(--muted); }
.sidebar-user-actions { display: flex; gap: 2px; }
.sidebar-user-actions a {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}
.sidebar-user-actions a:hover { background: var(--surface-muted); }

/* Admin 主内容区（不再限制 max-width，让内容铺满 sidebar 右边） */
.admin-main {
  padding: 28px 32px 48px;
  max-width: none;
}
.admin-main .page-shell { max-width: 1200px; }
.admin-foot {
  padding: 20px 32px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* 响应式：窄屏 sidebar 变顶栏 */
@media (max-width: 760px) {
  .sidebar { position: relative; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-main { margin-left: 0; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .sidebar-nav-group { display: none; }
  .sidebar-nav a { padding: 6px 10px; margin: 0; font-size: 13px; }
  .sidebar-foot { display: none; }
  .sidebar-batch { padding: 8px 12px; }
  .admin-main { padding: 20px 16px 40px; }
}

/* 顶栏 */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
}
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}
.nav a:hover { background: var(--surface-muted); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.main { padding-top: 28px; padding-bottom: 48px; }
.foot { padding-bottom: 32px; color: var(--muted); font-size: 13px; }

/* 标题区 */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: .2px; }
h2 { font-size: 16px; margin: 0; }
.sub { margin: 0; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 提示条 */
.flash {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash.ok { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #c9e5e0; }
.flash.bad { background: var(--danger-soft); color: var(--danger); border: 1px solid #f5d2ce; }

/* 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.link { font-size: 14px; }
.link.danger { color: var(--danger); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.link.danger:hover { text-decoration: underline; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #971d13; border-color: #971d13; }
.review-filter input[type="date"] { width: auto; flex: 0 1 150px; }

/* 指标 */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { font-size: 28px; font-weight: 700; letter-spacing: .5px; }
.metrics-sm .metric-value { font-size: 22px; }
.metrics-sm { margin: 14px 0 6px; }

/* 搜索栏 */
.searchbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.searchbar input { flex: 1 1 240px; }
.searchbar .check-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 14px;
  color: var(--text);
}
.searchbar .check-inline input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

/* 评审筛选栏：四个控件 + 按钮 固定一行 */
.review-filter {
  flex-wrap: nowrap;
  align-items: center;
}
.review-filter select,
.review-filter input[type="search"] {
  width: auto;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
}
.review-filter select { flex: 1 1 100px; max-width: 170px; }
.review-filter input[type="search"] { flex: 1 1 150px; }
.review-filter .btn { flex: 0 0 auto; white-space: nowrap; }

/* 工作台：新建批次 */
.batch-new { margin: 4px 0 14px; }
.batch-new select { flex: 0 0 120px; width: auto; }
.batch-new .btn { flex: 0 0 auto; white-space: nowrap; }

/* 班级明细筛选：单行 */
.class-filter {
  flex-wrap: nowrap;
  align-items: center;
}
.class-filter select,
.class-filter input[type="search"] {
  width: auto;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
}
.class-filter select { flex: 0 0 auto; max-width: 200px; }
.class-filter input[type="search"] { flex: 1 1 180px; }
.class-filter .btn { flex: 0 0 auto; white-space: nowrap; }
.class-filter #f-count { flex: 0 0 auto; white-space: nowrap; }
.class-filter #filter-count { flex: 0 0 auto; white-space: nowrap; margin-left: auto; }
@media (max-width: 760px) {
  .class-filter { flex-wrap: wrap; }
  .class-filter select { flex: 1 1 calc(50% - 5px); max-width: none; }
  .class-filter input[type="search"] { flex: 1 1 100%; }
}

/* 长页面：桌面右侧粘性目录，窄屏内联章节 Tab */
.with-toc {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-direction: row-reverse;  /* toc 天然在右 */
}
.page-toc {
  position: sticky;
  top: 76px;
  flex: 0 0 132px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.page-toc a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.page-toc a:hover { background: var(--surface-muted); color: var(--text); }
.page-toc a.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}
.page-toc a .muted-sm { font-size: 11px; }
.toc-top {
  margin-top: 6px;
  padding: 8px 10px 2px;
  border: 0;
  border-top: 1px dashed var(--border);
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0 0 8px 8px;
}
.toc-top:hover { color: var(--brand-dark); background: var(--surface-muted); }
.toc-top[hidden] { display: none; }
.toc-main { flex: 1 1 auto; min-width: 0; }
.toc-main > .card:first-child { margin-top: 0; }
#form, #summary, #detail { scroll-margin-top: 80px; }

/* 平板 & 窄屏（≤1200px）：toc 自动降级为内联章节 Tab */
@media (max-width: 1200px) {
  .with-toc { display: block; flex-direction: row-reverse; }
  .page-toc {
    position: sticky;
    top: 0;
    z-index: 6;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 16px;
    padding: 8px;
    border-radius: var(--radius);
  }
  .page-toc a {
    white-space: nowrap;
    padding: 6px 14px;
    flex-shrink: 0;
    border-radius: 20px;
    border: 1px solid transparent;
  }
  .page-toc a:hover { background: var(--surface-muted); border-color: var(--border); }
  .page-toc a.active {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand-dark);
  }
  .toc-top { display: none; }
}

@media (max-width: 760px) {
  .page-toc { top: 52px; padding: 6px; }
  .page-toc a { padding: 6px 10px; font-size: 13px; border-radius: 14px; }
}

/* 表格 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
  background: var(--surface-muted);
}
.table th:first-child { border-top-left-radius: 8px; }
.table th:last-child { border-top-right-radius: 8px; }
.table tbody tr:hover { background: #fafcfc; }
.table .mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.strong { font-weight: 600; white-space: normal; }
.row-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.row-actions > * { flex: 0 0 auto; }
.row-actions form { margin: 0; display: inline-flex; }
@media (min-width: 761px) {
  .table th:last-child, .table td:last-child { min-width: 110px; }
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
}
.tag-soft { background: var(--surface-muted); color: var(--muted); margin-left: 6px; }

.empty { color: var(--muted); padding: 12px 0; margin: 0; }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 16px;
  font-size: 14px;
}
.pager .disabled { color: #b9c3c2; }
.pager-info { color: var(--muted); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.2;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--surface-muted); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; }

/* 表单 */
.form-card { max-width: 760px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.req { color: var(--danger); }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.isbn-input { font-size: 17px; letter-spacing: .5px; }
textarea { resize: vertical; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.table tr.is-stopped td { opacity: .65; }
.major-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 12px;
  padding: 8px 0;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-soft);
}
.major-checkboxes .major-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 13px;
}
.major-checkboxes .major-check:hover { background: var(--bg-hover); }

/* 本学期课程页：历史开设记录 */
.course-history {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.course-history .history-item {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: help;
}
.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 18px;
}

.result-card { border-color: #c9e5e0; }
.warn-list {
  margin: 10px 0 16px;
  padding: 12px 16px 12px 30px;
  background: #fffaf0;
  border: 1px solid #f3e2c0;
  border-radius: 9px;
  color: #8a5a12;
  font-size: 13.5px;
}
.warn-list li { margin: 3px 0; }

/* 教师端 */
.nav-user { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.muted-sm {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
  margin-top: 2px;
}
.tag-warn { background: #fff4e5; color: #9a5b00; }
.tag-ok { background: #dcfce7; color: #166534; }
.tag-info { background: #dbeafe; color: #1e40af; }

/* 评审统计 */
.review-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}
.stat-num { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat-warn .stat-num { color: #9a5b00; }
.stat-info .stat-num { color: #1e40af; }
.stat-ok .stat-num { color: #166534; }

/* 候选教材小标签 */
/* 候选教材列表：竖排 + 自动换行，避免挤压「操作」列 */
.pill-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.table td.pill-cell { white-space: normal; min-width: 240px; max-width: 460px; }
.tb-pill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  max-width: 100%;
  padding: 3px 9px;
  margin: 0;
  border-radius: 8px;
  background: var(--surface-muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}
.pill-main {
  background: var(--brand);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.pill-final { background: #166534; }

/* 评审表单 */
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.radio-item:hover { background: #fafcfc; }
.radio-item:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); }
.radio-item input[type="radio"] {
  width: auto; margin-top: 3px; accent-color: var(--brand); flex: 0 0 auto;
}
.radio-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.rank-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--surface-muted);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}
.badge-main { background: var(--brand); color: #fff; }

.comment-block {
  background: var(--surface-muted);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.comment-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.comment-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }

.batch-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.batch-tab {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}
.batch-tab:hover { text-decoration: none; border-color: #cfd8d7; }
.batch-tab.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}

.btn-sm { padding: 6px 12px; font-size: 13px; }

.login-wrap { display: flex; justify-content: center; padding: 24px 0; }
.login-card { width: 100%; max-width: 420px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { margin-bottom: 20px; }

.tb-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--surface);
}
.tb-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.tb-item:last-of-type { border-bottom: 0; }
.tb-item[hidden] { display: none; }   /* 覆盖 display:flex，保证筛选能隐藏 */
.tb-item:hover { background: #fafcfc; }
.tb-item input { width: auto; margin: 3px 0 0; accent-color: var(--brand); flex: 0 0 auto; }
.tb-item:has(input:checked) { background: var(--brand-soft); }
.tb-main { display: flex; flex-direction: column; gap: 2px; }
.tb-title { font-weight: 600; font-size: 14px; }
.tb-meta { color: var(--muted); font-size: 12.5px; }
.tb-empty { padding: 14px; color: var(--muted); font-size: 13px; margin: 0; }
#tb-filter { margin-bottom: 8px; }

.counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
.label-like { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.total-box {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 9px;
  background: var(--surface-muted);
  font-size: 14px;
}
.total-box strong { font-size: 18px; color: var(--brand-dark); }
.standalone-action { margin: -8px 0 24px; }
.export-notes { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; }
.export-notes li { margin: 4px 0; }

/* 扫码添加 */
.scan-row { display: flex; gap: 10px; align-items: stretch; }
.scan-row .isbn-input { flex: 1 1 auto; font-size: 20px; letter-spacing: 1px; }
.scan-row .btn { flex: 0 0 auto; padding: 0 22px; }
.scan-row input[type="file"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
}
.scan-status {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}
.scan-status.ok { background: var(--brand-soft); color: var(--brand-dark); border-color: #c9e5e0; }
.scan-status.warn { background: #fff4e5; color: #9a5b00; border-color: #f3e2c0; }

@media (max-width: 640px) {
  .scan-row { flex-direction: column; }
  .scan-row .btn { width: 100%; padding: 10px 16px; }
}

@media (max-width: 640px) {
  .counts { grid-template-columns: 1fr 1fr; }
  .tb-list { max-height: 330px; }
}

/* 手机端：表格转卡片 */
@media (max-width: 760px) {
  .wrap { padding: 0 14px; }
  h1 { font-size: 21px; }
  .main { padding-top: 18px; }
  .card { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .table-wrap { overflow: visible; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--surface);
  }
  .table tbody tr:hover { background: var(--surface); }
  .table td {
    display: flex;
    gap: 12px;
    border: 0;
    padding: 5px 0;
    white-space: normal;
  }
  .table td::before {
    content: attr(data-label);
    flex: 0 0 72px;
    color: var(--muted);
    font-size: 12.5px;
  }
  .table td.actions-cell::before { content: ""; flex-basis: 0; }
  .searchbar input { flex-basis: 100%; }
  .review-filter { flex-wrap: wrap; }
  .review-filter select { flex: 1 1 calc(50% - 5px); max-width: none; }
  .review-filter input[type="search"] { flex: 1 1 100%; }
}

/* ===== 体检 / 日志 / 备份 ===== */
.tool-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 30px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0b5d57 0%, #0f766e 55%, #14857b 100%);
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(11, 93, 87, .18);
}
.tool-hero::before,
.tool-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  pointer-events: none;
}
.tool-hero::before { width: 220px; height: 220px; right: 90px; top: -140px; }
.tool-hero::after { width: 300px; height: 300px; right: -110px; bottom: -210px; }
.tool-hero-main { position: relative; z-index: 1; max-width: 640px; flex: 1 1 auto; min-width: 0; }
.tool-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .16em;
  font-weight: 700;
  color: #a7e8df;
  text-transform: uppercase;
}
.tool-hero h1 {
  color: #fff;
  font-size: 27px;
  line-height: 1.2;
  margin: 8px 0;
  letter-spacing: .5px;
}
.tool-hero p {
  margin: 0;
  color: rgba(255, 255, 255, .8);
  font-size: 13.5px;
  line-height: 1.7;
}
.tool-progress {
  max-width: 430px;
  height: 8px;
  margin-top: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
}
.tool-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5eead4, #a7f3d0);
}
.tool-progress-label {
  margin-top: 7px;
  font-size: 12px;
  color: rgba(255, 255, 255, .72);
}
.tool-hero-audit { background: linear-gradient(135deg, #0c3f4c 0%, #0f5f5a 55%, #0e7490 100%); }
.tool-hero-backup { background: linear-gradient(135deg, #134e4a 0%, #0b5d57 55%, #0f766e 100%); }

.health-ring {
  --pct: 0;
  width: 126px;
  height: 126px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  background: conic-gradient(
    #5eead4 calc(var(--pct) * 1%),
    rgba(255, 255, 255, .16) 0
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.health-ring-inner {
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background: #0b5a55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .2);
}
.health-ring-inner strong { font-size: 27px; line-height: 1; }
.health-ring-inner strong small { font-size: 13px; margin-left: 1px; }
.health-ring-inner span { font-size: 10.5px; color: rgba(255, 255, 255, .7); margin-top: 4px; }

.hero-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.hero-metric {
  min-width: 82px;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
}
.hero-metric strong { display: block; font-size: 22px; line-height: 1.2; color: #fff; }
.hero-metric span { font-size: 11.5px; color: rgba(255, 255, 255, .72); }

.tool-metrics .metric { border-radius: 14px; }
.metric.tone-warn { border-top: 3px solid #f59e0b; }
.metric.tone-info { border-top: 3px solid #3b82f6; }
.metric.tone-ok { border-top: 3px solid #10b981; }
.metric-note { font-size: 11.5px; color: var(--muted); }

.check-card { border-left: 4px solid #10b981; transition: box-shadow .2s ease; }
.check-card:hover { box-shadow: 0 6px 18px rgba(16, 24, 24, .06); }
.check-card.is-warn { border-left-color: #f59e0b; }
.check-card.is-info { border-left-color: #3b82f6; }
.check-title { display: flex; align-items: flex-start; gap: 12px; flex: 1 1 auto; min-width: 0; }
.check-title > div { min-width: 0; }
.check-badge {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 800;
}
.check-card.is-warn .check-badge { background: #fff4e5; color: #9a5b00; }
.check-card.is-info .check-badge { background: #dbeafe; color: #1e40af; }
.check-title h2 { margin: 0; font-size: 16px; }
.check-sub { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.check-lines {
  max-height: 230px;
  overflow: auto;
  margin-top: 14px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdfd;
}
.check-lines ul { margin: 0; padding: 0; list-style: none; }
.check-lines li {
  padding: 7px 0;
  border-bottom: 1px dashed #edf1f1;
  font-size: 13.5px;
  line-height: 1.55;
}
.check-lines li:last-child { border-bottom: 0; }
.check-ok {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 9px;
  background: #f0fdf4;
  color: #166534;
  font-size: 13px;
  font-weight: 600;
}
.check-ok .status-dot { background: #16a34a; }
.check-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  flex: 0 0 auto;
}

.audit-filter-card { padding: 16px 18px; }
.audit-filter { margin-bottom: 0; }
.audit-filter .filter-sep { align-self: center; color: var(--muted); font-size: 12px; }
.audit-filter input[type="date"] { flex: 0 0 150px; }
.audit-table td { vertical-align: top; }
.audit-time { display: flex; flex-direction: column; line-height: 1.35; }
.audit-time span { font-weight: 600; font-size: 13px; }
.audit-time small { color: var(--muted); font-size: 12px; }
.audit-actor { display: flex; align-items: center; gap: 9px; }
.audit-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}
.audit-actor .tag { margin-top: 2px; }
.audit-action {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tone-download { background: #dbeafe; color: #1e40af; }
.tone-review { background: #ede9fe; color: #5b21b6; }
.tone-return { background: #ffedd5; color: #9a3412; }
.tone-course { background: #dcfce7; color: #166534; }
.tone-login { background: #e0f2fe; color: #075985; }
.tone-backup { background: #f3e8ff; color: #6b21a8; }
.tone-account { background: #fce7f3; color: #9d174d; }
.audit-path {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  white-space: normal;
}
.method-chip {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10.5px;
}
.audit-detail {
  margin-top: 2px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11.5px;
}
.audit-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #166534;
  font-size: 12.5px;
  font-weight: 600;
}
.audit-status .status-dot { background: #16a34a; }
.audit-status.is-fail { color: var(--danger); }
.audit-status.is-fail .status-dot { background: var(--danger); }
.pager-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 16px; }
.pager-info { color: var(--muted); font-size: 12.5px; }
.empty-state { padding: 38px 16px 26px; text-align: center; }
.empty-glyph {
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
}

.backup-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .88);
  font-size: 12.5px;
}
.backup-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #5eead4; }
.backup-status.warn .dot { background: #fbbf24; }
.backup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.backup-grid .card { margin-bottom: 0; }
.backup-action-card { display: flex; flex-direction: column; gap: 14px; }
.backup-card-head { display: flex; align-items: flex-start; gap: 12px; }
.backup-card-head h2 { margin: 0 0 2px; font-size: 16px; }
.backup-card-head .hint { margin: 0; }
.backup-glyph {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}
.backup-glyph.danger { background: var(--danger-soft); color: var(--danger); }
.backup-last {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-muted);
}
.backup-last-label { color: var(--muted); font-size: 11.5px; }
.backup-last strong { font-size: 14px; }
.backup-note { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.backup-includes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}
.backup-includes li {
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11.5px;
}
.restore-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 9px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12.5px;
  line-height: 1.6;
}
.restore-warning .status-dot { margin-top: 6px; background: #d97706; }
.file-drop {
  display: block;
  margin-bottom: 12px;
  padding: 16px;
  border: 1.5px dashed #cbd5d1;
  border-radius: 12px;
  background: #fbfdfd;
  text-align: center;
  cursor: pointer;
}
.file-drop:hover { border-color: var(--brand); background: #f6fbfa; }
.file-drop-title { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.file-drop input[type="file"] {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12.5px;
}
.file-drop input[type="file"]::file-selector-button {
  margin-right: 9px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.file-drop input[type="file"]::file-selector-button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}
.file-drop input[type="file"]::-webkit-file-upload-button {
  margin-right: 9px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.file-drop-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.backup-name { display: flex; align-items: center; gap: 10px; }
.zip-badge {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2f3;
  color: #475569;
  font-size: 10.5px;
  font-weight: 800;
}
.latest-pill { margin-left: 6px; }

@media (max-width: 760px) {
  .tool-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 22px;
  }
  .tool-hero h1 { font-size: 23px; }
  .health-ring { align-self: center; }
  .hero-metrics {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-metric { min-width: 0; }
  .backup-grid { grid-template-columns: 1fr; }
  .audit-filter input[type="date"] { flex: 1 1 calc(50% - 30px); }
  .audit-filter .filter-sep { display: none; }
  .audit-filter input[type="search"] { flex: 1 1 100%; }
  .audit-table td { white-space: normal; }
  .audit-detail { max-width: 100%; white-space: normal; }
}

/* ---------- 退书提交与归档 ---------- */
.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.status-line { display: flex; align-items: flex-start; gap: 10px; }
.status-line .status-dot {
  margin-top: 8px;
  width: 8px;
  height: 8px;
  background: #b45309;
}
.status-line .status-dot.is-warn { background: #2563eb; }
.status-line .status-dot.is-ok { background: #16a34a; }
.status-line .hint { margin: 2px 0 0; max-width: 720px; }
.status-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-card .actions form { margin: 0; }

/* ---------- 评审截止与催办 ---------- */
.deadline-form { margin: 0 0 14px; flex-wrap: wrap; }
.deadline-form input[type="date"] { flex: 0 0 170px; width: auto; }
.pending-metrics { margin: 4px 0 0; }
.pending-wrap { max-height: 380px; overflow-y: auto; }
.pending-wrap thead th { position: sticky; top: 0; z-index: 2; }

/* ---------- 工作台统计看板 ---------- */
.overview-batches { display: flex; gap: 6px; flex-wrap: wrap; }
.batch-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}
.batch-chip:hover { text-decoration: none; background: var(--surface-muted); }
.batch-chip.active {
  background: var(--brand-soft);
  border-color: #c9e5e0;
  color: var(--brand-dark);
  font-weight: 600;
}
.overview-metrics { margin: 4px 0 18px; }
.overview-amount { border-top: 1px dashed var(--border); padding-top: 14px; }
.overview-amount .card-head { margin-bottom: 8px; }

@media (max-width: 760px) {
  .status-card { align-items: flex-start; }
  .deadline-form input[type="date"] { flex: 1 1 100%; }
  .pending-wrap { max-height: none; }
  .overview-batches { width: 100%; }
}

/* ---------- 顶部导航下拉 ---------- */
.nav-drop { position: relative; display: inline-flex; align-items: center; }
.nav-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav-drop-btn:hover { background: var(--surface-muted); color: var(--text); }
.nav-drop-btn.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-drop-btn:focus-visible,
.nav-menu a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* CSS 小三角，避免字符在不同字体下显示成圆点 */
.caret {
  width: 6px;
  height: 6px;
  margin-left: 1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: .55;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-drop.open .caret {
  transform: rotate(-135deg) translate(-2px, -1px);
  opacity: .9;
}

.nav-menu {
  display: block;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  min-width: 168px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(16, 24, 24, .14), 0 2px 6px rgba(16, 24, 24, .05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(.98);
  transform-origin: top left;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-drop.open .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.nav-menu-right { left: auto; right: 0; transform-origin: top right; }
.nav-menu a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.nav-menu a:hover { background: var(--surface-muted); text-decoration: none; }
.nav-menu a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.nav-menu-caption {
  display: block;
  padding: 5px 10px 7px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
}
.nav-menu-tools { min-width: 236px; }
.nav-menu-tools a { padding: 9px 11px; }
.menu-title { display: block; font-size: 13.5px; font-weight: 600; }
.menu-hint {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  white-space: normal;
}
.nav-menu-tools a:hover .menu-hint { color: #4b5f5d; }

/* 右上角账号菜单 */
.nav-user-btn { gap: 8px; padding: 4px 10px 4px 5px; }
.nav-avatar {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 600;
}
.nav-user-text { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.nav-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.nav-user-role { font-size: 10.5px; color: var(--muted); }
.nav-user-btn .caret { margin-left: 2px; }

.nav-menu-account { min-width: 244px; }
.nav-menu-account-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 9px;
}
.nav-avatar-lg { width: 34px; height: 34px; font-size: 14px; }
.nav-menu-account-head > div { min-width: 0; }
.nav-menu-account-head strong { display: block; font-size: 13.5px; color: var(--text); }
.account-role {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.nav-menu-divider { height: 1px; margin: 4px 8px 6px; background: var(--border); }
.nav-menu-account a.menu-danger:hover { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 760px) {
  .nav-menu-tools {
    left: auto;
    right: 0;
    min-width: 220px;
    transform-origin: top right;
  }
}

/* 待办提醒（教师端 / 辅导员端首页） */
.notice-card { border-color: #f0d9a8; background: #fffdf6; }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 2px;
  border-top: 1px solid var(--border);
}
.notice-item:first-child { border-top: 0; }
.notice-main { min-width: 0; }
.notice-main a.strong { font-size: 14px; }
.notice-main p { margin: 3px 0 0; }
.notice-side {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.notice-side form { margin: 0; }

/* 批量导入结果 */
.import-result {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #f0c9c4;
  border-radius: 8px;
  background: #fdf6f5;
}
.import-result-head { margin: 0 0 8px; font-weight: 600; color: var(--danger); }
.import-errors {
  margin: 0;
  padding-left: 20px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.7;
}
.import-errors li { margin-bottom: 2px; }

/* 操作日志导出与清理 */
.audit-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}
.audit-tools form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.audit-tools input[type="number"] {
  width: 84px;
  flex: 0 0 auto;
  padding: 6px 8px;
}

/* 批次操作较多时允许换行，避免删除按钮被挤出可视区域 */
.actions-cell.actions-wrap { white-space: normal; }
.row-actions-wrap { flex-wrap: wrap; white-space: normal; row-gap: 6px; }

/* 导航未读角标（教师端 / 辅导员端） */
.nav-badge {
  display: inline-block;
  min-width: 17px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 9px;
  background: #d9534f;
  color: #fff;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
}

/* 提醒中心：未读高亮 */
.notice-item.unread {
  padding-left: 10px;
  border-left: 3px solid #e6a23c;
  background: #fff9ec;
}

/* 导入表单内的行内复选框 */
.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
  font-size: 13px;
  color: var(--text);
}

/* 中等宽度收紧导航，避免换行拥挤 */
@media (max-width: 1180px) {
  .nav { gap: 2px; }
  .nav a, .nav-drop-btn { padding: 6px 8px; font-size: 13px; }
}
@media (max-width: 900px) {
  .nav .nav-user { display: none; }
}
