/* ==========================================================================
   比赛综合平台 · 浅色极简设计系统
   原则：白 / 浅灰底色，1px 细线，克制留白，单一墨色强调，无渐变光效
   ========================================================================== */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #0a0a0a;
  --muted: #787878;
  --line: #e6e6e6;
  --line-2: #f0f0f0;
  --line-strong: #d0d0d0;
  --soft: #f5f5f5;
  --panel: #fafafa;
  --accent: #111111;
  --accent-2: #111111;
  --accent-soft: #f0f0f0;
  --grad: linear-gradient(180deg, #1f1f1f, #0a0a0a);
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --ok: #027a48;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --info: #344054;
  --info-soft: #f2f4f7;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, .04);
  --shadow-md: 0 10px 30px -16px rgba(10, 10, 10, .18);
  --shadow-lg: 0 32px 80px -40px rgba(10, 10, 10, .3);
  --ring: 0 0 0 3px rgba(10, 10, 10, .08);
  --th-bg: transparent;
}

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(10, 10, 10, .1); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #d6d6d6; border-radius: 8px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #bdbdbd; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
input, select, textarea, button { font-family: inherit; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: none; }

/* ============================ 登录 / 注册 ============================ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; padding: 32px 24px;
  background:
    radial-gradient(1000px 520px at 12% -8%, rgba(22,163,74,.10), transparent 62%),
    radial-gradient(800px 460px at 108% 106%, rgba(22,163,74,.07), transparent 58%),
    var(--bg);
}
.login-theme { position: absolute; top: 22px; right: 24px; }

.login-card {
  width: 880px; max-width: 100%; display: flex; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 28px 64px -28px rgba(16,40,24,.28), 0 4px 14px -6px rgba(16,24,20,.10);
  animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* 左栏：绿色渐变品牌面板 */
