/* ============================================================
   泊宁同学录 · 纸感纪念册设计系统（v2026.3 手作版）
   设计语言：纸张 + 墨 + 朱砂印章，像一本真的毕业纪念册
   - 楷体标题（系统楷体栈，无外部依赖）/ 米白纸底 + 纸纹
   - 小圆角 / 实色按钮 / 1px 描边卡片，拒绝渐变大圆角悬浮风
   - 拍立得相框 / 虚线裁切线 / 目录式排版
   - 亮色 = 暖纸；暗色 = 夜读台灯下的深棕纸
   ============================================================ */

/* ---------- 主题令牌（默认：朱砂红印章色，后台可自定义覆盖） ---------- */
:root {
  --hue: 8;
  --bg: #f6f1e6;
  --surface: #fffdf7;
  --surface-2: #f1ebdc;
  --surface-glass: #f8f3e8;
  --border: #e4dbc6;
  --border-strong: #c9bb9d;
  --text: #38322a;
  --text-muted: #6f675a;
  --text-faint: #a2988a;
  --primary: #b03a2e;
  --primary-strong: #8e2d23;
  --primary-contrast: #fff8f2;
  --primary-soft: #f5e7e2;
  --accent: #8a6d3b;
  --danger: #a52a1f;
  --danger-soft: #f7e4e0;
  --success: #4a6741;
  --success-soft: #e6efe0;
  --warning: #9a6b1f;
  --warning-soft: #f6ecd7;
  --ring: hsl(var(--hue) 55% 42% / .4);
  --shadow-sm: 0 1px 2px rgb(72 54 30 / .1);
  --shadow-md: 0 3px 10px rgb(72 54 30 / .13), 0 1px 3px rgb(72 54 30 / .08);
  --shadow-lg: 0 14px 34px rgb(72 54 30 / .2), 0 4px 10px rgb(72 54 30 / .1);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --header-h: 60px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  --font-kai: "Kaiti SC", "STKaiti", KaiTi, 楷体, "FZKai-Z03S", "LXGW WenKai", "Noto Serif SC", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --grain-op: .045;
}

[data-theme="dark"] {
  --bg: #1a1512;
  --surface: #231d17;
  --surface-2: #2c251d;
  --surface-glass: #201a15;
  --border: #3a3127;
  --border-strong: #514536;
  --text: #ede4d3;
  --text-muted: #b0a390;
  --text-faint: #7c7161;
  --primary: #df7a5e;
  --primary-strong: #ec9d84;
  --primary-contrast: #2a120c;
  --primary-soft: hsl(var(--hue) 32% 17%);
  --accent: #c9a05e;
  --danger: #e5736a;
  --danger-soft: #3d201c;
  --success: #8fbf84;
  --success-soft: #21301e;
  --warning: #d9a941;
  --warning-soft: #33290f;
  --ring: hsl(var(--hue) 55% 58% / .45);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-md: 0 3px 10px rgb(0 0 0 / .45);
  --shadow-lg: 0 14px 34px rgb(0 0 0 / .55);
  --grain-op: .06;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background-color .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}

/* 纸纹：覆盖全页的极淡颗粒（印刷纸质感） */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* 弹层/头部在纸纹之上 */
.site-header, .dropdown, .toast, .back-top, .main-nav.open { z-index: 100; }

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-strong); }

::selection { background: hsl(var(--hue) 60% 50% / .28); }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 28px); }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 200;
  background: var(--primary); color: var(--primary-contrast);
  padding: 8px 16px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top .2s;
}
.skip-link:focus { top: 0; color: var(--primary-contrast); }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: .86em; }
.font-kai { font-family: var(--font-kai); }

h1, h2, h3, h4 { font-family: var(--font-kai); font-weight: 600; letter-spacing: .015em; }

/* ---------- 图标 ---------- */
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- 头部（纸面导航，1px 墨线分隔） ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface-glass);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: inset 0 -1px 0 var(--surface);
  transition: box-shadow .25s, background-color .25s;
}
.site-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner { display: flex; align-items: center; gap: 12px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }

/* 品牌印章：朱砂方章 + 楷体首字，微微一歪，像真的印章 */
.brand-mark {
  width: 34px; height: 34px; border-radius: 5px;
  display: grid; place-items: center;
  background: var(--primary);
  color: var(--primary-contrast);
  font-family: var(--font-kai);
  font-size: 19px; font-weight: 600;
  transform: rotate(-4deg);
  box-shadow: var(--shadow-sm), inset 0 0 0 1.5px rgb(255 255 255 / .22);
}
.brand-name { font-family: var(--font-kai); font-size: 1.12rem; letter-spacing: .06em; }

.main-nav { display: flex; align-items: center; gap: 2px; margin-left: 12px; }
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: var(--radius-sm);
  transition: color .15s, background-color .15s;
}
.nav-link .icon { width: 16px; height: 16px; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active {
  color: var(--primary); font-weight: 600;
  background: var(--primary-soft);
}
.nav-link.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px;
  height: 2px; background: var(--primary); border-radius: 2px; opacity: .75;
}
.nav-dot {
  position: absolute; top: 5px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface-glass);
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-muted); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--primary); }

/* 主题切换：亮显月亮、暗显太阳 */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- 按钮（实色 + 小圆角，像老式印刷按钮） ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600;
  padding: 9px 20px; min-height: 40px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; text-align: center;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-strong); color: var(--primary-contrast); box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: var(--primary); color: var(--primary-contrast); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); color: #fff; }
