/* ==========================================================================
   毕业生档案管理系统 — 设计系统
   适配 320px 手机 ~ 4K 大屏；所有尺寸用 clamp/rem 流式缩放
   ========================================================================== */

:root {
  --brand: #2f5bea;
  --brand-dark: #1e41b8;
  --brand-light: #eaf0ff;
  --brand-ring: rgba(47, 91, 234, .18);
  --accent: #12b886;
  --warn: #f59f0b;
  --danger: #e03131;
  --info: #1098ad;

  --text: #101828;
  --text-2: #475467;
  --text-3: #8a94a6;
  --line: #e7ebf3;
  --line-2: #f0f3f9;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #fafbfe;

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 16px;
  --radius-xl: 22px;

  --shadow-s: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-l: 0 18px 48px rgba(16, 24, 40, .12);

  --sidebar-w: 246px;
  --topbar-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3dae7; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9c3d6; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ 登录页 */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--surface);
}
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(155deg, #16205c 0%, #24379b 42%, #2f5bea 100%);
  color: #fff;
}
.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: .35;
}
.auth-brand::before {
  width: 460px; height: 460px; right: -160px; top: -140px;
  background: radial-gradient(circle at 30% 30%, #7c9bff, transparent 68%);
}
.auth-brand::after {
  width: 360px; height: 360px; left: -120px; bottom: -120px;
  background: radial-gradient(circle at 60% 40%, #12b886, transparent 70%);
  opacity: .25;
}
.auth-brand .logo-row { display: flex; align-items: center; gap: 12px; position: relative; }
.auth-brand .mark {
  width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.16);
  display: grid; place-items: center; backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.24);
}
.auth-brand h1 {
  font-size: clamp(26px, 3.1vw, 42px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.5px;
  margin-bottom: 16px;
  position: relative;
}
.auth-brand .lead {
  font-size: clamp(13px, 1.1vw, 15px);
  color: rgba(255,255,255,.78);
  max-width: 30em;
  position: relative;
}
.auth-features { display: grid; gap: 14px; margin-top: 36px; position: relative; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: rgba(255,255,255,.86); }
.auth-feature .dot {
  width: 22px; height: 22px; border-radius: 7px; background: rgba(255,255,255,.16);
  display: grid; place-items: center; flex: none; margin-top: 2px;
}
.auth-foot { font-size: 12px; color: rgba(255,255,255,.5); position: relative; }

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(24px, 5vw, 72px);
  background: var(--surface);
}
.auth-card { width: 100%; max-width: 396px; }
.auth-card .kicker { font-size: 12px; letter-spacing: .18em; color: var(--brand); font-weight: 700; }
.auth-card h2 { font-size: 26px; margin: 10px 0 6px; letter-spacing: -.4px; }
.auth-card .sub { color: var(--text-3); margin-bottom: 28px; font-size: 13.5px; }

/* ------------------------------------------------------------------ 表单控件 */
.field { margin-bottom: 16px; }
.field > label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  margin-bottom: 7px; letter-spacing: .01em;
}
.field .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .16s, box-shadow .16s, background .16s;
  outline: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.65; }