.login-brand {
  width: 340px; flex: none; padding: 44px 36px;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  background: linear-gradient(158deg, #14532d 0%, #15803d 58%, #16a34a 100%);
  border-right: none;
}
.login-brand::after {
  content: ""; position: absolute; right: -70px; top: -70px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.07); pointer-events: none;
}
.login-brand::before {
  content: ""; position: absolute; left: -50px; bottom: 90px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,.05); pointer-events: none;
}
.login-brand h1 {
  font-size: 17px; font-weight: 650; letter-spacing: .16em; color: #fff;
  display: flex; align-items: center; gap: 10px; position: relative; z-index: 1;
}
.login-brand h1::before {
  content: ""; width: 9px; height: 9px; border-radius: 3px;
  background: #86efac; flex: none;
}
.brand-slogan {
  margin: 14px 0 40px; font-size: 12.5px; line-height: 1.9;
  color: rgba(255,255,255,.78); position: relative; z-index: 1;
}
.brand-points {
  list-style: none; margin: auto 0 0; display: flex; flex-direction: column;
  gap: 0; border-top: 1px solid rgba(255,255,255,.18);
  position: relative; z-index: 1;
}
.brand-points li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.14);
}
.brand-points svg { width: 17px; height: 17px; flex: none; color: #86efac; margin-top: 2px; }
.brand-points b { display: block; font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 3px; }
.brand-points span { font-size: 11.5px; color: rgba(255,255,255,.68); line-height: 1.65; }

/* 右栏：表单 */
.login-forms { flex: 1; min-width: 0; padding: 44px 48px 34px; }
.login-sub { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 24px; }
.login-card label {
  display: block; margin-bottom: 16px; color: var(--muted);
  font-size: 12px; font-weight: 500;
}
.login-card input,
.login-card select {
  display: block; width: 100%; margin-top: 6px;
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 14px; color: var(--ink); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:hover, .login-card select:hover { border-color: #b8b8b8; }
.login-card input:focus, .login-card select:focus {
  outline: none; border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
.login-card select:disabled { opacity: .5; cursor: not-allowed; background: var(--soft); }

/* 输入框内嵌图标 */
.login-card input[name="username"], .login-card input[name="real_name"], .login-card input[name="student_id"],
.login-card input[name="password"], .login-card input[name="password2"], .login-card input[name="captcha_code"],
.login-card input[name="email"] {
  background-repeat: no-repeat; background-position: 12px center; background-size: 15px 15px;
  padding-left: 36px;
}
.login-card input[name="username"], .login-card input[name="real_name"], .login-card input[name="student_id"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 20c0-3.6 3.1-6 7-6s7 2.4 7 6'/%3E%3C/svg%3E");
}
.login-card input[name="password"], .login-card input[name="password2"], .login-card input[name="captcha_code"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
}
.login-card input[name="email"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7.5l9 6 9-6'/%3E%3C/svg%3E");
}

.login-error { color: var(--danger); font-size: 12.5px; min-height: 20px; margin-bottom: 8px; }
.login-error:not(:empty) { animation: errin .2s ease both; }
@keyframes errin { from { opacity: 0; transform: translateY(-3px); } }
.login-card .btn-primary { background: #16a34a; border-color: #16a34a; color: #fff; }
.login-card .btn-primary:hover:not(:disabled) { background: #15803d; border-color: #15803d; }
.login-switch { text-align: center; font-size: 12.5px; margin-top: 16px; color: var(--muted); }
.login-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

.login-tabs {
  display: flex; gap: 2px; padding: 3px; margin-bottom: 22px;
  background: var(--soft); border-radius: 9px;
}
.login-tab {
  flex: 1; padding: 8px 10px; border: none; border-radius: 7px;
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: background .15s, color .15s;
}
.login-tab:hover { color: var(--ink); }
.login-tab.active {
  background: var(--surface); color: #15803d; font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.code-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.code-row input { flex: 1; min-width: 0; margin-top: 0; padding-left: 12px; background-image: none !important; }
.code-row .code-btn { flex: none; height: 39px; white-space: nowrap; font-size: 12.5px; }
.cap-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.cap-row img {
  height: 39px; width: 116px; flex: none; object-fit: contain; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.cap-row input { flex: 1; margin-top: 0; }
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.login-card .pill a { margin-left: 6px; font-size: 11.5px; }

@media (max-width: 900px) {
  .login-card { flex-direction: column; width: 440px; }
  .login-brand { width: auto; padding: 18px 24px; border-right: none; border-bottom: none; }
  .login-brand h1 { font-size: 15px; }
  .brand-slogan { display: block; margin: 7px 0 0; font-size: 12px; line-height: 1.6; }
  .brand-points { display: none; }
  .login-forms { padding: 28px 26px 26px; }
}
@media (max-width: 520px) {
  .reg-grid { grid-template-columns: 1fr; }
  .login-wrap { padding: 16px; }
}

/* ============================ 顶栏 / 布局 ============================ */
.topbar {
  height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; background: var(--surface);
}
.brand {
  font-size: 13.5px; font-weight: 650; letter-spacing: .18em; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.brand::before {
  content: ""; width: 9px; height: 9px; border-radius: 2px;
  background: var(--ink); flex: none;
}
.brand:has(.brand-logo:not(.hidden))::before { display: none; }
.brand-logo { height: 22px; width: auto; max-width: 120px; object-fit: contain; display: block; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.who { color: var(--ink); font-size: 12.5px; margin: 0; font-weight: 500; }

.user-box { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; color: var(--ink); transition: border-color .15s, background .15s;
}
.user-chip:hover { border-color: var(--line-strong); background: var(--soft); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--ink); color: var(--surface);
  font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.caret { width: 13px; height: 13px; color: var(--muted); flex: none; margin-left: 2px; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  min-width: 188px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 5px;
}
.ud-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 11px; border-radius: 6px; border: 0; background: none;
  font-size: 13px; color: var(--ink); cursor: pointer; text-decoration: none;
  transition: background .12s;
}
.ud-item:hover { background: var(--soft); text-decoration: none; }
.ud-item.danger { color: var(--danger); }
.ud-sep { height: 1px; background: var(--line); margin: 5px 4px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; min-width: 34px; padding: 0 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius); cursor: pointer; font-size: 12.5px;
  position: relative; transition: border-color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--soft); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:active { transform: translateY(1px); }
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius); cursor: pointer; color: var(--ink); flex: none;
  transition: border-color .15s, background .15s;
}
.theme-btn:hover { border-color: var(--line-strong); background: var(--soft); }
.badge {
  position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 10.5px; line-height: 16px; text-align: center; padding: 0 4px;
  box-shadow: 0 0 0 2px var(--surface);
}

.layout { display: flex; min-height: calc(100vh - 60px); }
.sidebar {
  width: 216px; flex: none; padding: 22px 14px 32px;
  border-right: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 60px; align-self: flex-start;
  max-height: calc(100vh - 60px); overflow-y: auto;
}
.nav-group { margin-bottom: 4px; }
.nav-group-t {
  font-size: 10.5px; letter-spacing: .16em; color: #a8a8a8;
  padding: 14px 10px 7px; font-weight: 500;
}
.nav-group:first-child .nav-group-t { padding-top: 2px; }
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  color: var(--muted); font-size: 13px; margin-bottom: 1px;
  transition: color .12s, background .12s;
}
.sidebar a:hover { color: var(--ink); background: var(--soft); text-decoration: none; }
.sidebar a.active { color: var(--ink); font-weight: 600; background: var(--soft); }
.sidebar a.active .nav-ico { color: var(--ink); }
.nav-ico { width: 16px; height: 16px; flex: none; color: currentColor; }

.main { flex: 1; padding: 36px 40px 64px; max-width: 1280px; min-width: 0; }
.loading { color: var(--muted); padding: 56px 0; text-align: center; font-size: 12.5px; letter-spacing: .08em; }

/* ============================ 通用组件 ============================ */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 26px; padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-head h2 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

.btn {
  display: inline-block; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); padding: 7px 14px; border-radius: 7px; cursor: pointer; font-size: 12.5px;
  line-height: 1.5; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover:not(:disabled) { background: var(--soft); border-color: #bdbdbd; text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn-primary:hover:not(:disabled) { background: #2b2b2b; border-color: #2b2b2b; }
.btn-danger { color: var(--danger); border-color: #e9c6c2; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); border-color: #d9a9a4; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 10px; margin-top: 4px; font-weight: 600; letter-spacing: 2px; }

.card {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px;
  margin-bottom: 16px; background: var(--surface);
  transition: border-color .15s;
  animation: cardIn .25s ease;
}
.card:hover { border-color: var(--line-strong); }
.card-warn { border-color: #f0dfc4; }
.card-danger { border-color: #f2d3d0; }
@keyframes cardIn { from { opacity: 0; } }

/* 卡片内标题条 */
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head b, .card-head h3 { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.card-head .row-actions { margin-left: auto; }

.grid { display: grid; gap: 14px; }.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.stat { position: relative; padding: 20px 22px; }
.stat .k {
  color: var(--muted); font-size: 11px; letter-spacing: .12em;
  margin-bottom: 12px; font-weight: 500;
}
.stat .v {
  font-size: 30px; font-weight: 600; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat .v small {
  font-size: 11.5px; color: var(--muted); font-weight: 400;
  display: block; margin-top: 10px; letter-spacing: 0;
}

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; color: var(--muted); font-weight: 500;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  white-space: nowrap; letter-spacing: .08em;
}
td {
  padding: 13px 16px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle; font-size: 13px;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--panel); }
tbody tr:last-child td { border-bottom: none; }
.table-card { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px;
  border: 1px solid transparent; color: #525252; background: var(--soft);
  white-space: nowrap; font-weight: 500; letter-spacing: .01em;
}
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.danger { color: var(--danger); background: var(--danger-soft); }
.pill.info { color: var(--info); background: var(--info-soft); }

/* ============================ 表单 ============================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } }
.field label {
  display: block; font-size: 12px; color: var(--muted);
  margin-bottom: 6px; font-weight: 500;
}
.field input, .field input[type=text], .field input[type=number], .field input[type=password],
.field input[type=email], .field input[type=datetime-local], .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); font-size: 13.5px; color: var(--ink);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b8b8b8; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: var(--ring);
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.65; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.result-import { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.result-import select { width: auto; min-width: 130px; }
.result-import .hint { margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.check {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  cursor: pointer; user-select: none;
}
.check input { accent-color: var(--ink); width: 14px; height: 14px; cursor: pointer; }
.section-title {
  font-size: 12px; font-weight: 600; color: var(--ink); margin: 30px 0 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
  letter-spacing: .08em; display: flex; align-items: center; gap: 8px;
}
.section-title::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--ink); }
.section-title:first-child { margin-top: 0; }

/* ============================ 漏评告警 ============================ */
.alert-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.alert-chip {
  display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--soft);
  border: 1px solid var(--line); color: var(--ink);
}
.alert-chip.danger { color: var(--danger); border-color: #f2d3d0; background: var(--danger-soft); }
.alert-chip.warn { color: var(--warn); border-color: #f0dfc4; background: var(--warn-soft); }
.alert-chip.info { color: var(--info); border-color: #e4e7ec; background: var(--info-soft); }

.edit-rows { display: flex; flex-direction: column; gap: 8px; }
.edit-row { display: flex; gap: 8px; align-items: center; }
.edit-row input, .edit-row select {
  padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 7px; font-size: 12.5px;
  transition: border-color .15s, box-shadow .15s;
}
.edit-row input:focus, .edit-row select:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.edit-row input[type=text] { flex: 1; }
.edit-row input[type=number] { width: 90px; }
.mini-btn {
  border: 1px dashed var(--line-strong); background: none; color: var(--muted); cursor: pointer;
  padding: 7px 14px; border-radius: 7px; font-size: 12px;
  transition: color .15s, border-color .15s, background .15s;
}
.mini-btn:hover { color: var(--ink); border-color: var(--ink); background: var(--soft); }

/* ============================ 工具条 / 分页 ============================ */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select, .toolbar input {
  padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 7px; font-size: 12.5px;
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.toolbar select:focus, .toolbar input:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.pager {
  display: flex; gap: 12px; align-items: center; margin-top: 16px;
  color: var(--muted); font-size: 12.5px;
}

/* ============================ 弹窗 ============================ */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 10, .38);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px;
  animation: fadein .15s ease;
}
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  width: 640px; max-width: 100%; max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: pop .18s ease both;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } }
.modal.wide { width: 880px; }
.modal-head {
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head b { font-size: 14px; font-weight: 600; letter-spacing: .01em; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot {
  padding: 14px 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--panel); border-radius: 0 0 14px 14px;
}
.x-btn {
  border: none; background: none; font-size: 16px; color: var(--muted); cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px; transition: background .15s, color .15s;
}
.x-btn:hover { color: var(--ink); background: var(--soft); }

pre.content-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; max-height: 340px; overflow: auto; white-space: pre-wrap;
  word-break: break-word; font-size: 12.5px; line-height: 1.75; font-family: inherit;
}
.kv { display: grid; grid-template-columns: 108px 1fr; gap: 9px 14px; font-size: 12.5px; margin-bottom: 14px; }
.kv .k { color: var(--muted); }

/* ============================ 新闻阅读 ============================ */
.modal.news-read { width: 760px; max-height: 88vh; position: relative; }
.news-read-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.news-read-scroll { flex: 1 1 auto; min-height: 0; padding: 44px 56px 8px; overflow-y: auto; }
.news-read-title {
  font-size: 23px; line-height: 1.45; font-weight: 600; margin: 0 0 14px;
  letter-spacing: -.01em; padding-right: 30px;
}
.news-read-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  font-size: 12px; color: var(--muted); padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.news-read-body {
  padding: 24px 0 12px; font-size: 14.5px; line-height: 2;
  color: var(--ink); white-space: pre-wrap; word-break: break-word;
}
.news-read-foot { padding: 14px 56px 20px; display: flex; justify-content: flex-end; }
@media (max-width: 720px) {
  .news-read-scroll { padding: 38px 22px 8px; }
  .news-read-foot { padding: 12px 22px 16px; }
  .news-read-title { font-size: 20px; }
}

/* ============================ 评审打分 ============================ */
.score-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.score-row .name { flex: 1; }
.score-row .score-input { display: flex; align-items: center; gap: 8px; flex: none; }
.score-row .btn-quick { flex: none; height: 36px; padding: 0 12px; }
.score-row .max { color: var(--muted); font-size: 11.5px; }
.score-row input[type=number] {
  width: 104px; padding: 7px 10px; border: 1px solid var(--line-strong);
  border-radius: 7px; transition: border-color .15s, box-shadow .15s;
}
.score-row input[type=number]:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.total-line { margin-top: 18px; font-size: 14px; font-weight: 600; }

/* ============================ 通知 ============================ */
.notif {
  padding: 15px 4px; border-bottom: 1px solid var(--line-2);
  display: flex; gap: 12px; align-items: flex-start; transition: background .12s;
}
.notif:hover { background: var(--panel); }
.notif .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink);
  margin-top: 8px; flex: none;
}
.notif.read .dot { background: var(--line-strong); }
.notif .t { font-weight: 600; margin-bottom: 3px; font-size: 13.5px; }
.notif .b { color: var(--muted); font-size: 12.5px; }
.notif .m { color: var(--muted); font-size: 11.5px; margin-top: 5px; }

/* ============================ 提交格式说明 ============================ */
.fmt-card { padding: 16px 20px; background: var(--panel); }
.fmt-title { font-size: 12px; font-weight: 600; margin-bottom: 8px; letter-spacing: .08em; }
.fmt-list { margin-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.fmt-list b { color: var(--ink); font-weight: 600; }
.check-ok { color: var(--ok); }
.check-err { color: var(--danger); }

/* ============================ 报名确认 / 电子签名 ============================ */
.confirm-note { font-size: 12.5px; line-height: 1.85; color: var(--muted); }
.confirm-note b { color: var(--ink); font-weight: 600; }
.enroll-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.sign-pad-wrap {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 6px;
}
.sign-pad {
  width: 100%; height: 240px; display: block; background: #fff;
  border-radius: 6px; touch-action: none; cursor: crosshair;
}
.sign-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* ============================ 系统管理 ============================ */
.health-card { display: flex; align-items: center; gap: 14px; padding: 18px 22px; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.health-card.good .health-dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.health-card.bad .health-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.health-t { font-weight: 600; font-size: 14px; }
.feat-card { margin-bottom: 0; padding: 16px 18px; }
.feat-card:hover { border-color: var(--line-strong); }
.feat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.feat-name { font-weight: 600; font-size: 13.5px; }

/* ============================ 提示 ============================ */
#toast-root {
  position: fixed; top: 72px; right: 24px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--ink); color: var(--surface); padding: 10px 18px;
  border-radius: 8px; font-size: 12.5px; border: 1px solid transparent;
  box-shadow: var(--shadow-md); animation: slidein .2s ease both;
}
.toast.err { background: var(--danger); }
@keyframes slidein { from { opacity: 0; transform: translateX(10px); } }
@keyframes fadein { from { opacity: 0; } }

.empty { color: var(--muted); text-align: center; padding: 56px 0; font-size: 12.5px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; }

/* ============================ 个人中心 ============================ */
.profile-grid {
  display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.6fr);
  gap: 16px; align-items: start;
}
.profile-card, .profile-form-card { min-width: 0; }
.profile-avatar {
  width: 60px; height: 60px; border-radius: 50%; background: var(--ink); color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 600; margin-bottom: 14px;
}
.profile-name { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.profile-role { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
@media (max-width: 800px) { .profile-grid { grid-template-columns: 1fr; } }

/* ============================ QQ 登录 ============================ */
.qq-box { margin-top: 20px; }
.qq-split {
  display: flex; align-items: center; gap: 12px; color: var(--muted);
  font-size: 11.5px; margin-bottom: 14px;
}
.qq-split span { flex: 1; height: 1px; background: var(--line); }
.qq-btn { border-style: solid; }
.qq-btn:hover { border-color: #12b7f5; color: #0b8fc0; }

/* ============================ 阅卷工作台 ============================ */
.grade-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.grade-title { flex: 1; font-weight: 600; font-size: 14px; min-width: 200px; }
.grade-progress { width: 200px; }
.grade-progress .bar {
  height: 4px; background: var(--soft); border-radius: 99px; overflow: hidden;
}
.grade-progress .bar > div {
  height: 100%; background: var(--ink); border-radius: 99px; transition: width .35s ease;
}
.grade-progress .txt { font-size: 11.5px; color: var(--muted); margin-top: 6px; text-align: right; }
.grade-body { display: flex; gap: 16px; align-items: flex-start; }
.grade-paper { flex: 1; min-width: 0; margin-bottom: 0; }
.paper-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 13px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
}
.paper-head > span:first-of-type { font-weight: 600; }
.paper-content {
  background: none; border: none; padding: 0; font-size: 14.5px; line-height: 2;
  max-height: calc(100vh - 250px); overflow-y: auto; white-space: pre-wrap;
  word-break: break-word; font-family: inherit; color: var(--ink);
}
.grade-panel {
  width: 350px; flex: none; position: sticky; top: 84px;
  margin-bottom: 0; box-shadow: var(--shadow-md);
}
.grade-panel .score-row input[type=number] {
  width: 116px; font-size: 15px; padding: 8px 11px; font-weight: 600;
}
.kbd-hint { font-weight: 400; opacity: .55; font-size: .9em; }
@media (max-width: 980px) {
  .grade-body { flex-direction: column; }
  .grade-panel { width: 100%; position: static; }
}

/* ============================ 报名设置 / 大模型配置 ============================ */
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.7; }

/* ============================ 新闻专区 ============================ */
.news-card { cursor: pointer; }
.news-card:hover { border-color: var(--line-strong); }
.news-excerpt {
  color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-top: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============================ 排行榜 ============================ */
.lb-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 4px;
}
.lb-card table { font-size: 12.5px; }
tbody tr.rank-me { background: var(--soft); }
tbody tr.rank-me:hover { background: var(--soft); }
tbody tr.rank-me td:first-child { position: relative; }
tbody tr.rank-me td:first-child::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--ink);
}

/* ============================ 官网设置 / Logo ============================ */
.logo-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.logo-preview {
  width: 132px; height: 60px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; background: var(--panel);
  font-size: 11.5px; overflow: hidden; flex: none; color: var(--muted);
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo-ops .hint { flex-basis: 100%; }

/* ============================ AI 预审 ============================ */
.ai-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 16px; align-items: start; }
.ai-side { padding: 20px; position: sticky; top: 24px; }
.ai-main { min-width: 0; }
.ai-side .section-title { margin-top: 20px; }
.ai-side .section-title:first-child { margin-top: 0; }

.ai-dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-dist-k { width: 74px; flex: none; font-size: 12px; color: var(--muted); }
.ai-dist-bar { flex: 1; height: 4px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.ai-dist-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--muted); transition: width .3s ease; }
.ai-dist-bar > span.high { background: var(--danger); }
.ai-dist-bar > span.medium { background: var(--warn); }
.ai-dist-bar > span.low { background: #737373; }
.ai-dist-bar > span.none { background: var(--ok); }
.ai-dist-n { width: 26px; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.ai-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.ai-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-num { font-size: 11.5px; color: var(--muted); }
.ai-num b { color: var(--ink); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ai-engine { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.ai-bar { margin-top: 10px; height: 4px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.ai-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--ink); }
.ai-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; }
.ai-k { color: var(--muted); margin-right: 2px; }
.ai-chip {
  display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--surface);
  border: 1px solid var(--line); font-size: 11px; color: var(--ink); line-height: 18px;
}
.ai-reasons { margin: 10px 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.ai-warn {
  margin-top: 10px; padding: 6px 10px; border-radius: 6px;
  background: var(--warn-soft); color: var(--warn); font-size: 11.5px;
}

/* 比赛配置：AI 预审卡片 */
.ai-config { padding: 18px 20px; }
.ai-config-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.ai-config-head .check { margin: 0; font-weight: 600; }
.ai-config .checks { margin-bottom: 14px; }
.ai-config.off #ai-config-body, .ai-config.off #ai-config-fields { opacity: .4; pointer-events: none; }

/* 大模型配置 */
.llm-status {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.llm-status-main { display: flex; align-items: center; gap: 10px; }
.llm-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--line-strong); flex: none; }
.llm-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.llm-status-t { font-weight: 600; }
.llm-key { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.llm-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.llm-test { font-size: 12px; color: var(--muted); }
.llm-test.ok { color: var(--ok); }
.llm-test.bad { color: var(--danger); }

/* ---------------- 邮箱配置卡片 ---------------- */
.mail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.mail-head-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mail-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--soft); color: var(--ink);
  display: grid; place-items: center;
}
.mail-title { font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mail-pill {
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px;
  background: var(--soft); color: var(--muted);
}
.mail-pill.on { background: var(--ok-soft); color: var(--ok); }
.mail-meta { flex: none; text-align: right; }
.mail-meta-k { font-size: 11px; color: var(--muted); margin-top: 6px; }
.mail-meta-k:first-child { margin-top: 0; }
.mail-meta-v { font-size: 13px; }
.mail-switch { margin: 16px 0 14px; font-weight: 600; font-size: 13px; }
.mail-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mail-group {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 16px;
}
.mail-group-t {
  font-size: 12px; font-weight: 600; color: var(--muted);
  letter-spacing: .06em; margin-bottom: 14px;
}
.mail-group .form-grid { gap: 14px 16px; }
.mail-test {
  margin-top: 14px; padding: 14px 16px;
  background: var(--panel); border: 1px dashed var(--line-strong); border-radius: 10px;
}
.mail-test-t { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .06em; margin-bottom: 10px; }
.mail-test-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mail-test-row input {
  flex: 1; min-width: 220px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 13.5px; color: var(--ink); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.mail-test-row input:hover { border-color: #b8b8b8; }
.mail-test-row input:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.mail-test .hint { font-size: 11.5px; color: var(--muted); }
@media (max-width: 800px) {
  .mail-groups { grid-template-columns: 1fr; }
  .mail-head { flex-direction: column; }
  .mail-meta { text-align: left; }
}

@media (max-width: 1000px) {
  .ai-layout { grid-template-columns: 1fr; }
  .ai-side { position: static; }
}

/* ============================ 奖状生成 ============================ */
.cert-layout {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px; align-items: start;
}
@media (max-width: 1100px) { .cert-layout { grid-template-columns: 1fr; } }
.cert-preview {
  display: flex; align-items: center; justify-content: center; min-height: 180px;
  padding: 12px; border: 1px dashed var(--line-strong);
  border-radius: var(--radius); background: var(--panel);
}
.cert-preview img { display: block; max-width: 100%; height: auto; border-radius: 6px; }

.inbox-thumb {
  width: 56px; height: 42px; object-fit: cover; border-radius: 5px;
  border: 1px solid var(--line); cursor: zoom-in; display: block; background: var(--soft);
}
.cert-stage { position: relative; width: 100%; }
.cert-stage img {
  display: block; width: 100%; height: auto; border-radius: 6px;
  user-select: none; -webkit-user-drag: none;
}
.cert-hit {
  position: absolute; z-index: 1; white-space: nowrap; line-height: 1.2; cursor: move;
  padding: 2px 4px; border: 1px dashed rgba(10, 10, 10, .3);
  border-radius: 3px; user-select: none; touch-action: none;
}
.cert-hit:hover { border-color: rgba(10, 10, 10, .6); background: rgba(10, 10, 10, .04); }
.cert-hit.selected { border-color: var(--ink); background: rgba(10, 10, 10, .06); }
.cert-hit.dragging { border-color: var(--ink); background: rgba(10, 10, 10, .08); }
.cert-hit:focus-visible { outline: none; border-color: var(--ink); }
.cert-guide { position: absolute; z-index: 2; background: var(--ink); opacity: .5; pointer-events: none; }
.cert-guide-v { left: 50%; top: 0; bottom: 0; width: 1px; }
.cert-guide-h { top: 50%; left: 0; right: 0; height: 1px; }
.cert-field { padding: 12px 0; border-top: 1px solid var(--line); }
.cert-field.active {
  background: var(--soft); border-radius: 8px;
  box-shadow: inset 2px 0 0 var(--ink);
  padding-left: 10px; padding-right: 10px; margin-left: -10px; margin-right: -10px;
}
.cert-field:first-child { padding-top: 0; border-top: none; }
.cert-field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cert-check { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12.5px; }
.cert-check input { width: 14px; height: 14px; accent-color: var(--ink); }
.cert-field-head select {
  padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font-size: 12px;
}
.cert-field-head select:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.cert-field-grid {
  display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px;
  font-size: 11.5px; color: var(--muted);
}
.cert-field-grid label { display: flex; align-items: center; gap: 6px; }
.cert-field-grid input[type=number] {
  width: 72px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font-size: 12.5px;
}
.cert-field-grid input[type=number]:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.cert-field-grid select {
  width: 96px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font-size: 12.5px;
}
.cert-field-grid select:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.cert-field-grid input[type=color] {
  width: 42px; height: 30px; padding: 2px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: var(--surface); cursor: pointer;
}

/* ============================ 主题切换 ============================ */
.t-ico { width: 16px; height: 16px; display: block; }
html:not([data-theme="dark"]) .t-sun { display: none; }
html[data-theme="dark"] .t-moon { display: none; }

html[data-theme="dark"] {
  --bg: #0c0c0c;
  --surface: #141414;
  --ink: #f2f2f2;
  --muted: #8f8f8f;
  --line: #262626;
  --line-2: #1e1e1e;
  --line-strong: #363636;
  --soft: #1c1c1c;
  --panel: #171717;
  --accent: #f2f2f2;
  --accent-2: #f2f2f2;
  --accent-soft: #242424;
  --grad: linear-gradient(180deg, #f2f2f2, #cfcfcf);
  --danger: #f97066;
  --danger-soft: rgba(249, 112, 102, .12);
  --ok: #47cd89;
  --ok-soft: rgba(71, 205, 137, .12);
  --warn: #fdb022;
  --warn-soft: rgba(253, 176, 34, .12);
  --info: #d0d5dd;
  --info-soft: #1f1f1f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 10px 30px -16px rgba(0, 0, 0, .8);
  --shadow-lg: 0 32px 80px -40px rgba(0, 0, 0, .9);
  --ring: 0 0 0 3px rgba(242, 242, 242, .12);
}
html[data-theme="dark"] .login-brand {
  background: linear-gradient(158deg, #0b2e1a 0%, #14532d 58%, #15803d 100%);
}
html[data-theme="dark"] .pill { color: #c9c9c9; }
html[data-theme="dark"] .btn-primary { background: var(--ink); color: #0c0c0c; border-color: var(--ink); }
html[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #ffffff; border-color: #ffffff; }
/* 登录页主按钮恒为品牌绿 */
html[data-theme="dark"] .login-card .btn-primary { background: #16a34a; color: #fff; border-color: #16a34a; }
html[data-theme="dark"] .login-card .btn-primary:hover:not(:disabled) { background: #15803d; border-color: #15803d; }
html[data-theme="dark"] .login-card input:focus, html[data-theme="dark"] .login-card select:focus {
  border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}
html[data-theme="dark"] .btn-danger { border-color: rgba(249, 112, 102, .35); }
html[data-theme="dark"] .sign-pad { background: #fff; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #333; border: 2px solid transparent; background-clip: content-box; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4a4a4a; background-clip: content-box; }

/* ============================ 电子签名步骤 ============================ */
.sign-steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.sign-step {
  flex: 1; min-width: 104px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  transition: border-color .15s, color .15s;
}
.sign-step .n {
  width: 19px; height: 19px; border-radius: 50%; flex: none;
  font-size: 10.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--muted); border: 1px solid var(--line);
}
.sign-step.active { border-color: var(--ink); color: var(--ink); }
.sign-step.active .n { background: var(--ink); color: var(--surface); border-color: transparent; }
.sign-step.done { border-color: #bfe6d2; color: var(--ok); }
.sign-step.done .n { background: var(--ok); color: #fff; border-color: transparent; }
.sign-name-readonly { background: var(--soft) !important; color: var(--muted) !important; cursor: default; }

/* ============================ 响应式 ============================ */
@media (max-width: 860px) {
  .sidebar {
    width: 62px; padding: 16px 8px;
    max-height: none; position: static;
  }
  .nav-group-t { display: none; }
  .nav-group { margin-bottom: 8px; }
  .sidebar a { justify-content: center; padding: 10px 0; }
  .sidebar a span { display: none; }
  .main { padding: 24px 20px 56px; }
  .who { display: none; }
  .user-chip { padding: 4px; }
  .caret { display: none; }
}

@media (max-width: 680px) {
  .topbar { padding: 0 14px; height: 54px; }
  .brand { font-size: 12.5px; letter-spacing: .12em; }
  .top-actions { gap: 4px; }
  .icon-btn { height: 32px; min-width: 32px; padding: 0 8px; }
  .main { padding: 18px 14px 48px; }
  .layout { min-height: calc(100vh - 54px); }
  .sidebar { width: 54px; padding: 12px 6px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; padding-bottom: 14px; margin-bottom: 18px; }
  .page-head h2 { font-size: 18px; }
  .page-head .row-actions { width: 100%; }
  .card { padding: 16px; border-radius: 10px; }
  .stat { padding: 16px; }
  .stat .v { font-size: 25px; }
  .overlay { padding: 10px; }
  .modal { border-radius: 12px; }
  .modal-head { padding: 13px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; flex-wrap: wrap; }
  /* 表格横向滚动不再被卡片裁切 */
  .table-card, .lb-card { border-radius: 10px; }
  .table-card table, .lb-card table { min-width: 560px; }
  .grade-top { gap: 10px; }
  .grade-title { flex: 1 1 100%; min-width: 0; }
  .grade-progress { width: 100%; }
  .grade-progress .txt { text-align: left; }
  .score-row { flex-wrap: wrap; row-gap: 8px; }
  .score-row .name {
    flex: 1 1 100%; display: flex; align-items: baseline;
    justify-content: space-between; gap: 10px;
  }
  .score-row .name .max { margin: 0; }
  .score-row .score-input { flex: 1 1 100%; }
  .grade-panel .score-row input[type=number] {
    width: auto; flex: 1; min-width: 0; font-size: 16px; padding: 10px 12px;
  }
  .score-row .btn-quick { height: 42px; padding: 0 15px; font-size: 13.5px; }
  .kbd-hint { display: none; }
  #grade-submit {
    position: sticky; bottom: 8px; z-index: 6;
    box-shadow: 0 6px 20px rgba(10, 10, 10, .18);
  }
  .paper-head { gap: 10px; }
  .paper-content { max-height: 50vh; font-size: 14px; }
  .section-title { margin: 22px 0 12px; }
  .btn-block { letter-spacing: 1px; }
  .sign-pad { height: 200px; }
  .sign-steps { gap: 6px; }
  .sign-step { padding: 7px 9px; font-size: 11px; min-width: 0; }
  .toast { max-width: calc(100vw - 32px); }
}
