/* AI 辅助阅卷系统 —— 前端样式（白色科技风，单文件，无外部依赖）
 *
 * 配色规范（与首页保持一致）：
 *   主色 #006aff  辅色 #00c2ff  背景 #f5f7fa  卡片 #ffffff
 *   文字 #171e2b / #5e6774 / #9aa3b0   描边 #e8ecf2 / #d4dae3
 *
 * 说明：本文件是全站唯一控制顶部导航的地方（前台 .yj-top 与管理后台
 * admin/lib/admin_layout.php 用的是同一套类名），因此导航的白色背景
 * 在这里统一定义，不需要每个页面各写一份覆盖。
 */

:root {
  /* 旧变量名保留：个别页面仍在引用（--ok / --mono 等），避免改动波及 */
  --bg: #f5f7fa;
  --bg2: #fbfcfe;
  --panel: #ffffff;
  --panel2: #f2f5f9;
  --line: #e8ecf2;
  --line2: #d4dae3;
  --text: #171e2b;
  --dim: #5e6774;
  --dim2: #9aa3b0;
  --brand: #006aff;
  --brand2: #0052cc;
  --ok: #2fa84f;
  --warn: #e67e22;
  --bad: #e5484d;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Cascadia Mono", monospace;

  /* 新主题补充变量 */
  --blue: #006aff;
  --blue-deep: #0052cc;
  --blue-cyan: #00c2ff;
  --blue-bg: #e8f3ff;
  --blue-border: #b3d5ff;
  --t1: #171e2b;
  --t2: #5e6774;
  --t3: #9aa3b0;
  --grad-blue: linear-gradient(135deg, #006aff 0%, #0090ff 55%, #00c2ff 100%);
  --shadow-sm: 0 1px 3px rgba(23, 30, 43, .05);
  --shadow-md: 0 6px 20px rgba(23, 30, 43, .08);
  --shadow-blue: 0 6px 18px rgba(0, 106, 255, .28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.yj-body { background: var(--bg); padding: 0; margin: 0; }

/* ── 页面顶部淡蓝氛围光（科技感，不干扰内容） ──
 *
 * 这一段原来只写在 index.php 里，于是只有首页导航下方是淡蓝的
 * （#ebf1fa），别的页面是纯灰（#f5f7fa）—— 逐像素比对导航区时
 * 发现的唯一差别。提到共享样式里，所有页面就都和首页一致了。
 *
 * fixed 覆盖在窗口顶部，pointer-events:none 保证不挡点击；
 * 内容靠 .yj-main 抬到它上面（下面那条 z-index）。 */
body::before {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 240px;
  background: linear-gradient(180deg, rgba(0, 106, 255, .055), transparent);
  pointer-events: none;
  z-index: 0;
}
.yj-main { position: relative; z-index: 1; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  overflow: auto;
  max-height: 420px;
  color: var(--text);
}

::selection { background: rgba(0, 106, 255, .18); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #c9d2dd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8b4c4; }
::-webkit-scrollbar-track { background: transparent; }

/* ── 骨架 ── */
.yj-shell { min-height: 100vh; display: flex; flex-direction: column; }
.yj-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }
.yj-main-narrow { max-width: 520px; }

/* ── 顶部导航：白底 + 蓝色点缀（全站统一样式） ── */
.yj-top {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 4px rgba(23, 30, 43, .04);
}
/* 导航底部的渐变能量线，科技感点睛（不占空间、不影响布局） */
.yj-top::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg,
    rgba(0, 106, 255, 0), rgba(0, 106, 255, .38), rgba(0, 194, 255, .38), rgba(0, 106, 255, 0));
  pointer-events: none;
}
.yj-top-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  height: 56px; display: flex; align-items: center; gap: 24px;
}
.yj-brand {
  color: var(--t1); font-weight: 600; font-size: 15px;
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
}
.yj-brand:hover { text-decoration: none; }

/* ── 左上角品牌 logo ──
 *
 * 原先是「一个渐变圆点 + 站点名文字」，现在换成整张 logo 图片
 * （assets/logo.jpg，805×180 的横版字标）。
 *
 * 高度 32px：导航条 56px 高，上下各留 12px，视觉上不挤。
 * 用 height + width:auto 保持原始比例 —— 两边都写死的话，换个比例的
 * logo 就会被拉变形。
 * display:block 去掉 img 默认的基线间隙，否则整个导航会往下偏几像素。
 */
