/* ============================================================
   2026级硕士研究生基本信息管理系统 —— 样式表 v2
   手机端：底部导航 + 卡片列表 + 大按钮
   电脑端：左侧导航 + 数据表格
   ============================================================ */

/* ---------------- 设计变量 ---------------- */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef2f9;
  --text: #0f1b2d;
  --text-2: #45536b;
  --muted: #7a879c;
  --line: #e7ecf5;
  --line-strong: #d7dfec;
  --primary: #2f6bf2;
  --primary-2: #4b86ff;
  --primary-hover: #1f5be0;
  --primary-soft: #eaf1ff;
  --accent: #7c5cff;
  --success: #0f9d6e;
  --success-soft: #e6f7f0;
  --warn: #b7791f;
  --warn-soft: #fdf3e2;
  --danger: #e0483f;
  --danger-soft: #fdeceb;
  --shadow-xs: 0 1px 2px rgba(15, 27, 45, .05);
  --shadow-sm: 0 2px 6px rgba(15, 27, 45, .05), 0 1px 2px rgba(15, 27, 45, .04);
  --shadow-md: 0 16px 36px -22px rgba(15, 27, 45, .38);
  --shadow-lg: 0 30px 60px -30px rgba(15, 27, 45, .42);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 20px;
  --sidebar-w: 244px;
  --tabbar-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-num: "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0a111d;
  --surface: #121b2b;
  --surface-2: #172136;
  --surface-3: #1d2a42;
  --text: #e9eff9;
  --text-2: #b3c0d4;
  --muted: #8697b0;
  --line: #223047;
  --line-strong: #2d3e5a;
  --primary: #5b91ff;
  --primary-2: #7aa8ff;
  --primary-hover: #86b0ff;
  --primary-soft: #1a2b4d;
  --accent: #9d86ff;
  --success: #34d399;
  --success-soft: #10322a;
  --warn: #fbbf24;
  --warn-soft: #3a2c11;
  --danger: #f87171;
  --danger-soft: #3a1c1c;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-md: 0 18px 40px -22px rgba(0, 0, 0, .8);
  --shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, .9);
}