.btn-sm { padding: 6px 14px; min-height: 34px; font-size: .9rem; }
.btn-lg { padding: 12px 28px; min-height: 48px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

/* ---------- 卡片（纸卡：1px 描边 + 浅投影） ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
}
.card-hover:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-pad { padding: clamp(18px, 3vw, 26px); }

/* ---------- 页面骨架 ---------- */
.site-main { flex: 1; padding-block: clamp(18px, 3.5vw, 34px) 56px; position: relative; z-index: 2; }

/* v2026.5 页头统一手作锚点：标题前置朱砂小方章（像盖章的篇名）+ 底部信纸虚线 */
.page-head {
  margin-bottom: 22px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; border-bottom: 1px dashed var(--border-strong);
}
.page-title {
  margin: 0; font-size: clamp(1.4rem, 3.2vw, 1.75rem); font-weight: 600; letter-spacing: .02em;
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.page-title::before {
  content: ""; flex: none; width: 13px; height: 13px; border-radius: 3px;
  background: var(--primary);
  box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3.5px var(--primary);
  transform: rotate(-7deg); opacity: .88;
}
.page-sub { margin: 4px 0 0; color: var(--text-muted); font-size: .93rem; }
/* 面包屑（手写小字，像铅笔标注的来路） */
.crumb {
  margin: 0 0 5px; font-family: var(--font-kai);
  font-size: .82rem; letter-spacing: .05em; color: var(--text-faint);
}
.crumb a { color: var(--text-muted); text-decoration: none; border-bottom: 1px dashed var(--border-strong); padding-bottom: 1px; }
.crumb a:hover { color: var(--primary); border-color: var(--primary); }
/* 页头右侧手写印章（如「N 场报名中」） */
.page-stamp { flex: none; margin-bottom: 4px; font-size: .8rem; padding: 3px 11px; }
/* 详情信息条：像誊在信纸上的活动须知（时间/地点/发起人/截止） */
.fact-list {
  display: grid; grid-template-columns: repeat(2, 1fr);
  margin: 0 0 16px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--surface);
}
.fact { padding: 12px 16px; min-width: 0; }
.fact:nth-child(n+3) { border-top: 1px dashed var(--border); }
.fact:nth-child(2n) { border-left: 1px dashed var(--border); }
.fact dt {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-kai); font-size: .78rem; letter-spacing: .12em;
  color: var(--text-faint);
}
.fact dt .icon { width: 14px; height: 14px; color: var(--primary); flex: none; }
.fact dd { margin: 3px 0 0; font-size: .93rem; color: var(--text); word-break: break-all; }
/* 关于页：站点数据改成绩单式三格（虚线分栏，手机端不再三行大条） */
.about-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); overflow: hidden;
}
.about-stats .stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 14px 8px; min-width: 0;
}
.about-stats .stat b { font-family: var(--font-kai); font-size: clamp(1.5rem, 4.5vw, 1.9rem); color: var(--primary); line-height: 1.1; }
.about-stats .stat span { color: var(--text-muted); font-size: .82rem; }
.about-stats .stat + .stat { border-left: 1px dashed var(--border); }
/* 关于页：简介与统计之间加一道手作分隔 */
.about-intro { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.about-intro:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- Toast（纸条） ---------- */
.toast {
  position: relative; z-index: 110;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 12px 16px; margin-bottom: 12px;
  animation: toast-in .3s ease;
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--accent); }
.toast-close { margin-left: auto; background: none; border: 0; color: var(--text-faint); font-size: 20px; cursor: pointer; line-height: 1; padding: 4px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- 表单（纸上墨线框） ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field .hint { font-size: .8rem; color: var(--text-faint); margin-top: 5px; }
.input, textarea.input, select.input {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 13px; min-height: 42px;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.65; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--text-faint); }
.input-invalid { border-color: var(--danger); }

.form-error {
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid hsl(var(--hue) 55% 70% / .5);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: .9rem; margin-bottom: 16px;
}

.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: .88rem; cursor: pointer; user-select: none;
  transition: border-color .15s, color .15s, background-color .15s;
}
.check-pill:hover { border-color: var(--primary); }
.check-pill input { position: absolute; opacity: 0; pointer-events: none; }
.check-pill:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* ---------- 头像（白边照片） ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 2px solid var(--surface); box-shadow: var(--shadow-sm); }
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 84px; height: 84px; }
.avatar-xl { width: 108px; height: 108px; }
.avatar-fallback {
  display: grid; place-items: center;
  color: var(--primary-contrast); font-weight: 700; font-size: 1.2em;
  background: var(--primary);
}

/* ---------- 徽标（印章样式：楷体 + 细描边） ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-kai);
  font-size: .78rem; font-weight: 600; letter-spacing: .08em;
  padding: 2px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-muted);
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }

/* ---------- 表格（成绩册风） ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-weight: 700; color: var(--text-muted); background: var(--surface-2); font-size: .82rem; letter-spacing: .04em; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }

/* ---------- 用户下拉菜单 ---------- */
.user-menu { position: relative; }
.user-menu-btn { display: grid; place-items: center; background: none; border: 0; padding: 3px; border-radius: 50%; cursor: pointer; }
.user-menu-btn .avatar { transition: box-shadow .15s; }
.user-menu-btn:hover .avatar { box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-sm); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 200px; z-index: 120;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.user-menu.open .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown-head { padding: 10px 12px 8px; display: flex; flex-direction: column; border-bottom: 1px dashed var(--border-strong); margin-bottom: 6px; }
.dropdown a, .dropdown .menu-danger {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500; font-size: .92rem;
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font-family: inherit;
}
.dropdown a:hover, .dropdown .menu-danger:hover { background: var(--surface-2); }
.menu-danger { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.inline-form { display: contents; }

/* ---------- 页脚（纪念册封底） ---------- */
.site-footer {
  margin-top: auto; position: relative; z-index: 2;
  border-top: 1px solid var(--border-strong);
  background: var(--surface-glass);
  padding-block: 22px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-muted); font-size: .88rem; }