.yj-brand-logo {
  height: 32px;
  width: auto;
  display: block;
}
/* 管理后台的副标记：logo 只说明"哪个系统"，还要看得出自己在后台 */
.yj-brand-sub {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--t3);
  padding-left: 9px;
  border-left: 1px solid var(--line2);
}
/* 旧样式保留：万一还有页面在用圆点 */
.yj-brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--grad-blue);
  box-shadow: 0 0 10px rgba(0, 106, 255, .55);
}
.yj-nav { display: flex; gap: 4px; flex: 1; }
.yj-nav a {
  color: var(--t2); padding: 6px 12px; border-radius: 4px;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: color .15s, background-color .15s;
}
.yj-nav a:hover { background: rgba(0, 106, 255, .06); color: var(--blue); text-decoration: none; }
.yj-nav a.on { background: var(--blue-bg); color: var(--blue); font-weight: 600; }

.yj-me { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.yj-uname { color: var(--t2); font-size: 13px; }
.yj-credit {
  font-size: 12.5px; color: var(--t2);
  background: var(--blue-bg); border: 1px solid var(--blue-border);
  padding: 3px 10px; border-radius: 20px;
}
.yj-credit b { color: var(--blue-deep); font-family: var(--mono); }

/* ── 顶部导航里的按钮：全站钉死成同一副样子 ──
 *
 * 为什么要单独写这一段：站里有 11 个页面各自重写了 .yj-btn / .yj-btn-ghost /
 * .yj-btn-sm，而且分成了两派 —— 一派圆角矩形（首页就是这一派），
 * 一派胶囊形（22px 圆角 + 蓝字）。结果是导航栏里同一个「退出」按钮，
 * 在首页是 50×28 的灰色圆角矩形，到 results / admin 等页却变成
 * 56×32 的蓝色胶囊，一眼就看得出不是一套。
 *
 * 这里用两级选择器 `.yj-top .yj-btn`（优先级 0,2,0）压过页面里的
 * 单级 `.yj-btn`（0,1,0），把导航里的按钮统一成首页的样子；
 * **各页面正文里的按钮不受影响**，不必去改那 11 个文件。
 */
.yj-top .yj-btn {
  /* display / 对齐必须一起写死，不能只给尺寸。
   *
   * 踩过的坑：help.php 自带 `.yj-btn { display: inline-block }`，
   * 和 app.css 里的 `.yj-btn { display: inline-flex }` 优先级相同（都是单类），
   * 它写在后面就赢了 —— 结果按钮外框仍是 28px 高（我这边定的），
   * 里面的「退出」两个字却顶到了上边缘，比别的页面高 7 像素。
   * 只量包围盒根本看不出来，得看文字位置。
   * 所以这里把 display 和居中一并锁死。 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  border-radius: 4px;
  background: #fff;
  background-image: none;
  color: var(--t1);
  border: 1px solid var(--line2);
  box-shadow: none;
  transform: none;
}
.yj-top .yj-btn:hover {
  background: var(--blue-bg);
  background-image: none;
  border-color: var(--blue-border);
  color: var(--blue);
  box-shadow: none;
  transform: none;
}
.yj-top .yj-btn:active {
  background: #d8e9ff;
  filter: none;
}

/* .yj-foot 已移除：页脚的版本行不再显示，前台版权由各页自己的 .page-footer 承担 */
.yj-dim { color: var(--t2); }
.yj-dim2 { color: var(--t3); }
.yj-mono { font-family: var(--mono); color: var(--blue-deep); }

/* ── 卡片 ── */
.yj-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.yj-card > h2, .yj-card > h3 { margin-top: 0; }
.yj-card h2 { font-size: 16px; margin: 0 0 14px; color: var(--t1); }
.yj-card h3 { font-size: 14.5px; margin: 0 0 10px; color: var(--t1); }
.yj-card-sub { color: var(--t2); font-size: 13px; margin: -8px 0 14px; }

.yj-page-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.yj-page-title h1 { font-size: 20px; margin: 0; color: var(--t1); }
.yj-page-title .yj-sub { color: var(--t3); font-size: 13px; margin-top: 3px; }

/* ── 按钮 ── */
.yj-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--grad-blue); color: #fff; border: none;
  padding: 8px 16px; border-radius: 4px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; font-family: inherit; line-height: 1.35;
  transition: transform .15s, box-shadow .15s, background-color .15s, color .15s;
}
.yj-btn:hover {
  transform: translateY(-1px); box-shadow: var(--shadow-blue);
  text-decoration: none; color: #fff;
}
.yj-btn:active { transform: translateY(0); box-shadow: none; filter: brightness(.94); }
.yj-btn:focus-visible { outline: 2px solid rgba(0, 106, 255, .4); outline-offset: 2px; }
.yj-btn:disabled, .yj-btn.off { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.yj-btn-ghost { background: #fff; color: var(--t1); border: 1px solid var(--line2); }
.yj-btn-ghost:hover { background: var(--blue-bg); border-color: var(--blue-border); color: var(--blue); box-shadow: none; }
.yj-btn-ok { background: var(--ok); color: #fff; }
.yj-btn-ok:hover { background: #279044; color: #fff; }
.yj-btn-bad { background: #fff; color: var(--bad); border: 1px solid #ffd2d3; }
.yj-btn-bad:hover { background: #fff3f3; border-color: var(--bad); color: var(--bad); box-shadow: 0 4px 12px rgba(229, 72, 77, .18); }
.yj-btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 4px; }
.yj-btn-lg { padding: 11px 26px; font-size: 15px; }
.yj-btn-block { width: 100%; }
.yj-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ── 表单 ── */
.yj-field { margin-bottom: 15px; }
.yj-field > label { display: block; font-size: 13px; color: var(--t2); margin-bottom: 6px; }
.yj-field .yj-hint { font-size: 12px; color: var(--t3); margin-top: 5px; line-height: 1.6; }
.yj-req::after { content: " *"; color: var(--bad); }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=email], select, textarea {
  width: 100%; background: #fff; color: var(--text);
  border: 1px solid var(--line2); border-radius: 4px;
  padding: 9px 11px; font-size: 13.5px; font-family: inherit; line-height: 1.6;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 106, 255, .14);
}
textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }
input[type=file] { padding: 7px; font-size: 13px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: auto; margin-right: 6px; }

.yj-row { display: flex; gap: 14px; flex-wrap: wrap; }
.yj-row > * { flex: 1; min-width: 180px; }
.yj-row-3 > * { min-width: 130px; }

.yj-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--t2); }
.yj-inline input[type=checkbox] { margin: 0; }

