/* ===== HFUT 综合评议管理 · Swiss Modernism 2.0（学术深蓝） ===== */
:root {
  --color-primary: #1E3A5F;
  --color-on-primary: #FFFFFF;
  --color-secondary: #0369A1;
  --color-accent: #059669;
  --color-background: #F1F5F9;
  --color-foreground: #0F172A;
  --color-muted: #E8EEF5;
  --color-muted-fg: #64748B;
  --color-border: #D8E0EA;
  --color-card: #FFFFFF;
  --color-destructive: #DC2626;
  --color-ring: #0369A1;
  --color-warning: #B45309;
  --color-success: #059669;
  --text-secondary: #64748B;
  --sidebar-bg: #0F2744;
  --sidebar-fg: #E2E8F0;
  --sidebar-muted: #8BA3C0;
  --sidebar-hover: rgba(255, 255, 255, .07);
  --sidebar-active: rgba(3, 105, 161, .28);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 39, 68, .04), 0 6px 20px rgba(15, 39, 68, .06);
  --shadow-md: 0 4px 12px rgba(15, 39, 68, .07), 0 12px 28px rgba(15, 39, 68, .06);
  --shadow-lg: 0 16px 48px rgba(15, 39, 68, .16);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, .7);
  --sidebar-w: 268px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Noto Serif SC", "Noto Sans SC", "Songti SC", serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --bp-phone: 640px;
  --bp-tablet: 1024px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-foreground);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(3, 105, 161, .07), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(30, 58, 95, .06), transparent 50%),
    var(--color-background);
  min-height: 100dvh;
  overflow-x: hidden;
  touch-action: manipulation;
}
img, video { max-width: 100%; height: auto; }
svg {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
}
body.sidebar-open { overflow: hidden; }
a { color: var(--color-secondary); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--color-primary); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }
:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}
.btn:focus-visible, .nav-item:focus-visible, .input:focus-visible {
  outline: none;
}

/* 跳过导航 */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 300;
  background: var(--color-primary); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; text-decoration: none; color: #fff; }

/* ===== 布局 ===== */
.app { min-height: 100dvh; max-width: 100%; min-width: 0; }
.main {
  min-width: 0; display: flex; flex-direction: column;
  margin-left: var(--sidebar-w); min-height: 100dvh;
  max-width: 100%;
}
.content {
  flex: 1; padding: var(--space-5) 28px 56px;
  max-width: 1280px; width: 100%; margin: 0 auto;
  animation: contentIn .35s var(--ease);
  min-width: 0; overflow-x: clip;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700; margin-bottom: 6px;
  letter-spacing: .01em; color: var(--color-primary);
}
.page-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 22px; line-height: 1.7; }

.page-hero {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 22px;
  padding: 22px 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(232,238,245,.85)),
    linear-gradient(120deg, rgba(3,105,161,.08), transparent 55%);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow), var(--shadow-inset);
}
.page-hero .page-title { margin-bottom: 4px; }
.page-hero .page-sub { margin-bottom: 0; max-width: 52ch; }
.page-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-hero .deadline-wrap { margin-top: 10px; }

.grade-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: 12px; box-shadow: var(--shadow);
}
.grade-bar .label { font-size: 13px; color: var(--text-secondary); font-weight: 500; flex-shrink: 0; }
.grade-bar .value { font-size: 13px; font-weight: 600; color: var(--color-primary); overflow-wrap: anywhere; min-width: 0; }
.grade-bar .input { max-width: none; min-height: 44px; padding: 8px 40px 8px 12px; }
.grade-bar .select-wrap { flex: 1 1 240px; min-width: 0; max-width: 100%; }
.grade-bar-meta {
  font-size: 12px; color: var(--text-secondary); margin-left: auto;
  overflow-wrap: anywhere; line-height: 1.5; min-width: 0;
}

.info-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.info-list tr td { padding: 12px 4px; border-bottom: 1px solid var(--color-muted); vertical-align: top; }
.info-list tr:last-child td { border-bottom: none; }
.info-list .k { width: 120px; color: var(--text-secondary); font-weight: 500; }
.info-list .v { font-weight: 600; color: var(--color-foreground); }

.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.table-actions {
  display: flex; gap: 8px; flex-wrap: nowrap; align-items: center;
}

.panel-head {
  padding: 14px 18px; border-bottom: 1px solid var(--color-muted);
  font-weight: 600; background: linear-gradient(180deg, #F8FAFC, var(--color-muted));
  border-radius: 12px 12px 0 0; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--color-primary);
}