.footer-copy { margin: 0; font-family: var(--font-kai); letter-spacing: .05em; }
.footer-links { display: flex; gap: 18px; margin: 0; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--primary); }

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  width: 42px; height: 42px; border-radius: var(--radius-sm); z-index: 90;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text-muted); display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .2s;
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { color: var(--primary); border-color: var(--primary); }

/* ============================================================
   欢迎页（纪念册封面页）
   ============================================================ */
.hero {
  position: relative;
  display: flex; align-items: center; gap: clamp(24px, 4vw, 52px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md), inset 0 0 0 4px var(--bg), inset 0 0 0 5px var(--border);
  background: var(--surface);
  padding: clamp(26px, 5vw, 56px) clamp(22px, 5vw, 60px);
  margin-bottom: clamp(18px, 3.5vw, 34px);
  overflow: hidden;
}
/* 大字号水印：站名首字，像纸页背后的淡淡印章 */
.hero-watermark {
  position: absolute; right: -0.06em; bottom: -0.32em;
  font-family: var(--font-kai); font-size: clamp(160px, 30vw, 300px); line-height: 1;
  color: var(--primary); opacity: .045; pointer-events: none; user-select: none;
}
.hero-main { flex: 1; min-width: 0; position: relative; }

/* 班级标语：楷体小红章，两枚微微歪着 */
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-badges .badge {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid currentColor;
  padding: 3px 12px;
}
.hero-badges .badge:nth-child(odd) { transform: rotate(-2deg); }
.hero-badges .badge:nth-child(even) { transform: rotate(1.4deg); }

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 600; line-height: 1.25; letter-spacing: .04em;
}
/* 站名强调：荧光笔在纸上的划线感（像真人拿笔划重点） */
.hero h1 em {
  font-style: normal;
  background: linear-gradient(to top, var(--primary-soft) 34%, transparent 34%);
  padding: 0 .08em;
  border-radius: 2px;
}
.hero-rich { font-size: 1.02rem; line-height: 2.05; max-width: 40em; margin: 0 0 18px; color: var(--text); }
.hero-rich :where(h2, h3) { margin: .5em 0 .2em; font-size: 1.15em; }
.hero-rich a { text-decoration: underline; }
.hero-rich ul, .hero-rich ol { text-align: left; display: inline-block; margin: .3em auto; padding-left: 1.4em; }
.hero-rich strong { color: var(--primary); }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

/* 管理员快接编辑入口：手写小字链接 */
.hero-edit {
  display: inline-block;
  margin: -6px 0 14px;
  font-family: var(--font-kai);
  font-size: .84rem;
  color: var(--text-faint);
  border-bottom: 1px dashed var(--border-strong);
  padding-bottom: 1px;
}
.hero-edit:hover { color: var(--primary); border-color: var(--primary); }

/* 手写体统计行：低调的一行小字 */
.hero-line {
  margin: 0;
  font-family: var(--font-kai);
  font-size: .95rem; letter-spacing: .04em;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-strong);
  padding-top: 12px;
}
.hero-line b {
  font-family: var(--font-kai);
  color: var(--primary);
  font-size: 1.12em;
  font-weight: 700;
  margin: 0 1px;
}

/* 封面照片：拍立得 + 胶带 */
.hero-photo { flex: none; width: min(36%, 340px); margin: 0; position: relative; }
.polaroid {
  background: #fbf8ef;
  padding: 10px 10px 40px;
  border: 1px solid #e2d9c4;
  box-shadow: 0 10px 24px rgb(72 54 30 / .22), 0 3px 6px rgb(72 54 30 / .12);
  transform: rotate(2.2deg);
  transition: transform .25s ease;
}
.polaroid:hover { transform: rotate(.4deg) scale(1.015); }
.polaroid img { width: 100%; aspect-ratio: 4 / 3.2; object-fit: cover; display: block; background: var(--surface-2); }
.polaroid figcaption {
  position: absolute; left: 0; right: 0; bottom: 9px;
  text-align: center;
  font-family: var(--font-kai);
  font-size: .88rem; letter-spacing: .1em;
  color: #8a7d66;
}
/* 半透明和纸胶带 */
.tape {
  position: absolute; top: -12px; left: 50%;
  width: 88px; height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background:
    repeating-linear-gradient(45deg, rgb(214 178 106 / .55) 0 6px, rgb(199 158 82 / .55) 6px 12px);
  box-shadow: 0 1px 3px rgb(72 54 30 / .18);
  opacity: .92;
}
.tape.tape-right { left: auto; right: -26px; top: 40%; transform: rotate(66deg); }

/* ---------- 目录（欢迎页板块：像纪念册的目录页） ---------- */
.toc { padding: clamp(8px, 2vw, 18px) clamp(18px, 3.5vw, 30px); }
.toc-head {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-kai); font-size: 1.05rem; letter-spacing: .2em;
  color: var(--text-muted);
  padding: 10px 4px 14px;
  border-bottom: 1px dashed var(--border-strong);
}
.toc-head::before, .toc-head::after { content: ""; flex: 1; border-top: 1px dashed var(--border-strong); }
.toc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(20px, 4vw, 44px); }
.toc-item {
  display: flex; align-items: baseline; gap: 14px;
  padding: 15px 4px;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
}
.toc-item:nth-last-child(-n+2) { border-bottom: 0; }
.toc-num { font-family: var(--font-kai); font-size: 1.5rem; color: var(--primary); flex: none; line-height: 1; }
.toc-body h3 { margin: 0 0 3px; font-size: 1.12rem; }
.toc-body p { margin: 0; color: var(--text-muted); font-size: .88rem; line-height: 1.7; }

/* 封底絮语：一行低调的话 */
.paper-note {
  margin: clamp(18px, 3vw, 28px) 0 0;
  text-align: center;
  font-family: var(--font-kai);
  font-size: .92rem; letter-spacing: .06em;
  color: var(--text-muted);
}
.paper-note::before { content: "—— "; color: var(--text-faint); }
.paper-note::after { content: " ——"; color: var(--text-faint); }

