/**
 * 基础与通用类。类名沿用设计稿：.app / .side / .sitem / .card / .btn / .tag /
 * .th / .td / .zebra / .cell / .step / .kick / .num —— 改设计稿时好对照。
 *
 * 设计稿用 Noto Sans SC（Google Fonts）。这里走系统中文字体栈，不外链 ——
 * 学校网络访问 Google Fonts 经常超时，字体加载失败会导致整页闪烁。
 */
* {
  box-sizing: border-box;
}

/**
 * hidden 属性必须真的能藏住东西。
 *
 * 浏览器默认样式表里的 [hidden] { display: none } 优先级极低，
 * **任何**作者样式里的 display 都能盖掉它。于是 `.side { display: flex }`
 * 让登录页的 `side.hidden = true` 完全失效（登录页上挂着一整条侧导航），
 * `.btn { display: inline-flex }` 让 `<button hidden>` 照样显示。
 * 两处都是静默失效 —— JS 那边写着 hidden = true，看着一切正常。
 *
 * !important 在这里是对的：hidden 的语义就是「无论如何都不显示」。
 */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans SC',
    'MiSans', 'Source Han Sans SC', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  height: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  color: var(--accent-dark);
}

input,
textarea,
select,
button {
  font: inherit;
  color: inherit;
}

/* ── 骨架 ───────────────────────────────────────────── */
.app {
  display: flex;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

/* 流程页（导入向导、评语审阅）去掉侧导航，全宽聚焦 */
.main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--s5) var(--gutter);
}

/* 清单/阅读类页面收窄。一行文字超过 ~90 个汉字，眼睛回行就开始找不着 ——
   表格类页面不加这个类，它们要的是宽 */
.main-narrow > * {
  max-width: 1040px;
}

.main-flush {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 内容填满视口的页面（名册）：卡片吃掉剩余高度，表格区在卡内伸缩滚动。
   人少时留白收在卡片框内；人多时表格恰好占满、表尾钉在底部。 */
.main-fill {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.main-fill > * {
  flex-shrink: 0;
}
.main-fill .fill-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.main-fill .fill-card .table-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
}
.main-fill .fill-card .table-foot {
  flex-shrink: 0;
}

.center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-bg {
  background: linear-gradient(180deg, var(--accent-bg) 0%, var(--bg) 60%);
  align-items: center;
  justify-content: center;
}

/* ── 侧导航 ─────────────────────────────────────────── */
.side {
  width: var(--side-w);
  flex: none;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 18px;
}

.side-logo {
  width: 30px;
  height: 30px;
  /* 圆角和底色都在图里。容器再涂一层会在圆角外沿露出一圈直角的底 */
  border-radius: 9px;
  flex: none;
  display: block;
}

.side-name {
  font-weight: 800;
  font-size: 15px;
}

.sitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-btn);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.sitem:hover {
  background: var(--accent-bg);
}

.sitem-on {
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-weight: 700;
}

/* 尚未到开放时间：保留点击反馈，所以不能用 pointer-events:none。 */
.sitem.is-feature-closed { color: var(--muted-2); cursor: help; }
.sitem.is-feature-closed:hover { background: var(--surface-sunken); }

.nav-closed {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
}

.btn.is-feature-closed {
  opacity: 0.62;
  cursor: help;
}

/* 导航角标：有几件没处理，不点进去就要看得见。
   0 的时候整个元素不渲染 —— 灰色的「0」比没有更吵。 */
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 逾期用警示色。同一个位置换颜色，比多加一个图标便宜 */
.nav-badge.is-warn { background: var(--warn); }

.nav-badge.is-quiet {
  background: var(--neutral-bg);
  color: var(--muted);
  font-weight: 600;
}

/* 导航分组小标题。五项以内本不需要分组，
   但「今日 / 学生 / 期末 / 归档」是四种时间尺度的活，标出来能少想一步 */
.side-group {
  padding: 14px 12px 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  font-weight: 700;
}

.side-spacer {
  flex: 1;
}

.side-me {
  gap: 8px;
}