.status-hero {
  display: flex; align-items: center; gap: 16px; padding: 18px;
  border-radius: 14px; border: 1px solid var(--color-border); margin-bottom: 16px;
  background: #fff;
}
.status-hero .icon {
  width: 48px; height: 48px; border-radius: 14px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.status-hero .icon svg { width: 24px; height: 24px; }
.status-hero.ok { background: linear-gradient(135deg, #ECFDF5, #fff); border-color: #A7F3D0; }
.status-hero.ok .icon { background: #D1FAE5; color: #065F46; }
.status-hero.warn { background: linear-gradient(135deg, #FFFBEB, #fff); border-color: #FDE68A; }
.status-hero.warn .icon { background: #FEF3C7; color: #92400E; }
.status-hero.info { background: linear-gradient(135deg, #F0F9FF, #fff); border-color: #BAE6FD; }
.status-hero.info .icon { background: #E0F2FE; color: #075985; }
.status-hero.err { background: linear-gradient(135deg, #FEF2F2, #fff); border-color: #FECACA; }
.status-hero.err .icon { background: #FEE2E2; color: #991B1B; }
.status-hero .title { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.status-hero .desc { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

.password-field { position: relative; }
.password-field .input { padding-right: 48px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: none; background: transparent; color: var(--text-secondary);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.password-toggle:hover { background: var(--color-muted); color: var(--color-foreground); }
.password-toggle svg { width: 18px; height: 18px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ===== 管理端表单分区 ===== */
.form-shell { max-width: 760px; }
.form-section {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow), var(--shadow-inset);
  padding: 22px 24px; margin-bottom: 16px;
}
.form-section-head {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px;
}
.form-section-head .icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(3, 105, 161, .1); color: var(--color-secondary);
}
.form-section-head .icon svg { width: 20px; height: 20px; }
.form-section-head .icon.green { background: #D1FAE5; color: #065F46; }
.form-section-head .icon.amber { background: #FEF3C7; color: #92400E; }
.form-section-head .icon.violet { background: #EDE9FE; color: #5B21B6; }
.form-section-head h2 {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  color: var(--color-primary); margin: 0 0 2px; line-height: 1.3;
}
.form-section-head p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.form-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding-top: 4px; margin-top: 4px;
}
.form-inline {
  display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
}
.form-inline .input { flex: 1; min-width: 200px; }
.form-inline .btn { flex-shrink: 0; }

.check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: 8px;
}
.check-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; min-height: 44px; min-width: 0;
  background: #fff; border: 1px solid var(--color-border); border-radius: 10px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
  user-select: none; overflow-wrap: anywhere;
}
.check-chip:hover { border-color: #B8C9DC; background: #F8FBFF; }
.check-chip:has(input:checked) {
  border-color: var(--color-secondary); background: #E0F2FE;
  box-shadow: 0 0 0 3px rgba(3, 105, 161, .12); color: #075985;
}
.check-chip input { width: 16px; height: 16px; accent-color: var(--color-secondary); flex-shrink: 0; }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-list .check-chip { max-width: 100%; }

.ratio-preview {
  display: flex; height: 10px; border-radius: 999px; overflow: hidden;
  background: var(--color-muted); margin: 8px 0 12px;
}
.ratio-preview > span { height: 100%; transition: width .3s var(--ease); }
.ratio-preview .r-report { background: #0369A1; }
.ratio-preview .r-peer { background: #059669; }
.ratio-preview .r-defense { background: #1E3A5F; }
.ratio-legend {
  display: flex; flex-wrap: wrap; gap: 12px 18px; font-size: 12px; color: var(--text-secondary);
  margin-bottom: 14px;
}
.ratio-legend i {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px;
  vertical-align: middle;
}
.ratio-legend .r-report { background: #0369A1; }
.ratio-legend .r-peer { background: #059669; }
.ratio-legend .r-defense { background: #1E3A5F; }
.sum-hint {
  font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 10px;
  margin-bottom: 4px; border: 1px solid transparent;
}
.sum-hint.ok { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.sum-hint.bad { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }

.major-panel {
  background: linear-gradient(180deg, #F0FDF4, #fff);
  border: 1px solid #A7F3D0; border-radius: 14px; padding: 16px 16px 14px;
  scroll-margin-top: 80px;
}
.major-panel .check-chip {
  border-color: #BBF7D0; background: #fff;
}
.major-panel .check-chip:has(input:checked) {
  border-color: #059669; background: #D1FAE5; color: #065F46;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, .12);
}
.major-panel .check-chip input { accent-color: #059669; }

.grade-major-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 280px));
  justify-content: start;
  align-items: start;
  gap: 10px;
  min-width: 0;
  width: 100%;
}
.grade-major-card {
  min-width: 0; max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border); border-radius: 12px;
  padding: 12px 14px; background: #FAFCFF;
  overflow-wrap: anywhere;
}
.grade-major-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.grade-major-head .btn { flex-shrink: 0; width: auto; }
.grade-major-title {
  font-weight: 700; min-width: 0; flex: 1 1 auto;
  overflow-wrap: anywhere; line-height: 1.35;
}
.grade-major-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-width: 0;
}
.grade-major-tags .badge { max-width: 100%; white-space: normal; }

.create-split {
  display: grid; grid-template-columns: 1.2fr .9fr; gap: 16px; align-items: start;
}
@media (max-width: 900px) {
  .create-split { grid-template-columns: 1fr; }
}

@keyframes contentIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ===== 侧栏（深蓝学术） ===== */
.sidebar {
  width: var(--sidebar-w);
  background:
    linear-gradient(180deg, #143356 0%, var(--sidebar-bg) 42%, #0B1C30 100%);
  color: var(--sidebar-fg);
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
  display: flex; flex-direction: column;
  transition: transform .28s var(--ease);
  box-shadow: 4px 0 24px rgba(11, 28, 48, .18);
}
.sidebar-brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 18px; font-weight: 700; font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-family: var(--font-display);
  letter-spacing: .02em; flex-shrink: 0;
}
.sidebar-brand > div:last-child {
  line-height: 1.25; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.sidebar-brand .logo {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; display: block;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 39, 68, .2);
}
.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 14px 12px 24px;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.nav-group {
  margin: 16px 10px 8px; font-size: 11px; font-weight: 600;
  letter-spacing: .1em; color: var(--sidebar-muted); text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--sidebar-fg);
  font-size: 14px; font-weight: 500; margin-bottom: 2px;
  transition: background .2s var(--ease), color .2s var(--ease);
  min-height: 44px; cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--sidebar-muted); transition: color .2s; }
.nav-item:hover { background: var(--sidebar-hover); text-decoration: none; color: #fff; }
.nav-item:hover svg { color: #CBD5E1; }
.nav-item.active {
  background: var(--sidebar-active); color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 #38BDF8;
}
.nav-item.active svg { color: #7DD3FC; }
.sidebar-footer {
  padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px; color: var(--sidebar-muted); line-height: 1.5; flex-shrink: 0;
}

/* 侧栏父子节点 */
.nav-parent { margin-bottom: 2px; }
.nav-parent summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--sidebar-fg);
  font-size: 14px; font-weight: 500;
  min-height: 44px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-parent summary::-webkit-details-marker { display: none; }
.nav-parent summary::marker { content: ""; }
.nav-parent summary:hover { background: var(--sidebar-hover); color: #fff; }
.nav-parent summary:hover svg { color: #CBD5E1; }
.nav-parent summary svg:first-child { width: 18px; height: 18px; flex-shrink: 0; color: var(--sidebar-muted); }
.nav-parent .nav-arrow { margin-left: auto; width: 14px; height: 14px; color: var(--sidebar-muted);
  transition: transform .2s var(--ease); flex-shrink: 0; }
.nav-parent[open] .nav-arrow { transform: rotate(90deg); }
.nav-parent[open] > summary { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-parent[open] > summary svg:first-child { color: #7DD3FC; }
.nav-sub { margin: 4px 0 8px 14px; border-left: 1px solid rgba(255, 255, 255, .12); padding-left: 8px; }
.nav-sub .nav-item { font-size: 13px; padding: 8px 10px; min-height: 40px; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .48);
  z-index: 45; backdrop-filter: blur(2px);
}
.sidebar-backdrop.show { display: block; }

/* ===== 顶栏 ===== */
.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  position: sticky; top: 0; z-index: 40;
  flex-wrap: nowrap; min-width: 0; max-width: 100%;
}
.hamburger {
  display: none; background: #fff; border: 1px solid var(--color-border);
  border-radius: 10px; width: 44px; height: 44px; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s; cursor: pointer;
}
.hamburger:hover { background: var(--color-muted); }
.hamburger svg { width: 20px; height: 20px; }
.topbar-title { font-weight: 600; font-size: 15px; color: var(--color-primary); min-width: 0; }
.topbar-right {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  flex-wrap: nowrap; justify-content: flex-end; min-width: 0; flex-shrink: 0;
}
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--color-muted); border-radius: 999px; font-size: 13px; font-weight: 500;
  max-width: 280px;
}
.user-chip > span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 96px;
}
.role-badge {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: rgba(3, 105, 161, .1); color: var(--color-secondary); font-weight: 600;
}

.act-as-banner {
  background: linear-gradient(90deg, #FEF3C7, #FFFBEB);
  color: #92400E; padding: 10px 24px; font-size: 13px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid #FDE68A;
  flex-shrink: 0;
}
.act-as-banner a { color: #92400E; font-weight: 600; text-decoration: underline; }

.role-switch { position: relative; flex-shrink: 0; }
.role-switch summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center;
  gap: 6px; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 10px;
  font-size: 13px; background: #fff; min-height: 40px; white-space: nowrap;
  transition: border-color .2s, box-shadow .2s;
}
.role-switch summary:hover { border-color: #B8C7D9; }
.role-switch summary::-webkit-details-marker { display: none; }
.role-switch .menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: min(380px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--color-border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 0; z-index: 60;
  animation: menuIn .18s var(--ease); overflow: hidden;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.role-switch .menu-section {
  padding: 12px 14px 8px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  border-top: 1px solid var(--color-muted);
}
.role-switch .menu-section:first-child { border-top: none; padding-top: 12px; }
.role-switch .menu-quick {
  max-height: 168px; overflow-y: auto; padding: 0 8px 8px;
}
.role-switch .menu a {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 8px; font-size: 13px; color: var(--color-foreground);
  min-height: 42px; line-height: 1.35;
}
.role-switch .menu a:hover { background: var(--color-muted); text-decoration: none; }
.role-switch .menu a.active {
  background: rgba(3, 105, 161, .1); color: var(--color-secondary); font-weight: 600;
}
.role-switch .menu-search { padding: 0 12px 12px; }
.role-switch .menu-search .input { min-height: 40px; }
.role-switch .search-results {
  margin-top: 8px; max-height: 240px; border-radius: 10px;
}
.role-switch .sr-item {
  align-items: flex-start; gap: 10px; padding: 12px;
  min-height: auto;
}
.role-switch .sr-main { flex: 1; min-width: 0; }
.role-switch .sr-title {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px;
}
.role-switch .sr-detail {
  font-size: 12px; color: var(--text-secondary); line-height: 1.45;
  word-break: break-all;
}
.role-switch .sr-roles {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  transition: background .2s var(--ease), transform .15s var(--ease), box-shadow .2s, opacity .2s, border-color .2s;
  white-space: nowrap; cursor: pointer; min-height: 40px; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(180deg, #254A73, var(--color-primary));
  color: #fff; box-shadow: 0 2px 8px rgba(30, 58, 95, .25);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #2C5580, #18324F);
  color: #fff; box-shadow: 0 4px 14px rgba(30, 58, 95, .3);
}
.btn-primary:focus-visible { box-shadow: 0 0 0 3px rgba(3, 105, 161, .35); }
.btn-secondary {
  background: #fff; border-color: var(--color-border); color: var(--color-foreground);
}
.btn-secondary:hover:not(:disabled) { background: var(--color-muted); border-color: #C5D0DE; color: var(--color-foreground); }
.btn-success { background: var(--color-accent); color: #fff; }
.btn-success:hover:not(:disabled) { background: #047857; color: #fff; }
.btn-danger { background: var(--color-destructive); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #B91C1C; color: #fff; }
.btn-danger-ghost { background: #FEF2F2; color: var(--color-destructive); }
.btn-danger-ghost:hover:not(:disabled) { background: #FEE2E2; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; min-height: 34px; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 22px; font-size: 15px; min-height: 48px; }

/* ===== 卡片 ===== */
.card {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow), var(--shadow-inset);
  padding: 22px; margin-bottom: 20px;
  transition: box-shadow .25s var(--ease), transform .2s var(--ease);
  max-width: 100%; min-width: 0;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover { box-shadow: var(--shadow-md); }
}
.login-logo {
  width: 58px; height: 58px; border-radius: 50%;
  object-fit: cover; display: block;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 39, 68, .18);
}
.card-title {
  font-size: 16px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--color-primary); font-family: var(--font-display);
}
.card-title .hint { font-size: 12px; color: var(--text-secondary); font-weight: 400; font-family: var(--font); }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--color-secondary), var(--color-primary));
  opacity: .85;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 39, 68, .1); }
.stat-card .label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.stat-card .value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-primary); }
.stat-card .value small { font-size: 14px; color: var(--text-secondary); font-weight: 400; }
.stat-card .meta { font-size: 12px; color: var(--text-secondary); margin-top: 8px; white-space: nowrap; }

/* 统一看板（状态 / KPI） */
.board-section { margin-bottom: 22px; }
.board-section-title {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  letter-spacing: .04em; text-transform: none; margin: 0 0 10px 2px;
}
.board-grid {
  display: grid; gap: 14px; margin-bottom: 20px;
  align-items: stretch;
}
.board-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.board-card {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px; min-height: 118px;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s;
}
.board-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--color-secondary), var(--color-primary));
  opacity: .85;
}
@media (hover: hover) and (pointer: fine) {
  .board-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 39, 68, .1); }
}
.board-card.tone-ok::before { background: linear-gradient(180deg, #34D399, #059669); }
.board-card.tone-warn::before { background: linear-gradient(180deg, #FBBF24, #B45309); }
.board-card.tone-err::before { background: linear-gradient(180deg, #F87171, #DC2626); }
.board-card.tone-info::before { background: linear-gradient(180deg, #38BDF8, #0369A1); }
.board-card.tone-muted::before { background: linear-gradient(180deg, #94A3B8, #64748B); }
.board-label {
  font-size: 13px; line-height: 1.4; font-weight: 500;
  color: var(--text-secondary);
}
.board-status {
  font-size: 18px; line-height: 1.35; font-weight: 600;
  color: var(--color-foreground); letter-spacing: .01em;
  display: flex; align-items: center; min-height: 28px;
}
.board-status-sm { font-size: 16px; font-weight: 600; }
.board-kpi {
  font-size: 26px; line-height: 1.2; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--color-primary);
}
.board-kpi small {
  font-size: 14px; color: var(--text-secondary); font-weight: 500;
}
.board-meta {
  margin-top: auto; font-size: 12px; line-height: 1.5;
  color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board-meta.muted { opacity: .72; }
.kpi-card .bar,
.board-card .bar,
.stat-card .bar {
  height: 6px; border-radius: 3px; background: var(--color-muted);
  margin-top: 4px; overflow: hidden;
}
.kpi-card .bar > div,
.board-card .bar > div,
.stat-card .bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
  border-radius: 3px; transition: width .45s var(--ease);
}

.share-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px;
  min-width: 0;
}
.share-grid > .card { margin-bottom: 0; min-width: 0; }
.share-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px dashed var(--color-muted);
  min-width: 0;
}
.share-row:last-child { border-bottom: none; padding-bottom: 0; }
.share-row:first-of-type { padding-top: 0; }
.share-name {
  font-size: 13px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; line-height: 1.4;
}
.share-bar {
  grid-column: 1 / -1; height: 8px; background: var(--color-muted);
  border-radius: 99px; overflow: hidden; min-width: 0;
}
.share-bar > i {
  display: block; height: 100%; max-width: 100%;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
  border-radius: 99px;
}
.share-meta {
  font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums;
  text-align: right; overflow-wrap: anywhere; line-height: 1.4;
}
.sc-line {
  font-variant-numeric: tabular-nums; font-size: 13px;
  overflow-wrap: anywhere; word-break: break-word;
}
.sc-line b { color: var(--color-primary); margin-left: 4px; }
.sc-agg {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0; max-width: 100%;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, #F7FBFF 0%, #EEF6FB 100%);
  border: 1px solid #C5DCEC;
  border-radius: var(--radius);
  box-shadow: var(--shadow-inset);
}
.mat-tags + .sc-agg, #dSc .sc-agg { margin-top: 10px; }
.sc-agg-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.sc-agg-title { min-width: 0; }
.sc-agg-label {
  display: block; font-size: 13px; font-weight: 700; color: var(--color-primary);
  letter-spacing: .02em; line-height: 1.3;
}
.sc-agg-caption {
  display: block; margin-top: 2px;
  font-size: 11px; font-weight: 500; color: var(--text-secondary); line-height: 1.3;
}
.sc-agg-total {
  font-size: 28px; font-weight: 700; color: var(--color-primary);
  font-variant-numeric: tabular-nums; line-height: 1;
  letter-spacing: -.03em; white-space: nowrap;
}
.sc-agg-total small {
  margin-left: 3px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0;
}
.sc-agg-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px; margin: 0; padding: 0; list-style: none;
}
.sc-agg-item {
  min-width: 0; padding: 8px 8px 7px;
  background: #fff; border: 1px solid #E2EBF3; border-radius: var(--radius-sm);
}
.sc-agg-k {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-secondary); line-height: 1.3;
}
.sc-agg-v {
  display: block; margin: 2px 0 6px;
  font-size: 16px; font-weight: 700; color: var(--color-foreground);
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
.sc-agg-bar {
  display: block; height: 4px; background: var(--color-muted);
  border-radius: 99px; overflow: hidden;
}
.sc-agg-bar > i {
  display: block; height: 100%; max-width: 100%;
  background: var(--color-secondary); border-radius: 99px;
}
.sc-agg-item.is-zero .sc-agg-v { color: var(--text-secondary); font-weight: 600; }
.sc-agg-item.is-zero .sc-agg-bar > i { width: 0 !important; }
.defense-profile-kpis .sc-agg { margin-top: 0; }
@media (max-width: 640px) {
  .sc-agg { padding: 12px; gap: 8px; }
  .sc-agg-total { font-size: 24px; }
  .sc-agg-grid { gap: 6px; }
  .sc-agg-item { padding: 7px 6px 6px; }
  .sc-agg-v { font-size: 15px; }
}
@media (max-width: 420px) {
  .sc-agg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.student-hero .page-sub { max-width: none; }
.ratio-chip {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  margin-top: 12px; padding: 8px 12px; border-radius: 999px;
  background: rgba(3, 105, 161, .08); color: var(--color-primary);
  font-size: 13px; font-weight: 500; line-height: 1.4;
  max-width: 100%;
}
.ratio-chip .sep { color: var(--text-secondary); font-weight: 400; }
.flow-card { overflow: hidden; }

/* 截止时间徽标 */
.deadline-wrap { margin-top: 10px; }
.deadline-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 999px;
  background: #FEF2F2; color: #DC2626; font-weight: 600;
  font-size: 13px; white-space: normal; line-height: 1.5;
  max-width: 100%;
}
.deadline-tag svg { width: 13px; height: 13px; flex-shrink: 0; }
.deadline-tag.is-closed {
  background: #F1F5F9; color: #475569; font-weight: 600;
}

/* 状态色点 */
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 8px; flex-shrink: 0;
}
.status-dot.ok { background: var(--color-success); box-shadow: 0 0 0 3px rgba(5, 150, 105, .2); }
.status-dot.warn { background: var(--color-warning); box-shadow: 0 0 0 3px rgba(180, 83, 9, .18); }
.status-dot.err { background: var(--color-destructive); box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.status-dot.muted { background: #94A3B8; box-shadow: 0 0 0 3px rgba(100, 116, 139, .18); }

/* 流程步骤条 */
.flow-steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
  margin-bottom: 0;
}
.flow-step {
  background: linear-gradient(180deg, #F8FBFF, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 8px; min-height: 168px;
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.flow-step:hover { transform: translateY(-2px); border-color: #B8C9DC; box-shadow: var(--shadow); }
.flow-step .step-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.flow-step .step-idx {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(30, 58, 95, .08); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.flow-step .step-title { font-weight: 700; font-size: 15px; color: var(--color-foreground); line-height: 1.4; }
.flow-step .step-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; min-height: 36px; }
.flow-step .step-actions { margin-top: auto; padding-top: 6px; }

/* 导出页层级 */
.export-primary-card { border-color: #B8D4EA; background: linear-gradient(180deg, #F7FBFF, #fff); }
.export-lead { font-size: 14px; color: var(--text-secondary); margin: 0 0 14px; line-height: 1.7; max-width: 62ch; }
.btn-lg { min-height: 44px; padding: 10px 18px; font-size: 15px; }
.export-secondary-card { padding: 0; }
.export-secondary-summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 18px 22px;
  user-select: none;
}
.export-secondary-summary::-webkit-details-marker { display: none; }
.export-secondary-caret {
  font-size: 12px; color: var(--text-secondary); font-weight: 500;
  padding: 4px 10px; border-radius: 999px; background: var(--color-muted);
}
.export-secondary-caret::before { content: "展开"; }
.export-secondary-card[open] .export-secondary-caret {
  background: #E0F2FE; color: #075985;
}
.export-secondary-card[open] .export-secondary-caret::before { content: "收起"; }
.export-secondary-body { padding: 0 22px 22px; border-top: 1px solid var(--color-muted); padding-top: 16px; }
.export-item-grid { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== 表格 ===== */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: #fff;
  max-width: 100%;
}
.table-wrap > table.table { min-width: 520px; }
table.table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.table th, table.table td {
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--color-muted);
}
table.table th {
  background: linear-gradient(180deg, #F7F9FC, var(--color-muted));
  font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--color-primary);
}
table.table tr:last-child td { border-bottom: none; }
table.table tbody tr { transition: background .15s; }
table.table tbody tr:hover { background: #F7FBFF; }
table.table .num { font-variant-numeric: tabular-nums; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }

/* ===== 徽章 ===== */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  max-width: 100%; line-height: 1.35;
  overflow-wrap: anywhere; word-break: break-word;
}
.badge-green { background: #D1FAE5; color: #065F46; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-blue { background: #E0F2FE; color: #075985; }
.badge-gray { background: var(--color-muted); color: var(--text-secondary); }
.badge-amber { background: #FEF3C7; color: #92400E; }

.name-fold { min-width: 0; max-width: 240px; }
.name-fold summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  min-height: 36px; min-width: 0;
  padding: 2px 4px 2px 0;
  border-radius: 8px;
}
.name-fold summary:hover { background: #F8FAFC; }
.name-fold summary::-webkit-details-marker { display: none; }
.name-fold summary::after {
  content: ""; width: 12px; height: 12px; flex-shrink: 0; margin-left: auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s var(--ease);
}
.name-fold[open] { max-width: 320px; }
.name-fold[open] summary::after { transform: rotate(180deg); }
.name-fold-preview {
  font-size: 13px; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.name-fold-list {
  margin-top: 6px; padding: 8px 10px;
  font-size: 13px; line-height: 1.65; overflow-wrap: anywhere;
  background: #F8FAFC; border: 1px solid var(--color-border); border-radius: 10px;
  max-height: 8.5em; overflow-y: auto;
}

/* ===== 表单 ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.form-group label .req { color: var(--color-destructive); }
.form-group .hint { font-size: 12px; color: var(--text-secondary); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--color-border);
  border-radius: 10px; background: #fff; outline: none;
  transition: border .2s, box-shadow .2s; min-height: 44px;
}
select.input {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer;
  padding: 10px 40px 10px 12px;
  font-weight: 500;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
select.input:hover { border-color: #B8C7D9; }
select.input:disabled {
  opacity: .72; cursor: not-allowed; background-color: #F8FAFC;
}
.select-wrap { position: relative; min-width: 0; max-width: 100%; }
.select-wrap select.input { width: 100%; }
.toolbar .select-wrap { flex: 1 1 160px; min-width: 0; max-width: 240px; }
.form-group .select-wrap { display: block; }
.form-group:has(> .select-wrap) { min-width: min(100%, 200px); }
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--color-ring);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, .16);
}
textarea.input { resize: vertical; min-height: 90px; }
.input.is-invalid {
  border-color: var(--color-destructive);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}
.input-readonly {
  background: #F8FAFC; color: var(--color-primary); font-weight: 700;
  cursor: default;
}
.field-error {
  margin-top: 5px; font-size: 12px; color: var(--color-destructive); line-height: 1.4;
}
.char-count {
  margin-top: 6px; font-size: 12px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums; text-align: right;
}
.char-count.is-warn { color: var(--color-warning); font-weight: 600; }
.char-count.is-over { color: var(--color-destructive); font-weight: 600; }
.sc-block {
  margin: 4px 0 18px; padding: 14px 16px 8px;
  background: #F8FAFC; border: 1px solid var(--color-border); border-radius: 12px;
}
.sc-block-title {
  font-size: 13px; font-weight: 700; color: var(--color-primary); margin-bottom: 4px;
}
.sc-block-hint {
  font-size: 12px; color: var(--text-secondary); line-height: 1.55; margin: 0 0 12px;
}
.sc-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 12px;
}
.sc-grid .form-group { margin-bottom: 10px; }

.rank-combo {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.rank-combo .input { flex: 1 1 120px; min-width: 0; }
.rank-combo-sep { color: var(--text-secondary); font-weight: 700; flex-shrink: 0; }
.rank-combo-total {
  min-width: 3.2em; padding: 10px 12px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #F8FAFC; border: 1px solid var(--color-border); border-radius: 10px;
  font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-primary);
}
.mat-tags { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.mat-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; max-width: 100%;
  background: #F0F9FF; border: 1px solid #BAE6FD; font-size: 13px;
}
.mat-tag i {
  font-style: normal; color: var(--text-secondary); font-size: 12px; font-weight: 600;
}
.mat-tag b { font-variant-numeric: tabular-nums; color: var(--color-primary); }
.mat-summary {
  margin-top: 12px; padding: 10px 12px;
  background: #F8FAFC; border: 1px solid var(--color-border); border-radius: 12px;
}
.mat-summary summary {
  cursor: pointer; font-weight: 600; font-size: 13px; color: var(--color-secondary);
  list-style: none;
}
.mat-summary summary::-webkit-details-marker { display: none; }
.mat-summary summary::after {
  content: "查看"; float: right; font-weight: 500; color: var(--text-secondary); font-size: 12px;
}
.mat-summary[open] summary::after { content: "收起"; }
.mat-summary p {
  margin: 8px 0 0; font-size: 13px; line-height: 1.7; white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ===== 弹窗 ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%;
  max-width: 560px; max-height: 90dvh; display: flex; flex-direction: column;
  animation: modalIn .25s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes sheetIn {
  from { opacity: .6; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes toastUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.modal-lg { max-width: 820px; }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--color-muted);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-weight: 700; font-size: 16px; font-family: var(--font-display); color: var(--color-primary); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--color-muted);
  display: flex; justify-content: flex-end; gap: 10px;
}
.modal-close {
  background: none; border: none; font-size: 22px; line-height: 1;
  color: var(--text-secondary); width: 40px; height: 40px; border-radius: 8px;
  cursor: pointer;
}
.modal-close:hover { color: var(--color-foreground); background: var(--color-muted); }
[hidden] { display: none !important; }

/* ===== 确认 / 提示弹窗 ===== */
.dialog-backdrop {
  z-index: 220;
  padding: 16px;
}
.dialog {
  max-width: 420px;
  width: 100%;
}
.dialog-body {
  display: flex; gap: 14px; align-items: flex-start; padding: 22px 20px 8px;
}
.dialog-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.dialog-icon svg { width: 22px; height: 22px; }
.dialog-icon.info { background: #E0F2FE; color: #0369A1; }
.dialog-icon.success { background: #D1FAE5; color: #047857; }
.dialog-icon.warning { background: #FEF3C7; color: #B45309; }
.dialog-icon.danger { background: #FEE2E2; color: #DC2626; }
.dialog-copy { flex: 1; min-width: 0; }
.dialog-heading {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  color: var(--color-primary); margin-bottom: 6px; line-height: 1.35;
}
.dialog-message {
  font-size: 14px; line-height: 1.65; color: #334155; white-space: pre-wrap; word-break: break-word;
}
.dialog-highlight {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--color-muted); border: 1px solid var(--color-border);
  font-size: 14px; font-weight: 600; letter-spacing: .02em;
  color: var(--color-primary); text-align: left; user-select: all;
  line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.account-cell {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.account-cell .num { font-variant-numeric: tabular-nums; }
.dialog-footer {
  border-top: none; padding-top: 8px; padding-bottom: 18px;
}
@media (prefers-reduced-motion: reduce) {
  .modal, .dialog, .modal-backdrop, .toast { animation: none !important; }
}

/* ===== 提示 ===== */
.toast-wrap {
  position: fixed; top: 16px; right: 16px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 12px 18px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-secondary); font-size: 14px;
  min-width: 240px; max-width: 360px; animation: slideIn .25s var(--ease);
}
.toast.success { border-color: var(--color-success); }
.toast.error { border-color: var(--color-destructive); }
.toast.info { border-color: var(--color-secondary); }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.alert {
  padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-info { background: #E0F2FE; color: #075985; border-color: #BAE6FD; }
.alert-success { background: #D1FAE5; color: #065F46; border-color: #A7F3D0; }
.alert-error { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.alert-title { font-weight: 700; margin-bottom: 4px; }
.alert p { margin: 0; line-height: 1.55; }

/* 开放开关 */
.switch-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: #F8FAFC; border: 1px solid var(--color-border);
  cursor: pointer; user-select: none;
}
.switch-row.is-on, .switch-row:has(input:checked) {
  background: #ECFDF5; border-color: #A7F3D0;
}
.switch {
  position: relative; width: 44px; height: 26px; flex-shrink: 0; margin-top: 1px;
}
.switch input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: #CBD5E1; cursor: pointer;
  transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; width: 20px; height: 20px;
  left: 3px; top: 3px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
  transition: transform .2s;
}
.switch input:checked + .track { background: var(--color-success); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--color-ring); outline-offset: 2px; }
.switch-copy b { display: block; font-size: 14px; }
.switch-copy small { display: block; color: var(--text-secondary); font-size: 12px; line-height: 1.45; margin-top: 2px; }

/* ===== 拖拽上传 ===== */
.dropzone {
  border: 2px dashed #B8C9DC; border-radius: var(--radius);
  padding: 40px 20px; text-align: center; background: #F8FBFF;
  transition: border .2s, background .2s, transform .2s; cursor: pointer;
}
.dropzone:hover { border-color: var(--color-secondary); }
.dropzone.dragover {
  border-color: var(--color-secondary); background: #E0F2FE;
  transform: scale(1.01);
}
.dropzone .dz-icon { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--color-secondary); }
.dropzone .dz-title { font-weight: 600; margin-bottom: 4px; }
.dropzone .dz-sub { font-size: 13px; color: var(--text-secondary); }

/* ===== 导入进度条 ===== */
.import-progress {
  margin-top: 16px;
  padding: 12px 14px;
  background: #F8FBFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.import-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.import-progress-head > span:first-child { color: var(--text-secondary); }
.import-progress-head > span:last-child {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary);
  flex-shrink: 0;
  min-height: 1em;
}
.import-progress .pbar { height: 8px; }
.import-progress.is-processing .pbar { position: relative; }
.import-progress.is-processing .pbar > div {
  width: 35% !important;
  transition: none;
  animation: import-indeterminate 1.1s ease-in-out infinite;
}
.import-progress.is-done .pbar > div {
  background: linear-gradient(90deg, var(--color-success), #34D399);
}
.import-progress.is-error {
  background: #FEF2F2;
  border-color: #FECACA;
}
.import-progress.is-error .pbar > div {
  background: var(--color-destructive);
  animation: none;
  width: 100% !important;
}
.import-progress.is-error .import-progress-head > span:first-child {
  color: #991B1B;
  font-weight: 600;
}
@keyframes import-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* ===== 互评（学生端 + 管理端模板） ===== */
.peer-rules {
  background: linear-gradient(180deg, #F0FDF8, #fff);
  border: 1px solid #B7E4D0;
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-inset);
}
.peer-rules-head {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px;
}
.peer-rules-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #D1FAE5; color: #065F46;
}
.peer-rules-icon svg { width: 18px; height: 18px; }
.peer-rules h2 {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: var(--color-primary); margin: 0 0 4px; line-height: 1.3;
}
.peer-rules p {
  margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.55;
}
.peer-rules p b { color: #065F46; font-variant-numeric: tabular-nums; }
.peer-rule-grid {
  list-style: none; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.peer-rule-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--color-border);
  min-height: 56px;
}
.peer-rule-label { font-size: 14px; font-weight: 700; color: var(--color-foreground); }
.peer-rule-limit { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.peer-rule-item.opt-c0 { border-color: #A7F3D0; background: #F0FDF4; }
.peer-rule-item.opt-c0 .peer-rule-label { color: #065F46; }
.peer-rule-item.opt-c1 { border-color: #BAE6FD; background: #F0F9FF; }
.peer-rule-item.opt-c1 .peer-rule-label { color: #075985; }
.peer-rule-item.opt-c2 { border-color: #FDE68A; background: #FFFBEB; }
.peer-rule-item.opt-c2 .peer-rule-label { color: #92400E; }
.peer-rule-item.opt-c3 { border-color: #DDD6FE; background: #F5F3FF; }
.peer-rule-item.opt-c3 .peer-rule-label { color: #5B21B6; }
.peer-rule-item.opt-c4 { border-color: #FECACA; background: #FEF2F2; }
.peer-rule-item.opt-c4 .peer-rule-label { color: #991B1B; }
.peer-rule-item.opt-c5 { border-color: #99F6E4; background: #F0FDFA; }
.peer-rule-item.opt-c5 .peer-rule-label { color: #115E59; }

.peer-counter {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.peer-counter.sticky {
  position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 30;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 14px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.peer-counter .chip {
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--color-muted); color: var(--text-secondary); min-height: 36px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent; font-variant-numeric: tabular-nums;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.peer-counter .chip-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: currentColor; opacity: .55;
}
.peer-counter .chip.over {
  background: #FEF2F2; color: #991B1B; border-color: #FECACA;
}
.peer-counter .chip.ok {
  background: #ECFDF5; color: #065F46; border-color: #A7F3D0;
}
.peer-counter .chip.ok .chip-dot { opacity: 1; }
.peer-counter .chip.over .chip-dot { opacity: 1; }
.peer-counter .chip-progress {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}

.peer-list-card { overflow: hidden; }
.peer-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: none; border-bottom: 1px solid var(--color-muted);
  margin: 0; min-width: 0; min-inline-size: 0;
  background: #fff;
  transition: background .2s var(--ease);
}
.peer-row:hover { background: #F8FBFF; }
.peer-row.is-rated { background: #F8FFFB; }
.peer-row:last-child { border-bottom: none; }
.peer-avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-muted); color: var(--color-primary);
  font-weight: 700; font-size: 14px; font-family: var(--font-display);
}
.peer-meta { min-width: 0; flex: 0 1 160px; }
.peer-row .p-name {
  font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.peer-row .p-no { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.peer-choice-chip {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #E0F2FE; color: #075985;
}

.radio-group {
  display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; justify-content: flex-end;
}
.radio-group label {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  border: 1px solid var(--color-border); border-radius: 10px; font-size: 13px;
  cursor: pointer; user-select: none; min-height: 40px;
  background: #fff; color: var(--color-foreground);
  transition: border-color .2s var(--ease), background .2s var(--ease),
              color .2s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease);
}
.radio-group label:hover {
  border-color: #B8C9DC; background: #F8FBFF;
}
.radio-group label:active { transform: scale(.97); }
.radio-group label:focus-within {
  outline: 2px solid var(--color-ring); outline-offset: 2px;
}
.radio-group input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  pointer-events: none;
}
.radio-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid #94A3B8; background: #fff;
  box-shadow: inset 0 0 0 2px #fff;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.radio-group label:has(input:checked) { font-weight: 700; }
.radio-group label:has(input:checked) .radio-dot {
  border-color: currentColor; background: currentColor;
}
.radio-group label.opt-c0:has(input:checked) { border-color: var(--color-success); background: #D1FAE5; color: #065F46; box-shadow: 0 0 0 3px rgba(5, 150, 105, .12); }
.radio-group label.opt-c1:has(input:checked) { border-color: var(--color-secondary); background: #E0F2FE; color: #075985; box-shadow: 0 0 0 3px rgba(3, 105, 161, .12); }
.radio-group label.opt-c2:has(input:checked) { border-color: var(--color-warning); background: #FEF3C7; color: #92400E; box-shadow: 0 0 0 3px rgba(180, 83, 9, .12); }
.radio-group label.opt-c3:has(input:checked) { border-color: #7C3AED; background: #EDE9FE; color: #5B21B6; box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.radio-group label.opt-c4:has(input:checked) { border-color: var(--color-destructive); background: #FEE2E2; color: #991B1B; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.radio-group label.opt-c5:has(input:checked) { border-color: #0D9488; background: #CCFBF1; color: #115E59; box-shadow: 0 0 0 3px rgba(13, 148, 136, .12); }

.peer-submit-bar {
  position: sticky; bottom: 0; z-index: 25;
  background: linear-gradient(180deg, transparent, var(--color-background) 28%);
  padding: 18px 0 8px; margin-top: 8px;
}

/* ===== 互评模板配置（管理端） ===== */
.peer-preset-label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #334155;
}
.peer-preset-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px;
}
.peer-preset-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: left; padding: 12px 14px; min-height: 64px;
  border: 1px solid var(--color-border); border-radius: 12px;
  background: #fff; cursor: pointer; width: 100%;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.peer-preset-card:hover { border-color: #B8C9DC; background: #F8FBFF; }
.peer-preset-card.is-active {
  border-color: var(--color-secondary); background: #F0F9FF;
  box-shadow: 0 0 0 3px rgba(3, 105, 161, .12);
}
.peer-preset-name { font-size: 13px; font-weight: 700; color: var(--color-primary); line-height: 1.4; }
.peer-preset-opts { font-size: 12px; color: var(--text-secondary); }

.peer-opt-list { display: flex; flex-direction: column; gap: 10px; }
.peer-opt-card {
  border: 1px solid var(--color-border); border-radius: 12px; background: #F8FAFC;
  padding: 12px 14px 6px; box-shadow: var(--shadow-inset);
}
.peer-opt-card-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.peer-opt-idx {
  width: 24px; height: 24px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: #fff;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.peer-opt-card-kicker {
  font-size: 12px; font-weight: 600; color: var(--text-secondary); flex: 1;
}
.peer-opt-card .peer-opt-del {
  min-height: 36px; padding: 6px 10px; gap: 4px;
}
.peer-opt-card .peer-opt-del svg { width: 15px; height: 15px; }
.peer-opt-fields {
  display: grid; grid-template-columns: 1.2fr .8fr .8fr .8fr; gap: 10px 12px;
}
.peer-opt-fields .form-group { margin-bottom: 10px; }
.peer-opt-fields .form-group label { font-size: 12px; margin-bottom: 4px; }
.peer-opt-note {
  display: flex; gap: 8px; align-items: flex-start;
  background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 10px;
  padding: 10px 12px; font-size: 12px; color: #1D4ED8; line-height: 1.6; margin-top: 12px;
}
.peer-opt-note .note-icon {
  width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; color: inherit;
}
.peer-opt-note .note-icon svg {
  width: 16px; height: 16px; max-width: 16px; display: block;
}

.peer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.peer-col .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.peer-col-opts { display: flex; flex-wrap: wrap; gap: 4px; }
.peer-col-muted { font-size: 12px; color: var(--text-secondary); }
.peer-mini-chip {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.4;
  border: 1px solid transparent;
}
.peer-mini-chip.opt-c0 { background: #D1FAE5; color: #065F46; }
.peer-mini-chip.opt-c1 { background: #E0F2FE; color: #075985; }
.peer-mini-chip.opt-c2 { background: #FEF3C7; color: #92400E; }
.peer-mini-chip.opt-c3 { background: #EDE9FE; color: #5B21B6; }
.peer-mini-chip.opt-c4 { background: #FEE2E2; color: #991B1B; }
.peer-mini-chip.opt-c5 { background: #CCFBF1; color: #115E59; }

/* ===== 打分 ===== */
.score-stage { display: flex; flex-direction: column; align-items: center; padding: 30px 0; }
.score-options { display: flex; gap: 14px; margin: 22px 0; flex-wrap: wrap; justify-content: center; }
.score-btn {
  width: 120px; height: 96px; border-radius: var(--radius); border: 2px solid var(--color-border);
  background: #fff; font-size: 24px; font-weight: 700; color: var(--color-foreground);
  transition: all .2s var(--ease); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; cursor: pointer;
}
.score-btn small { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.score-btn:hover:not(:disabled) {
  border-color: var(--color-secondary); transform: translateY(-3px); box-shadow: var(--shadow);
}
.score-btn:disabled { opacity: .35; cursor: not-allowed; }
.score-btn.checked {
  border-color: var(--color-secondary); background: #E0F2FE; color: var(--color-secondary);
}
.defense-score-95 { border-color: var(--color-accent); color: var(--color-accent); }
.defense-score-95.checked { background: #D1FAE5; }
.defense-score-90 { border-color: var(--color-secondary); color: var(--color-secondary); }
.defense-score-90.checked { background: #E0F2FE; }
.defense-score-85 { border-color: var(--color-warning); color: var(--color-warning); }
.defense-score-85.checked { background: #FEF3C7; }

.progress-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.progress-top .pbar { flex: 1; }
.pbar { height: 8px; background: var(--color-muted); border-radius: 4px; overflow: hidden; }
.pbar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
  border-radius: 4px; transition: width .4s var(--ease);
}

.timer-ring {
  width: 56px; height: 56px; border-radius: 50%; border: 4px solid var(--color-border);
  border-top-color: var(--color-secondary); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; margin-bottom: 14px; animation: spin 1.2s linear infinite;
}
.timer-ring.done { animation: none; border-color: var(--color-success); color: var(--color-success); }
@keyframes spin { to { transform: rotate(360deg); } }

.pdf-frame {
  width: 100%; height: 62dvh; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: #fff;
}

/* ===== 报告打分：整页锁定 + PDF 单页适配 + 底部直接打分 ===== */
body.no-page-scroll,
body.grading-mode,
body.defense-grade-mode {
  overflow: hidden !important;
  height: 100dvh;
  max-height: 100dvh;
  overscroll-behavior: none;
  touch-action: manipulation;
}
body.no-page-scroll .main,
body.grading-mode .main,
body.defense-grade-mode .main {
  height: 100dvh; max-height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
}
body.no-page-scroll .content,
body.grading-mode .content,
body.defense-grade-mode .content {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  max-width: none; width: 100%;
  animation: none;
}
body.no-page-scroll .topbar,
body.grading-mode .topbar,
body.defense-grade-mode .topbar,
body.defense-grade-mode .act-as-banner { flex-shrink: 0; }
body.defense-grade-mode .app { height: 100dvh; max-height: 100dvh; overflow: hidden; }
body.grading-mode .content > .alert {
  flex-shrink: 0; margin-bottom: 8px; padding: 8px 12px; font-size: 13px;
}

.grading-report-page {
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
}
.grading-immersive { gap: 8px; }
.grading-toolbar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.grading-toolbar-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.grading-toolbar-sub {
  font-size: 12px; color: var(--text-secondary);
  display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center;
  line-height: 1.35; min-width: 0;
}
.grading-toolbar-sub b { color: var(--color-primary); font-variant-numeric: tabular-nums; }
.grading-toolbar-sub .sep { opacity: .45; }
.grading-toolbar-progress { width: 100%; max-width: 240px; }
.grading-toolbar-actions {
  display: flex; gap: 6px; flex-shrink: 0; align-items: center;
}
.grading-toolbar-actions .btn { min-height: 36px; padding: 6px 10px; }

.grading-pdf-stage {
  flex: 1; min-height: 0; position: relative;
  background: #D7E0EA; border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.grading-pdf-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 14px; background: #F8FAFC; z-index: 3;
}
.grading-pdf-scroll {
  flex: 1; min-height: 0; width: 100%;
  overflow: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 8px 8px 52px;
  box-sizing: border-box;
}
.pdf-fit-canvas {
  display: block;
  width: auto; height: auto;
  max-width: none; max-height: none;
  background: #fff;
  box-shadow: 0 2px 16px rgba(15, 39, 68, .18);
  border-radius: 2px;
}
.pdf-blob-frame {
  flex: 1; width: 100%; height: 100%; min-height: 0;
  border: none; background: #fff;
}
.pdf-fallback {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 20px; color: var(--text-secondary); text-align: center;
  font-size: 14px;
}
.grading-page-nav {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  z-index: 2;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 12px; font-weight: 600; color: var(--color-primary);
  white-space: nowrap;
  max-width: calc(100% - 16px);
}
.grading-page-nav .nav-divider {
  width: 1px; height: 16px; background: var(--color-border); margin: 0 2px;
}
.grading-page-nav .btn { min-height: 32px; min-width: 32px; padding: 4px 10px; font-size: 12px; }
.grading-page-nav .btn:disabled { opacity: .4; }

/* 底部打分条：尽量紧凑，把空间留给报告 */
.grading-scorebar {
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.grading-scorebar-status {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary); text-align: center;
  line-height: 1.4; flex-wrap: nowrap; white-space: nowrap;
}
.grading-scorebar-status #timerHint { min-width: 0; }
.timer-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 24px; padding: 0 8px;
  border-radius: 999px; font-weight: 700; font-size: 12px;
  background: #E0F2FE; color: #075985;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; flex-shrink: 0; gap: 0;
}
.timer-pill.done { background: #D1FAE5; color: #065F46; }
.grading-scorebar-btns {
  display: flex; gap: 8px; width: 100%; margin: 0; flex-wrap: nowrap;
}
.grading-scorebar-btns .score-btn {
  flex: 1 1 0; width: auto; min-width: 4.8em; height: 48px; margin: 0;
  font-size: 18px; line-height: 1; flex-direction: row; align-items: center; justify-content: center;
  gap: 0; white-space: nowrap; word-break: keep-all; overflow-wrap: normal;
}
.grading-scorebar-btns .score-btn small {
  font-size: 13px; line-height: 1; color: inherit; opacity: .72;
}

/* 历史悬浮窗 */
.grading-float {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.grading-float[hidden] { display: none !important; }
.grading-float-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  animation: fadeIn .2s ease;
}
.grading-float-panel {
  position: relative; z-index: 1;
  width: min(440px, 100%);
  max-height: min(80dvh, 640px);
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: gradingSheetIn .28s var(--ease);
  padding-bottom: var(--safe-bottom);
  overflow: hidden;
}
.grading-float-panel-lg { width: min(560px, 100%); }
@keyframes gradingSheetIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.grading-float-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px 10px;
  border-bottom: 1px solid var(--color-muted);
  flex-shrink: 0;
}
.grading-float-title {
  font-weight: 700; font-size: 16px;
  font-family: var(--font-display); color: var(--color-primary);
}
.grading-float-body {
  padding: 14px 16px 18px;
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center;
  min-height: 0;
}
.answer-sheet-float {
  width: 100%; margin-top: 0; padding-top: 0; border-top: none;
}
.answer-sheet-float .sheet-grid {
  max-height: min(48dvh, 380px);
}
body.grading-float-open { overflow: hidden; }

@media (min-width: 901px) {
  .grading-float {
    align-items: center; padding: 24px;
  }
  .grading-float-panel {
    border-radius: 16px;
    padding-bottom: 0;
    max-height: min(82dvh, 640px);
  }
  .grading-scorebar {
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: 6px 12px;
    gap: 12px;
  }
  .grading-scorebar-status { justify-content: flex-start; flex: 1; margin: 0; }
  .grading-scorebar-btns { width: auto; min-width: 260px; max-width: 320px; }
  .grading-scorebar-btns .score-btn { height: 48px; font-size: 20px; }
}

/* 打分页：压缩顶栏，减少手机端拥挤 */
body.grading-mode .topbar-title { font-size: 14px; }
body.grading-mode .user-chip { display: none; }
@media (max-width: 860px) {
  body.grading-mode .topbar-right .btn-sm { padding: 6px 8px; font-size: 12px; }
  body.grading-mode .mobile-user-label { display: none !important; }
  body.grading-mode .content {
    padding: 6px 8px calc(6px + var(--safe-bottom));
  }
  .grading-scorebar-btns .score-btn { height: 58px; font-size: 20px; flex-direction: row; white-space: nowrap; }
  .grading-toolbar { padding: 6px 8px; border-radius: 10px; }
  .grading-scorebar { border-radius: 12px; padding: 8px; }
}

/* ===== 答题卡（历史分数） ===== */
.answer-sheet {
  width: 100%; margin-top: 22px; padding-top: 18px;
  border-top: 1px dashed var(--color-border);
}
.answer-sheet .sheet-title {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.answer-sheet .sheet-legend { font-size: 12px; color: var(--text-secondary); display: flex; gap: 10px; flex-wrap: wrap; }
.answer-sheet .sheet-legend .lg { display: inline-flex; align-items: center; gap: 4px; }
.answer-sheet .sheet-legend .dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sheet-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px; max-height: min(32dvh, 240px); overflow-y: auto;
  padding: 4px 2px; overscroll-behavior: contain;
}
.sheet-cell {
  aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700;
  background: var(--color-muted); color: var(--text-secondary);
  border: 1px solid var(--color-border);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
  position: relative;
}
.sheet-cell:hover { transform: scale(1.06); box-shadow: var(--shadow); }
.sheet-cell .sheet-no { font-size: 9px; font-weight: 500; position: absolute; top: 2px; left: 4px; color: rgba(100,116,139,.7); }
.sheet-cell.scored-100 { background: #DCFCE7; color: #166534; border-color: #86EFAC; }
.sheet-cell.scored-90 { background: #FEF9C3; color: #854D0E; border-color: #FDE047; }
.sheet-cell.current { outline: 3px solid var(--color-secondary); outline-offset: 2px; }
@media (max-width: 1024px) {
  .sheet-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
}
.pdf-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 62dvh; border: 1px dashed var(--color-border); border-radius: var(--radius-sm);
  color: var(--text-secondary); gap: 10px;
}

/* ===== 成员列表/顺序 ===== */
.order-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--color-border); border-radius: 10px; margin-bottom: 8px;
  background: #fff; transition: border-color .2s, box-shadow .2s;
}
@media (hover: hover) and (pointer: fine) {
  .order-row:hover { border-color: #B8C9DC; box-shadow: var(--shadow); }
}
.order-row .order-no {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(145deg, #0369A1, #1E3A5F);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.order-row .o-name { font-weight: 600; }
.order-row .o-info { color: var(--text-secondary); font-size: 13px; flex: 1; }
.order-row .o-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }

.defense-slot { margin-top: 16px; }
.defense-slot:first-of-type { margin-top: 4px; }
.defense-slot-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.defense-slot-head h3 {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: var(--color-primary); margin: 0 0 2px; line-height: 1.3;
}
.defense-slot-head p { margin: 0; font-size: 12px; color: var(--text-secondary); }
.defense-slot-list { display: flex; flex-direction: column; gap: 8px; }
.defense-slot-empty {
  padding: 14px 12px; font-size: 13px; color: var(--text-secondary);
  border: 1px dashed var(--color-border); border-radius: 10px; background: #F8FAFC;
}
.defense-slot.slot-priority .order-row { border-color: #FDE68A; background: #FFFBEB; }
.defense-slot.slot-priority .order-no { background: linear-gradient(145deg, #D97706, #92400E); }
.defense-slot.slot-defer .order-row { border-color: #E2E8F0; background: #F8FAFC; }
.defense-slot.slot-defer .order-no { background: linear-gradient(145deg, #64748B, #334155); }
.slot-switch {
  display: inline-flex; border: 1px solid var(--color-border); border-radius: 8px;
  overflow: hidden; background: #fff;
}
.slot-btn {
  border: none; background: transparent; color: var(--text-secondary);
  font-size: 12px; font-weight: 600; padding: 6px 10px; min-height: 32px;
  cursor: pointer; font-family: inherit;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.slot-btn + .slot-btn { border-left: 1px solid var(--color-border); }
.slot-btn:hover { background: var(--color-muted); color: var(--color-foreground); }
.slot-btn.is-on { background: var(--color-primary); color: #fff; }
.slot-priority .slot-btn.is-on { background: #B45309; }
.slot-defer .slot-btn.is-on { background: #475569; }

/* ===== 搜索选择器 ===== */
.search-box { display: flex; gap: 8px; margin-bottom: 12px; }
.search-results {
  max-height: 280px; overflow-y: auto; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: #fff;
}
.search-results .sr-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--color-muted); cursor: pointer;
  min-height: 44px; transition: background .15s;
}
.search-results .sr-item:hover { background: #E0F2FE; }
.search-results .sr-item:last-child { border-bottom: none; }

/* ===== 空态 & 分页 ===== */
.empty { text-align: center; padding: 56px 20px; color: var(--text-secondary); }
.empty svg { width: 44px; height: 44px; color: #94A3B8; margin-bottom: 10px; }
.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 12px; border: 1px solid var(--color-border);
  border-radius: 8px; font-size: 13px; background: #fff; min-width: 36px; text-align: center;
  transition: background .15s, border-color .15s;
}
.pagination a:hover { background: var(--color-muted); text-decoration: none; }
.pagination .current {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}

/* ===== 催促消息 ===== */
.urge-box { width: 100%; min-height: 220px; font-family: "SF Mono", Consolas, monospace; font-size: 13px; }

/* ===== 登录页（分栏品牌） ===== */
.login-page {
  min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--color-background); position: relative;
}
.login-brand-pane {
  position: relative; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 52px;
  background:
    radial-gradient(ellipse 90% 70% at 10% 0%, rgba(56, 189, 248, .22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(3, 105, 161, .35), transparent 50%),
    linear-gradient(155deg, #0B1C30 0%, #143356 45%, #0F2744 100%);
}
.login-brand-pane::before {
  content: ""; position: absolute; inset: 0; opacity: .28; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
}
.login-brand-pane > * { position: relative; z-index: 1; }
.login-brand-mark {
  display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px;
}
.login-brand-mark .logo {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; display: block; background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.login-brand-hero {
  margin: 48px 0 auto;
  animation: contentIn .5s var(--ease);
}
.login-brand-hero .uni {
  font-family: var(--font-display); font-size: clamp(32px, 4vw, 44px);
  font-weight: 700; line-height: 1.25; letter-spacing: .02em; margin-bottom: 14px;
}
.login-brand-hero .product {
  font-size: 18px; opacity: .92; margin-bottom: 18px; font-weight: 500;
}
.login-brand-hero .tagline {
  font-size: 14px; line-height: 1.75; opacity: .72; max-width: 36ch;
}
.login-brand-feats {
  display: grid; gap: 10px; margin-top: 28px; max-width: 360px;
}
.login-brand-feats li {
  list-style: none; display: flex; align-items: center; gap: 10px;
  font-size: 13px; opacity: .85;
}
.login-brand-feats li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #38BDF8; box-shadow: 0 0 0 3px rgba(56, 189, 248, .25); flex-shrink: 0;
}
.login-brand-foot { font-size: 12px; opacity: .55; }

.login-form-pane {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
  background:
    radial-gradient(800px 400px at 80% 0%, rgba(3, 105, 161, .06), transparent 50%),
    #F8FAFC;
}
.login-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 20px;
  box-shadow: var(--shadow-md); padding: 36px 34px;
  border: 1px solid var(--color-border);
  animation: contentIn .4s var(--ease) .05s both;
}
.login-card .login-logo { display: none; }
.login-brand {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700; margin-bottom: 6px; color: var(--color-primary);
  text-align: left;
}
.login-sub {
  text-align: left; color: var(--text-secondary); font-size: 14px; margin-bottom: 26px;
}
.login-tip {
  margin-top: 22px; font-size: 12px; color: var(--text-secondary);
  background: linear-gradient(180deg, #F8FAFC, var(--color-muted));
  border-radius: 12px; padding: 12px 14px; line-height: 1.85;
  border: 1px solid var(--color-border);
}
.login-tip strong { color: var(--color-primary); font-weight: 600; }

/* ===== 响应式：Pad（≤1024） / 手机（≤640） ===== */

/* —— Pad / 小桌面：侧栏收起为抽屉 —— */
@media (max-width: 1024px) {
  .main { margin-left: 0; }
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    width: min(var(--sidebar-w), calc(100vw - 48px));
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
  }
  .sidebar.open { transform: none; }
  .hamburger { display: inline-flex; flex-shrink: 0; }
  .content {
    padding: 18px 18px calc(48px + var(--safe-bottom));
    max-width: none;
  }
  .topbar {
    padding: 0 16px;
    padding-left: calc(16px + var(--safe-left));
    padding-right: calc(16px + var(--safe-right));
    height: calc(var(--topbar-h) + var(--safe-top));
    padding-top: var(--safe-top);
  }
  .page-title { font-size: 24px; }
  .page-hero { padding: 18px 20px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .board-grid.cols-3,
  .board-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-grid { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: 1fr 1fr; }
  .flow-step { min-height: 0; }
  .form-section { padding: 18px 18px; }
  .card { padding: 18px; }
  .modal { max-height: calc(94dvh - var(--safe-top) - var(--safe-bottom)); }
  .modal-backdrop { padding: max(16px, var(--safe-top)) 16px max(16px, var(--safe-bottom)); }
  .act-as-banner { padding: 10px 16px; }
  .peer-counter.sticky { top: calc(var(--topbar-h) + var(--safe-top) + 4px); }
  .toast-wrap {
    top: calc(12px + var(--safe-top));
    right: calc(12px + var(--safe-right));
    left: auto;
  }
  .role-switch .menu {
    position: fixed;
    left: max(12px, var(--safe-left));
    right: max(12px, var(--safe-right));
    top: calc(var(--topbar-h) + var(--safe-top) + 8px);
    width: auto;
    max-width: none;
    max-height: calc(100dvh - var(--topbar-h) - var(--safe-top) - 20px);
    overflow-y: auto;
  }
}

/* —— 登录：Pad 起改为单栏 —— */
@media (max-width: 960px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand-pane {
    padding: 28px 24px max(28px, var(--safe-bottom));
    padding-top: calc(28px + var(--safe-top));
    min-height: auto;
  }
  .login-brand-hero { margin: 28px 0 20px; }
  .login-brand-hero .uni { font-size: clamp(24px, 6vw, 30px); }
  .login-brand-feats { display: none; }
  .login-brand-foot { display: none; }
  .login-form-pane {
    padding: 24px 16px calc(40px + var(--safe-bottom));
    padding-left: max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
  }
  .login-card { padding: 28px 22px; box-shadow: var(--shadow-lg); max-width: 440px; }
  .login-card .login-logo { display: block; margin: 0 auto 14px; }
  .login-brand, .login-sub { text-align: center; }
}

/* —— 窄 Pad / 大手机横屏：流程改为单列 —— */
@media (max-width: 860px) {
  .flow-steps { grid-template-columns: 1fr; }
  .user-chip { display: none; }
  .topbar-title {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 14px;
  }
  .topbar-right { gap: 6px; }
  .topbar-right .btn-sm {
    padding: 6px 10px; min-height: 36px; font-size: 12px;
  }
  .role-switch-label { display: none; }
  .role-switch summary {
    padding: 6px 8px; min-height: 36px; font-size: 12px; width: 36px; justify-content: center;
  }
  .mobile-user-label { display: none !important; }
  .peer-row {
    flex-wrap: wrap; align-items: flex-start; gap: 10px 12px;
    padding: 14px 12px;
  }
  .peer-meta { flex: 1 1 auto; }
  .radio-group {
    width: 100%; margin-left: 0; justify-content: stretch;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
  }
  .radio-group label {
    justify-content: center; min-height: 44px; padding: 10px 8px;
  }
  .score-options { gap: 10px; width: 100%; }
  .score-btn { width: calc(33.333% - 8px); min-width: 0; flex: 1 1 0; height: 88px; }
  body.defense-grade-mode .defense-score-options .score-btn {
    flex: 0 0 auto; width: auto; min-width: 4.6em; max-width: none; height: 44px;
  }
  .info-list .k { width: 96px; }
  .form-grid { grid-template-columns: 1fr; }
  .peer-opt-fields { grid-template-columns: 1fr 1fr; }
  .peer-preset-grid { grid-template-columns: 1fr 1fr; }
  .form-inline .input { min-width: 0; width: 100%; }
  .toolbar { gap: 8px; }
  .dropzone { padding: 28px 14px; }
  .dropzone .dz-title { font-size: 14px; line-height: 1.5; }
  .check-grid { grid-template-columns: 1fr 1fr; }
  .order-row { flex-wrap: wrap; }
  .order-row .o-info { flex: 1 1 140px; min-width: 0; }
  .order-row .o-actions { width: 100%; justify-content: flex-start; }
  .defense-slot-head { flex-wrap: wrap; }
  .search-box { flex-wrap: wrap; }
  .search-box .input { flex: 1 1 160px; min-width: 0; }
  .dialog-footer { flex-wrap: wrap; }
  .dialog-footer .btn { flex: 1 1 auto; min-width: 110px; }
  .export-item-grid .btn { flex: 1 1 140px; }
  .grade-bar .input { max-width: none; width: 100%; }
  .grade-bar { align-items: stretch; }
  .page-hero-actions { width: 100%; }
  .page-hero-actions .btn { flex: 1 1 auto; }
}

/* —— 手机（≤640） —— */
@media (max-width: 640px) {
  :root { --topbar-h: 56px; }

  .content {
    padding: 14px 12px calc(72px + var(--safe-bottom));
  }
  body.no-page-scroll .content,
  body.grading-mode .content,
  body.defense-grade-mode .content {
    padding: 8px 10px calc(10px + var(--safe-bottom));
  }
  .page-title { font-size: clamp(20px, 5.5vw, 22px); }
  .page-sub { font-size: 13px; margin-bottom: 16px; }
  .page-hero {
    padding: 14px; border-radius: 14px; margin-bottom: 16px; gap: 12px;
  }
  .page-hero .page-sub { max-width: none; }
  .ratio-chip {
    border-radius: 12px; width: 100%;
    justify-content: flex-start;
  }
  .board-grid.cols-3,
  .board-grid.cols-4 { grid-template-columns: 1fr; gap: 10px; }
  .share-grid { grid-template-columns: 1fr; gap: 12px; }
  .share-meta { text-align: left; }
  .board-card { min-height: 0; padding: 14px 16px; }
  .board-kpi { font-size: 22px; }
  .board-meta { white-space: normal; overflow-wrap: anywhere; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .value { font-size: 22px; }
  .stat-card .meta { white-space: normal; }
  .card { padding: 14px; margin-bottom: 14px; border-radius: 12px; }
  .form-section { padding: 14px; border-radius: 12px; }
  .form-section-head { gap: 10px; margin-bottom: 14px; }
  .panel-head { padding: 12px 14px; }
  .info-list .k {
    width: 30%; min-width: 72px; max-width: 110px;
    font-size: 13px; padding-right: 8px;
  }
  .info-list .v { font-size: 14px; word-break: break-word; }
  .table-wrap > table.table { min-width: 480px; font-size: 13px; }
  table.table th, table.table td { padding: 10px 10px; }
  .check-grid { grid-template-columns: 1fr; }
  .score-btn { width: 100%; min-width: 0; height: 72px; font-size: 20px; }
  .score-options { flex-direction: column; }
  .score-options.defense-score-options {
    flex-direction: row; flex-wrap: nowrap; gap: 10px; width: auto; margin: 8px auto;
  }
  body.defense-grade-mode .defense-score-options .score-btn {
    width: auto; min-width: 4.6em; max-width: none; flex: 0 0 auto; height: 42px;
    padding: 0 14px; font-size: 17px; flex-direction: row; white-space: nowrap;
  }
  .grading-scorebar-btns.score-options {
    flex-direction: row; flex-wrap: nowrap; margin: 0;
  }
  .grading-scorebar-btns .score-btn {
    width: auto; flex: 1 1 0; min-width: 4.8em; height: 46px; font-size: 17px;
    flex-direction: row; white-space: nowrap; gap: 0;
    word-break: keep-all; overflow-wrap: normal;
  }
  .toast-wrap {
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
    top: calc(10px + var(--safe-top));
  }
  .toast {
    min-width: 0; max-width: none; width: 100%;
  }
  .modal { border-radius: 16px 16px 12px 12px; max-width: none; }
  .modal-lg { max-width: none; }
  .modal-header, .modal-body, .modal-footer { padding-left: 16px; padding-right: 16px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 120px; min-height: 44px; }
  .dialog { max-width: none; }
  .dialog-body { padding: 18px 16px 6px; }
  .peer-submit-bar {
    padding: 14px 0 calc(8px + var(--safe-bottom));
    margin-left: -12px; margin-right: -12px;
    padding-left: 12px; padding-right: 12px;
    background: linear-gradient(180deg, transparent, rgba(241, 245, 249, .95) 20%, var(--color-background));
  }
  .peer-counter.sticky { top: calc(var(--topbar-h) + var(--safe-top) + 4px); }
  .peer-counter .chip { font-size: 12px; padding: 6px 10px; min-height: 32px; }
  .peer-opt-fields { grid-template-columns: 1fr 1fr; }
  .peer-opt-fields .input { min-height: 44px; }
  .peer-preset-grid { grid-template-columns: 1fr; }
  .peer-rules { padding: 14px; }
  .peer-rule-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 24px 18px; border-radius: 16px; }
  .login-brand { font-size: 22px; }
  .login-brand-pane { padding-left: max(18px, var(--safe-left)); padding-right: max(18px, var(--safe-right)); }
  .btn-block { min-height: 48px; }
  .pagination a, .pagination span { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .action-row .btn { flex: 1 1 auto; }
  .status-hero { padding: 14px; gap: 12px; }
  .status-hero .icon { width: 42px; height: 42px; }
  .urge-box { min-height: 160px; font-size: 12px; }
  .badge {
    white-space: normal; text-align: center;
  }
  .role-badge {
    max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .flow-step .step-head {
    flex-wrap: wrap; align-items: flex-start;
  }
  .flow-step .step-title { overflow-wrap: anywhere; }
  .order-row { align-items: flex-start; }
  .order-row .o-name,
  .order-row .o-info {
    min-width: 0; overflow-wrap: anywhere;
  }
  .order-row .badge {
    flex-shrink: 1; max-width: 100%;
  }
  .board-label,
  .board-status,
  .board-status-sm {
    overflow-wrap: anywhere; word-break: break-word;
  }
  .page-hero .page-title,
  .page-hero .page-sub {
    overflow-wrap: anywhere;
  }
  .act-as-banner {
    font-size: 12px; line-height: 1.5;
  }
  .topbar-right { max-width: none; }
  .topbar-right .btn-sm { white-space: nowrap; }
  .btn-label-full { display: none; }
  .btn-label-short { display: inline !important; }
  .btn { max-width: 100%; }
  .card-title { overflow-wrap: anywhere; }
  .grading-float .score-options {
    flex-direction: row; width: 100%; gap: 10px;
  }
  .grading-float .score-btn {
    width: auto; flex: 1; min-width: 0; height: 84px;
  }
  .pdf-frame, .pdf-empty { height: 50dvh; }
  .create-split { gap: 12px; }
  .export-secondary-summary { padding: 14px 16px; flex-wrap: wrap; }
  .export-secondary-body { padding: 14px 16px 16px; }

  /* 防止 iOS 聚焦输入框时整页缩放 */
  input, select, textarea, .input { font-size: 16px; }

  /* 工具栏：筛选项铺满，按钮可点满宽 */
  .toolbar {
    flex-direction: column; align-items: stretch; gap: 10px;
  }
  .toolbar form {
    width: 100%; display: flex; flex-wrap: wrap; gap: 8px;
  }
  .toolbar .input,
  .toolbar form .input,
  .toolbar .select-wrap,
  .toolbar form .select-wrap {
    max-width: none !important; width: 100%; min-width: 0; flex: 1 1 100%;
  }
  .toolbar > .btn { width: 100%; justify-content: center; }

  select.input {
    min-height: 48px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    padding-right: 44px;
    background-position: right 14px center;
    background-size: 18px 18px;
  }
  .select-wrap { width: 100%; max-width: none; }
  .form-group .select-wrap { width: 100%; }

  .grade-bar {
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 12px 14px 14px;
  }
  .grade-bar .label {
    margin-left: 0 !important;
    font-size: 12px; letter-spacing: .02em;
  }
  .grade-bar .select-wrap { flex: 1 1 auto; width: 100%; }
  .grade-bar-meta { margin-left: 0; }

  .name-fold, .name-fold[open] { max-width: 100%; }
  .table-wrap.stack-mobile td:has(.name-fold) {
    flex-wrap: wrap; align-items: flex-start;
  }
  .table-wrap.stack-mobile td:has(.name-fold)::before {
    width: 100%; max-width: none; padding-top: 4px;
  }
  .table-wrap.stack-mobile .name-fold { width: 100%; flex: 1 1 100%; }

  .grade-major-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  }
  .grade-major-head { flex-wrap: wrap; }
  .rank-combo { width: 100%; }
  .rank-combo .input { flex: 1 1 auto; width: auto; }

  /* 弹层改为底部抽屉，更符合手机操作 */
  .modal-backdrop {
    align-items: flex-end; padding: 0;
  }
  .modal {
    max-width: none;
    border-radius: 18px 18px 0 0;
    max-height: min(92dvh, calc(100dvh - var(--safe-top)));
    animation: sheetIn .28s var(--ease);
  }
  .modal-footer {
    padding-bottom: calc(14px + var(--safe-bottom));
  }
  .dialog-backdrop {
    align-items: flex-end; padding: 0;
  }
  .dialog {
    max-width: none;
    border-radius: 18px 18px 0 0;
    padding-bottom: var(--safe-bottom);
  }
  .dialog-footer .btn { min-height: 44px; }

  .toast-wrap {
    top: auto;
    bottom: calc(14px + var(--safe-bottom));
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
  }
  .toast {
    animation: toastUp .25s var(--ease);
  }

  /* 表格操作按钮保持同一行，避免被撑成两行 */
  table.table .table-actions,
  table.table .action-row {
    margin-top: 0; flex-wrap: nowrap; gap: 6px;
  }
  table.table .table-actions .btn,
  table.table .action-row .btn {
    flex: 0 0 auto; width: auto;
  }

  .account-cell { align-items: flex-start; }
  .account-cell .btn { min-height: 36px; }

  .status-hero { align-items: flex-start; }
  .alert { font-size: 13px; line-height: 1.55; }

  /* 有 data-label 的表格：手机端改为卡片，不再左右滑动 */
  .table-wrap.stack-mobile {
    border: none; background: transparent; overflow: visible;
    box-shadow: none;
  }
  .table-wrap.stack-mobile > table.table {
    min-width: 0; background: transparent;
  }
  .table-wrap.stack-mobile thead { display: none; }
  .table-wrap.stack-mobile tbody { display: block; }
  .table-wrap.stack-mobile tr {
    display: block;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 4px 14px 8px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
  }
  .table-wrap.stack-mobile tbody tr:hover { background: #fff; }
  .table-wrap.stack-mobile td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--color-muted);
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .table-wrap.stack-mobile td:last-child { border-bottom: none; }
  .table-wrap.stack-mobile td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    flex: 0 0 auto;
    max-width: 42%;
  }
  .table-wrap.stack-mobile td.empty,
  .table-wrap.stack-mobile td[colspan] {
    display: block; text-align: center; border: none; padding: 18px 8px;
  }
  .table-wrap.stack-mobile td.empty::before,
  .table-wrap.stack-mobile td[colspan]::before { content: none; }
  .table-wrap.stack-mobile td[data-label="操作"] {
    justify-content: flex-start; flex-wrap: wrap;
  }
  .table-wrap.stack-mobile td[data-label="操作"]::before {
    width: 100%; max-width: none; margin-bottom: 2px;
  }
  .table-wrap.stack-mobile td[data-label="账号"] {
    align-items: flex-start; flex-wrap: wrap;
  }
  .table-wrap.stack-mobile .account-cell {
    justify-content: flex-end; width: auto; flex: 1;
  }
  .table-wrap.stack-mobile .table-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* —— 超小屏（≤380） —— */
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
  .content { padding-left: 10px; padding-right: 10px; }
  .topbar-right .btn-sm:not(.btn-icon) {
    padding: 6px 8px; font-size: 11px;
  }
  .radio-group label { font-size: 12px; padding: 8px 6px; gap: 4px; }
  .peer-rule-grid { grid-template-columns: 1fr; }
}

/* —— 横屏手机：压缩顶栏与登录品牌区 —— */
@media (max-width: 900px) and (max-height: 480px) and (orientation: landscape) {
  .login-brand-pane { padding-top: 16px; padding-bottom: 16px; }
  .login-brand-hero { margin: 12px 0 8px; }
  .login-brand-hero .uni { font-size: 22px; }
  .login-brand-hero .tagline { display: none; }
  .login-form-pane { padding-top: 16px; padding-bottom: 16px; }
  .topbar { height: 48px; }
  :root { --topbar-h: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .content, .login-card, .login-brand-hero, .grading-float-panel { animation: none; }
}

/* 顶栏移动端用户名（默认隐藏，窄屏也不再显示以免挤爆顶栏） */
.mobile-user-label {
  display: none;
  align-items: center;
  font-size: 12px; font-weight: 600; color: var(--color-primary);
  max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-label-short { display: none; }

/* ===== 防止卡片/栅格撑出屏幕 ===== */
.page-hero, .form-section, .stat-card, .board-card, .grade-bar, .alert, .status-hero {
  max-width: 100%; min-width: 0;
}
.page-title, .page-sub { overflow-wrap: anywhere; word-break: break-word; }
.stat-card .label { overflow-wrap: anywhere; }
.progress-top { min-width: 0; }
.progress-top .progress-label,
.progress-top > div:first-child { flex-shrink: 0; font-weight: 600; white-space: nowrap; }

/* ===== 答辩打分页：整页锁定，压缩一屏完成 ===== */
.defense-grade-page {
  flex: 1; min-height: 0; max-width: 100%;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
}
.defense-grade-head { min-width: 0; flex-shrink: 0; }
.defense-grade-title {
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  color: var(--color-primary); overflow-wrap: anywhere; line-height: 1.25;
}
.defense-grade-sub {
  font-size: 12px; color: var(--text-secondary); margin: 2px 0 6px;
  overflow-wrap: anywhere; line-height: 1.4;
}
.defense-grade-page .progress-top { margin-bottom: 0; gap: 8px; }
.defense-grade-page .pbar { height: 6px; }
.defense-grade-body {
  flex: 1; min-height: 0; margin-bottom: 0;
  display: flex; flex-direction: column;
  justify-content: flex-start; align-items: stretch;
  overflow: hidden; padding: 12px 16px;
}
.defense-info-pane {
  flex: 1 1 auto; min-height: 0; width: 100%;
  max-width: 780px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 8px;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.defense-grade-dock {
  flex: 0 0 auto; flex-shrink: 0;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 4px 2px;
  background: transparent;
}
.defense-current { margin-bottom: 0; flex: 0 0 auto; padding: 8px 12px; }
.defense-current-meta { flex: 1; min-width: 0; }
.defense-profile {
  flex: 0 0 auto; overflow: visible;
  margin-top: 0; padding-top: 0; border-top: none;
  display: flex; flex-direction: column; gap: 8px;
}
.defense-profile-empty {
  flex-shrink: 0; margin-top: 8px; padding: 8px 10px; font-size: 13px; color: var(--text-secondary);
  background: #F8FAFC; border: 1px dashed var(--color-border); border-radius: 10px;
}
.defense-profile-kpis {
  display: flex; flex-wrap: nowrap; gap: 8px;
  margin-bottom: 0; flex: 0 0 auto;
  align-items: stretch; justify-content: flex-start;
  width: 100%;
}
.defense-kpi {
  flex: 0 0 auto; width: auto; min-width: 7.2em;
  background: #F8FAFC; border: 1px solid var(--color-border); border-radius: 10px;
  padding: 8px 12px;
}
.defense-profile-kpis .sc-agg {
  flex: 1 1 auto; min-width: 0;
}
.defense-kpi-sc { grid-column: 1 / -1; }
.defense-kpi-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.defense-kpi-head .defense-kpi-label { margin-bottom: 0; }
.defense-kpi-label {
  display: block; font-size: 11px; color: var(--text-secondary); font-weight: 600;
  margin-bottom: 2px;
}
.defense-kpi-value {
  display: block; font-size: 18px; font-weight: 700; color: var(--color-primary);
  font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.3;
}
.defense-sc-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0;
}
.defense-kpi-sc .defense-sc-chips { margin-bottom: 0; }
.defense-sc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  background: #E0F2FE; color: #075985; border: 1px solid #BAE6FD;
}
.defense-sc-chip b { font-variant-numeric: tabular-nums; }
.defense-summary-box {
  flex: 0 0 auto;
  display: flex; flex-direction: column;
  background: #F8FAFC; border: 1px solid var(--color-border); border-radius: 10px;
  padding: 8px 12px;
}
.defense-summary-label {
  font-size: 12px; font-weight: 700; color: var(--color-primary); margin-bottom: 4px;
  flex-shrink: 0;
}
.defense-summary-text {
  flex: 0 0 auto;
  font-size: 13px; line-height: 1.55; color: var(--color-foreground);
  white-space: pre-wrap; overflow-wrap: anywhere;
  overflow: visible;
}
.defense-summary-details summary {
  cursor: pointer; font-weight: 600; color: var(--color-secondary); font-size: 13px;
}
.defense-summary-details p {
  margin: 8px 0 0; font-size: 13px; line-height: 1.7; white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.defense-grade-dock .score-stage {
  flex: 0 0 auto; flex-shrink: 0;
  padding: 8px 0 0; align-items: center; width: 100%;
}
.defense-score-hint {
  margin: 0 0 6px; font-size: 12px; line-height: 1.45;
  color: var(--text-secondary); text-align: center; width: 100%;
}
body.defense-grade-mode .defense-score-options {
  display: flex; flex-wrap: nowrap; gap: 10px;
  width: auto; max-width: 100%;
  justify-content: center; margin: 4px auto 8px;
}
body.defense-grade-mode .defense-score-options .score-btn {
  display: inline-flex; flex: 0 0 auto; flex-direction: row;
  align-items: center; justify-content: center;
  width: auto; min-width: 4.6em; max-width: none;
  height: 44px; padding: 0 16px;
  font-size: 18px; line-height: 1; white-space: nowrap;
  word-break: keep-all;
}
.defense-nav {
  display: flex; align-items: center; gap: 10px; width: 100%;
  justify-content: space-between;
}
.defense-pos {
  font-size: 13px; color: var(--text-secondary); white-space: nowrap; flex-shrink: 0;
}
.defense-grade-foot {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  flex-shrink: 0;
}
.defense-grade-foot .btn { flex: 1 1 auto; justify-content: center; min-height: 40px; }
.defense-grade-page .sc-agg {
  flex: 1 1 auto; min-width: 0;
  padding: 8px 10px; gap: 6px; overflow: visible;
}
.defense-grade-page .sc-agg-caption { display: none; }
.defense-grade-page .sc-agg-head { align-items: center; }
.defense-grade-page .sc-agg-label { font-size: 12px; }
.defense-grade-page .sc-agg-total { font-size: 20px; }
.defense-grade-page .sc-agg-grid { gap: 6px; }
.defense-grade-page .sc-agg-k {
  font-size: 12px; white-space: nowrap; overflow: visible;
  letter-spacing: 0; line-height: 1.2;
}
.defense-grade-page .sc-agg-item { padding: 5px 6px 5px; overflow: visible; }
.defense-grade-page .sc-agg-v { font-size: 14px; margin: 1px 0 4px; }
.defense-grade-page .sc-agg-bar { height: 3px; }
.defense-grade-body.card:hover { transform: none; box-shadow: var(--shadow), var(--shadow-inset); }

@media (max-width: 860px) {
  .defense-grade-title { font-size: 16px; }
  .defense-grade-body { padding: 10px 12px; justify-content: flex-start; }
  .defense-profile-kpis { flex-wrap: wrap; }
  .defense-kpi { flex: 1 1 calc(50% - 4px); width: auto; min-width: 0; }
  .defense-profile-kpis .sc-agg { flex: 1 1 100%; }
  body.defense-grade-mode .defense-score-options .score-btn {
    flex: 0 0 auto; width: auto; min-width: 4.6em; max-width: none;
    height: 42px; padding: 0 14px; font-size: 17px;
    flex-direction: row; white-space: nowrap;
  }
  .defense-nav .btn { flex: 1; min-width: 0; padding: 8px 10px; }
  .hamburger { width: 40px; height: 40px; flex-shrink: 0; }
}

@media (max-width: 640px) {
  .table-wrap.stack-mobile tr { max-width: 100%; min-width: 0; }
  .table-wrap.stack-mobile td > * {
    min-width: 0; max-width: 100%; overflow-wrap: anywhere;
  }
  .form-section, .page-hero { overflow-x: clip; }
}