/* ---------- 旧 hero 结构兼容（升级缓存期） ---------- */
.hero-stats { display: flex; justify-content: center; gap: clamp(18px, 5vw, 48px); margin-top: 22px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-family: var(--font-kai); font-size: clamp(1.3rem, 3.5vw, 1.8rem); color: var(--primary); }
.hero-stat span { font-size: .82rem; color: var(--text-muted); }
.hero p { margin: 0 auto 18px; max-width: 560px; font-size: clamp(1rem, 2.2vw, 1.1rem); color: var(--text-muted); }

/* ---------- 功能卡（班级中心等） ---------- */
.grid { display: grid; gap: clamp(12px, 2.2vw, 18px); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 205px), 1fr)); }

.feature-card { text-align: center; padding: 24px 20px; }
.feature-icon {
  width: 48px; height: 48px; margin: 0 auto 12px;
  border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.feature-icon .icon { width: 24px; height: 24px; }
.feature-card h3 { margin: 0 0 7px; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: .9rem; }

/* ---------- 统计卡（班级中心：低调数字） ---------- */
.stat-card { display: flex; align-items: center; gap: 12px; padding: 15px 18px; }
.stat-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.stat-icon .icon { width: 20px; height: 20px; }
.stat-card b { display: block; font-family: var(--font-kai); font-size: 1.35rem; color: var(--primary); line-height: 1.25; }
.stat-card span { color: var(--text-muted); font-size: .85rem; }

/* ---------- 同学卡（档案卡风） ---------- */
.member-card { padding: 20px 16px 16px; text-align: center; position: relative; overflow: hidden; }
.member-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 46px;
  background: var(--primary-soft);
  border-bottom: 1px dashed var(--border-strong);
}
.member-card .avatar-xl { position: relative; margin: 6px auto 12px; border: 3px solid var(--surface); box-shadow: var(--shadow-sm); }
.member-card h3 { position: relative; margin: 0 0 3px; font-size: 1.04rem; }
.member-card .muted { position: relative; font-size: .84rem; }
.member-card .cardbg { position: absolute; inset: 0; object-fit: cover; opacity: .12; }
.member-card > * { position: relative; }
.member-card .member-ops { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.member-card:hover .member-ops, .member-card:focus-within .member-ops { opacity: 1; }

/* ---------- 搜索栏 ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-bar .input { flex: 1; padding-left: 40px; }
.search-wrap { position: relative; flex: 1; }
.search-wrap .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-faint); width: 17px; height: 17px; }

/* ---------- 字母索引 ---------- */
.letter-index { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.letter-index a {
  min-width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: var(--radius-sm); font-size: .78rem; font-weight: 700;
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
  transition: color .12s, border-color .12s;
}
.letter-index a:hover { color: var(--primary); border-color: var(--primary); }
.letter-index a.disabled { opacity: .3; pointer-events: none; }

/* ---------- 资料卡（个人主页） ---------- */
.profile-hero { overflow: hidden; }
.profile-cover { height: clamp(110px, 20vw, 170px); object-fit: cover; width: 100%; }
.profile-body { padding: 0 clamp(18px, 4vw, 32px) 26px; margin-top: -44px; }
.profile-avatar-ring {
  width: 92px; height: 92px; border-radius: 50%;
  padding: 4px; background: var(--surface);
  box-shadow: var(--shadow-md); margin-bottom: 12px;
}
.profile-avatar-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.profile-name { margin: 0; font-size: 1.45rem; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-sign { color: var(--text-muted); margin: 6px 0 0; font-family: var(--font-kai); }

/* ---------- 标签页（书签） ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-strong); margin: 18px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 16px; font-family: var(--font-kai); font-size: .98rem; font-weight: 600; color: var(--text-muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- 信息网格 ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px 22px; }
.info-item { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.info-item .icon { width: 15px; height: 15px; color: var(--primary); transform: translateY(2px); }
.info-item dt { color: var(--text-faint); font-size: .84rem; min-width: 76px; flex: none; }
.info-item dd { margin: 0; font-weight: 500; word-break: break-all; }

/* ---------- 留言（信纸） ---------- */
.comment-item { display: flex; gap: 12px; padding: 16px; }
.comment-item + .comment-item { border-top: 1px dashed var(--border); }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.comment-author { font-weight: 700; color: var(--text); font-family: var(--font-kai); font-size: 1.04rem; letter-spacing: .05em; }
.comment-author:hover { color: var(--primary); }
.comment-text { word-break: break-word; overflow-wrap: anywhere; }
.comment-meta { display: flex; gap: 14px; margin-top: 8px; color: var(--text-faint); font-size: .8rem; }
.comment-meta button, .comment-meta a { background: none; border: 0; padding: 0; font: inherit; color: var(--text-faint); cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.comment-meta button:hover, .comment-meta a:hover { color: var(--primary); }
.comment-replies { margin-top: 12px; border-left: 2px solid var(--border-strong); padding-left: 14px; display: flex; flex-direction: column; gap: 12px; }
.comment-reply { display: flex; gap: 10px; }
.comment-reply .avatar { width: 30px; height: 30px; }
.private-tag { font-size: .74rem; }

/* ---------- 留言编辑器 ---------- */
.composer { padding: 16px; margin-bottom: 16px; }
.composer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.composer-tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.composer-tools label { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-muted); cursor: pointer; }
.emoji-panel {
  display: none; grid-template-columns: repeat(8, 1fr); gap: 2px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 8px; margin-top: 10px;
}
.emoji-panel.open { display: grid; }
.emoji-panel button { font-size: 20px; background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; padding: 4px; line-height: 1.3; transition: background .12s, transform .12s; }
.emoji-panel button:hover { background: var(--surface); transform: scale(1.15); }
.char-count { margin-left: auto; font-size: .78rem; color: var(--text-faint); }

/* ---------- 相册（影集页） ---------- */
.album-card { overflow: hidden; }
.album-cover {
  aspect-ratio: 16 / 10; width: 100%; object-fit: cover;
  transition: transform .3s ease;
  background: var(--surface-2);
  display: block;
  border-bottom: 1px solid var(--border);
}
.album-card:hover .album-cover { transform: scale(1.03); }
.album-cover-empty { aspect-ratio: 16/10; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); border-bottom: 1px solid var(--border); }
.album-cover-empty .icon { width: 40px; height: 40px; opacity: .55; }
.album-body { padding: 13px 16px 15px; }
.album-body h3 { margin: 0 0 4px; font-size: 1.02rem; }
.album-body p { margin: 0; color: var(--text-muted); font-size: .85rem; }

/* 照片墙：拍立得小照，微微歪斜 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 158px), 1fr)); gap: 12px 10px; }
.photo-tile {
  position: relative;
  background: #fbf8ef;
  padding: 6px 6px 22px;
  border: 1px solid #e2d9c4;
  box-shadow: 0 3px 8px rgb(72 54 30 / .14);
  display: block; cursor: pointer;
  transform: rotate(-1.1deg);
  transition: transform .18s ease, box-shadow .18s ease;
}
.photo-tile:nth-child(2n) { transform: rotate(1deg); }
.photo-tile:nth-child(3n) { transform: rotate(-.3deg); }
.photo-tile:hover, .photo-tile:focus-visible { transform: rotate(0) scale(1.03); box-shadow: var(--shadow-md); z-index: 2; }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface-2); }
.photo-tile .tile-ops {
  position: absolute; top: 6px; right: 6px; display: flex; gap: 6px;
  opacity: 0; transition: opacity .18s;
}
.photo-tile:hover .tile-ops, .photo-tile:focus-within .tile-ops { opacity: 1; }
[data-theme="dark"] .photo-tile { background: #2e2820; border-color: #443a2c; }
[data-theme="dark"] .polaroid { background: #332c23; border-color: #4a3f31; }
[data-theme="dark"] .polaroid figcaption { color: #b3a48c; }

/* ---------- 灯箱（图片详情） ---------- */
.lightbox-stage { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.lightbox-img { width: 100%; max-height: min(72vh, 860px); object-fit: contain; background: #14100c; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgb(20 16 12 / .62); color: #fff; border: 1px solid rgb(255 255 255 / .25);
  cursor: pointer; transition: background .15s;
  z-index: 5;
}
.lightbox-nav:hover { background: rgb(20 16 12 / .85); }
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }
.lightbox-nav .icon { width: 22px; height: 22px; }

/* ---------- 上传区（相册内页：一页贴照片的纸） ---------- */
.upload-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px clamp(14px, 3vw, 22px) clamp(16px, 3vw, 20px);
  margin-bottom: 22px;
}
.upload-panel-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.upload-panel-head .icon { width: 22px; height: 22px; color: var(--primary); margin-top: 5px; flex: none; }
.upload-panel-head h2 { margin: 0 0 2px; font-size: 1.08rem; }
.upload-panel-head p { margin: 0; }

/* 拖放区：像相册里一页空白的贴照片位 */
.dropzone {
  position: relative;
  display: block;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: clamp(26px, 5vw, 40px) 18px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .18s, background-color .18s, color .18s, transform .18s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.dropzone.dragover { border-style: solid; transform: scale(.995); }
.dropzone.has-files { padding: clamp(14px, 2.5vw, 20px) 18px; }
.dropzone.has-files .dz-title { font-size: 1rem; }
.dz-icon { width: clamp(30px, 5vw, 38px); height: clamp(30px, 5vw, 38px); margin: 0 auto 10px; opacity: .75; }
.dz-title { display: block; font-family: var(--font-kai); font-size: 1.08rem; letter-spacing: .04em; margin-bottom: 6px; }
.dz-sub { display: block; font-size: .86rem; color: var(--text-muted); }
.dropzone:hover .dz-sub, .dropzone.dragover .dz-sub { color: inherit; }
.dz-sub .dz-pick { text-decoration: underline; text-underline-offset: 3px; }
/* 桌面/手机差异化文案（触屏说“点”，桌面说“拖”） */
.dz-mobile { display: none; }
@media (hover: none), (max-width: 640px) {
  .dz-desktop { display: none; }
  .dz-mobile { display: inline; }
  .dz-sub .dz-pick { text-decoration: none; }
}

/* 四角相片贴：像老相册贴照片的透明角贴 */
.dz-corner { position: absolute; width: 26px; height: 26px; pointer-events: none; opacity: .55; }
.dz-corner::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgb(190 160 110 / .5), rgb(160 130 85 / .35));
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.dz-corner.tl { top: -8px; left: -8px; }
.dz-corner.tr { top: -8px; right: -8px; transform: scaleX(-1); }
.dz-corner.bl { bottom: -8px; left: -8px; transform: scaleY(-1); }
.dz-corner.br { bottom: -8px; right: -8px; transform: scale(-1); }
[data-theme="dark"] .dz-corner::before { background: linear-gradient(135deg, rgb(205 170 110 / .45), rgb(140 110 70 / .3)); }

/* 待传预览：拍立得小照排开，歪歪斜斜 */
.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr));
  gap: 16px 12px;
  margin-top: 18px;
}
.up-thumb {
  position: relative;
  margin: 0;
  background: #fbf8ef;
  border: 1px solid #e2d9c4;
  padding: 6px 6px 8px;
  box-shadow: 0 3px 8px rgb(72 54 30 / .14);
  transform: rotate(-1.2deg);
  transition: transform .18s ease, box-shadow .18s ease;
}
.up-thumb:nth-child(2n) { transform: rotate(1.1deg); }
.up-thumb:nth-child(3n) { transform: rotate(-.4deg); }
.up-thumb:hover { transform: rotate(0) scale(1.03); box-shadow: var(--shadow-md); z-index: 2; }
.up-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface-2); }
.up-cap { display: flex; flex-direction: column; gap: 1px; padding: 5px 2px 1px; min-width: 0; }
.up-name {
  font-size: .76rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.up-size { font-size: .68rem; color: var(--text-faint); text-align: center; }
.up-thumb.bad { border-color: var(--danger); }
.up-thumb.bad .up-size { color: var(--danger); }
.up-remove {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--danger); color: #fff;
  border: 2px solid var(--surface);
  font-size: 14px; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow-sm);
  opacity: 0; transform: scale(.8);
  transition: opacity .15s, transform .15s;
}
.up-thumb:hover .up-remove, .up-thumb:focus-within .up-remove { opacity: 1; transform: scale(1); }
[data-theme="dark"] .up-thumb { background: #2e2820; border-color: #443a2c; }

.upload-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.upload-actions .btn-primary { margin-right: 2px; }
.upload-actions .faint { flex-basis: 100%; }
@media (max-width: 480px) {
  .upload-preview { grid-template-columns: repeat(auto-fill, minmax(min(100%, 96px), 1fr)); }
  .upload-actions .btn { flex: 1; }
}

/* 相册空状态：收敛在一小格里 */
.album-empty {
  text-align: center; padding: 34px 20px; color: var(--text-faint);
}
.album-empty .icon {
  width: 40px; height: 40px; margin: 0 auto 10px; opacity: .5;
  padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: 50%;
  box-sizing: content-box;
}
.album-empty h3 { margin: 0 0 5px; color: var(--text-muted); font-size: 1.02rem; }
.album-empty p { margin: 0; font-size: .9rem; }

/* 通用单文件选择框（头像等小场景） */
.upload-zone {
  display: block;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 22px 16px; text-align: center;
  color: var(--text-muted); cursor: pointer;
  transition: border-color .18s, background-color .18s, color .18s;
  background: var(--surface-2);
}
.upload-zone:hover, .upload-zone:focus-visible { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.upload-zone .icon { width: 26px; height: 26px; margin: 0 auto 8px; }
.upload-zone strong { font-family: var(--font-kai); font-weight: 600; letter-spacing: .03em; }

/* ---------- 表格行操作（单行文字链：替代换行堆叠的按钮组，行高减半、视觉更轻） ---------- */
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 2px; }
.row-actions form { display: inline-flex; }
.row-actions .act-link {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 5px 9px; border-radius: 7px;
  background: none; border: 0; cursor: pointer;
  color: var(--text-muted); font-size: .84rem; font-weight: 600; letter-spacing: .01em;
  transition: color .15s ease, background-color .15s ease;
}
.row-actions a.act-link { text-decoration: none; }
.row-actions .act-link:hover, .row-actions .act-link:focus-visible {
  color: var(--primary); background: var(--primary-soft);
}
.row-actions .act-danger { color: var(--danger); }
.row-actions .act-danger:hover, .row-actions .act-danger:focus-visible {
  color: var(--danger); background: var(--danger-soft);
}
.row-actions .act-sep { width: 1px; height: 14px; margin: 0 4px; background: var(--border); flex: none; }
/* 手机端：触控区加大到 30px 高；操作链禁止换行（挤成竖排比横向滚动更难看），
   列宽不够时整表在 .table-wrap 里横向滚动（宽表移动端标准行为） */
@media (max-width: 640px) {
  .row-actions { flex-wrap: nowrap; }
  .row-actions .act-link { padding: 7px 10px; font-size: .88rem; }
  .row-actions .act-sep { display: none; }
}

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-weight: 600; font-size: .9rem;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .cur { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); pointer-events: none; }
.pagination .gap { border: 0; background: none; }
.pagination .pg-arrow { padding: 0 13px; }
.pagination .is-off { opacity: .35; pointer-events: none; }
.pagination .pg-info {
  border: 0; background: none; min-width: 0; padding: 0 6px;
  color: var(--text-faint); font-weight: 500; font-size: .82rem; letter-spacing: .02em;
}
/* 手机端：加大触控区、收紧间距（每页 10 条数据时翻页按钮依然好按） */
@media (max-width: 640px) {
  .pagination { gap: 5px; margin-top: 20px; }
  .pagination a, .pagination span { min-width: 40px; height: 40px; font-size: .85rem; }
  .pagination .pg-arrow { padding: 0 14px; }
}

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-faint); }
.empty .icon { width: 42px; height: 42px; margin: 0 auto 12px; opacity: .5; }
.empty h3 { margin: 0 0 6px; color: var(--text-muted); font-size: 1.02rem; }
.empty p { margin: 0; font-size: .9rem; }

