/* ============================================================
   在线考试系统 全局样式 v2 —— 现代化设计（移动端优先）
   设计令牌统一管理：改一处即可全站换肤
   ============================================================ */
:root {
  /* 主色：靛蓝 → 紫 渐变体系 */
  --c-primary: #4f6bff;
  --c-primary-deep: #3b4fe0;
  --c-accent: #7c5cff;
  --c-success: #16a34a;
  --c-danger: #e11d48;
  --c-warn: #d97706;
  --c-info: #2563eb;

  /* 中性色 */
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1a2030;
  --text-2: #4b5568;
  --muted: #7a819c;
  --line: #e9ecf4;
  --line-2: #f0f2f8;

  /* 圆角与阴影 */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --shadow-1: 0 1px 2px rgba(23,30,60,.05), 0 2px 8px rgba(23,30,60,.05);
  --shadow-2: 0 4px 12px rgba(23,30,60,.08), 0 12px 32px rgba(23,30,60,.08);
  --ring: 0 0 0 3px rgba(79,107,255,.16);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* 全局 sticky footer：内容不足一屏时页脚仍贴在视口最底部 */
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
body > .topbar { flex: 0 0 auto; }
body > .wrap { flex: 1 0 auto; width: 100%; }
body > .site-footer { flex: 0 0 auto; margin-top: auto; }
a { color: var(--c-primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--c-primary-deep); }
img { max-width: 100%; }
::selection { background: rgba(79,107,255,.18); }

/* 键盘可达：统一焦点样式（无障碍） */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 6px;
}

/* ---------- 布局 ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 30px 22px 56px; }

/* ---------- 后台 sticky footer：内容不足一屏时页脚也贴在最底部 ---------- */
.admin-body { display: flex; flex-direction: column; min-height: 100vh; }
.admin-body .topbar { flex: 0 0 auto; }
.admin-body .wrap { flex: 1 0 auto; width: 100%; }
.admin-body .site-footer { flex: 0 0 auto; }
/* 手机端后台底部导航栏（桌面隐藏，≤768px 由媒体查询启用） */
.bottom-nav, .bn-sheet { display: none; }

/* ---------- 顶部导航 ---------- */
.topbar {
  background: linear-gradient(120deg,#16215c 0%, #2c3fcb 45%, #6a4ff0 100%);
  box-shadow: 0 2px 16px rgba(30,40,120,.28);
  position: sticky; top: 0; z-index: 50;
}
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; font-size: 17px; color: #fff; display: flex; align-items: center; gap: 10px; letter-spacing: .2px; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 10px; color: #fff;
  background: rgba(255,255,255,.16); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}