/* ── 表格 ── */
.yj-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.yj-table th, .yj-table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line); vertical-align: middle;
}
.yj-table th { color: var(--t2); font-weight: 600; font-size: 12.5px; background: var(--panel2); }
.yj-table tr:last-child td { border-bottom: none; }
.yj-table tbody tr:hover { background: rgba(0, 106, 255, .04); }
.yj-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* ── 徽标 ── */
.yj-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; line-height: 1.7; border: 1px solid transparent; white-space: nowrap;
}
.yj-badge.ok { background: #eafaf0; color: #1f8a41; border-color: #c9edd6; }
.yj-badge.bad { background: #fff1f1; color: #cf3438; border-color: #ffd2d3; }
.yj-badge.warn { background: #fdf3e7; color: #b8620f; border-color: #f5ddb9; }
.yj-badge.info { background: var(--blue-bg); color: var(--blue-deep); border-color: var(--blue-border); }
.yj-badge.gray { background: #f2f4f7; color: var(--t2); border-color: #e4e8ee; }

/* ── 空状态 ── */
.yj-empty { text-align: center; padding: 52px 20px; color: var(--t3); }
.yj-empty-icon { font-size: 34px; color: var(--line2); margin-bottom: 12px; }
.yj-empty p { margin: 0 0 16px; }

/* ── 登录页 ── */
.yj-login-wrap { display: flex; align-items: center; justify-content: center; padding: 8vh 20px 40px; }
.yj-login {
  width: 100%; max-width: 400px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 32px 28px;
  box-shadow: var(--shadow-md);
}
.yj-login h1 { font-size: 19px; margin: 0 0 6px; text-align: center; color: var(--t1); }
.yj-login .yj-login-sub { color: var(--t2); font-size: 13px; text-align: center; margin-bottom: 24px; }
.yj-login .yj-btn { width: 100%; margin-top: 6px; }

/* ── 提示条 ── */
.yj-alert {
  border-radius: 8px; padding: 11px 14px; font-size: 13px;
  margin-bottom: 14px; line-height: 1.7; border-left: 3px solid;
}
.yj-alert.info { background: var(--blue-bg); border-color: var(--blue); color: #00459c; }
.yj-alert.warn { background: #fff8e6; border-color: var(--warn); color: #91530a; }
.yj-alert.bad { background: #fff2f0; border-color: var(--bad); color: #b8292d; }
.yj-alert.ok { background: #f0fbf4; border-color: var(--ok); color: #1c7a39; }

/* ── 标签 ── */
.yj-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.yj-tabs a, .yj-tabs button {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--t2); padding: 8px 14px; cursor: pointer;
  font-size: 13.5px; font-family: inherit; border-radius: 6px 6px 0 0;
}
.yj-tabs a:hover, .yj-tabs button:hover { background: rgba(0, 106, 255, .06); color: var(--blue); text-decoration: none; }
.yj-tabs .on { color: var(--blue); border-bottom-color: var(--brand); font-weight: 600; }

/* ── 试卷列表 ── */
.yj-paper-list { display: grid; gap: 11px; }
.yj-paper-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.yj-paper-row:hover {
  transform: translateX(3px);
  border-color: var(--blue-border);
  box-shadow: 0 8px 22px rgba(0, 106, 255, .1);
}
.yj-paper-main { flex: 1; min-width: 0; }
.yj-paper-name { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; color: var(--t1); }
.yj-paper-meta { color: var(--t3); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ── 题目编辑 ── */
.yj-q {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 13px;
  box-shadow: var(--shadow-sm);
}
.yj-q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.yj-q-no {
  background: var(--grad-blue); color: #fff; font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 4px; font-family: var(--mono);
}
.yj-q-head .yj-q-title { flex: 1; color: var(--t2); font-size: 13px; }
.yj-q-body.collapsed { display: none; }
.yj-q .yj-field:last-child { margin-bottom: 0; }
.yj-q-fig { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.yj-q-fig img { max-height: 70px; border-radius: 6px; border: 1px solid var(--line2); background: #fff; }

/* ── 统计条 ── */
.yj-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.yj-stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.yj-stat .k { color: var(--t3); font-size: 12.5px; }
.yj-stat .v { font-size: 22px; font-weight: 700; font-family: var(--mono); margin-top: 4px; color: var(--t1); }
.yj-stat .v.ok { color: var(--ok); }
.yj-stat .v.bad { color: var(--bad); }

/* ── 进度 ── */
.yj-progress { height: 6px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.yj-progress > i { display: block; height: 100%; background: var(--grad-blue); transition: width .3s; }

/* ── 模态 ── */
.yj-modal-mask {
  position: fixed; inset: 0; background: rgba(23, 30, 43, .35);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(2px);
}
.yj-modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px; max-width: 520px; width: 100%; max-height: 86vh; overflow: auto;
  box-shadow: 0 18px 50px rgba(23, 30, 43, .18);
}
.yj-modal h3 { margin: 0 0 12px; font-size: 15.5px; color: var(--t1); }

.yj-hidden { display: none !important; }
.yj-nowrap { white-space: nowrap; }
.yj-right { text-align: right; }
.yj-center { text-align: center; }
.yj-mt { margin-top: 14px; }
.yj-mt2 { margin-top: 22px; }
.yj-mb { margin-bottom: 14px; }
.yj-small { font-size: 12.5px; }

@media (max-width: 760px) {
  .yj-top-inner { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .yj-nav { order: 3; width: 100%; overflow-x: auto; }
  .yj-main { padding: 16px 14px 50px; }
  .yj-row > * { min-width: 100%; }
  .yj-paper-row { flex-wrap: wrap; }
}

/* ── 页面加载进度条 ──
 *
 * 原来这个进度条是「每页各写一份」的约定，于是难免漏：
 * install.php 完全没有，login.php 有标记没样式，
 * admin/papers.php 和 admin/users.php 还各存了两份。
 * 现在统一放在这里，标记由 yj_page_head() / yj_admin_head() 输出，
 * 各页面不用再自己写，新页面也自动就有。
 *
 * 纯 CSS 动画：进页面时从左到右扫一遍再淡出，不需要 JS。 */
.loading-bar-box {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 10001;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}
.loading-bar {
  height: 100%;
  width: 0%;
  background: var(--grad-blue);
  box-shadow: 0 0 8px rgba(0, 144, 255, .8);
  animation: loadingMove .6s ease-out forwards;
}
@keyframes loadingMove {
  0% { width: 0; opacity: 1; }
  70% { width: 100%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}


/* ── 列表分页 ──
 *
 * 原先只在 admin/audit.php 里内联了一份。现在管理后台的「阅卷成绩」也要用，
 * 与其再抄一份，不如提上来做共享 —— 抄三份的下场就是改一处、漏两处。
 */
.yj-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.yj-pagination .yj-page-info { font-size: 13px; color: var(--t2); }
.yj-pagination .yj-page-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.yj-pagination .yj-page-btns a,
.yj-pagination .yj-page-btns span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--line2);
  background: #fff;
  color: var(--t2);
  transition: all .2s;
}
.yj-pagination .yj-page-btns a:hover {
  border-color: #2f8bff;
  color: var(--blue);
  background: #f0f7ff;
}
.yj-pagination .yj-page-btns .cur {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}
.yj-pagination .yj-page-btns .dots {
  border: none;
  background: transparent;
  color: var(--t3);
  min-width: 20px;
}