/* ---------- 骨架屏 / 懒加载 ---------- */
.skeleton { background: var(--surface-2); border-radius: var(--radius-sm); position: relative; overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, hsl(40 30% 90% / .6), transparent);
  animation: shimmer 1.4s infinite;
}
[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, hsl(0 0% 100% / .06), transparent); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
img[data-lazy] { opacity: 0; transition: opacity .35s; }
img[data-lazy].loaded { opacity: 1; }

/* ---------- 滚动显现（克制：只做轻微淡入） ---------- */
.reveal { opacity: 0; transition: opacity .3s ease; }
.reveal.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- 密码强度 ---------- */
.pwd-meter { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.pwd-meter i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--danger); transition: width .25s, background-color .25s; }
.pwd-meter.w1 i { width: 25%; background: var(--danger); }
.pwd-meter.w2 i { width: 50%; background: var(--warning); }
.pwd-meter.w3 i { width: 75%; background: var(--success); }
.pwd-meter.w4 i { width: 100%; background: var(--success); }

/* ---------- 认证卡片（信笺） ---------- */
.auth-wrap { max-width: 430px; margin: 1.5vh auto 0; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; }
.auth-logo .auth-name { font-family: var(--font-kai); font-size: 1.28rem; letter-spacing: .08em; font-weight: 600; }
.auth-logo .brand-mark { width: 42px; height: 42px; font-size: 21px; }
.auth-sub { margin: 0 0 18px; font-size: .92rem; }
.auth-alt { text-align: center; margin-top: 16px; font-size: .9rem; color: var(--text-muted); }