.side-ava {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex: none;
}

/* ── 文本 ───────────────────────────────────────────── */
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

.kick {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.h1 {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.h1-sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.muted {
  color: var(--muted);
}

.hint {
  font-size: 12.5px;
  color: var(--muted);
}

.pretty {
  text-wrap: pretty;
}

/* ── 标签 ───────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.tag-accent {
  background: var(--accent-bg);
  color: var(--accent-dark);
}

.tag-outline {
  background: var(--surface);
  border: 1px solid var(--line-3);
  color: var(--ink-2);
}

.tag-neutral {
  background: var(--neutral-bg);
  color: var(--ink-2);
}

.tag-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.tag-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.tag-sm {
  font-size: 11px;
  padding: 2px 8px;
}

.tag-btn {
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.tag-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ── 按钮 ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-btn);
  font-size: 13.5px;
  font-weight: 600;
  padding: 0 16px;
  min-height: 38px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--e-accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
}

/* 删除、清空、解绑这类不可逆的动作。只在确认弹层里用 ——
   页面上的入口不该长成红的，红色留给「按下去就没了」的那一下 */
.btn-danger {
  background: var(--warn);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(0.92);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line-3);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--accent-bg);
}

.btn-sm {
  min-height: 32px;
  font-size: 12.5px;
  padding: 0 12px;
}

