/* ============================================================
   CTF 训练平台主题（公网业务版）
   在 style.css 之后加载，只做覆盖，不改原组件结构。
   ============================================================ */

:root {
  --bg: #070b14;
  --surface: #0f1726;
  --surface-2: #131f33;
  --ink: #e6eefb;
  /* V2.8：原来的 #8fa3c0 在深底上偏灰，提亮一档；仍明显弱于正文 */
  --muted: #9fb3cd;
  --line: #22324b;
  --brand: #22d3ee;
  --brand-dark: #06b6d4;
  --brand-soft: #0b2b38;
  --teal: #a3e635;
  --teal-soft: #1b2a12;
  --ok: #34d399;
  --ok-soft: #0d2a22;
  --warn: #fbbf24;
  --warn-soft: #2a2110;
  --danger: #fb7185;
  --danger-soft: #2b1219;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --ctf-grid: rgba(34, 211, 238, .045);
  --card-bg: #0f1726;
}

html { color-scheme: dark; }

body {
  background:
    radial-gradient(1000px 520px at 88% -12%, rgba(34, 211, 238, .13) 0%, transparent 62%),
    radial-gradient(820px 460px at -8% 4%, rgba(163, 230, 53, .07) 0%, transparent 58%),
    linear-gradient(var(--ctf-grid) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, var(--ctf-grid) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--bg);
  color: var(--ink);
}