/* 注册模式提示（纸上批注） */
.mode-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--primary-soft);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  color: var(--primary-strong);
  padding: 10px 14px; margin-bottom: 16px;
  font-size: .88rem; line-height: 1.65;
}
[data-theme="dark"] .mode-note { color: var(--primary-strong); }

/* 验证码行 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .input { flex: 1; min-width: 0; letter-spacing: .2em; }
.captcha-row img {
  flex: none; width: 128px; height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  cursor: pointer;
}

/* ---------- 管理后台（作业本标签） ---------- */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-nav a { padding: 7px 14px; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); }
.admin-nav a:hover { color: var(--primary); border-color: var(--primary); }
.admin-nav a.active { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }

/* ---------- 通知条（黑板报） ---------- */
.notice-bar {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border-strong); border-left: 4px solid var(--primary);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 18px; font-size: .92rem;
}
.notice-bar .icon { color: var(--primary); margin-top: 3px; }

/* ---------- 时间线 ---------- */
.timeline { display: flex; flex-direction: column; gap: 4px; }
.timeline-item { display: flex; gap: 12px; padding: 10px 4px; border-radius: var(--radius-sm); transition: background-color .12s; }
.timeline-item:hover { background: var(--surface-2); }
.timeline-date { flex: none; width: 84px; color: var(--text-faint); font-size: .8rem; padding-top: 3px; }