.btn-lg {
  min-height: 44px;
  font-size: 14.5px;
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-block {
  width: 100%;
}

/* ── 卡片 ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--e1);
}

.card-clip {
  overflow: hidden;
}

.card-pad {
  padding: 16px 18px;
}

.card-on {
  border: 1.5px solid var(--accent);
}

/* ── 表格 ───────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
}

.th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  padding: var(--row-pad-y) var(--row-pad-x);
  height: 32px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-sunken);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* 可点排序的表头。箭头常驻占位，不然排序一变列宽跟着跳 */
.th-sort {
  cursor: pointer;
  user-select: none;
}
.th-sort:hover { color: var(--accent-dark); }
.th-sort::after {
  content: '↕';
  margin-left: 4px;
  opacity: 0.25;
  font-size: 10px;
}
.th-sort.is-asc::after { content: '↑'; opacity: 1; color: var(--accent); }
.th-sort.is-desc::after { content: '↓'; opacity: 1; color: var(--accent); }

.td {
  padding: var(--row-pad-y) var(--row-pad-x);
  height: var(--row-h);
  border-bottom: 1px solid var(--line);
  font-size: var(--cell-font);
  vertical-align: middle;
}

/* 数字列右对齐：46 行分数上下对不齐时，眼睛没法扫出高低 */
.td-num,
.th-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 选择列：固定 36px，不参与自适应 */
.th-pick,
.td-pick {
  width: 36px;
  padding-left: var(--s3);
  padding-right: 0;
}

.pick {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}

/* 选中行要一眼看得出来，且优先级高过斑马纹 */
tbody tr.is-picked,
.zebra tbody tr.is-picked:nth-child(even) {
  background: var(--accent-bg);
}

/* 定长内容列（学籍号/日期/电话这种）禁折行，窄屏交给 .table-scroll 横向滚 */
.nowrap {
  white-space: nowrap;
}

.zebra tbody tr:nth-child(even) {
  background: var(--zebra);
}

.row-hover tbody tr {
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.row-hover tbody tr:hover {
  background: var(--accent-bg);
}

.table-foot {
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ── 步骤条 ─────────────────────────────────────────── */
.steps {
  display: flex;
  gap: 20px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.step-todo {
  color: var(--muted);
}

.stepn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--neutral-bg);
  color: var(--muted);
  flex: none;
}

.stepn-on {
  background: var(--accent);
  color: #fff;
}

/* ── 表单 ───────────────────────────────────────────── */
.field {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-btn);
  padding: 11px 14px;
  margin-top: 6px;
  font-size: 14px;
  width: 100%;
  background: var(--surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 111, 122, 0.1);
}

.select {
  border: 1px solid var(--line-3);
  border-radius: var(--r-inner);
  padding: 6px 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.select:focus {
  outline: none;
  border-color: var(--accent);
}

.select-on {
  border: 1.5px solid var(--accent);
}

/* ── 布局助手 ───────────────────────────────────────── */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.col {
  display: flex;
  flex-direction: column;
}

.flex1 {
  flex: 1;
  min-width: 0;
}

.none {
  flex: none;
}

.wrap {
  flex-wrap: wrap;
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.hr {
  height: 1px;
  background: var(--line-2);
}

/* ── 转写中的小转圈 ─────────────────────────────────── */
.spin {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(15, 111, 122, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  flex: none;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── 进度条 ─────────────────────────────────────────── */
.bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--neutral-bg);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

/* ── Toast ──────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--r-btn);
  font-size: 13.5px;
  box-shadow: var(--e2);
  animation: toast-in 0.2s var(--ease);
  max-width: 380px;
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 确认弹层的标题与正文。正文比 .hint 大一档：这句话是做决定的依据，
   不是可看可不看的补充说明 */
.dlg-title {
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.5;
}

.dlg-body {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* 弹层里的勾选项。整块可点 —— 只让 12px 见方的小方块可点，是在为难人 */
.dlg-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-inner);
  background: var(--surface-sunken);
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}

.dlg-check input {
  margin: 3px 0 0;
  flex: none;
  accent-color: var(--accent);
}

/* 贴着入口的解释气泡。和 toast 同一套配色（同样是系统在说话），
   区别只在它长在被点的那个东西旁边 —— 见 ui.js 的 popover() */
.pop {
  position: fixed;
  z-index: 200;
  max-width: 300px;
  padding: 10px 14px;
  border-radius: var(--r-btn);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: var(--e2);
  animation: pop-in 0.16s var(--ease);
}

/* 小三角。--pop-caret 由 popover() 按 anchor 的中心算出来：
   气泡被视口挤歪时，指的还得是那个入口 */
.pop::before {
  content: '';
  position: absolute;
  top: var(--pop-caret, 50%);
  left: -5px;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  background: var(--ink);
  transform: rotate(45deg);
  border-radius: 2px;
}

.pop.pop-left::before {
  left: auto;
  right: -5px;
}

@keyframes pop-in {
  from { transform: translateX(-4px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.pop.pop-left {
  animation-name: pop-in-left;
}

@keyframes pop-in-left {
  from { transform: translateX(4px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ── 空状态 ─────────────────────────────────────────── */
.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.dropzone {
  border: 2px dashed rgba(15, 111, 122, 0.35);
  border-radius: 14px;
  padding: 32px;
  margin-top: 22px;
  background: var(--surface-sunken);
  text-align: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.dropzone:hover,
.dropzone.is-over {
  background: var(--accent-bg);
  border-color: var(--accent);
}

/* ── 常驻外壳的内容区 ───────────────────────────────── */
.view {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 换路由时的淡入。只有 6px 位移 + 0.14s —— 够让眼睛觉得「换了一页」，
   又不至于让人等动画。页内局部更新不加这个类。 */
.view-in {
  animation: view-in 0.14s var(--ease);
}

@keyframes view-in {
  from { opacity: 0.4; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* 表格局部更新时不要整块跳 —— 给 tbody 一个极短的过渡 */
.tbody-swap {
  animation: fade-soft 0.12s var(--ease);
}

@keyframes fade-soft {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

/* 顶部细进度条：数据在路上时用它，而不是把内容清空 */
.route-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 300;
  transition: width 0.2s var(--ease), opacity 0.3s var(--ease);
  opacity: 0;
}

.route-bar.is-on {
  opacity: 1;
  width: 70%;
}

.route-bar.is-done {
  width: 100%;
  opacity: 0;
}

/* ── 工具条 ─────────────────────────────────────────
   表格上方那一行：搜索 + 筛选 + 右侧操作。原来每个页面各摆各的，
   结果四个页面四种高度、四种间距。收成一个组件，页面只填内容。 */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: var(--r-card) var(--r-card) 0 0;
  flex-wrap: wrap;
}

/* 选中若干行后，工具条整条换成批量操作 —— 不新开一条 bar，
   否则表格会被往下挤，选中/取消时整页跳动 */
.toolbar.is-picking {
  background: var(--accent-bg);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

/* ── 待处理清单（今日）───────────────────────────────
   每一条都能就地处理完。处理完的行原地淡出，不重画整页 —— 
   「点一下、少一条」是这一屏唯一的节奏。 */
.task {
  display: flex;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
  transition: background var(--dur) var(--ease), opacity 0.2s var(--ease);
}

.task:last-child { border-bottom: none; }
.task:hover { background: var(--surface-sunken); }

.task.is-gone {
  opacity: 0;
  transform: translateX(8px);
}

.task-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.task-mark.is-warn { background: var(--warn-bg); color: var(--warn); }
.task-mark.is-ok { background: var(--ok-bg); color: var(--ok); }

.task-body { flex: 1; min-width: 0; }

.task-text {
  font-size: 13.5px;
  line-height: 1.5;
}

.task-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.task-do {
  display: flex;
  gap: var(--s2);
  align-items: center;
  flex: none;
}

/* 主操作永远是实的 —— 淡化的按钮读起来像禁用，老师会以为点不了。
   淡的是「删除 / 忽略」这类退路，hover 整行才浮出来。 */
.task-do .undo-score {
  opacity: 0.45;
  transition: opacity var(--dur) var(--ease);
}

.task:hover .task-do .undo-score,
.task:focus-within .task-do .undo-score { opacity: 1; }

/* ── 分区标题 ───────────────────────────────────────
   卡片内部的小节。比再套一层卡片轻，层级也更清楚 */
.sec-head {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-sunken);
}

.sec-title {
  font-size: 13px;
  font-weight: 700;
}

.sec-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── 键盘提示 ───────────────────────────────────────
   这个工作台的活是「连着干两小时」，键盘流必须看得见才有人用 */
.kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-3);
  border-bottom-width: 2px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── 主从布局 ───────────────────────────────────────
   左边一列可滚的清单，右边跟着变的详情。学生详情、评语审阅共用。 */
.master {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--s3);
  overflow: hidden;
}

.master > * { min-height: 0; overflow: auto; }

@media (max-width: 1180px) {
  .master { grid-template-columns: 1fr; }
  .master > .master-list { display: none; }
}

/* 主从清单里的一行 */
.mitem {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 7px var(--s3);
  border-radius: var(--r-inner);
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-2);
}

.mitem:hover { background: var(--accent-bg); }

.mitem-on {
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-weight: 700;
}

/* ── 全局搜索（⌘K）─────────────────────────────────
   浮层而不是页面：老师是在办公室被人问一句话时用它的，
   这时候手上正开着别的屏，不该为了查一句跳走再跳回来。 */
.side-search {
  display: flex;
  align-items: center;
  gap: var(--s2);
  width: 100%;
  margin: 0 0 var(--s2);
  padding: 7px 12px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-btn);
  background: var(--surface-sunken);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.side-search:hover { border-color: var(--accent); color: var(--ink-2); }
.side-search .kbd { margin-left: auto; }

.pal-wrap {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(18, 42, 41, 0.28);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
}

.pal {
  width: min(640px, 92vw);
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--e2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.pal-in {
  border: none;
  outline: none;
  padding: 16px 18px;
  font-size: 15px;
  border-bottom: 1px solid var(--line-2);
  background: none;
}

.pal-body { overflow: auto; padding: 6px; }

.pal-group {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  padding: 10px 12px 4px;
}

.pal-item {
  padding: 7px 12px;
  border-radius: var(--r-inner);
  cursor: pointer;
}

/* 选中态用键盘走出来，所以不能只做 hover */
.pal-item.is-on { background: var(--accent-bg); }

.pal-label {
  font-size: 13.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pal-meta {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pal-hint {
  padding: 22px 14px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pal-foot {
  display: flex;
  gap: var(--s4);
  padding: 8px 14px;
  border-top: 1px solid var(--line-2);
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-sunken);
}