/* ---------------- 基础 ---------------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* hidden 属性必须可靠隐藏：.drawer 等元素上的 display 会覆盖浏览器默认的 [hidden] 样式 */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 100% -12%, rgba(75, 134, 255, .10), transparent 62%),
    radial-gradient(900px 520px at -8% 4%, rgba(124, 92, 255, .07), transparent 58%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

:root[data-theme="dark"] body {
  background-image:
    radial-gradient(1100px 620px at 100% -12%, rgba(91, 145, 255, .14), transparent 62%),
    radial-gradient(900px 520px at -8% 4%, rgba(157, 134, 255, .10), transparent 58%);
}

a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
svg { width: 100%; height: 100%; fill: currentColor; }
h1, h2, h3, h4 { letter-spacing: .2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

::selection { background: rgba(47, 107, 242, .18); }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(140deg, #5b8cff 0%, #2f6bf2 48%, #1b4fd1 100%);
  color: #fff; font-weight: 700; font-size: 20px;
  display: grid; place-items: center;
  box-shadow: 0 10px 20px -10px rgba(47, 107, 242, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
  flex: 0 0 auto;
  letter-spacing: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: .3px; }
.brand-text span { font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); font-size: 14.5px; font-weight: 500;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .8; transition: opacity .16s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  color: var(--primary);
  font-weight: 650;
  background: linear-gradient(120deg, rgba(75, 134, 255, .14), rgba(75, 134, 255, .06));
  box-shadow: inset 0 0 0 1px rgba(47, 107, 242, .14);
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: "";
  position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
}

.sidebar-foot { margin-top: auto; padding-top: 18px; }
.foot-card {
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.foot-card strong {
  font-family: var(--font-num);
  font-size: 24px; line-height: 1;
  color: var(--primary);
  letter-spacing: -.5px;
}
.foot-label { font-size: 12px; color: var(--muted); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 26px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-size: 16.5px; font-weight: 700; margin: 0; letter-spacing: .4px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.theme-btn { color: var(--muted); }
.theme-btn:hover { color: var(--text); }
.theme-btn .ico-sun { display: none; }
.theme-btn .ico-moon { display: block; }
:root[data-theme="dark"] .theme-btn .ico-sun { display: block; }
:root[data-theme="dark"] .theme-btn .ico-moon { display: none; }

.view {
  padding: 24px 26px 48px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  flex: 1 1 auto;
  outline: none;
  animation: viewIn .28s ease both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.only-mobile { display: none; }
.only-desktop { display: inline-flex; }

/* 登录时隐藏导航骨架 */
body.login-mode .sidebar,
body.login-mode .tabbar,
body.login-mode .topbar { display: none; }
body.login-mode .view { padding: 0; max-width: none; }

/* 搜索框：隐藏浏览器自带清除按钮 */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* ---------------- 按钮 ---------------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 15px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 550; cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s, color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px -10px rgba(47, 107, 242, .9), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #5b91ff, var(--primary-hover));
  box-shadow: 0 12px 22px -12px rgba(47, 107, 242, .95), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-danger-ghost { color: var(--danger); border-color: var(--line-strong); background: transparent; box-shadow: none; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: transparent; }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; box-shadow: none; }

.icon-btn {
  width: 38px; height: 38px; padding: 9px;
  border-radius: 11px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer;
  display: inline-grid; place-items: center;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.card-head .head-actions { margin-left: auto; display: flex; gap: 8px; }
.card-head .head-actions + .sub { margin-left: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 7px;
  font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-blue { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-green { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .2px; font-family: var(--font-num); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ---------------- 概览 ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(700px 260px at 88% -30%, rgba(255, 255, 255, .28), transparent 60%),
    radial-gradient(500px 300px at 4% 130%, rgba(124, 92, 255, .45), transparent 60%),
    linear-gradient(118deg, #1b3fa8 0%, #2b62e6 52%, #4b86ff 100%);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  color: #fff;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  box-shadow: 0 24px 48px -30px rgba(27, 63, 168, .9);
  margin-bottom: 18px;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(600px 300px at 85% 10%, #000 10%, transparent 75%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: .6px; font-weight: 700; }
.hero p { margin: 0; font-size: 13.5px; color: rgba(255, 255, 255, .8); }
.hero .hero-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .26);
  color: #fff;
  backdrop-filter: blur(6px);
  box-shadow: none;
}
.hero .btn:hover { background: rgba(255, 255, 255, .24); }
.hero .btn-solid { background: #fff; border-color: #fff; color: #1b4fd1; font-weight: 650; }
.hero .btn-solid:hover { background: #f2f6ff; color: #1746bd; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px 15px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.stat::after {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  opacity: .85;
}
.stat .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .label svg { width: 14px; height: 14px; opacity: .8; }
.stat .value {
  font-family: var(--font-num);
  font-size: 28px; font-weight: 700; line-height: 1.2;
  margin-top: 3px; letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.bars { padding: 10px 14px 16px; max-height: 372px; overflow-y: auto; }
.bar-btn {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; background: transparent;
  border-radius: 10px; cursor: pointer;
  transition: background .14s ease;
}
.bar-btn:hover { background: var(--surface-2); }
.bar-btn:active { background: var(--surface-3); }
.bar-btn:hover .bar-fill { filter: brightness(1.05); }
.bar-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; margin-bottom: 7px; gap: 10px; }
.bar-top .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bar-top .num { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; font-size: 12.5px; }
.bar-track { display: block; height: 9px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar-fill {
  display: block;
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #6fa4ff, #2f6bf2);
  min-width: 3px;
  transition: width .6s cubic-bezier(.22, .61, .36, 1), filter .15s;
}

.recent-list { padding: 6px 0 10px; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; cursor: pointer;
  transition: background .15s;
}
.recent-item:hover { background: var(--surface-2); }
.avatar {
  width: 36px; height: 36px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(140deg, #eaf1ff, #dbe7ff);
  color: var(--primary);
  display: grid; place-items: center; font-weight: 650; font-size: 14.5px;
}
:root[data-theme="dark"] .avatar { background: linear-gradient(140deg, #1c2f52, #182642); }
.recent-main { min-width: 0; flex: 1 1 auto; }
.recent-main strong { font-size: 14px; font-weight: 600; display: block; }
.recent-main span { font-size: 12.5px; color: var(--muted); }
.recent-time { font-size: 12px; color: var(--muted); flex: 0 0 auto; }

/* ---------------- 工具条 / 搜索 ---------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search {
  position: relative; flex: 1 1 260px; min-width: 0; max-width: 420px;
}
.search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted); pointer-events: none;
}
.search input {
  width: 100%; height: 40px; padding: 0 36px 0 38px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search .clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted);
  border-radius: 50%; cursor: pointer; display: none; place-items: center;
}
.search .clear svg { position: static; transform: none; width: 14px; height: 14px; }
.search.has-value .clear { display: grid; }

.select {
  height: 40px; padding: 0 34px 0 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%237a879c' d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  appearance: none; outline: none; max-width: 100%;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.select:hover { border-color: var(--line-strong); }
.select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.select-sm {
  height: 32px; font-size: 13px;
  padding: 0 30px 0 10px;
  background-position: right 7px center;
  background-size: 16px;
  border-radius: 9px;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13px; color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
  background: linear-gradient(120deg, rgba(75, 134, 255, .16), rgba(75, 134, 255, .08));
  border-color: transparent; color: var(--primary); font-weight: 650;
}
.chip .x { width: 13px; height: 13px; opacity: .75; }

.result-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted);
  padding: 11px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data td {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  vertical-align: middle; white-space: nowrap;
}
table.data tbody tr { cursor: pointer; transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.name-cell { font-weight: 600; }
table.data td.actions { text-align: right; }
table.data .row-actions { display: inline-flex; gap: 2px; opacity: .55; transition: opacity .15s; }
table.data tbody tr:hover .row-actions { opacity: 1; }
table.data .row-actions .icon-btn { width: 32px; height: 32px; padding: 7px; border-radius: 9px; }
table.data .row-actions .icon-btn svg { width: 17px; height: 17px; }
table.data .row-actions .icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.num-col { color: var(--muted); font-variant-numeric: tabular-nums; width: 46px; }

/* ---------------- 手机端卡片列表 ---------------- */
.student-cards { display: none; }

/* ---------------- 分页 ---------------- */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 13px 16px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); flex-wrap: wrap;
  background: var(--surface-2);
}
.pager .pages { display: flex; gap: 6px; align-items: center; }

/* ---------------- 空状态 ---------------- */
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty .empty-icon {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px;
  background: linear-gradient(150deg, var(--primary-soft), rgba(124, 92, 255, .10));
  color: var(--primary);
  display: grid; place-items: center;
  border: 1px solid rgba(47, 107, 242, .12);
}
.empty .empty-icon svg { width: 28px; height: 28px; }
.empty h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
.empty p { margin: 0 0 18px; font-size: 13.5px; }

/* ---------------- 表单 ---------------- */
.form-head { margin-bottom: 16px; }
.form-head h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: .3px; }
.form-head p { margin: 0; color: var(--muted); font-size: 13px; }

.form-section { margin-bottom: 16px; }
.form-section-head { display: flex; align-items: baseline; gap: 8px; padding: 16px 20px 0; }
.form-section-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.form-section-head span { font-size: 12px; color: var(--muted); }
.form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 18px; padding: 15px 20px 20px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.col-span-2 { grid-column: span 2; }
.field > label { font-size: 13px; font-weight: 550; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.field > label .req { color: var(--danger); font-weight: 700; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field > input,
.field > select {
  width: 100%; height: 44px; padding: 0 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field > input::placeholder { color: var(--muted); }
.field > input:hover, .field > select:hover { border-color: var(--line-strong); }
.field > input:focus, .field > select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.field.error > input, .field.error > select { border-color: var(--danger); background: var(--danger-soft); }
.field .err-msg { font-size: 12px; color: var(--danger); display: none; }
.field.error .err-msg { display: block; }

.segmented { display: flex; gap: 8px; }
.segmented label {
  flex: 1 1 0; height: 44px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); display: grid; place-items: center;
  cursor: pointer; font-size: 14px; color: var(--text-2);
  transition: all .15s;
}
.segmented label:hover { border-color: var(--primary); color: var(--primary); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 650;
  box-shadow: 0 0 0 3px rgba(47, 107, 242, .10);
}

.form-actions {
  display: flex; gap: 10px; align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  position: sticky; bottom: 0; z-index: 5;
}
.form-actions .spacer { flex: 1 1 auto; }

/* ---------------- 高级查询 ---------------- */
.query-card { margin-bottom: 16px; }
.query-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 16px 20px 4px;
}
.query-grid .col-span-2 { grid-column: span 2; }
.inner-search { max-width: none; flex: 1 1 auto; }
.inner-search input {
  height: 44px; padding-left: 38px; padding-right: 34px;
  border-radius: var(--radius-sm);
}
.query-actions {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 18px;
  flex-wrap: wrap;
}
.query-actions .grow { flex: 1 1 auto; }

/* ---------------- 导入导出 ---------------- */
.panel-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
.drop-zone {
  margin: 18px 20px; border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius); background: var(--surface-2);
  padding: 30px 20px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.drop-zone:hover, .drop-zone.drag {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.drop-zone:active { transform: scale(.995); }
.drop-zone .dz-icon {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 15px;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.drop-zone .dz-icon svg { width: 22px; height: 22px; }
.drop-zone strong { display: block; font-size: 14.5px; margin-bottom: 4px; }
.drop-zone span { font-size: 12.5px; color: var(--muted); }

.import-options { padding: 0 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.radio-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; cursor: pointer; }
.radio-row input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); }
.radio-row .desc { display: block; font-size: 12px; color: var(--muted); }

.export-list { padding: 8px 0 16px; }
.export-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.export-item:hover { background: var(--surface-2); }
.export-item .file-icon {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--text-2);
}
.export-item .file-icon svg { width: 18px; height: 18px; }
.export-item .info { flex: 1 1 auto; min-width: 0; }
.export-item .info strong { display: block; font-size: 14px; font-weight: 600; }
.export-item .info span { font-size: 12px; color: var(--muted); }

.danger-zone { border-color: var(--line-strong); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); }
.danger-zone .card-head {
  background: linear-gradient(180deg, var(--surface), var(--danger-soft));
  border-bottom-color: color-mix(in srgb, var(--danger) 18%, var(--line));
}
.danger-zone .card-head h2 { color: var(--danger); }

.result-box {
  margin: 0 20px 18px; padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px;
}
.result-box .ok { color: var(--success); font-weight: 650; }
.result-box .warn { color: var(--warn); font-weight: 650; }
.result-box ul { margin: 8px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; color: var(--text-2); }
.result-box li { margin-bottom: 3px; font-size: 12.5px; }

/* ---------------- 二维码 ---------------- */
.qr-body { padding: 18px 20px 20px; }
.qr-pair { display: flex; gap: 18px; flex-wrap: wrap; }
.qr-item {
  margin: 0; flex: 1 1 190px; min-width: 180px; max-width: 380px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 12px; border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.qr-img {
  padding: 9px; border-radius: 12px; background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.qr-img img { display: block; width: 168px; height: 168px; }
.qr-item figcaption { display: flex; flex-direction: column; gap: 5px; align-items: center; text-align: center; width: 100%; }
.qr-item figcaption strong { font-size: 13.5px; }
.qr-item figcaption span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.qr-item.qr-hot {
  position: relative;
  border-color: rgba(47, 107, 242, .45);
  box-shadow: 0 0 0 3px rgba(47, 107, 242, .08), var(--shadow-sm);
  background: linear-gradient(180deg, var(--primary-soft), var(--surface));
}
:root[data-theme="dark"] .qr-item.qr-hot { background: linear-gradient(180deg, #16243d, var(--surface)); }
.qr-badge {
  position: absolute; top: -10px; left: 14px;
  height: 20px; padding: 0 9px; border-radius: 99px;
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 650; color: #fff;
  background: linear-gradient(135deg, #5b8cff, #2f6bf2);
  box-shadow: 0 6px 12px -6px rgba(47, 107, 242, .9);
}
.qr-url {
  display: block; width: 100%;
  font-size: 11.5px; background: var(--surface-3);
  border-radius: 8px; padding: 6px 8px;
  word-break: break-all; color: var(--text-2);
  font-family: var(--font-num);
}
.qr-tip { margin: 14px 0 0; line-height: 1.6; }
.modal.modal-wide { width: min(680px, calc(100vw - 32px)); }

/* ---------------- 打印花名册 ---------------- */
.print-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.print-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.print-go { margin-left: auto; }
.print-sheet {
  background: #fff; color: #111827;
  padding: 26px 28px 30px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  max-width: 1280px; margin: 0 auto;
}
.print-head h1 {
  font-size: 19px; text-align: center; letter-spacing: 2px;
  margin: 0 0 10px; color: #111827; font-weight: 700;
}
.print-meta {
  display: flex; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; font-size: 12px; color: #374151; margin-bottom: 10px;
}
.print-table { width: 100%; border-collapse: collapse; font-size: 11.5px; color: #111827; }
.print-table th,
.print-table td {
  border: 1px solid #4b5563; padding: 4px 6px;
  text-align: center; vertical-align: middle; word-break: break-word;
}
.print-table th { background: #eef2f8; font-weight: 600; }
.print-table td.col-name { font-weight: 600; }
.print-table .col-index { width: 44px; }
.print-sign {
  display: flex; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; font-size: 12px; color: #374151; margin-top: 18px;
}
.print-tip { margin: 12px auto 0; max-width: 920px; text-align: center; }

/* ---------------- 勾选与批量操作 ---------------- */
.check-col { width: 38px; text-align: center; padding-left: 12px !important; padding-right: 4px !important; }
.check-col input,
.sc-check { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
table.data tbody tr.selected { background: var(--primary-soft); }
table.data tbody tr.selected:hover { background: var(--primary-soft); }
.student-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.sc-check { flex: 0 0 auto; margin-right: 2px; }

.selbar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 45;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 32px);
  animation: slideUp .2s ease;
}
.sel-count { font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.sel-count b { color: var(--primary); font-size: 15.5px; }
.selbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#listResults.has-selection { padding-bottom: 88px; }

/* ---------------- 底部导览 ---------------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
}
.tab-item {
  flex: 1 1 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; height: var(--tabbar-h);
  transition: color .15s;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--primary); font-weight: 600; }
.tab-item.active svg { filter: drop-shadow(0 4px 8px rgba(47, 107, 242, .35)); }
.tab-add { position: relative; }
.tab-add-btn {
  position: absolute; top: -19px; left: 50%; transform: translateX(-50%);
  width: 52px; height: 52px; border-radius: 17px;
  background: linear-gradient(135deg, #5b8cff, #2f6bf2 60%, #1b4fd1);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 14px 26px -12px rgba(47, 107, 242, .95), inset 0 1px 0 rgba(255, 255, 255, .3);
  border: 3px solid var(--surface);
}
.tab-add-btn svg { width: 24px; height: 24px; }
.tab-add > span:last-child { margin-top: 31px; }

/* ---------------- 抽屉 / 弹窗 / 提示 ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(8, 15, 28, .48);
  z-index: 60; backdrop-filter: blur(3px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideRight { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(440px, 94vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -40px rgba(0, 0, 0, .55);
  overflow-y: auto;
  animation: slideRight .22s ease;
  display: flex; flex-direction: column;
}
.drawer-head {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 12px;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.drawer-head .avatar { width: 46px; height: 46px; border-radius: 14px; font-size: 18px; }
.drawer-head h2 { margin: 0; font-size: 17px; }
.drawer-head .sub { font-size: 12.5px; color: var(--muted); }
.drawer-body { padding: 8px 20px 20px; }
.detail-group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-group:last-child { border-bottom: 0; }
.detail-group h4 { margin: 0 0 4px; font-size: 11.5px; color: var(--muted); font-weight: 650; letter-spacing: .8px; text-transform: uppercase; }
.detail-row { display: flex; gap: 12px; padding: 5px 0; font-size: 14px; }
.detail-row .k { width: 104px; flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.detail-row .v { flex: 1 1 auto; word-break: break-all; }
.detail-row .v.empty-val { color: var(--line-strong); }
.drawer-foot {
  margin-top: auto; padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); display: flex; gap: 10px;
  position: sticky; bottom: 0; background: var(--surface);
}

.modal {
  position: fixed; z-index: 80;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(430px, calc(100vw - 40px));
  background: var(--surface); border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 24px; animation: slideUp .2s ease;
}
.modal h3 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0 0 14px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal .modal-actions .btn { min-width: 78px; }

/* 弹窗内名单表格 */
.modal-scroll {
  max-height: min(52vh, 460px); overflow: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; padding: 9px 10px; white-space: nowrap;
  background: var(--surface-2); color: var(--muted);
  font-size: 12px; font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.mini-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mini-table tbody tr:last-child td { border-bottom: 0; }
.mini-table tbody tr:hover { background: var(--surface-2); }
.mini-table td.nm { font-weight: 650; }

/* 分布下钻弹窗 */
.modal.dist-modal { padding: 0; overflow: hidden; }
.dm-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.dm-icon {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff;
  box-shadow: 0 10px 20px -12px rgba(47, 107, 242, .95);
}
.dm-icon svg { width: 21px; height: 21px; }
.dm-head h3 { margin: 0; font-size: 17px; letter-spacing: .2px; }
.dm-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.dm-sub b { color: var(--primary); font-size: 13.5px; }

.dm-stats { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px 4px; }
.dm-stat {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-2);
}
.dm-stat b { color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.dm-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dm-dot.m { background: #4b86ff; }
.dm-dot.f { background: #f0a03c; }

.dm-list {
  max-height: min(46vh, 400px);
  overflow-y: auto;
  padding: 10px 14px 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}
.dm-item {
  display: flex; gap: 10px; align-items: flex-start;
  text-align: left; width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer;
  transition: background .14s, border-color .14s, transform .14s;
}
.dm-item:hover { background: var(--surface-2); border-color: var(--primary); transform: translateY(-1px); }
.dm-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 650; font-size: 14px;
}
.dm-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dm-name { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14px; }
.dm-gender {
  font-style: normal; font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 5px;
}
.dm-gender.m { background: #e8f0ff; color: #2f6bf2; }
.dm-gender.f { background: #fdf3e2; color: #b7791f; }
:root[data-theme="dark"] .dm-gender.m { background: #1a2b4d; color: #7aa8ff; }
:root[data-theme="dark"] .dm-gender.f { background: #3a2c11; color: #fbbf24; }
.dm-no { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dm-tags, .dm-contact {
  font-size: 11.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dist-modal .modal-actions {
  margin: 0; padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.toasts {
  position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: 26px; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  background: #0f1b2d; color: #fff;
  padding: 11px 17px; border-radius: 999px;
  font-size: 13.5px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  animation: slideUp .2s ease;
  max-width: 100%;
}
.toast.ok { background: #0b7a55; }
.toast.err { background: #b42318; }
.toast svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* ---------------- 登录 ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(390px, 100%); padding: 30px 26px; }
.login-card .brand { justify-content: center; padding-bottom: 22px; }
.login-card h2 { margin: 0 0 6px; font-size: 19px; text-align: center; }
.login-card p { margin: 0 0 20px; text-align: center; color: var(--muted); font-size: 13px; }
.login-card input {
  width: 100%; height: 46px; padding: 0 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2); outline: none; margin-bottom: 12px;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------------- 加载 ---------------- */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: grid; place-items: center; min-height: 60vh; color: var(--muted); gap: 12px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1180px) {
  .panel-grid { grid-template-columns: 1fr; }
  .query-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .only-mobile { display: inline-grid; }
  .only-desktop { display: none !important; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.22, .61, .36, 1);
    box-shadow: 30px 0 70px -40px rgba(0, 0, 0, .6);
    width: 268px; flex-basis: 268px;
    height: 100dvh;
  }
  .sidebar.open { transform: none; }
  .topbar { padding: 10px 14px; }
  .topbar-title { font-size: 16px; }
  .view { padding: 14px 12px calc(var(--tabbar-h) + 30px); }
  .tabbar { display: flex; }
  .hero { padding: 20px; gap: 14px; border-radius: var(--radius); }
  .hero h2 { font-size: 18.5px; }
  .hero p { font-size: 12.5px; }
  .hero .hero-actions { margin-left: 0; width: 100%; }
  .hero .hero-actions .btn { flex: 1 1 auto; height: 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat .value { font-size: 23px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .query-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .query-grid .col-span-2 { grid-column: span 2; }
  .query-actions .btn { flex: 1 1 auto; }

  table.data { display: none; }
  .student-cards { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
  .student-card {
    border: 1px solid var(--line); border-radius: 14px;
    background: var(--surface); padding: 13px 14px;
    display: flex; flex-direction: column; gap: 9px;
    transition: background .15s, border-color .15s;
  }
  .student-card:active { background: var(--surface-2); }
  .sc-top { display: flex; align-items: center; gap: 10px; }
  .sc-name { font-size: 15.5px; font-weight: 650; }
  .sc-no { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .sc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
  .sc-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--text-2); }
  .sc-meta .k { color: var(--muted); margin-right: 6px; }
  .sc-actions { display: flex; gap: 8px; border-top: 1px dashed var(--line); padding-top: 9px; }
  .sc-actions .btn { flex: 1 1 0; height: 34px; font-size: 13px; }

  .form-grid { grid-template-columns: 1fr; padding: 12px 14px 16px; gap: 12px; }
  .field.col-span-2 { grid-column: auto; }
  .form-section-head { padding: 14px 14px 0; }
  .form-actions { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .form-actions .btn { flex: 1 1 auto; height: 46px; }
  .form-actions .btn-ghost { flex: 0 0 auto; }
  .field > input,
  .field > select { height: 46px; font-size: 16px; }
  .search input, .select { height: 42px; }
  .toolbar { gap: 8px; }
  .search { flex-basis: 100%; max-width: none; }
  .toolbar .select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .toolbar > .btn { flex: 1 1 auto; }
  .drop-zone { margin: 14px; padding: 24px 16px; }
  .card-pad { padding: 14px; }
  .card-head { padding: 13px 14px; }
  .card-head .sub { font-size: 12px; }
  .bars { padding: 4px 14px 14px; }
  .recent-item { padding: 10px 14px; }
  .export-item { padding: 12px 14px; }
  .result-box { margin: 0 14px 14px; }
  .import-options { padding: 0 14px 14px; }
  .toasts { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  .pager { padding: 10px 12px; }

  .selbar {
    left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
    transform: none; flex-direction: column; align-items: stretch; gap: 8px;
    padding: 10px 12px;
  }
  .sel-count { text-align: center; }
  .selbar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .selbar-actions .btn { width: 100%; height: 38px; }
  #listResults.has-selection { padding-bottom: 176px; }

  .qr-body { padding: 14px; }
  .qr-pair { flex-direction: column; gap: 12px; }
  .qr-item { flex: 0 0 auto; }
  .qr-img img { width: 190px; height: 190px; }
  .dm-list { grid-template-columns: 1fr; max-height: min(52vh, 420px); padding: 8px 12px 4px; }
  .dm-head { padding: 14px 14px 12px; }
  .dm-stats { padding: 10px 14px 2px; gap: 6px; }
  .dm-stat { height: 26px; padding: 0 9px; font-size: 12px; }
  .dist-modal .modal-actions { padding: 10px 14px 14px; }
  .dist-modal .modal-actions .btn { flex: 1 1 auto; }

  .print-toolbar { gap: 8px; }
  .print-toolbar .btn-primary { width: 100%; height: 46px; order: 3; }
  .print-presets { width: 100%; }
  .print-sheet { padding: 16px 12px 20px; border-radius: 10px; }
  .print-head h1 { font-size: 15px; letter-spacing: 1px; }
  .print-meta { font-size: 10.5px; }
  .print-table { font-size: 8px; }
  .print-table th, .print-table td { padding: 3px 2px; }
  .print-sign { font-size: 10.5px; }
  .print-tip { font-size: 11px; }
}

@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .tab-item span { font-size: 10.5px; }
  .tab-add-btn { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* 打印：导出为 PDF / 打印花名册时使用 */
@media print {
  .sidebar, .tabbar, .topbar, .topbar-actions, .toolbar, .pager,
  .sc-actions, .row-actions, .print-toolbar, .print-tip, .selbar,
  .toasts, .overlay, .drawer, .modal { display: none !important; }
  html, body { background: #fff !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .app { display: block !important; }
  .main { display: block !important; }
  .view { padding: 0 !important; max-width: none !important; margin: 0 !important; animation: none; }
  .print-sheet {
    box-shadow: none !important; border: 0 !important; border-radius: 0 !important;
    padding: 0 !important; max-width: none !important; width: 100% !important;
  }
  .print-table { font-size: 9pt; }
  .print-table th { background: #eef2f8 !important; }
  .print-table thead { display: table-header-group; }
  .print-table tr,
  .print-table td,
  .print-table th { page-break-inside: avoid; break-inside: avoid; }
  table.data { display: table !important; }
  .student-cards { display: none !important; }
}