/* ---------- 控制台限制卡片（v2026.9）：限高 + 内部滚动，数据再多也不撑长页面 ---------- */
.dash-scroll {
  max-height: 300px; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 6px 2px 0; margin: 0 -2px; scrollbar-width: thin;
  border-top: 1px dashed transparent;
}
.dash-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin: 10px 0 0; padding-top: 10px;
  border-top: 1px dashed var(--border); /* 信纸虚线分隔，呼应全站纸感 */
  font-size: .78rem; color: var(--text-faint);
}
.dash-foot a { flex: none; color: var(--text-faint); border-bottom: 1px dashed transparent; }
.dash-foot a:hover { color: var(--primary); border-bottom-color: currentColor; }
@media (max-width: 640px) {
  .dash-scroll { max-height: 262px; } /* 手机端控制台卡片稍矮，滚动更跟手（须置于基础规则之后覆盖） */
  .dash-foot { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 99;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateY(-10px); opacity: 0; visibility: hidden; pointer-events: none;
    transition: all .2s ease;
  }
  .main-nav.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .nav-link { padding: 12px 14px; font-size: 1rem; }
  .nav-link.active::after { display: none; }
  .nav-link.active { border-left: 3px solid var(--primary); padding-left: 11px; }
  .nav-toggle { display: grid; }
  .brand-name { display: none; }
  .hero { flex-direction: column-reverse; text-align: center; }
  .hero-photo { width: min(64%, 300px); }
  .hero-badges, .hero-cta { justify-content: center; }
  .hero-rich { margin-inline: auto; }
  .toc-list { grid-template-columns: 1fr; }
  .toc-item:nth-last-child(-n+2) { border-bottom: 1px dashed var(--border); }
  .toc-item:last-child { border-bottom: 0; }
}
@media (min-width: 901px) {
  .nav-toggle { display: none; }
  .main-nav { visibility: visible !important; opacity: 1 !important; transform: none !important; position: static; background: none; border: 0; box-shadow: none; padding: 0; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 12px 14px; gap: 10px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 118px), 1fr)); gap: 10px 8px; }
  .comment-item { padding: 14px 10px; }
  .info-item dt { min-width: 64px; }
  .hero-cta .btn { width: 100%; }
  .hero-photo { width: 78%; }
  .lightbox-nav { width: 38px; height: 38px; }
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
  .table th, .table td { padding: 9px 10px; }
  .search-bar { flex-direction: column; }
  .page-title { font-size: 1.3rem; }
  .captcha-row { flex-direction: column; }
  .captcha-row img { width: 100%; height: 48px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .auth-wrap { max-width: 100%; }
  /* 页头：小屏上下堆叠；操作区（按钮/印章/按钮组）统一右对齐，呼应桌面「标题左/操作右」，拇指易触 */
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 12px; }
  .page-head > * + * { align-self: flex-end; }
  .page-head .btn { justify-content: center; width: auto; min-height: 44px; }
  .page-head .page-stamp { margin-bottom: 0; }
  /* 详情信息条：手机端单列（时间/地点/发起人各占一行，不再挤作一团） */
  .fact-list { grid-template-columns: 1fr; }
  .fact:nth-child(n+3) { border-top: 1px dashed var(--border); }
  .fact:nth-child(2n) { border-left: 0; }
  .fact:nth-child(n+2) { border-top: 1px dashed var(--border); }
  .fact dd { font-size: .95rem; }
  /* 上传区头部：图标与说明上下排 */
  .upload-panel-head { gap: 10px; }
  .upload-panel-head .icon { margin-top: 3px; }
  .hero-edit { display: block; text-align: center; }
  .dz-corner { width: 20px; height: 20px; }
  /* 活动便签：小屏收敛倾斜与胶带（防溢出） */
  .activity-card { margin-top: 10px; transform: rotate(-.4deg); box-shadow: 2px 3px 0 rgb(72 54 30 / .06); }
  .activity-card:nth-child(2n) { transform: rotate(.35deg); }
  .activity-card:nth-child(3n) { transform: rotate(-.1deg); }
  .activity-card .tape { width: 56px; height: 18px; top: -9px; }
  .activity-card:hover, .activity-card:focus-visible { transform: rotate(0); }
  .activity-sheet .tape { width: 72px; }
  /* 后台站点设置：邮件服务双列并排字段回落单列 */
  .admin-config-cols { grid-template-columns: 1fr !important; }
}