.input:hover, .select:hover, .textarea:hover { border-color: #cfd8ea; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring);
}
.input[readonly], .input:disabled, .select:disabled {
  background: var(--surface-2); color: var(--text-2); cursor: not-allowed;
}
.input.err, .select.err, .textarea.err { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(224,49,49,.12); }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.err-msg { font-size: 12px; color: var(--danger); margin-top: 6px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ------------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .12s, box-shadow .16s, background .16s, border-color .16s, opacity .16s;
  background: #fff; color: var(--text);
  border-color: var(--line);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, #3a68f0, var(--brand)); color: #fff;
  border-color: var(--brand-dark); box-shadow: 0 1px 2px rgba(30,65,184,.28), 0 6px 16px rgba(47,91,234,.22);
}
.btn-primary:hover { background: linear-gradient(180deg, #4b76f4, #2a52e0); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--text); }
.btn-danger { background: #fff; border-color: #ffd0d0; color: var(--danger); }
.btn-danger:hover { background: #fff5f5; }
.btn-success { background: var(--accent); border-color: #0ca678; color: #fff; }
.btn-success:hover { background: #0ca678; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ 骨架布局 */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--surface);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sidebar-head { height: var(--topbar-h); display: flex; align-items: center; gap: 11px; padding: 0 18px; border-bottom: 1px solid var(--line-2); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, #2f5bea, #1b3ba8); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 10px rgba(47,91,234,.28);
}
.brand-text { min-width: 0; }
.brand-text b { display: block; font-size: 13.5px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 11px; color: var(--text-3); letter-spacing: .08em; }

.nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.nav-group-title { font-size: 10.5px; letter-spacing: .14em; color: var(--text-3); font-weight: 700; padding: 14px 10px 7px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 11px;
  border-radius: 9px; color: var(--text-2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; position: relative; transition: background .14s, color .14s;
  margin-bottom: 2px; user-select: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 650; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10.5px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 700;
}
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line-2); }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px;
  cursor: pointer; transition: background .14s;
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(140deg, #e8eeff, #d5e0ff); color: var(--brand-dark);
  font-weight: 700; font-size: 13px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .meta { min-width: 0; }
.user-chip .meta b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta span { font-size: 11px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: none; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 0 clamp(14px, 2.2vw, 30px);
  background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16.5px; font-weight: 650; letter-spacing: -.2px; }
.topbar .crumb { font-size: 12px; color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; display: grid; place-items: center; cursor: pointer;
  color: var(--text-2); position: relative; transition: background .14s;
}
.icon-btn:hover { background: var(--line-2); color: var(--text); }
.icon-btn .dot-badge {
  position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 8px; display: grid; place-items: center; border: 2px solid #fff;
}
.content { padding: clamp(16px, 2.2vw, 28px) clamp(14px, 2.2vw, 30px) 90px; flex: 1; width: 100%; }
.page-max { max-width: 1480px; margin: 0 auto; width: 100%; }

.menu-toggle { display: none; }

/* ------------------------------------------------------------------ 卡片 */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
}
.card-pad { padding: clamp(16px, 1.8vw, 24px); }
.card-head {
  display: flex; align-items: center; gap: 12px; padding: 18px clamp(16px, 1.8vw, 24px);
  border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); }
.card-head .spacer { margin-left: auto; }

.grid { display: grid; gap: clamp(12px, 1.5vw, 20px); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); align-items: start; }
.g-side-r { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); align-items: start; }

/* KPI */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .label { font-size: 12.5px; color: var(--text-3); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; letter-spacing: -1px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12px; color: var(--text-3); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.kpi .glyph {
  position: absolute; right: 14px; top: 16px; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; background: var(--brand-light); color: var(--brand);
}
.kpi.teal .glyph { background: #e6faf4; color: #0ca678; }
.kpi.amber .glyph { background: #fff6e6; color: #d97706; }
.kpi.rose .glyph { background: #ffecef; color: #e03131; }

.trend { font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }
.trend.up { color: var(--accent); }
.trend.down { color: var(--danger); }

/* 进度条 */
.bar { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5b83f7, var(--brand)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar.teal > i { background: linear-gradient(90deg, #34d9a4, #0ca678); }
.bar.amber > i { background: linear-gradient(90deg, #fbc34a, #f59f0b); }

/* 徽标 */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 7px; font-size: 11.5px; font-weight: 650; letter-spacing: .01em;
  background: var(--line-2); color: var(--text-2); white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.ok { background: #e7f9f2; color: #0a8f66; }
.chip.pending { background: #fff5e5; color: #b7791f; }
.chip.danger { background: #ffecec; color: #c92a2a; }
.chip.draft { background: #eef1f7; color: #6b7789; }
.chip.info { background: #e7f5ff; color: #1864ab; }
.chip.plain::before { display: none; }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tb { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
table.tb th {
  text-align: left; font-size: 11.5px; letter-spacing: .06em; font-weight: 700;
  color: var(--text-3); padding: 11px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
table.tb td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
table.tb tbody tr:hover td { background: #fbfcff; }
table.tb tbody tr:last-child td { border-bottom: none; }
table.tb .name-cell { display: flex; align-items: center; gap: 10px; }
table.tb .mono { font-variant-numeric: tabular-nums; color: var(--text-2); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .input, .toolbar .select { height: 38px; min-height: 38px; }
.search { position: relative; }
.search .input { padding-left: 36px; min-width: 210px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }

.pager { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pager .info { font-size: 12.5px; color: var(--text-3); margin-right: auto; }

/* 空态 */
.empty { padding: 56px 24px; text-align: center; color: var(--text-3); }
.empty svg { opacity: .5; margin-bottom: 14px; }
.empty b { display: block; color: var(--text-2); font-size: 14.5px; margin-bottom: 6px; }

/* 抽屉 / 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .42); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
  animation: fade .16s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: var(--radius-xl); width: 100%; max-width: 560px;
  box-shadow: var(--shadow-l); max-height: 88vh; display: flex; flex-direction: column;
  animation: pop .18s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal.wide { max-width: 880px; }
.modal-head { padding: 20px 22px 14px; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.modal-head .sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.modal-body { padding: 4px 22px 8px; overflow-y: auto; }
.modal-foot { padding: 16px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Toast */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 260px; max-width: min(400px, calc(100vw - 36px));
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow-l); display: flex; gap: 10px; align-items: flex-start;
  animation: slidein .22s cubic-bezier(.2,.8,.2,1); font-size: 13px;
}
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } }
.toast .bar-ico { width: 4px; border-radius: 99px; align-self: stretch; flex: none; background: var(--brand); }
.toast.ok .bar-ico { background: var(--accent); }
.toast.warn .bar-ico { background: var(--warn); }
.toast.err .bar-ico { background: var(--danger); }
.toast b { display: block; font-size: 13px; margin-bottom: 2px; }
.toast span { color: var(--text-2); font-size: 12.5px; }

/* 加载 */
.skeleton { background: linear-gradient(90deg, #eef1f7 25%, #f7f9fc 37%, #eef1f7 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.loading-line { height: 2px; background: var(--brand); position: fixed; top: 0; left: 0; right: 0; z-index: 300; transform-origin: 0 50%; animation: load 1.2s ease-in-out infinite; }
@keyframes load { 0% { transform: scaleX(0); opacity: 1; } 50% { transform: scaleX(.7); } 100% { transform: scaleX(1); opacity: 0; } }

/* 表单卡片（学生端） */
.form-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 20px; display: flex; flex-direction: column; gap: 14px; position: relative;
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.form-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #dbe3f2; }
.form-card h4 { font-size: 15px; font-weight: 650; }
.form-card p { font-size: 12.5px; color: var(--text-3); min-height: 34px; }
.form-card .ring-wrap { position: absolute; right: 18px; top: 18px; }

.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: var(--line-2); }
.ring .val { stroke: var(--brand); transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* 步骤条 */
.steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); font-weight: 550; }
.step i {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--line-2); color: var(--text-3); font-size: 11px; font-weight: 700; font-style: normal;
}
.step.done i { background: #e7f9f2; color: #0a8f66; }
.step.cur { color: var(--text); }
.step.cur i { background: var(--brand); color: #fff; }
.step-line { width: 22px; height: 1px; background: var(--line); }

/* 分组标题 */
.section-title { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.section-title h3 { font-size: 14.5px; font-weight: 650; }
.section-title .line { flex: 1; height: 1px; background: var(--line-2); }
.section-title .tip { font-size: 12px; color: var(--text-3); }

/* 响应式表单栅格 */
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-1 { grid-column: span 1; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid .span-4 { grid-column: span 4; }

/* 动态表格（简历/家庭成员） */
.dyn { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dyn-row { display: grid; gap: 0; border-bottom: 1px solid var(--line-2); }
.dyn-row:last-child { border-bottom: none; }
.dyn-row > div { padding: 8px 10px; border-right: 1px solid var(--line-2); min-width: 0; }
.dyn-row > div:last-child { border-right: none; }
.dyn-row input { border: none; width: 100%; padding: 4px 2px; background: transparent; outline: none; font-size: 13px; }
.dyn-row input:focus { background: #f7faff; }
.dyn-head { background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--text-3); letter-spacing: .04em; }
.dyn-foot { padding: 10px; display: flex; gap: 8px; background: var(--surface-2); }
.row-del { width: 26px; height: 26px; border-radius: 7px; border: none; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.row-del:hover { background: #ffecec; color: var(--danger); }

/* 成绩表 */
.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px 14px; }
.score-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.score-item label { flex: 1; font-size: 13px; color: var(--text-2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-item input { width: 68px; text-align: center; }

/* 底部浮动操作条 */
.action-bar {
  position: sticky; bottom: 0; z-index: 20; margin: 0 calc(clamp(14px, 2.2vw, 30px) * -1) -90px;
  padding: 12px clamp(14px, 2.2vw, 30px);
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.action-bar .save-state { font-size: 12px; color: var(--text-3); margin-right: auto; display: flex; align-items: center; gap: 6px; }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.dot-live.saving { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* 通知面板 */
.popover {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(380px, calc(100vw - 28px));
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-l); z-index: 60; overflow: hidden;
  animation: pop .16s cubic-bezier(.2,.8,.2,1);
}
.popover-head { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; }
.popover-head b { font-size: 13.5px; }
.popover-list { max-height: 380px; overflow-y: auto; }
.noti { padding: 12px 16px; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; cursor: pointer; }
.noti:hover { background: var(--surface-2); }
.noti .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--brand-light); color: var(--brand); }
.noti.success .ico { background: #e7f9f2; color: #0a8f66; }
.noti.warning .ico { background: #fff5e5; color: #b7791f; }
.noti b { font-size: 12.8px; font-weight: 650; display: block; }
.noti p { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.noti .time { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.noti.unread { background: #f8faff; }

/* 移动端底部导航 */
.tabbar { display: none; }

/* uploader */
.uploader {
  border: 1.5px dashed #d3dcec; border-radius: var(--radius); padding: 22px; text-align: center;
  background: var(--surface-2); cursor: pointer; transition: border-color .16s, background .16s;
}
.uploader:hover, .uploader.drag { border-color: var(--brand); background: #f5f8ff; }
.uploader b { font-size: 13.5px; }
.uploader span { font-size: 12px; color: var(--text-3); display: block; margin-top: 4px; }
.photo-preview { width: 108px; height: 144px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.photo-empty { width: 108px; height: 144px; border-radius: 10px; border: 1.5px dashed #d3dcec; display: grid; place-items: center; color: var(--text-3); font-size: 11.5px; text-align: center; background: var(--surface-2); }

/* 提示条 */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: 12.8px; line-height: 1.55; }
.alert.info { background: #eff6ff; color: #1e429f; }
.alert.warn { background: #fff8e6; color: #92400e; }
.alert.err { background: #fff1f1; color: #a61e1e; }
.alert b { font-weight: 700; }

/* 详情键值 */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); word-break: break-all; }

/* 图表 */
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

/* ------------------------------------------------------------------ 断点 */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  :root { --sidebar-w: 220px; }
  .g-main, .g-side, .g-side-r { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-3, .form-grid .span-4 { grid-column: span 2; }
}
@media (max-width: 900px) {
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-l);
    width: 264px;
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .nav-mask { position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 35; }
  .content { padding-bottom: 100px; }
}
@media (max-width: 720px) {
  .g-4, .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2, .form-grid .span-3, .form-grid .span-4 { grid-column: span 1; }
  .topbar h1 { font-size: 15px; }
  .topbar .crumb { display: none; }
  .kpi .value { font-size: 26px; }
  .modal { max-height: 92vh; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .action-bar .save-state { width: 100%; margin-bottom: 4px; }
  .action-bar .btn { flex: 1; }
  .content { padding-bottom: 108px; }
  /* 学生端底部导航 */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(255,255,255,.95); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 5px 0; border-radius: 10px; font-size: 10.5px; color: var(--text-3);
    cursor: pointer; border: none; background: none;
  }
  .tabbar .tab.active { color: var(--brand); background: var(--brand-light); }
  .tabbar .tab svg { width: 19px; height: 19px; }
  .toolbar .search, .toolbar .search .input { width: 100%; min-width: 0; }
  .toolbar > * { flex: 1 1 auto; }
}
@media (min-width: 1800px) {
  body { font-size: 15px; }
  .page-max { max-width: 1620px; }
}

/* 打印 */
@media print {
  .sidebar, .topbar, .action-bar, .tabbar { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}