.brand .logo-img { background: transparent; box-shadow: none; object-fit: contain; padding: 2px; }
.brand small { font-weight: 400; font-size: 12px; opacity: .78; }
.nav { display: flex; align-items: center; gap: 4px; overflow-x: visible; overflow-y: visible; white-space: nowrap; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: rgba(255,255,255,.82); margin-left: 0; font-size: 14px; padding: 8px 13px; border-radius: 10px; transition: all .18s ease; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.14); }
.nav a.active { color: #fff; background: rgba(255,255,255,.2); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.nav-user { position: relative; margin-left: 14px; flex: 0 0 auto; }
.nav-user .dd-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 200; }
.user-dd-btn { display: flex; align-items: center; gap: 6px; background: transparent; border: 0; color: #fff; cursor: pointer; padding: 4px 6px; border-radius: 999px; font-family: inherit; }
.user-dd-btn:hover { background: rgba(255,255,255,.14); }
.dd-caret { font-size: 10px; color: rgba(255,255,255,.75); }
.role-badge { font-size: 12px; color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); padding: 4px 12px; border-radius: 999px; }
.dd-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 208px; background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 8px; z-index: 100; border: 1px solid var(--line); }
.nav-user.open .dd-menu { display: block; animation: ddIn .15s ease; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dd-head { padding: 10px 12px 9px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; font-size: 14px; color: var(--text); white-space: nowrap; }
.dd-head .dd-on { font-size: 12px; color: var(--c-success); font-weight: 500; margin-left: 6px; }
.dd-menu .dd-item { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; white-space: nowrap; transition: all .14s ease; }
.dd-menu .dd-item:hover { background: #f2f5ff; color: var(--c-primary); }
.dd-menu .dd-danger { color: var(--c-danger); }
.dd-menu .dd-danger:hover { background: #fdf0f3; color: var(--c-danger); }
.logout-btn { font-size: 13px; color: #fff; border: 1px solid rgba(255,255,255,.5); padding: 6px 14px; border-radius: 10px; transition: all .18s ease; }
.logout-btn:hover { background: #fff; color: #2c3fcb; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--r-lg); padding: 26px 26px; margin-bottom: 22px; box-shadow: var(--shadow-1); border: 1px solid rgba(233,236,244,.8); }
.card-title { font-size: 17px; font-weight: 700; margin: 0 0 20px; letter-spacing: .2px; }

/* ---------- 趋势柱状图（无 JS 依赖） ---------- */
.trend-chart { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding-top: 26px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-bar { width: 62%; max-width: 44px; background: linear-gradient(180deg,#7c9bff,#4f6bff); border-radius: 8px 8px 4px 4px; min-height: 3px; position: relative; transition: filter .15s ease; }
.trend-col:hover .trend-bar { filter: brightness(1.08); }
.trend-val { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--c-primary); font-weight: 700; }
.trend-label { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ---------- 部门分布横向条形 ---------- */
.dept-list { display: flex; flex-direction: column; gap: 13px; padding: 2px 4px; }
.dept-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dept-name { min-width: 84px; text-align: left; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 2px; }
.dept-bar-wrap { flex: 1; background: #eef1f7; border-radius: 6px; height: 14px; overflow: hidden; }
.dept-bar { height: 100%; background: linear-gradient(90deg,#7c9bff,#4f6bff); border-radius: 6px; transition: width .4s; }
.dept-num { width: 52px; color: var(--c-primary); font-weight: 600; text-align: right; }

/* ---------- 活动类型环形图 ---------- */
.pie-wrap { display: flex; justify-content: center; margin: 6px 0 20px; }
.pie { width: 160px; height: 160px; border-radius: 50%; position: relative; box-shadow: 0 6px 18px rgba(79,107,255,.16); }
.pie-empty { background: #eef1f7; }
.pie-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: #fff; width: 94px; height: 94px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; color: var(--c-primary); box-shadow: var(--shadow-1); }
.pie-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.pie-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.pie-item b { margin-left: auto; color: var(--c-primary); }
.dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; border: none; cursor: pointer; border-radius: 12px; padding: 10px 22px;
  font-size: 14.5px; font-weight: 500; font-family: inherit;
  background: linear-gradient(135deg,var(--c-primary),var(--c-primary-deep)); color: #fff; text-decoration: none;
  box-shadow: 0 2px 6px rgba(79,107,255,.28);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease, background .15s ease;
}
.btn:hover { opacity: 1; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79,107,255,.36); color: #fff; }
.btn:active { transform: translateY(0); box-shadow: 0 2px 5px rgba(79,107,255,.3); }
.btn-sm { padding: 5px 13px; font-size: 13px; border-radius: 10px; box-shadow: none; }
.btn-sm:hover { transform: none; box-shadow: 0 2px 8px rgba(79,107,255,.3); }
.btn-green { background: linear-gradient(135deg,#18b058,#128a43); box-shadow: 0 2px 6px rgba(22,163,74,.28); }
.btn-green:hover { box-shadow: 0 6px 16px rgba(22,163,74,.36); }
.btn-red { background: linear-gradient(135deg,#ef4466,#d31d45); box-shadow: 0 2px 6px rgba(225,29,72,.28); }
.btn-red:hover { box-shadow: 0 6px 16px rgba(225,29,72,.36); }
.btn-gray { background: #e8ebf1; color: #3a4254; box-shadow: none; }
.btn-gray:hover { background: #dfe3ec; box-shadow: none; color: #3a4254; }
.btn-outline { background: #fff; border: 1.5px solid var(--c-primary); color: var(--c-primary); box-shadow: none; }
.btn-outline:hover { background: #f3f6ff; color: var(--c-primary-deep); }
.btn-block { display: block; width: 100%; text-align: center; padding: 12px; font-size: 15px; font-weight: 600; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line-2); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.table th { background: #f6f8fc; color: #5b6478; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table th small { color: var(--muted); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover td { background: #f8faff; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 8px; font-weight: 500; }
.form-control {
  width: 100%; padding: 12px 15px; border: 1.5px solid #dde2ec; border-radius: var(--r-sm);
  font-size: 15px; background: #fff; font-family: inherit; color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--ring); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.row { display: flex; gap: 12px; }
.row .col { flex: 1; }

/* ---------- 标签/徽章 ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .2px; }
.badge-green { background: #e6f8ee; color: #0d8a48; }
.badge-blue { background: #e9efff; color: #3b5fe0; }
.badge-purple { background: #f1ecff; color: #7040e0; }
.badge-gray { background: #f0f2f6; color: #5f6779; }
.badge-red { background: #fdecf0; color: #c21a44; }
.badge-orange { background: #fdf2e2; color: #b45309; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 22px; }

/* 仪表盘欢迎区 */
.dash-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(120deg, #2c3fcb 0%, #4f6bff 55%, #7c5cff 100%);
  border-radius: var(--r-lg); padding: 26px 28px; margin-bottom: 22px; color: #fff;
  box-shadow: 0 8px 24px rgba(60,80,220,.3); position: relative; overflow: hidden;
}
.dash-hero::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255,255,255,.1); pointer-events: none;
}
.dash-hero-title { font-size: 22px; font-weight: 800; letter-spacing: .3px; }
.dash-hero-sub { font-size: 13px; opacity: .88; margin-top: 5px; }
.dash-hero .btn { background: #fff; color: var(--c-primary-deep); font-weight: 700; border: none; padding: 8px 16px; font-size: 13px; box-shadow: 0 2px 8px rgba(20,30,90,.2); }
.dash-hero .btn:hover { background: #eef3ff; }

/* 图表卡片 */
.chart-card { padding: 20px 22px 24px; }
/* 仪表盘下半区：趋势图 + 最近活动并排 */
.dash-cols { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; align-items: stretch; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }
.stat {
  background: var(--card); border-radius: var(--r-md); padding: 18px 20px 18px 26px;
  box-shadow: var(--shadow-1); border: 1px solid rgba(233,236,244,.8);
  position: relative; overflow: hidden; display: grid;
  grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 15px; align-items: center;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--c), rgba(255,255,255,.25)); background-color: var(--c); }
.stat .num { grid-column: 2; grid-row: 1; font-size: 26px; font-weight: 800; color: var(--c); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .label { grid-column: 2; grid-row: 2; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.stat-icon { grid-column: 1; grid-row: 1 / 3; align-self: center; justify-self: center; color: var(--c); line-height: 0; }
.stat-icon svg { width: 28px; height: 28px; }
.c-blue{--c:#4f6bff} .c-cyan{--c:#0ea5e9} .c-purple{--c:#8b5cf6} .c-green{--c:#16a34a}
.c-orange{--c:#f97316} .c-pink{--c:#ec4899} .c-red{--c:#ef4444} .c-slate{--c:#64748b}
.stat-link { display: block; color: inherit; text-decoration: none; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.stat-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); color: inherit; }
.stat-link:hover .num { opacity: .85; }

/* ---------- 提示 ---------- */
.alert { padding: 15px 19px; border-radius: var(--r-sm); margin-bottom: 22px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: #e6f8ee; color: #0d8a48; border-color: #c9efdb; }
.alert-error { background: #fdecf0; color: #c21a44; border-color: #f8d3dd; }
.alert-info { background: #e9efff; color: #3b5fe0; border-color: #d3e0ff; }
.alert-warn { background: #fdf2e2; color: #b45309; border-color: #f8e3c2; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 50px 20px; color: #a0a6b8; }
.empty .icon { font-size: 42px; margin-bottom: 10px; }

/* ---------- 二维码 ---------- */
.qr-box { text-align: center; }
.qr-box canvas, .qr-box img { max-width: 220px; width: 100%; }
.qr-link { font-size: 13px; color: var(--muted); word-break: break-all; margin: 10px 0; }

/* ---------- 答题页 ---------- */
.answer-head { text-align: center; padding: 8px 0 4px; }
.answer-title { font-size: 21px; font-weight: 800; margin: 6px 0; letter-spacing: .2px; }
.answer-desc { color: var(--muted); font-size: 14px; margin-bottom: 14px; white-space: pre-line; }
.question-card {
  background: var(--card); border-radius: var(--r-lg); padding: 20px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow-1); border: 1px solid rgba(233,236,244,.8);
  scroll-margin-top: 70px; transition: box-shadow .18s ease, border-color .18s ease;
}
.question-card:target { border-color: rgba(79,107,255,.4); box-shadow: 0 0 0 3px rgba(79,107,255,.12), var(--shadow-1); }
.q-img { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.q-img-item { max-width: 240px; max-height: 180px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; cursor: zoom-in; transition: transform .15s ease, box-shadow .15s ease; }
.q-img-item:hover { transform: scale(1.03); box-shadow: 0 4px 14px rgba(20,30,70,.15); }
/* 图片放大预览 lightbox */
.lb-backdrop { position: fixed; inset: 0; background: rgba(10,14,30,.85); z-index: 9999; display: none; align-items: center; justify-content: center; padding: 22px; cursor: zoom-out; }
.lb-backdrop.show { display: flex; }
.lb-backdrop img { max-width: 92vw; max-height: 88vh; border-radius: 14px; box-shadow: 0 16px 60px rgba(0,0,0,.5); }
.q-img { margin-bottom: 12px; text-align: center; }
.q-img img { max-width: 100%; max-height: 360px; border-radius: 12px; border: 1px solid var(--line); display: inline-block; }
.q-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.q-title .no { color: var(--c-primary); font-weight: 700; margin-right: 6px; }
.q-score { float: right; color: var(--muted); font-size: 12px; font-weight: 400; }
.opt {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid #e4e8f1; border-radius: 12px;
  padding: 12px 15px; margin-bottom: 9px; cursor: pointer; transition: all .16s ease; background: #fff;
}
.opt:hover { border-color: #b9c6ff; background: #f8faff; transform: translateX(2px); }
.opt input { flex: 0 0 auto; accent-color: var(--c-primary); width: 17px; height: 17px; margin: 0; }
.opt.selected, .opt:has(input:checked) { border-color: var(--c-primary); background: #eef3ff; box-shadow: 0 0 0 3px rgba(79,107,255,.12); color: var(--c-primary-deep); font-weight: 600; }
.q-input {
  width: 100%; padding: 10px 14px; border: 1.5px solid #dde2ec; border-radius: var(--r-sm);
  font-size: 15px; font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
.q-input:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--ring); }
.q-textarea {
  width: 100%; padding: 13px 15px; border: 1.5px solid #e4e8f1; border-radius: 12px; font-size: 15px;
  min-height: 110px; resize: vertical; font-family: inherit; line-height: 1.6;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.q-textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--ring); }
/* 批量判卷页：简答打分行 */
.grade-row { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grade-input { width: 110px; }
@media (max-width: 480px) {
  .grade-input { width: 100%; }
  .grade-row { align-items: stretch; }
}
.judge-row { display: flex; gap: 12px; }
.judge-row .opt { flex: 1; text-align: center; justify-content: center; margin-bottom: 0; }

/* 提交条 */
.submit-bar { position: sticky; bottom: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 16px; z-index: 10; }

/* ---------- 答题页：侧边题号导航 ---------- */
.take-layout { display: flex; gap: 18px; align-items: flex-start; max-width: 980px; margin: 0 auto; }
.take-main { flex: 1; min-width: 0; }
.answer-nav {
  position: sticky; top: 12px; width: 236px; flex: 0 0 236px; background: var(--card);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1); border: 1px solid rgba(233,236,244,.8);
  padding: 14px 14px 16px; max-height: 82vh; overflow-y: auto;
}
.nav-legend { font-size: 13px; color: #5b6478; display: flex; align-items: center; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; background: #f6f8fc; border-radius: 10px; padding: 8px 10px; }
.nav-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-done { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.18); }
.dot-undone { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.15); }
.nav-count { color: var(--c-primary); font-weight: 700; }
.nav-list { display: grid; grid-template-columns: repeat(6,1fr); gap: 7px; }
.nav-btn {
  border: none; border-radius: 9px; padding: 8px 0; font-size: 13px; cursor: pointer; font-weight: 600;
  color: #fff; font-family: inherit; transition: transform .12s, box-shadow .12s, filter .12s;
}
.nav-btn:hover { filter: brightness(1.08); }
.nav-btn.done { background: linear-gradient(135deg,#22c55e,#16a34a); box-shadow: 0 2px 5px rgba(34,197,94,.3); }
.nav-btn.undone { background: linear-gradient(135deg,#f87171,#ef4444); box-shadow: 0 2px 5px rgba(239,68,68,.22); }
/* 未答题号按题型着色 */
.nav-btn.undone.q-single { background: linear-gradient(135deg,#5c8aff,#4f6bff); box-shadow: 0 2px 5px rgba(79,107,255,.28); }
.nav-btn.undone.q-multi  { background: linear-gradient(135deg,#a78bfa,#8b5cf6); box-shadow: 0 2px 5px rgba(139,92,246,.26); }
.nav-btn.undone.q-judge  { background: linear-gradient(135deg,#22b8cf,#0891b2); box-shadow: 0 2px 5px rgba(8,145,178,.25); }
.nav-btn.undone.q-fill   { background: linear-gradient(135deg,#fbbf24,#f59e0b); box-shadow: 0 2px 5px rgba(245,158,11,.25); }
.nav-btn.undone.q-score  { background: linear-gradient(135deg,#aab3bf,#94a3b8); box-shadow: 0 2px 5px rgba(148,163,184,.22); }
.nav-btn.undone.q-essay  { background: linear-gradient(135deg,#2dd4bf,#0d9488); box-shadow: 0 2px 5px rgba(13,148,136,.25); }
.nav-btn.current { outline: 2px solid var(--c-primary); outline-offset: 2px; transform: scale(1.12); box-shadow: 0 3px 8px rgba(79,107,255,.3); z-index: 2; }
.nav-btn:hover { transform: scale(1.1); }
.nav-btn:focus { outline: none; }
.nav-btn:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
/* 题型图例 */
.nav-typelegend { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.tl { font-size: 11px; padding: 2px 8px; border-radius: 6px; color: #fff; line-height: 1.4; }
.tl-single{background:#4f6bff} .tl-multi{background:#8b5cf6} .tl-judge{background:#0891b2}
.tl-fill{background:#f59e0b} .tl-score{background:#94a3b8} .tl-essay{background:#0d9488}

@media (max-width: 980px) {
  .answer-nav { width: 176px; flex: 0 0 176px; }
  .nav-list { grid-template-columns: repeat(5,1fr); gap: 6px; }
}
@media (max-width: 720px) {
  .take-layout { flex-direction: column; gap: 10px; }
  .answer-nav { position: fixed; top: 0; left: 0; right: 0; width: auto; flex: none; border-radius: 0; box-shadow: 0 2px 10px rgba(0,0,0,.14); max-height: none; z-index: 50; padding: 8px 10px; background: #fff; }
  .nav-legend { margin-bottom: 6px; margin-right: 0; white-space: nowrap; padding: 5px 10px; }
  .nav-typelegend { display: none; }
  .nav-list { display: flex; overflow-x: auto; white-space: nowrap; padding-bottom: 5px; scrollbar-width: thin; }
  .nav-btn { flex: 0 0 auto; width: 38px; height: 38px; padding: 0; font-size: 13px; border-radius: 50%; }
  .take-main { margin-top: 62px; }
}

/* ---------- 结果页 ---------- */
.result-hero { text-align: center; padding: 30px 20px; }
.score-circle {
  width: 140px; height: 140px; border-radius: 50%; margin: 20px auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-size: 34px; font-weight: 800;
  box-shadow: 0 12px 32px rgba(20,30,80,.24);
}
.score-circle small { font-size: 13px; opacity: .9; font-weight: 400; }
.pass-yes { background: linear-gradient(135deg,#18b058,#22c55e); }
.pass-no { background: linear-gradient(135deg,#e11d48,#f04868); }
.result-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.result-item:last-child { border-bottom: none; }
.result-item .k { color: var(--muted); }
.result-item .v { font-weight: 600; }

/* ---------- 登录/注册页 ---------- */
.login-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(600px 320px at 12% 8%, rgba(79,107,255,.14), transparent 60%),
    radial-gradient(560px 300px at 88% 92%, rgba(124,92,255,.13), transparent 60%),
    linear-gradient(135deg,#eef2ff,#f7f6ff);
  padding: 20px;
}
.login-card {
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-radius: 20px; padding: 40px 34px; width: 100%; max-width: 400px;
  box-shadow: 0 16px 48px rgba(30,40,110,.12); border: 1px solid rgba(255,255,255,.7);
}
.login-card h1 { font-size: 20px; margin: 0 0 6px; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.login-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.login-tabs .tab { flex: 1; text-align: center; padding: 10px; font-size: 15px; color: var(--muted); cursor: pointer; transition: color .15s ease; }
.login-tabs .tab:hover { color: var(--text-2); }
.login-tabs .tab.active { color: var(--c-primary); font-weight: 600; border-bottom: 2.5px solid var(--c-primary); }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 22px; }
.toolbar .spacer { flex: 1; }
.toolbar h2 { font-size: 22px; font-weight: 700; letter-spacing: .3px; color: var(--text); }

/* ---------- 响应式 ---------- */
.nav-toggle { display: none; }
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .topbar-in { position: relative; height: auto; flex-wrap: nowrap; padding: 6px 12px; gap: 8px; }
  .brand { flex: 1; min-width: 0; }
  .brand .logo { width: 26px; height: 26px; }
  .brand span, .brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 隐藏式导航：默认收起，点汉堡展开下拉抽屉 */
  .nav-toggle { display: inline-flex; order: 4; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); color: #fff; width: 42px; height: 42px; border-radius: 12px; cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 4px; margin-left: 6px; }
  .nav-toggle span { width: 18px; height: 2px; background: #fff; border-radius: 2px; display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 4px; background: linear-gradient(135deg,#16215c,#2c3fcb); box-shadow: 0 14px 34px rgba(0,0,0,.25); z-index: 60; padding: 8px; border-radius: 0 0 16px 16px; }
  .nav.open { display: flex; }
  .nav a { flex: 0 0 auto; font-size: 14px; padding: 12px 18px; border-radius: 12px; }
  .nav-user { display: block; margin: 6px 0 2px; width: 100%; }
  .user-dd-btn { width: 100%; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.1); }
  .dd-menu { position: static; box-shadow: none; margin-top: 6px; background: #fff; }
  .role-badge { font-size: 11px; padding: 3px 8px; }
  .logout-btn { padding: 5px 10px; font-size: 12px; }
  /* 后台手机端：顶部汉堡+下拉抽屉 → 底部导航栏 */
  .admin-body .nav-toggle { display: none; }
  .admin-body .nav { display: none !important; }
  .admin-body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .admin-body .site-footer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(15,23,42,.07);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  }
  .bn-item {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10.5px; color: #8a93a0; text-decoration: none;
    padding: 4px 0; border-radius: 10px; background: none; border: none; font-family: inherit; cursor: pointer;
  }
  .bn-item .bn-ico { font-size: 19px; line-height: 1.2; }
  .bn-item.active { color: var(--c-primary); font-weight: 600; }
  .bn-item:active { background: #f3f6fb; }
  /* 「我的」弹层菜单 */
  .bn-sheet {
    display: none; position: fixed; left: 10px; right: 10px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 95;
    background: #fff; border-radius: 16px; box-shadow: 0 18px 44px rgba(15,23,42,.24); padding: 8px;
    animation: bnUp .16s ease;
  }
  .bn-sheet.open { display: block; }
  @keyframes bnUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .admin-sheet .bn-head, .bn-sheet .bn-head { display: flex; align-items: center; gap: 6px; padding: 8px 12px 6px; font-size: 13px; color: var(--text); }
  .bn-sheet .bn-head b { font-size: 14px; }
  .bn-sheet .dd-on { color: #9aa2ae; font-size: 12px; }
  .bn-sheet a { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 10px; color: #3a4254; font-size: 14px; text-decoration: none; }
  .bn-sheet a:active { background: #f3f6fb; }
  .bn-sheet a.bn-danger { color: #e5484d; }
  /* 学员端手机：顶部汉堡+下拉 → 底部导航栏 */
  .take-body .nav-toggle { display: none; }
  .take-body .nav { display: none !important; }
  .take-body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .take-body .site-footer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .table-wrap { overflow-x: auto; }
  .hide-sm { display: none !important; }
  /* 移动端胶囊美化：卡片 / 表格行卡片化 / 表单单列堆叠 */
  .wrap { padding: 20px 14px 44px; }
  .card { border-radius: var(--r-lg); padding: 20px 16px; margin-bottom: 16px; }
  .card-title { margin-bottom: 14px; }
  .toolbar { margin: 0 0 16px; gap: 8px 10px; }
  .toolbar h2 { width: 100%; }
  .toolbar > span { width: 100%; order: 9; font-size: 12px !important; color: #9aa2ae !important; }
  .toolbar .btn-sm { padding: 8px 14px; font-size: 13px; }
  /* .row 保持横向换行：字段各占一行，按钮自动并排成一行（不再居中竖堆） */
  .row { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .row .col { width: 100%; }
  .row > .btn { flex: 1 1 auto; min-width: 110px; margin: 0; }
  .row > span { flex: 1 1 100%; }
  .table th, .table td { padding: 12px 12px; font-size: 13px; }
  .ops { gap: 6px; }
  .ops .btn-sm { padding: 5px 10px; font-size: 12px; }
  /* 移动端仪表盘优化 */
  .dash-hero { flex-wrap: wrap; border-radius: var(--r-lg); padding: 18px 16px; margin-bottom: 16px; }
  .dash-hero .btn { width: 100%; text-align: center; margin-top: 8px; }
  .stat-grid { gap: 12px; }
  .stat { border-radius: 14px; padding: 14px 14px 14px 18px; }
  .stat .num { font-size: 22px; }
  .dash-cols { gap: 16px; }
  /* 卡片式列表（.table-card）：每条记录一张卡片 */
  .table-card { border: 0; }
  .table-card thead { display: none; }
  .table-card tr { display: block; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 16px; padding: 6px 14px; background: #fff; box-shadow: var(--shadow-1); }
  .table-card td { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 2px; border: none; border-bottom: 1px dashed var(--line-2); white-space: normal; }
  .table-card td::before { content: attr(data-label); color: var(--muted); font-weight: 500; flex: none; }
  .table-card td:last-child { border-bottom: none; }
  .table-card td.hide-sm { display: flex; }
  .table-card td.card-ops { display: block; border: none; padding-top: 10px; }
  .table-card td.card-ops::before { content: none; }
  .table-card td.card-ops .ops { flex-wrap: wrap; justify-content: flex-start; }
}
@media (max-width: 480px) {
  body { font-size: 14px; }
  .wrap { padding: 16px 12px 40px; }
  .card { padding: 18px 14px; }
  .btn { padding: 11px 18px; }
  .btn-block { padding: 13px; }
  /* 输入控件 16px：避免 iOS 聚焦时页面自动放大 */
  .form-control, select.form-control, input[type="text"].form-control { font-size: 16px; }
}

/* 评分二维码弹窗（纯CSS，无JS依赖） */
.qr-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:1000;display:none;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(2px)}
.qr-toggle:checked ~ .qr-backdrop{display:flex}
.qr-modal{background:#fff;border-radius:var(--r-lg);padding:24px;max-width:320px;width:100%;text-align:center;box-shadow:0 20px 50px rgba(0,0,0,.3);animation:gmIn .18s ease}

/* 点击弹出下拉多选（纯CSS，无JS依赖） */
.dd{position:relative;display:block;width:100%;}
.dd-btn{display:flex;align-items:center;gap:6px;width:100%;background:#fff;border:1.5px solid #dde2ec;border-radius:12px;padding:9px 14px;font-size:14px;color:#3a4254;cursor:pointer;box-sizing:border-box;min-height:40px;text-align:left;font-family:inherit;transition:border-color .15s ease, box-shadow .15s ease;}
.dd-btn:hover{border-color:#b9c6ff;}
.dd-btn::after{content:"▾";margin-left:auto;color:#9ca3af;}
.dd-toggle{display:none;}
.dd-toggle:checked ~ .dd-panel{display:block;}
.dd-panel{display:none;position:absolute;left:0;right:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-2);max-height:220px;overflow:auto;z-index:70;padding:6px;}
.dd-opt{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:8px;font-size:14px;cursor:pointer;transition:background .12s ease;}
.dd-opt:hover{background:#f3f6fb;}
.dd-opt input{width:auto;flex:none;accent-color:var(--c-primary);}
.dd-sel{font-size:12px;color:var(--c-primary);background:#e9efff;border-radius:6px;padding:2px 7px;margin-left:4px;white-space:nowrap;}

/* 表格操作列：按钮紧凑并排不折行错位 */
.ops{display:flex;flex-wrap:nowrap;gap:6px;align-items:center;}
.ops .btn{padding:5px 10px;font-size:13px;}

/* 手动添加被评主体：等宽网格对齐 */
.manual-grid{display:grid;grid-template-columns:1fr 1.5fr 1.1fr 1.2fr auto;gap:8px;align-items:center;}
.manual-grid .dd-btn{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
@media(max-width:860px){
  .manual-grid{grid-template-columns:1fr 1fr;}
  .manual-grid .btn{grid-column:1 / -1;}
}

/* 下拉面板内搜索框 */
.dd-search{width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:8px;padding:7px 10px;font-size:14px;margin-bottom:6px;outline:none;font-family:inherit;}
.dd-search:focus{border-color:var(--c-primary);box-shadow:var(--ring);}

/* ===== 通用卡片弹窗（系统设置 / 成员添加导入） ===== */
.set-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;}
@media(max-width:980px){.set-grid{grid-template-columns:repeat(2,1fr);}}
@media(max-width:620px){.set-grid{grid-template-columns:1fr;}}
.set-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:20px;cursor:pointer;transition:.18s;display:flex;gap:14px;align-items:flex-start;box-shadow:var(--shadow-1);}
.set-card:hover{border-color:var(--c-primary);box-shadow:var(--shadow-2);transform:translateY(-2px);}
.set-ic{width:46px;height:46px;border-radius:13px;background:#e9efff;display:flex;align-items:center;justify-content:center;font-size:22px;flex:none;}
.set-body{flex:1;min-width:0;}
.set-t{font-weight:600;font-size:15px;color:var(--text);}
.set-d{font-size:12.5px;color:var(--muted);margin-top:4px;line-height:1.6;}
.set-arrow{color:var(--c-primary);font-size:18px;flex:none;align-self:center;}
.gm-backdrop{display:none;position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:1200;align-items:center;justify-content:center;padding:18px;backdrop-filter:blur(2px);}
.gm-backdrop.show{display:flex;}
.gm-box{background:#fff;border-radius:var(--r-lg);max-width:560px;width:100%;max-height:88vh;overflow:auto;padding:24px;position:relative;animation:gmIn .18s ease;box-shadow:0 24px 64px rgba(15,23,42,.3);}
@keyframes gmIn{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);}}
.gm-close{position:absolute;right:16px;top:14px;width:32px;height:32px;border-radius:50%;border:none;background:#f2f4f8;color:#6b7280;font-size:16px;cursor:pointer;transition:background .15s ease;}
.gm-close:hover{background:#e5e9f0;}
.gm-title{font-size:17px;font-weight:700;margin-bottom:14px;padding-right:36px;}
.doc-list{display:flex;flex-direction:column;gap:8px;margin:8px 0;}
.doc-item{display:flex;align-items:center;gap:10px;background:#f7f9fc;border:1px solid #e5e9f0;border-radius:10px;padding:9px 12px;font-size:13px;}

/* ===== 统一页脚：文字 / 备案（居中一行） / 友情链接 ===== */
.site-footer {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; text-align: center; color: #b0b6c0; font-size: 12px;
  padding: 26px 16px 40px; line-height: 1.7;
}
.site-footer .footer-main { color: #b0b6c0; }
.site-footer .footer-beian {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px 14px; text-align: center;
}
.site-footer .beian-item {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  color: #8a93a0; text-decoration: none; white-space: nowrap;
  transition: color .15s ease;
}
.site-footer .beian-item.footer-main { color: #9aa2ae; font-weight: 500; }
.site-footer a.beian-item:hover { color: var(--c-primary); }
.site-footer .beian-sep { color: #cfd5e0; }
.site-footer .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.site-footer .footer-links a { color: #8a93a0; text-decoration: none; }
.site-footer .footer-links a:hover { color: var(--c-primary); }
@media (max-width: 480px) {
  .site-footer { font-size: 11.5px; padding: 22px 12px 34px; gap: 6px; }
  .site-footer .footer-beian { gap: 5px 10px; }
  .site-footer .beian-item.footer-main { width: 100%; justify-content: center; }
  .site-footer .beian-item.footer-main + .beian-sep { display: none; }
}

/* ===== 登录页整屏布局（含页脚备案信息） ===== */
.login-page {
  min-height: 100dvh; display: flex; flex-direction: column;
  background:
    radial-gradient(600px 320px at 12% 8%, rgba(79,107,255,.14), transparent 60%),
    radial-gradient(560px 300px at 88% 92%, rgba(124,92,255,.13), transparent 60%),
    linear-gradient(135deg,#eef2ff,#f7f6ff);
}
.login-page .login-wrap { flex: 1 0 auto; min-height: 0; background: none; padding: 40px 20px 24px; }
.login-page .site-footer { flex: 0 0 auto; padding: 0 16px 26px; gap: 5px; }

/* ===== 首页 Hero（v2 新增） ===== */
.home-hero {
  background: linear-gradient(120deg,#16215c 0%, #2c3fcb 48%, #7c5cff 100%);
  border-radius: 22px; color: #fff; padding: 42px 28px; text-align: center;
  margin: 24px 0 22px; position: relative; overflow: hidden;
  box-shadow: 0 14px 40px rgba(44,63,203,.32);
}
.home-hero::before, .home-hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); pointer-events: none;
}
.home-hero::before { width: 220px; height: 220px; right: -60px; top: -80px; }
.home-hero::after { width: 150px; height: 150px; left: -40px; bottom: -60px; }
.home-hero h1 { font-size: 26px; font-weight: 800; margin: 0 0 8px; letter-spacing: .5px; }
.home-hero .sub { font-size: 14px; opacity: .88; }
.home-hero .hero-cta { margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.home-hero .hero-cta .btn { background: #fff; color: var(--c-primary-deep); font-weight: 700; box-shadow: 0 3px 12px rgba(15,20,60,.25); }
.home-hero .hero-cta .btn:hover { background: #eef3ff; }
.home-hero .hero-cta .btn.ghost { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.home-hero .hero-cta .btn.ghost:hover { background: rgba(255,255,255,.24); }
/* 手机端 Hero 收缩：更紧凑、不占满屏 */
@media (max-width: 720px) {
  .home-hero { padding: 24px 18px; border-radius: 18px; margin: 14px 0 16px; box-shadow: 0 10px 26px rgba(44,63,203,.26); }
  .home-hero::before { width: 150px; height: 150px; right: -50px; top: -60px; }
  .home-hero::after { width: 110px; height: 110px; left: -36px; bottom: -48px; }
  .home-hero h1 { font-size: 20px; margin-bottom: 5px; }
  .home-hero .sub { font-size: 13px; }
  .home-hero .hero-cta { margin-top: 14px; gap: 10px; }
  .home-hero .hero-cta .btn { padding: 9px 18px; font-size: 14px; }
}
@media (max-width: 480px) {
  .home-hero { padding: 20px 14px; border-radius: 16px; }
  .home-hero h1 { font-size: 18px; letter-spacing: .3px; }
  .home-hero .sub { font-size: 12.5px; }
  .home-hero .hero-cta .btn { flex: 1 1 auto; min-width: 0; padding: 9px 12px; }
  .empty { padding: 30px 16px; }
  .empty .icon { font-size: 34px; margin-bottom: 6px; }
}
.act-item { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.act-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: rgba(79,107,255,.35); }