/* 平板优化 */
@media (min-width: 641px) and (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .toc-list { grid-template-columns: 1fr; }
}

/* 自定义滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ============================================================
   v2026.2 组件（纸感化）
   ============================================================ */

/* ---------- 站点 Logo（导航品牌区） ---------- */
.brand-logo {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex: none;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

/* ---------- 生日提醒（班级中心） ---------- */
.birthday-card { border-left: 4px solid var(--primary); }
.birthday-today {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-kai); font-weight: 600; letter-spacing: .03em;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.birthday-today a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.birthday-soon { display: flex; gap: 8px; flex-wrap: wrap; }
.birthday-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: .86rem;
}

/* ---------- 班级活动 ---------- */
.activity-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.activity-mini {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: border-color .15s;
}
.activity-mini:hover { border-color: var(--primary); }
.activity-mini strong { font-size: .95rem; font-family: var(--font-kai); letter-spacing: .03em; }
.activity-count { font-size: .8rem; color: var(--primary); font-weight: 700; margin-top: 2px; }
/* ---------- 班级活动（v2026.4 手作便签风：胶带 + 微倾斜 + 印章，与全站纸感统一） ---------- */
.activity-card {
  position: relative; display: flex; flex-direction: column;
  padding: 24px 18px 16px; margin-top: 8px;
  transform: rotate(-.8deg);
  box-shadow: 3px 4px 0 rgb(72 54 30 / .07);
  transition: transform .25s ease, box-shadow .25s ease;
}
.activity-card:nth-child(2n) { transform: rotate(.7deg); }
.activity-card:nth-child(3n) { transform: rotate(-.25deg); }
.activity-card:hover, .activity-card:focus-visible {
  transform: rotate(0) translateY(-3px);
  box-shadow: var(--shadow-md);
}
.activity-card .tape { width: 72px; height: 22px; top: -11px; }
.activity-card-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.04rem; font-family: var(--font-kai); letter-spacing: .03em;
}
.activity-card-head .icon { flex: none; }
.act-meta { margin: 5px 0 0; font-size: .88rem; color: var(--text-muted); }
.act-meta .icon { color: var(--primary); }
.act-desc {
  margin: 8px 0 0; font-size: .85rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.act-foot { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
/* 活动状态印章（像盖在传单角上的章） */
.act-stamp {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  color: var(--primary-strong);
  font-size: .76rem; font-weight: 700; letter-spacing: .05em;
  transform: rotate(-2.5deg);
  opacity: .9;
}
.act-stamp.stamp-done {
  border-color: var(--text-muted);
  color: var(--text-muted);
  transform: rotate(2deg);
}
[data-theme="dark"] .act-stamp { color: var(--primary-strong); border-color: var(--primary); }
/* 详情页：活动介绍信纸（顶部胶带 + 段落虚线分隔，像誊在信纸上） */
.activity-sheet { position: relative; }
.activity-sheet .tape { width: 88px; top: -12px; }
.activity-sheet .activity-desc { line-height: 1.95; }
.activity-sheet .activity-desc p { margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.activity-sheet .activity-desc p:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
/* 详情页：报名名单（便利贴 + 顶部图钉） */
.activity-roster { position: relative; }
.roster-pin {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #e08a72, #b03a2e 58%, #7e241b);
  box-shadow: 0 2px 4px rgb(72 54 30 / .35), inset 0 -2px 3px rgb(0 0 0 / .25);
}
.activity-desc { line-height: 1.9; }
/* 空名单：手写批注（像组织者在空白名单旁写的一句） */
.roster-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; margin: 4px 0 8px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  font-family: var(--font-kai); font-size: .95rem; letter-spacing: .08em;
  color: var(--text-muted); text-align: center; padding: 18px 14px;
}
.signup-list { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.signup-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
/* 发件箱正文（后台查看调试邮件） */
.mail-view { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; background: #f3ede1; overflow-x: auto; }
.note-ok {
  background: var(--success-soft); color: var(--success);
  border: 1px dashed var(--success);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: .9rem;
  line-height: 1.7;
}

/* ---------- 富文本编辑器（后台站点设置） ---------- */
.rich-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap;
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 6px;
  background: var(--surface-2);
}
.rich-toolbar button {
  font: inherit; font-size: .82rem;
  min-height: 32px; min-width: 32px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.rich-toolbar button:hover { border-color: var(--primary); color: var(--primary); }
.rich-editor {
  min-height: 140px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface);
  line-height: 1.8;
  outline: none;
}
.rich-editor:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-faint);
}
.rich-editor h2 { font-size: 1.2em; margin: .4em 0 .2em; }
.rich-editor h3 { font-size: 1.08em; margin: .4em 0 .2em; }
.rich-editor ul, .rich-editor ol { padding-left: 1.5em; }

/* ---------- 后台批量操作栏 ---------- */
.batch-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 14px 0;
}
.batch-bar .check-pill { margin: 0; }

/* ---------- 待审核徽章 ---------- */
.badge-warn { background: var(--warning-soft); color: var(--warning); }

/* ---------- 统计数字实时刷新提示 ---------- */
[data-live-stat] { transition: color .3s; }
[data-live-stat].tick { animation: statTick .6s ease; }
@keyframes statTick {
  0% { transform: scale(1); }
  40% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