a { color: var(--brand); }
a:hover { color: #67e8f9; }
code {
  background: #0a1524;
  color: #7dd3fc;
  border: 1px solid var(--line);
}

/* ---- 顶栏 ---- */
.topbar {
  background: rgba(7, 11, 20, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { color: #f0f9ff; letter-spacing: 1px; }
.brand span { color: var(--brand); }
.nav a { color: #b8c7de; }
.nav a:hover { background: var(--brand-soft); color: var(--brand); }
.nav a.active {
  color: #04121a;
  background: linear-gradient(135deg, #22d3ee, #a3e635);
  font-weight: 700;
}
.nav .who { color: var(--muted); border-left-color: var(--line); }
.nav .logout { color: var(--danger); }
.nav-sub {
  background: #0d1727;
  border-color: var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}

/* ---- 布局与卡片 ---- */
.footer { color: #64748b; border-top-color: var(--line); }
.card {
  background: linear-gradient(180deg, rgba(19, 31, 51, .92), rgba(15, 23, 38, .96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.page-head h1 {
  font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
  letter-spacing: .5px;
}
.page-head h1::before {
  content: "// ";
  color: var(--brand);
  opacity: .8;
}
.section-head h2::before { background: var(--brand) !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---- 按钮 ---- */
.btn {
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: .2px;
}
.btn-primary {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  color: #04121a;
  border-color: #22d3ee;
}
.btn-primary:hover { background: linear-gradient(135deg, #67e8f9, #22d3ee); color: #04121a; }
.btn-secondary {
  background: rgba(15, 23, 38, .7);
  border-color: var(--line);
  color: #cfe0f5;
}
.btn-secondary:hover { background: #16243a; border-color: #2c4466; color: #fff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #5a2332; }
.btn-danger:hover { background: #3a1721; }
.btn-link, .link { color: var(--brand); }

/* ---- 徽标 / 等级 ---- */
.badge {
  background: #142136;
  color: #b9cbe4;
  border: 1px solid #22324b;
}
.badge-track { background: rgba(34, 211, 238, .13); color: #67e8f9; border-color: rgba(34, 211, 238, .3); }
.badge-today { background: rgba(251, 191, 36, .14); color: #fbbf24; border-color: rgba(251, 191, 36, .3); }
.badge-muted { background: #131c2b; color: #7c8ca5; }
.badge-open { background: rgba(52, 211, 153, .13); color: #34d399; border-color: rgba(52, 211, 153, .3); }
.badge-ok { background: rgba(52, 211, 153, .13); color: #34d399; border-color: rgba(52, 211, 153, .3); }
.badge-danger { background: rgba(251, 113, 133, .13); color: #fb7185; border-color: rgba(251, 113, 133, .3); }
.badge-todo { background: rgba(251, 191, 36, .13); color: #fbbf24; border-color: rgba(251, 191, 36, .3); }
.badge-diff { background: rgba(167, 139, 250, .13); color: #c4b5fd; border-color: rgba(167, 139, 250, .3); }
.badge-kind { background: rgba(56, 189, 248, .12); color: #7dd3fc; border-color: rgba(56, 189, 248, .3); }
.level-l1 { background: rgba(52, 211, 153, .14); color: #34d399; border-color: rgba(52, 211, 153, .35); }
.level-l2 { background: rgba(56, 189, 248, .14); color: #38bdf8; border-color: rgba(56, 189, 248, .35); }
.level-l3 { background: rgba(251, 191, 36, .14); color: #fbbf24; border-color: rgba(251, 191, 36, .35); }
.level-l4 { background: rgba(251, 113, 133, .14); color: #fb7185; border-color: rgba(251, 113, 133, .35); }
.level-unknown { background: #131c2b; color: #7c8ca5; }

/* ---- 表格 ---- */
.table { color: #dce7f7; }
.table th, .table td { border-bottom-color: var(--line); }
.table th { color: #8fa3c0; background: rgba(10, 17, 29, .65); }
.table tbody tr:hover td { background: #132136; }
.table-card { background: transparent; }

/* ---- 表单 ---- */
input, select, textarea {
  background: #0a1423 !important;
  border: 1px solid #263a58 !important;
  color: #e6eefb !important;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .12) !important;
  outline: none;
}
.field > span, .filter-item > span, .field-inline > span { color: #a9bbd4; }
.menu-panel { background: #0d1727; border-color: var(--line); box-shadow: 0 18px 44px rgba(0, 0, 0, .6); }
.menu-panel form + form { border-top-color: var(--line); }

/* ---- 折叠 / 选项卡 ---- */
.details-card > summary {
  background: #0d1727;
  border-color: var(--line);
}
.details-card > summary:hover { background: #132136; }
.tab-btn { color: var(--muted); }
.tab-btn:hover { color: var(--brand); background: var(--brand-soft); }
.tab-btn.is-active { color: #04121a; background: linear-gradient(135deg, #22d3ee, #67e8f9); border-color: var(--brand); }
.tab-btn.is-active:hover { background: linear-gradient(135deg, #67e8f9, #22d3ee); color: #04121a; }

/* ---- 提示 ---- */
.alert { border: 1px solid var(--line); }
.alert-error { background: var(--danger-soft); border-color: #5a2332; color: #fecdd3; }
.alert-warn { background: var(--warn-soft); border-color: #5b4413; color: #fde68a; }
.alert-ok { background: var(--ok-soft); border-color: #14523f; color: #a7f3d0; }
.alert-success { background: var(--ok-soft); border-color: #14523f; color: #a7f3d0; }

/* ---- 状态 ---- */
.status-badge { border: 1px solid transparent; }
.status-submitted, .status-reviewed, .status-solved { background: rgba(52, 211, 153, .13); color: #34d399; border-color: rgba(52, 211, 153, .3); }
.status-pending, .status-ai_done { background: rgba(251, 191, 36, .13); color: #fbbf24; border-color: rgba(251, 191, 36, .3); }
.status-none, .status-withdrawn { background: #131c2b; color: #7c8ca5; border-color: #22324b; }

/* ---- 学生题卡 / 挑战列表 ---- */
.item-row {
  background: linear-gradient(180deg, #101b2d, #0d1727);
  border-color: var(--line);
}
.item-row:hover { border-color: #2c4466; box-shadow: 0 12px 26px rgba(0, 0, 0, .35); }
.item-no .item-kind { color: var(--brand); }
.chevron { color: var(--brand); }
.progress { background: #0a1423; border: 1px solid var(--line); }
.progress span { background: linear-gradient(90deg, #22d3ee, #a3e635); }

/* ---- CTF 挑战卡片（新增） ---- */
/* V2.8：style.css 里的 .card.ctf-hero 是浅色底，特异度更高；这里把
   .card.ctf-hero 一起列出来，保证挑战列表/排行榜/题目页头部统一为深色玻璃卡。 */
.ctf-hero,
.card.ctf-hero {
  position: relative;
  overflow: hidden;
  padding: 26px 24px;
  border: 1px solid rgba(34, 211, 238, .28);
  background:
    linear-gradient(120deg, rgba(34, 211, 238, .12), rgba(163, 230, 53, .05) 55%, transparent),
    #0b1422;
}
.ctf-hero::after,
.card.ctf-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(34, 211, 238, .025) 3px 4px);
  pointer-events: none;
}
.ctf-hero h1,
.card.ctf-hero h1 { font-size: 30px; color: #f0f9ff; }
.ctf-hero .kicker,
.card.ctf-hero .kicker {
  color: var(--brand);
  font-family: "Consolas", monospace;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.ctf-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
}
.ctf-stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 38, .8);
}
.ctf-stat .num {
  display: block;
  font-family: "Consolas", monospace;
  font-size: 26px;
  font-weight: 800;
  color: #f0f9ff;
  line-height: 1.2;
}
.ctf-stat .label { color: var(--muted); font-size: 12px; }
.ctf-category { margin: 22px 0 8px; }
.ctf-category h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Consolas", monospace;
  font-size: 16px;
  color: #67e8f9;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ctf-category h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.challenge-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #101b2d, #0c1524);
  color: inherit;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.challenge-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, .55);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .4);
}
.challenge-card.is-solved { border-color: rgba(52, 211, 153, .5); }
.challenge-card.is-solved::before {
  content: "SOLVED";
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: "Consolas", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: #34d399;
}
.challenge-title { font-size: 17px; font-weight: 800; color: #f0f9ff; }
.challenge-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.challenge-points {
  margin-left: auto;
  font-family: "Consolas", monospace;
  font-weight: 800;
  color: #a3e635;
  font-size: 18px;
}
.challenge-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.challenge-desc { color: var(--muted); font-size: 13px; min-height: 20px; }
.flag-box {
  border: 1px solid rgba(34, 211, 238, .35);
  background: linear-gradient(180deg, rgba(34, 211, 238, .08), rgba(15, 23, 38, .6));
  padding: 18px;
}
.flag-box h2 { color: #67e8f9; font-family: "Consolas", monospace; }
.flag-form { display: flex; gap: 8px; flex-wrap: wrap; }
.flag-form input {
  flex: 1;
  min-width: 220px;
  font-family: "Consolas", monospace;
  letter-spacing: .5px;
}
.flag-solved {
  border: 1px solid rgba(52, 211, 153, .45);
  background: rgba(13, 42, 34, .75);
  color: #a7f3d0;
  padding: 14px 16px;
}

/* ---- 排行榜 ---- */
.rank-table td.rank {
  font-family: "Consolas", monospace;
  font-size: 18px;
  font-weight: 800;
  color: #67e8f9;
  width: 64px;
}
.rank-table tr:nth-child(1) td.rank { color: #fbbf24; }
.rank-table tr:nth-child(2) td.rank { color: #e2e8f0; }
.rank-table tr:nth-child(3) td.rank { color: #fb923c; }
.rank-points { font-family: "Consolas", monospace; font-weight: 800; color: #a3e635; }

/* ---- 登录页 ---- */
.login-wrap {
  min-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: min(440px, 100%);
  border-color: rgba(34, 211, 238, .32);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.login-head h1 { font-size: 21px; line-height: 1.5; }
.login-hint { color: var(--muted); }

/* ---- 其它零散覆盖 ---- */
.hero { background: linear-gradient(120deg, rgba(34, 211, 238, .09), rgba(15, 23, 38, .9)); border-color: var(--line); }
.summary-grid > div { background: rgba(15, 23, 38, .8); border-color: var(--line); }
.filter-card { background: rgba(15, 23, 38, .55); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.login-card .logo-dot { background: var(--brand); box-shadow: 0 0 18px var(--brand); }
.error-card { border-color: rgba(251, 113, 133, .35); }
.error-code { color: var(--danger); }
hr { border-color: var(--line); }
::selection { background: rgba(34, 211, 238, .3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a1423; }
::-webkit-scrollbar-thumb { background: #22324b; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #2c4466; }

/* ---- 覆盖旧版浅色块（style.css 后半段仍是白底） ---- */
.page-head {
  position: relative;
  z-index: 30;
  background: linear-gradient(135deg, #101b2d 0%, #0c1524 100%) !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow) !important;
}
.page-head::before { background: linear-gradient(180deg, var(--brand), #a3e635) !important; }
.table tbody tr:nth-child(even) td { background: transparent !important; }
.table tbody tr:hover td { background: #132136 !important; }
.table thead th { background: #0a1423 !important; }
.summary-metric { background: #0a1423 !important; border-color: var(--line) !important; }
.console-form, .console-row, .console-meta, .settings-team-head { background: #0b1422 !important; border-color: var(--line) !important; }
.answer-text, .requirement, .question-section, .deduction-card, .tips-card { background: #0a1423 !important; border-color: var(--line) !important; color: var(--ink) !important; }
.deduction-card .requirement { background: #0c1827 !important; }
.supplement-box, .check-item, .notification-row, .notification-row.unread, .rule-table .rule-hard, .team-card.is-alert, .draw-shortage { background: rgba(15, 23, 38, .75) !important; border-color: var(--line) !important; }
.notification-row.unread { border-color: rgba(34, 211, 238, .35) !important; }
.check-item.check-fail { background: rgba(251, 113, 133, .07) !important; }
.check-item.check-warn { background: rgba(251, 191, 36, .06) !important; }
.msg-link, .who {
  color: #b8c7de !important;
  background: #0d1727 !important;
  border: 1px solid var(--line) !important;
}
.msg-link:hover { background: var(--brand-soft) !important; color: var(--brand) !important; }
.msg-link .layui-icon { color: #b8c7de !important; }
.tabbar { background: #0d1727 !important; border-color: var(--line) !important; box-shadow: var(--shadow) !important; }
.msg-dot { color: #04121a !important; }
.status-badge { background: #142136 !important; color: #b9cbe4 !important; border: 1px solid #22324b !important; }
.status-unsubmitted { background: #131c2b !important; color: #93a4bd !important; border-color: #22324b !important; }
.status-blocked, .status-partial { background: rgba(251, 191, 36, .13) !important; color: #fbbf24 !important; border-color: rgba(251, 191, 36, .3) !important; }
.status-supplement { background: rgba(56, 189, 248, .13) !important; color: #7dd3fc !important; border-color: rgba(56, 189, 248, .3) !important; }
.status-submitted, .status-reviewed, .status-solved { background: rgba(52, 211, 153, .13) !important; color: #34d399 !important; border-color: rgba(52, 211, 153, .3) !important; }
.status-pending, .status-ai_done { background: rgba(251, 191, 36, .13) !important; color: #fbbf24 !important; border-color: rgba(251, 191, 36, .3) !important; }
.status-none, .status-withdrawn { background: #131c2b !important; color: #7c8ca5 !important; border-color: #22324b !important; }
.hero-badge { background: #0b1422 !important; border-color: var(--line) !important; }
.bank-tab { background: #0d1727 !important; color: #cfe0f5 !important; border-color: var(--line) !important; }
.bank-tab:hover { color: var(--brand) !important; border-color: var(--brand) !important; }
.bank-tab.active { background: var(--brand-soft) !important; color: var(--brand) !important; border-color: var(--brand) !important; }
.item-detail-head { background: linear-gradient(135deg, #101b2d 30%, #0b2b38 100%) !important; }
.score-chip { background: #0a1423 !important; color: #cfe0f5 !important; border-color: var(--line) !important; }
.score-total { background: var(--brand-soft) !important; border-color: rgba(34, 211, 238, .4) !important; color: var(--brand) !important; }
.pre-wrap, .requirement, .answer-text, .teammate-body .answer-text {
  background: #0a1423 !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
.link-list li, .attachment-list li { background: #0b1422 !important; border-color: var(--line) !important; }
.sub-h { color: #a9bbd4 !important; }
.tab-btn { color: #a9bbd4 !important; }
.tab-btn.is-active { color: #04121a !important; }
.slot-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.slot-list { display: grid; gap: 8px; margin-top: 12px; }
.slot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b1422;
}
.slot-row .slot-no {
  min-width: 62px;
  color: var(--muted);
  font-family: "Consolas", monospace;
  font-size: 13px;
}
.slot-row select { max-width: 220px; }
.details-card > summary { background: #0d1727 !important; }
.menu-panel { background: #0d1727 !important; }
.login-card { background: linear-gradient(180deg, #101b2d, #0b1422) !important; }
.card.empty { background: rgba(15, 23, 38, .55); }
.level-inline.level-l1, .level-inline.level-l2, .level-inline.level-l3, .level-inline.level-l4 { border: 1px solid transparent; }

@media (max-width: 720px) {
  .ctf-hero { padding: 20px 16px; }
  .ctf-hero h1 { font-size: 23px; }
  .challenge-grid { grid-template-columns: 1fr; }
}

/* ---- 动效：主页 LIVE 条、卡片入场、按钮/导航微动 ---- */
@keyframes ctf-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}
@keyframes live-scan {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(110%); }
}
@keyframes nav-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(34, 211, 238, 0); }
  50% { box-shadow: 0 0 16px rgba(34, 211, 238, .35); }
}
@keyframes hero-scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.challenge-card, .ctf-stat, .login-card, .live-strip, .card, .summary-card, .page-head {
  animation: none !important;
}
.summary-grid .card:nth-child(2), .ctf-stats .ctf-stat:nth-child(2) { animation-delay: .07s; }
.summary-grid .card:nth-child(3), .ctf-stats .ctf-stat:nth-child(3) { animation-delay: .14s; }
.ctf-stats .ctf-stat:nth-child(4) { animation-delay: .21s; }
.ctf-stats .ctf-stat:nth-child(5) { animation-delay: .28s; }
.ctf-stats .ctf-stat:nth-child(6) { animation-delay: .35s; }
.nav a.active { animation: nav-glow 2.6s ease-in-out infinite; }
.btn-primary { transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(34, 211, 238, .25); }
.ctf-hero,
.card.ctf-hero { isolation: isolate; }
.ctf-hero::before,
.card.ctf-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .07), transparent);
  transform: translateY(-100%);
  animation: hero-scan 6s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.ctf-hero > * { position: relative; z-index: 1; }
.live-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 9px 14px;
  border: 1px solid rgba(34, 211, 238, .28);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(13, 42, 34, .8), rgba(11, 43, 56, .8));
  overflow: hidden;
  color: #a7f3d0;
  animation: none !important;
}
.live-strip::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; width: 45%;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .16), transparent);
  animation: live-scan 3.4s linear infinite;
  pointer-events: none;
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #34d399;
  animation: live-pulse 1.7s ease-out infinite;
  flex: 0 0 auto;
}
.live-text {
  font-family: "Consolas", "Courier New", monospace;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #67e8f9;
}
.live-sub { color: #94a3b8; font-size: 12px; }
.login-live { justify-content: center; max-width: 520px; margin: 0 auto 14px; }
.login-roles { display: flex; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.login-roles span {
  padding: 3px 12px;
  border: 1px solid rgba(34, 211, 238, .3);
  border-radius: 999px;
  color: #67e8f9;
  font-size: 12px;
  background: rgba(34, 211, 238, .08);
}
.login-card { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
.login-wrap { flex-direction: column; }

/* =====================================================================
   V2.8 视觉统一补丁
   1) 顶栏长文本/窄屏
   2) 老师端深色卡片 + 页面标题可读性
   3) 学生首页统计/图表对齐
   4) 渐进式交互 acc-*（模块手风琴）
   ===================================================================== */

/* ---------- 1. 顶栏 ---------- */
.topbar-inner { min-width: 0; max-width: 1400px; }
.topbar .brand { flex: 0 0 auto; }
.topbar .sysnav { flex: 0 0 auto; }
/* 导航独占剩余空间；放不下时横向滚动，而不是把账号区挤成竖排 */
.topbar .nav {
  min-width: 0;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-start;   /* 溢出时从左侧开始裁切，保证首页/赛事编排可见 */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.topbar .nav::-webkit-scrollbar { display: none; }
.topbar .nav { gap: 2px; }
.topbar .nav a { flex: 0 0 auto; white-space: nowrap; padding: 6px 8px; }
.topbar .nav-tools {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
}
.topbar .nav-tools .msg-link,
.topbar .nav-tools .who,
.topbar .nav-tools .nav-mini {
  flex: 0 0 auto;
  white-space: nowrap;
}
.topbar .nav-tools .who {
  display: inline-block;
  vertical-align: middle;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1400px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
  .topbar .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .topbar .nav-tools { margin-left: auto; }
}

/* ---------- 2. 老师端：深色卡片与标题 ---------- */
.role-teacher .summary-card {
  background:
    radial-gradient(420px 160px at 100% 0, rgba(34, 211, 238, .10), transparent 70%),
    linear-gradient(160deg, rgba(19, 32, 52, .96), rgba(10, 18, 32, .98));
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  box-shadow: var(--shadow);
  animation: none;
}
.role-teacher .summary-card.summary-bank { border-left-color: #38bdf8; }
.role-teacher .summary-card.summary-team { border-left-color: #a3e635; }
.role-teacher .summary-card::before {
  background: radial-gradient(circle, rgba(34, 211, 238, .18), transparent 68%);
  opacity: .9;
  animation: none;
}
.role-teacher .summary-card::after {
  content: "//";
  position: absolute;
  right: 16px;
  top: 12px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  color: rgba(34, 211, 238, .35);
  pointer-events: none;
}
.role-teacher .summary-metric .num { color: #67e8f9; }
.role-teacher .summary-card .muted { color: var(--muted); }
.role-teacher .summary-card h2 { color: #dbeafe; }

/* 页面大标题：style.css 里的深色渐变字压在深底上不可读 */
.role-teacher .page-head h1,
.student-hero h1 {
  background-image: linear-gradient(90deg, #f2f9ff, #7dd3fc 42%, #a3e635 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head h1 { text-shadow: none; }
.ctf-hero .muted,
.card.ctf-hero .muted { color: var(--muted); }

/* ---------- 3. 学生首页：对齐、空状态、图表底纹 ---------- */
.student-dash .stat-grid-two { align-items: stretch; }
.student-dash .stat-grid-two .stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 132px;
}
.student-dash .stat-grid-two .stat-num { font-size: 38px; line-height: 1.1; }
.student-dash .stat-grid-two .stat .small { margin-top: 4px; }

.student-dash .chart-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr);
  align-items: stretch;
}
.student-dash .radar-card,
.student-dash .trend-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.student-dash .radar-chart {
  background:
    radial-gradient(closest-side, rgba(34, 211, 238, .075), transparent 72%),
    radial-gradient(closest-side, rgba(163, 230, 53, .035), transparent 60%);
  border-radius: 18px;
}
.student-dash .radar-note { margin-top: 10px; text-align: center; color: var(--muted); }
.student-dash #radar-empty {
  max-width: 560px;
  margin: 12px auto 4px;
  padding: 12px 16px;
  border: 1px dashed rgba(34, 211, 238, .30);
  border-radius: 12px;
  background: rgba(34, 211, 238, .05);
  color: #a9bbd4;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}
.student-dash #radar-empty[hidden] { display: none; }
.student-dash #radar-empty::after {
  content: "先完成一个挑战，能力雷达会自动点亮。";
  display: block;
  margin-top: 2px;
  color: #67e8f9;
  font-size: 12px;
}
/* 没有判分数据时，趋势卡撑满右列，空状态居中而不是缩成一条 */
.student-dash .trend-card > p.muted {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.student-dash .trend-card > p.muted::before {
  content: "";
  width: 64px;
  height: 42px;
  margin-bottom: 14px;
  border: 1px dashed rgba(34, 211, 238, .32);
  border-radius: 10px;
  background:
    linear-gradient(135deg, transparent 46%, rgba(34, 211, 238, .5) 46% 53%, transparent 53%) center / 100% 100% no-repeat,
    radial-gradient(circle at 74% 34%, rgba(163, 230, 53, .7) 0 2px, transparent 2.6px),
    linear-gradient(180deg, rgba(34, 211, 238, .12), rgba(34, 211, 238, .02));
}

@media (max-width: 1100px) {
  .student-dash .chart-grid { grid-template-columns: 1fr; }
  .student-dash .trend-card > p.muted { min-height: 150px; }
}
@media (max-width: 720px) {
  /* 标题与统计口径说明在窄屏改为上下两行，避免标题被挤成竖排 */
  .student-dash > .section-head { flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .student-dash > .section-head h2 { white-space: nowrap; }
  .student-dash > .section-head > .muted { flex: 1 1 100%; font-size: 12.5px; line-height: 1.6; }
}
@media (max-width: 560px) {
  /* 两张统计卡保持 2 列（不堆成两屏），数字略收小 */
  .student-dash .stat-grid-two .stat { min-height: 104px; padding: 14px 12px; }
  .student-dash .stat-grid-two .stat-num { font-size: 30px; }
  .student-dash .stat-grid-two .muted.small { font-size: 11.5px; line-height: 1.5; }
  .student-dash .chart-grid { gap: 12px; }
  .student-dash .radar-chart { height: 320px; }
}

/* ---------- 4. 渐进式交互：模块手风琴 acc-* ---------- */
/* 通用外壳：整行可点，状态/主按钮始终在头部可见 */
.acc-group { display: flex; flex-direction: column; gap: 12px; }
.acc-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(17, 29, 47, .86), rgba(10, 18, 31, .92));
  overflow: hidden;
}
.acc-item[open],
.acc-item.is-open {
  border-color: rgba(34, 211, 238, .42);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, .10), 0 10px 30px rgba(2, 8, 20, .45);
}
.acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.acc-head::-webkit-details-marker { display: none; }
.acc-head::marker { content: ""; }
.acc-head:hover { background: rgba(34, 211, 238, .045); }
.acc-idx {
  flex: 0 0 auto;
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(34, 211, 238, .28);
  background: rgba(34, 211, 238, .08);
  color: #67e8f9;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
  font-weight: 800;
}
.acc-title {
  flex: 1 1 auto;
  min-width: 0;
  color: #e6eefb;
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.acc-state {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .28);
  color: #b6c7dd;
  background: rgba(148, 163, 184, .08);
  font-size: 12px;
  white-space: nowrap;
}
.acc-state.is-doing { color: #67e8f9; border-color: rgba(34, 211, 238, .35); background: rgba(34, 211, 238, .09); }
.acc-state.is-done { color: #86efac; border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .09); }
.acc-chevron {
  flex: 0 0 auto;
  color: #7dd3fc;
  font-size: 13px;
  line-height: 1;
  transition: transform .2s ease;
}
.acc-item[open] > .acc-head .acc-chevron { transform: rotate(180deg); }
.acc-body {
  padding: 0 16px 16px;
  border-top: 1px dashed rgba(34, 211, 238, .16);
}
.acc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  padding: 12px 0 2px;
}
.acc-list { list-style: none; margin: 4px 0 0; padding: 0; }
.acc-row + .acc-row { border-top: 1px solid rgba(34, 211, 238, .08); }
.acc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
  text-decoration: none;
  min-width: 0;
}
.acc-link:hover { background: rgba(34, 211, 238, .07); text-decoration: none; }
.acc-row-idx {
  flex: 0 0 auto;
  min-width: 40px;
  color: #7dd3fc;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
}
.acc-row-title {
  flex: 1 1 auto;
  min-width: 0;
  color: #d7e5f6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-row-meta { flex: 0 0 auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.acc-note { color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* 变体：不用 <details> 时，用 checkbox + label 保留头部主按钮 */
.acc-item > input.acc-check {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.acc-item.is-collapsible > .acc-body { display: none; }
.acc-item.is-collapsible > input.acc-check:checked ~ .acc-body { display: block; }
.acc-item.is-collapsible > input.acc-check:checked ~ .acc-head .acc-chevron { transform: rotate(180deg); }
.acc-toggle {
  flex: 0 0 auto;
  padding: 5px 11px;
  border: 1px solid rgba(34, 211, 238, .32);
  border-radius: 999px;
  background: rgba(34, 211, 238, .07);
  color: #a5f3fc;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.acc-toggle:hover { border-color: rgba(34, 211, 238, .6); }
.acc-cta {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, .5);
  background: linear-gradient(90deg, rgba(34, 211, 238, .2), rgba(56, 189, 248, .12));
  color: #e0faff;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
}
.acc-cta:hover { color: #fff; border-color: #67e8f9; text-decoration: none; }

@media (max-width: 720px) {
  .acc-head { flex-wrap: wrap; gap: 6px 10px; padding: 12px; }
  .acc-title { flex: 1 1 calc(100% - 46px); white-space: normal; }
  .acc-meta { order: 5; }
  .acc-head .acc-cta, .acc-head .acc-toggle { margin-left: auto; }
  .acc-body { padding: 0 12px 12px; }
  .acc-row-title { white-space: normal; overflow-wrap: anywhere; }
  .acc-link { flex-wrap: wrap; row-gap: 3px; }
}

/* ---------- 4b. details 分组头 ---------- */
/* .details-card > summary 同时带 .section-head（justify-content:space-between），
   折叠箭头 ::before 会把唯一的内容块推到最右，出现大片空白；这里改为左对齐。 */
.details-card > summary.section-head { justify-content: flex-start; }
.details-card > summary.section-head > div { flex: 1 1 auto; min-width: 0; }
.details-card > summary.section-head h2 { font-size: 17px; }
.details-card > summary.section-head p { margin: 2px 0 0; }

/* ---------- 5. 全站小屏间距 ---------- */
@media (max-width: 720px) {
  /* 多列表格保留可读列宽，超宽部分在 .table-wrap 内横滑，避免逐字竖排 */
  .table-wrap > .table { min-width: 640px; }
  .table-wrap > .table.compact-table { min-width: 0; }
}

@media (max-width: 560px) {
  .topbar-inner { padding: 10px 12px; gap: 8px 10px; }
  .topbar .brand { font-size: 16px; letter-spacing: 0; }
  .container { padding: 14px 12px 34px; }
  .page-head { gap: 10px; }
  .page-head h1 { font-size: 22px; }
  .section-head { margin: 18px 0 10px; }
  .stat-num, .summary-metric .num { font-size: 26px; }
  .challenge-card { padding: 14px; }
  .challenge-card .challenge-top { flex-wrap: wrap; gap: 6px; }
  .challenge-card h3 { font-size: 15px; }
}

/* ---------- 4c. V2.8 手风琴分组（学生挑战 / 任务池 / 判分 / 题库） ---------- */
details.card > summary,
details.details-card > summary,
.ctf-category > summary {
  list-style: none;
  cursor: pointer;
}
details.card > summary::-webkit-details-marker,
details.details-card > summary::-webkit-details-marker,
.ctf-category > summary::-webkit-details-marker { display: none; }

.ctf-category > summary { display: flex; align-items: center; gap: 10px; }
.ctf-category h2 { margin: 0; flex: 1 1 auto; min-width: 0; }
.ctf-category-name {
  flex: 0 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctf-category-badges { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctf-category[open] > summary { margin-bottom: 12px; }
.ctf-category > summary:hover h2 { color: #a5f3fc; }
.ctf-category > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 6px; }

.pool-group-tools { display: flex; gap: 8px; margin: 12px 0 0; flex-wrap: wrap; }
.pool-day > summary.section-head { padding: 12px 16px; }
.pool-day[open] > summary.section-head { border-bottom: 1px dashed var(--line); }
.pool-day > summary:focus-visible,
.review-group > summary:focus-visible,
.exam-question-group > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 720px) {
  .ctf-category > summary { flex-wrap: wrap; }
  .ctf-category-name { white-space: normal; }
  .ctf-category h2 { flex-wrap: wrap; }
}

/* 手风琴分组展开指示（学生挑战列表） */
.ctf-category > summary::before {
  content: "▸";
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 13px;
  line-height: 1;
  transition: transform .15s ease;
}
.ctf-category[open] > summary::before { content: "▾"; }
