:root {
  --bg: #f5f5f1;
  --card: #ffffff;
  --ink: #141a1c;
  --ink-2: #333d3f;
  --muted: #6e7876;
  --line: #e6e5de;
  --line-strong: #d8d7cf;
  --accent: #1f6b56;
  --accent-2: #2c8468;
  --accent-soft: #edf3f0;
  --amber: #8a6320;
  --amber-soft: #f7f0e2;
  --red: #ad3a31;
  --red-soft: #fbeeec;
  --violet: #5a4a83;
  --violet-soft: #f0edf6;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 44px rgba(20, 26, 28, 0.08);
  --shadow-soft: 0 1px 2px rgba(20, 26, 28, 0.04);
  --topbar: rgba(250, 250, 247, 0.84);
  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { margin: 0 0 6px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 600; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
img { max-width: 100%; }

.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(230, 229, 222, 0.8);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.menu-toggle {
  flex: none;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.menu-toggle .icon { width: 20px; height: 20px; }
.menu-toggle:hover { background: #eeede7; border-color: var(--line); color: var(--ink); }
.topbar-avatar {
  margin-left: auto;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--line-strong);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-avatar:hover {
  color: var(--accent);
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(20, 26, 28, 0.1);
}
.topbar-login {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(31, 107, 86, 0.22);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.topbar-login:hover {
  background: #1a5d4b;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(31, 107, 86, 0.28);
}
.topbar-login svg { width: 15px; height: 15px; }

/* ---------------- drawer ---------------- */
body.drawer-open { overflow: hidden; }
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 20, 20, 0.42);
  backdrop-filter: blur(4px);
  animation: drawer-fade 0.25s ease;
}
.drawer-mask[hidden] { display: none; }
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 70;
  width: min(310px, 86vw);
  display: flex;
  flex-direction: column;
  padding: 20px 18px 22px;
  background: #fbfbf8;
  border-right: 1px solid var(--line);
  box-shadow: 24px 0 60px rgba(16, 20, 20, 0.14);
  transform: translateX(-104%);
  visibility: hidden;
  transition: transform 0.36s cubic-bezier(0.22, 0.8, 0.28, 1), visibility 0.36s;
  overflow-y: auto;
}
.drawer.is-open { transform: none; visibility: visible; }
.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.drawer-profile { flex: 1; display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.drawer-profile:hover { color: var(--ink); }
.drawer-user { display: flex; flex-direction: column; min-width: 0; }
.drawer-user strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-user small { font-size: 11.5px; color: var(--muted); }
.drawer-close {
  flex: none;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.drawer-close .icon { width: 17px; height: 17px; }
.drawer-close:hover { background: #eeede7; color: var(--ink); }
.drawer-label {
  margin: 16px 12px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease;
}
.drawer-link-main { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.drawer-link-main .icon { width: 17px; height: 17px; color: var(--muted); transition: color 0.18s ease; }
.drawer-link small { font-size: 11px; font-weight: 400; color: var(--muted); }
.drawer-link:hover { background: #efeee8; color: var(--ink); }
.drawer-link:hover .icon { color: var(--ink); }
.drawer-link:hover small { color: var(--muted); }
.drawer-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.drawer-link.is-active .icon { color: var(--accent); }
.drawer-link.is-active small { color: var(--accent); opacity: 0.75; }
.drawer-link-admin { color: var(--violet); }
.drawer-link-admin .icon { color: var(--violet); opacity: 0.8; }
.drawer-link-admin:hover { background: var(--violet-soft); color: var(--violet); }
.drawer-link-admin:hover .icon { color: var(--violet); }
.drawer-link-admin.is-active { background: var(--violet-soft); color: var(--violet); }
.drawer-link-admin.is-active .icon { color: var(--violet); }
.drawer-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.drawer-logout { gap: 8px; color: var(--muted); }
.drawer-logout .icon { width: 16px; height: 16px; }
@keyframes drawer-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 17px;
  color: #fff;
  background: var(--ink);
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.brand-text small { font-size: 11px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-link:hover { background: #eeede7; color: var(--ink); }
.nav-link.is-active { background: var(--ink); color: #fff; }
.nav-link-cta { background: var(--accent); color: #fff; font-weight: 500; }
.nav-link-cta:hover { background: #185845; color: #fff; }
.nav-admin { color: var(--violet); background: var(--violet-soft); }
.nav-admin:hover { background: #e8e2f2; color: var(--violet); }
.nav-admin.is-active { background: var(--violet); color: #fff; }
.nav-logout { margin: 0; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  line-height: 1.2;
}
.btn .icon { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(31, 107, 86, 0.18);
}
.btn-primary:hover { background: #185845; color: #fff; box-shadow: 0 10px 22px rgba(31, 107, 86, 0.24); transform: translateY(-1px); }
.btn-light { background: #fff; color: var(--accent); }
.btn-light:hover { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.btn-ghost:hover { background: #eeede7; color: var(--ink); border-color: var(--ink-2); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #f0d3cf; }
.btn-danger:hover { background: #f7dfdb; color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 12px; }

/* ---------------- layout ---------------- */
.page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 52px;
  flex: 1;
}
.page-landing { padding-top: 40px; }
.main > section + section, .page > section + section { margin-top: 20px; }
.footer {
  padding: 22px 20px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer-dot { margin: 0 8px; opacity: 0.5; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}
.card-inset {
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 17px; }

.grid-2 { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 20px; }
.grid-2 > .card { min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-leave { grid-template-columns: 0.95fr 1.05fr; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head-main h1 { font-size: 32px; margin: 2px 0 6px; letter-spacing: -0.025em; font-weight: 600; }
.page-head-main .muted { font-size: 13.5px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 10.5px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }

/* ---------------- avatar ---------------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  overflow: hidden;
  flex: none;
  border: 1px solid var(--line-strong);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }
.avatar-xl { width: 88px; height: 88px; font-size: 30px; }

/* ---------------- chips ---------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.chip-ok, .chip-info { background: var(--accent-soft); color: var(--accent); }
.chip-info { background: #eaf0f8; color: #2f5d8a; }
.chip-warn { background: var(--amber-soft); color: var(--amber); }
.chip-muted { background: #f0efe9; color: var(--muted); }
.chip-super { background: var(--violet-soft); color: var(--violet); }
.chip-admin { background: #eaf0f8; color: #2f5d8a; }
.chip-user { background: #f0efe9; color: var(--ink-2); }
.role-chips { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- flash ---------------- */
.flash-stack {
  position: fixed;
  z-index: 60;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 460px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flash {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: flash-in 0.28s cubic-bezier(0.22, 0.8, 0.28, 1);
  background: #fff;
  border: 1px solid var(--line);
}
.flash-success { background: var(--accent-soft); color: #155445; border-color: #d3e4dc; }
.flash-error { background: var(--red-soft); color: #962a22; border-color: #eed4d0; }
.flash-warn { background: var(--amber-soft); color: var(--amber); border-color: #eaddc4; }
.flash-info { background: #eef2f8; color: #38506b; border-color: #dae3ef; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- 签到 / 签退成功弹窗 ---------------- */
body.success-open { overflow: hidden; }
.success-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(14, 18, 18, 0.5);
  backdrop-filter: blur(8px) saturate(1.1);
  animation: success-fade 0.24s ease both;
}
.success-modal.is-closing { animation: success-fade-out 0.24s ease both; }
.success-dialog {
  position: relative;
  width: min(378px, 100%);
  padding: 34px 30px 26px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 34px 80px rgba(10, 16, 15, 0.32);
  text-align: center;
  overflow: hidden;
  animation: success-rise 0.42s cubic-bezier(0.22, 0.9, 0.28, 1.04) both;
}
.success-dialog::before {
  content: "";
  position: absolute;
  top: -46%;
  left: 50%;
  width: 260px;
  height: 260px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(44, 132, 104, 0.16), rgba(44, 132, 104, 0) 68%);
  pointer-events: none;
}
.success-modal.is-closing .success-dialog { animation: success-sink 0.24s ease both; }
.success-badge {
  position: relative;
  display: inline-flex;
  width: 76px;
  height: 76px;
  margin-bottom: 16px;
}
.success-badge::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(44, 132, 104, 0.18), rgba(44, 132, 104, 0) 70%);
  animation: success-halo 0.9s ease 0.15s both;
}
.success-badge svg { position: relative; width: 76px; height: 76px; }
.success-ring {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-dasharray: 182;
  stroke-dashoffset: 182;
  animation: success-draw 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}
.success-check {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 44;
  stroke-dashoffset: 44;
  animation: success-draw 0.34s cubic-bezier(0.4, 0, 0.2, 1) 0.62s forwards;
}
.success-kicker {
  margin: 0 0 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.success-dialog h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.success-desc {
  max-width: 28ch;
  margin: 0 auto 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.success-time {
  margin: 0 0 20px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  opacity: 0.78;
}
.success-dialog .btn { border-radius: 12px; padding: 12px 18px; }
@keyframes success-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes success-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes success-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes success-sink {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(10px) scale(0.97); }
}
@keyframes success-draw { to { stroke-dashoffset: 0; } }
@keyframes success-halo {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: none; }
}

/* ---------------- landing ---------------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  padding: 48px 6px 36px;
  position: relative;
}
.hero-copy { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid #dbe8e2;
  color: var(--accent);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  color: var(--ink);
}
.hero p { color: var(--muted); max-width: 440px; font-size: 15px; line-height: 1.8; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 18px; }
.hero-note { font-size: 12.5px; color: var(--muted) !important; }
.hero-panel { position: relative; z-index: 1; }
.hero-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px rgba(44, 132, 104, 0.12); display: inline-block; }
.hero-card-label { font-size: 12px; color: var(--muted); margin: 8px 0 16px; }
.hero-steps { margin: 0 0 18px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.hero-steps li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.hero-steps span { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.hero-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.hero-metrics strong { display: block; font-size: 21px; color: var(--ink); font-weight: 600; }
.hero-metrics small { font-size: 11px; color: var(--muted); }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 10px; }
.feature { padding: 22px; transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.feature h3 { font-size: 15px; margin: 14px 0 6px; }
.feature p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.7; }
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.feature-icon svg { width: 20px; height: 20px; }
.landing-roles { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.landing-roles h2 { margin-bottom: 4px; }

/* ---------------- auth ---------------- */
.page-auth { display: flex; align-items: center; justify-content: center; padding-top: 40px; }
.auth-wrap { width: 100%; max-width: 430px; }
.auth-card { padding: 30px 28px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .brand-mark { margin: 0 auto 12px; }
.auth-head h1 { font-size: 24px; }
.auth-hint {
  margin-top: 18px;
  padding: 13px 15px;
  border-radius: 12px;
  background: #f6faf9;
  border: 1px dashed #cfe6e1;
  font-size: 12.5px;
  color: var(--ink-2);
}
.auth-hint strong { color: var(--accent); display: block; margin-bottom: 4px; }
.auth-hint p { margin: 0; color: var(--muted); line-height: 1.7; }
.auth-hint em { font-style: normal; color: var(--ink-2); font-weight: 600; }
.auth-switch { text-align: center; margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.auth-forgot { text-align: center; margin: 12px 0 0; font-size: 12.5px; }

/* ---------------- forms ---------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea, .copy-input, .role-form select, .inline-edit input, .review-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field input:focus, .field select:focus, .field textarea:focus, .copy-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 107, 86, 0.1);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input[readonly] { background: #f2f1ec; color: var(--muted); cursor: not-allowed; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { color: var(--muted); font-size: 12px; }

.field-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafaf7;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.field-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.field-check span { line-height: 1.5; }

.var-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
  scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.settings-tab:hover { background: #f4f3ee; color: var(--ink); }
.settings-tab.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(31, 107, 86, 0.22);
}
.settings-tab.is-active:hover { background: var(--accent); color: #fff; }
.settings-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d5d4cc;
  flex: none;
}
.settings-dot.is-on { background: var(--accent); box-shadow: 0 0 0 3px rgba(31, 107, 86, 0.14); }
.settings-tab.is-active .settings-dot { background: rgba(255, 255, 255, 0.85); box-shadow: none; }

.var-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: #eef7f5;
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 7px;
}
.template-editor {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdfc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  min-height: 300px;
  resize: vertical;
}
.template-editor:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14); background: #fff; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.danger-card { border-color: #f0c8c3; background: linear-gradient(180deg, #fffdfc 0%, #fff9f8 100%); }
.danger-card .card-head h2 { color: #a63a30; }

.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed #c6e2dc;
  background: #f8fcfb;
  border-radius: 14px;
  padding: 22px 16px;
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.upload-box:hover { border-color: var(--accent-2); background: var(--accent-soft); }
.upload-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { font-size: 22px; color: var(--accent); line-height: 1; }
.upload-text { font-size: 13px; color: var(--muted); }
.upload-preview { max-height: 190px; border-radius: 10px; margin-top: 8px; object-fit: cover; }
.upload-box.has-preview { padding: 10px; }
.upload-box-sm { padding: 14px; }
.checkout-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

/* ---------------- dashboard ---------------- */
.status-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--line-strong);
}
.status-todo { border-left-color: #9aa5a3; }
.status-progress { border-left-color: var(--amber); }
.status-done { border-left-color: var(--accent); }
.status-leave { border-left-color: #2f5d8a; }
.status-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
}
.status-todo .status-badge { background: #f0efe9; color: var(--ink-2); }
.status-leave .status-badge { background: #eaf0f8; color: #2f5d8a; }
.status-card h2 { font-size: 23px; margin: 4px 0; letter-spacing: -0.02em; }
.status-main { min-width: 0; }
.status-side { display: flex; flex-direction: column; gap: 0; justify-content: center; min-width: 108px; }
.mini-stat { text-align: center; padding: 9px 14px; border-radius: 0; background: transparent; border: 0; border-top: 1px solid var(--line); }
.mini-stat:first-child { border-top: 0; }
.mini-stat strong { display: block; font-size: 21px; font-weight: 600; color: var(--ink); }
.mini-stat small { font-size: 11px; color: var(--muted); }
.status-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.status-actions form { flex: 0 0 auto; }
.status-photo { margin-top: 12px; }
.status-photo img { max-height: 220px; border-radius: 12px; border: 1px solid var(--line); }

.week-card { padding: 22px 24px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-day {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: #fcfcfa;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.week-day:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.week-day.is-done { background: var(--accent-soft); border-color: #cfe2d8; }
.week-day.is-partial { background: var(--amber-soft); border-color: #ecdcbf; }
.week-day.is-today { border-color: var(--ink); box-shadow: none; }
.week-label { font-size: 11.5px; color: var(--muted); }
.week-dot { font-size: 13px; font-weight: 600; color: var(--accent); min-height: 20px; }
.week-day small { font-size: 10.5px; color: var(--muted); }

.record-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.record-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.record-list li:last-child { border-bottom: 0; }
.record-list strong { display: block; font-size: 13.5px; font-weight: 500; }
.record-list small { display: block; font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 28px 10px; font-size: 13px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fcfcfa;
  color: var(--ink);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.quick-item:hover {
  border-color: var(--line-strong);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
}
.quick-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.quick-icon .icon { width: 17px; height: 17px; }
.quick-text { display: flex; flex-direction: column; min-width: 0; }
.quick-item strong { font-size: 13px; font-weight: 500; }
.quick-item small { font-size: 11px; color: var(--muted); }
.text-link { font-size: 12.5px; font-weight: 500; }
.center { display: block; text-align: center; margin-top: 12px; }

/* ---------------- scan ---------------- */
.scan-header { text-align: center; margin-bottom: 18px; }
.scan-header h1 { font-size: 28px; margin: 8px 0 4px; }
.scan-card { max-width: 560px; margin: 0 auto; padding: 26px; }
.scan-status-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.notice-card { max-width: 560px; margin: 0 auto; }
.notice-danger { border-left: 5px solid var(--red); }
.scan-tips { max-width: 560px; margin: 16px auto 0; }
.scan-tips h3 { margin-bottom: 8px; }
.scan-tips ul, .tips-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.scan-tips li, .tips-list li { margin-bottom: 6px; }

/* ---------------- month / tables ---------------- */
.month-form { display: flex; align-items: center; gap: 8px; }
.month-form label { font-size: 12.5px; color: var(--muted); }
.month-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; background: #fff; }

.stat-grid { display: grid; gap: 16px; margin-bottom: 18px; }
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 18px 20px; }
.stat small { color: var(--muted); font-size: 12px; }
.stat strong { display: block; font-size: 30px; line-height: 1.2; margin: 6px 0 2px; color: var(--accent); }
.stat strong em { font-size: 12px; font-style: normal; color: var(--muted); margin-left: 3px; }
.stat-word { font-size: 20px !important; }
.stat span { font-size: 12px; }

.table-wrap { width: 100%; overflow-x: auto; border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fafcfb;
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f9fdfb; }
.thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); display: block; }
.thumb-link { display: inline-block; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.page-btn { padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 12.5px; }
.page-btn:hover { border-color: var(--accent-2); color: var(--accent); }
.page-info { font-size: 12.5px; color: var(--muted); }

/* ---------------- leave ---------------- */
.tab-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { padding: 6px 12px; border-radius: 999px; background: #f2f1eb; color: var(--muted); font-size: 12.5px; border: 1px solid transparent; transition: background 0.18s ease, color 0.18s ease; }
.pill:hover { background: var(--accent-soft); color: var(--accent); }
.pill.is-active { background: var(--ink); color: #fff; font-weight: 500; }
.leave-list { display: flex; flex-direction: column; gap: 12px; }
.leave-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fbfdfc; }
.leave-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.leave-item-head p { margin: 2px 0 0; font-size: 12.5px; }
.leave-reason { font-size: 13.5px; margin: 8px 0; }
.leave-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.leave-item-foot small { font-size: 11.5px; }
.review-note { font-size: 12.5px; color: var(--amber); background: var(--amber-soft); border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; }
.leave-approval-list { display: flex; flex-direction: column; gap: 12px; }
.review-form { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.review-form input { flex: 1 1 200px; }
.review-actions { display: flex; gap: 8px; }

/* ---------------- 请假（学生端） ---------------- */
.leave-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: center;
  padding: 30px 32px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(120% 140% at 92% -10%, rgba(31, 107, 86, 0.1), rgba(31, 107, 86, 0) 55%),
    linear-gradient(180deg, #fbfbf7 0%, #ffffff 100%);
}
.leave-hero-main h1 {
  margin: 4px 0 10px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: 0.01em;
}
.leave-hero-main .muted { max-width: 44ch; margin: 0; }
.leave-active {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 14px 0 0;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
}
.leave-active .icon { width: 15px; height: 15px; }
.leave-stats { display: flex; }
.leave-stat { padding: 2px 22px; text-align: center; border-left: 1px solid var(--line); }
.leave-stat:first-child { border-left: 0; }
.leave-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
}
.leave-stat small { font-size: 11.5px; letter-spacing: 0.04em; color: var(--muted); }

.leave-layout { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 18px; align-items: start; }
.leave-history { padding: 22px; }
.leave-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 16px; }
.leave-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.leave-card {
  position: relative;
  padding: 15px 16px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.leave-card:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.leave-card.is-pending { border-left-color: var(--amber); }
.leave-card.is-approved { border-left-color: var(--accent); }
.leave-card.is-rejected { border-left-color: #c6c5bc; }
.leave-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.leave-range {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.015em;
}
.leave-range span { margin: 0 5px; color: var(--muted); font-size: 15px; }
.leave-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.leave-reason {
  margin: 12px 0 0;
  padding-left: 11px;
  border-left: 2px solid var(--line);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
  word-break: break-word;
}
.leave-note {
  margin: 10px 0 0;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--amber-soft);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
}
.leave-note span { margin-right: 6px; font-weight: 600; color: var(--amber); }
.leave-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.leave-foot-actions { display: flex; align-items: center; gap: 12px; }
.leave-proof { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.leave-proof .icon { width: 14px; height: 14px; }
.leave-empty { padding: 34px 12px; text-align: center; color: var(--muted); }
.leave-empty .icon { width: 34px; height: 34px; opacity: 0.45; }
.leave-empty p { margin: 8px 0 4px; font-size: 14px; color: var(--ink-2); }
.leave-empty small { font-size: 12px; }

@media (max-width: 980px) {
  .leave-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .leave-hero { grid-template-columns: 1fr; gap: 20px; padding: 24px 20px; }
  .leave-hero-main h1 { font-size: 26px; }
  .leave-stats { border-top: 1px solid var(--line); padding-top: 16px; }
  .leave-stat { flex: 1; padding: 0 8px; }
  .leave-stat strong { font-size: 24px; }
  .leave-history { padding: 18px; }
  .leave-range { font-size: 19px; }
}

/* ---------------- profile ---------------- */
.profile-hero { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.profile-meta h2 { margin-bottom: 2px; }
.profile-bio { color: var(--ink-2); font-size: 13.5px; margin: 10px 0 12px; max-width: 640px; }
.profile-tags { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- admin ---------------- */
.admin-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
}
.admin-nav .nav-link { font-size: 13px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-track { position: relative; width: 100%; max-width: 46px; height: 130px; background: #f1f7f5; border-radius: 9px; display: flex; align-items: flex-end; overflow: hidden; }
.bar-fill { width: 100%; min-height: 3px; border-radius: 9px; background: linear-gradient(180deg, #36d3bf, #0f766e); transition: height 0.4s ease; }
.bar-fill.is-today { background: linear-gradient(180deg, #fbbf24, #b45309); }
.bar-value { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.bar-label { font-size: 11px; color: var(--muted); }
.visit-figures { display: flex; gap: 28px; margin: 2px 0 8px; }
.visit-figures strong { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.visit-figures small { font-size: 12px; color: var(--muted); }
.big-line { font-size: 13px; font-weight: 600; margin-bottom: 2px; }

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.filter-bar .field { min-width: 130px; flex: 0 1 auto; }
.filter-actions { display: flex; gap: 8px; }
.summary-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.time-input { width: 92px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-family: inherit; }
.action-stack { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.action-stack form { margin: 0; }
.role-form { display: flex; gap: 4px; align-items: center; }
.role-form select { width: auto; padding: 5px 6px; font-size: 12px; }
.inline-edit summary { font-size: 12px; color: var(--accent); cursor: pointer; padding: 4px 6px; }
.inline-edit form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.inline-edit input { width: 110px; padding: 5px 8px; font-size: 12px; }

.qr-card { text-align: left; }
.qr-layout { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: center; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-soft); }
.qr-box img { width: 100%; max-width: 268px; display: block; }
.qr-info h2 { margin-top: 8px; }
.copy-row { display: flex; gap: 8px; margin: 14px 0 8px; }
.copy-input { flex: 1; font-size: 12px; }
.qr-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.qr-actions form { margin: 0; }
.qr-empty { text-align: center; padding: 30px 10px; }

.export-form { max-width: 640px; }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
.export-tip h3 { margin-bottom: 6px; }
.export-tip p { margin: 0; font-size: 12.5px; }

.error-page { text-align: center; padding: 70px 20px; }
.error-code { font-size: 72px; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.error-page .status-actions { justify-content: center; }

/* ---------------- 欢迎首页 ---------------- */
.page-home { max-width: none; padding: 0; display: flex; }
.home-hero {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: calc(100vh - 136px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  overflow: hidden;
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px 420px at 50% 4%, rgba(31, 107, 86, 0.07), transparent 72%),
    linear-gradient(180deg, #f8f8f4 0%, #f2f2ed 100%);
  pointer-events: none;
}
.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(20, 26, 28, 0.045) 1px, transparent 1px);
  background-size: 25% 100%;
  opacity: 0.55;
  pointer-events: none;
}
.home-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--muted);
}
.home-eyebrow::before,
.home-eyebrow::after {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--line-strong);
}
.home-title { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.home-line { display: block; overflow: hidden; padding-bottom: 6px; }
.home-line > span {
  display: block;
  transform: translateY(106%);
  animation: home-unveil 1.05s cubic-bezier(0.22, 0.8, 0.28, 1) forwards;
}
.home-line-delay > span { animation-delay: 0.16s; }
.home-class {
  font-family: var(--font-display);
  font-size: clamp(46px, 8.6vw, 116px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.home-welcome {
  font-size: clamp(22px, 3.6vw, 44px);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.home-welcome em { font-style: normal; margin: 0 2px; color: var(--accent); font-weight: 600; }
.home-rule {
  width: 56px;
  height: 1px;
  margin: 32px 0 34px;
  background: var(--line-strong);
  transform-origin: center;
  animation: home-rule 0.9s 0.6s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}
.home-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  animation: home-fade 0.9s 0.7s both;
}
.home-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}
.home-action .icon { width: 16px; height: 16px; }
.home-action:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(31, 107, 86, 0.14);
}
.home-action.is-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 12px 30px rgba(20, 26, 28, 0.16);
}
.home-action.is-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 18px 38px rgba(31, 107, 86, 0.24);
}
.home-hint {
  margin: 20px 0 0;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
  animation: home-fade 0.9s 0.82s both;
}
@keyframes home-unveil {
  to { transform: translateY(0); }
}
@keyframes home-rule {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}
@keyframes home-fade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 公告 ---------------- */
.notice-list { display: flex; flex-direction: column; gap: 14px; }
.notice-item { display: flex; flex-direction: column; gap: 8px; transition: box-shadow 0.2s ease, border-color 0.2s ease; }
.notice-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.notice-item.is-pinned { border-left: 3px solid var(--amber); }
.notice-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice-head h2 { margin: 0; font-size: 18px; }
.notice-body { margin: 0; font-size: 14px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; }
.notice-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 54px 22px;
  text-align: center;
}
.empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #f2f1ec;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.empty-icon .icon { width: 22px; height: 22px; }
.empty-card .btn { margin-top: 8px; }

/* ---------------- 课表 ---------------- */
.week-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.week-step {
  flex: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.week-step .icon { width: 16px; height: 16px; }
.week-step.is-prev .icon { transform: rotate(180deg); }
.week-step:hover { background: var(--accent-soft); border-color: #d3e4dc; color: var(--accent); }
.week-step.is-disabled { opacity: 0.35; pointer-events: none; }
.week-rail {
  flex: 1;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}
.week-rail::-webkit-scrollbar { display: none; }
.week-chip {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.week-chip:hover { background: #efeee8; color: var(--ink); }
.week-chip.is-current:not(.is-active) { border-color: #d3e4dc; color: var(--accent); }
.week-chip.is-active { background: var(--ink); color: #fff; font-weight: 600; }
.week-chip.is-active:hover { background: var(--ink); color: #fff; }
.timetable-card { padding: 20px; }
.timetable-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.timetable { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 13px; }
.timetable th, .timetable td { border-bottom: 1px solid var(--line); padding: 0; vertical-align: top; }
.timetable thead th {
  padding: 10px 8px;
  background: transparent;
  border-bottom: 1px solid var(--line-strong);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: left;
}
.timetable thead th:not(:first-child) { text-align: center; }
.timetable thead th.is-today { color: var(--accent); }
.tt-date { display: block; margin-top: 2px; font-size: 10px; font-weight: 500; letter-spacing: 0.02em; color: var(--muted); }
.timetable thead th.is-today .tt-date { color: var(--accent); opacity: 0.8; }
.timetable .timetable-cell.is-today { background: rgba(31, 107, 86, 0.045); }
.timetable tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 96px;
  padding: 12px 10px;
  background: #fbfbf8;
  text-align: left;
}
.timetable-period strong { display: block; font-size: 12px; font-weight: 600; }
.timetable-period small { font-size: 10px; font-weight: 400; color: var(--muted); }
.timetable-cell { height: 84px; padding: 5px !important; }
.tt-course {
  margin: 0 0 5px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  text-align: left;
}
.tt-course:nth-child(even) { background: var(--amber-soft); border-left-color: var(--amber); }
.tt-course strong { display: block; font-size: 12px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.tt-teacher { display: block; font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.tt-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.timetable-note { margin: 14px 2px 0; }

/* 手机端按天查看 */
.tt-mobile { display: none; }
@media (max-width: 760px) {
  .timetable-card { display: none; }
  .tt-mobile { display: block; }
  .week-bar { padding: 6px 8px; border-radius: 14px; gap: 6px; }
  .week-step { width: 30px; height: 30px; border-radius: 9px; }
  .week-chip { padding: 6px 11px; font-size: 12px; }

  .tt-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .tt-radio:focus-visible ~ .tt-tabs { outline: 2px solid var(--accent); outline-offset: 2px; }
  .tt-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tt-tabs::-webkit-scrollbar { display: none; }
  .tt-tab {
    flex: 1 1 0;
    min-width: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 7px 3px;
    border-radius: 10px;
    font-size: 12.5px;
    color: var(--ink-2);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
  }
  .tt-tab span { font-weight: 500; line-height: 1.3; }
  .tt-tab small { font-size: 10px; letter-spacing: -0.01em; color: var(--muted); }
  .tt-tab.is-empty span { color: var(--muted); }
  .tt-tab.is-today small { color: var(--accent); }

  #tt-day-0:checked ~ .tt-tabs > .tt-tab:nth-child(1),
  #tt-day-1:checked ~ .tt-tabs > .tt-tab:nth-child(2),
  #tt-day-2:checked ~ .tt-tabs > .tt-tab:nth-child(3),
  #tt-day-3:checked ~ .tt-tabs > .tt-tab:nth-child(4),
  #tt-day-4:checked ~ .tt-tabs > .tt-tab:nth-child(5),
  #tt-day-5:checked ~ .tt-tabs > .tt-tab:nth-child(6),
  #tt-day-6:checked ~ .tt-tabs > .tt-tab:nth-child(7) {
    background: var(--ink);
    color: #fff;
  }
  #tt-day-0:checked ~ .tt-tabs > .tt-tab:nth-child(1) small,
  #tt-day-1:checked ~ .tt-tabs > .tt-tab:nth-child(2) small,
  #tt-day-2:checked ~ .tt-tabs > .tt-tab:nth-child(3) small,
  #tt-day-3:checked ~ .tt-tabs > .tt-tab:nth-child(4) small,
  #tt-day-4:checked ~ .tt-tabs > .tt-tab:nth-child(5) small,
  #tt-day-5:checked ~ .tt-tabs > .tt-tab:nth-child(6) small,
  #tt-day-6:checked ~ .tt-tabs > .tt-tab:nth-child(7) small {
    color: rgba(255, 255, 255, 0.72);
  }

  .tt-panel { display: none; margin-top: 14px; }
  #tt-day-0:checked ~ .tt-panels > .tt-panel:nth-child(1),
  #tt-day-1:checked ~ .tt-panels > .tt-panel:nth-child(2),
  #tt-day-2:checked ~ .tt-panels > .tt-panel:nth-child(3),
  #tt-day-3:checked ~ .tt-panels > .tt-panel:nth-child(4),
  #tt-day-4:checked ~ .tt-panels > .tt-panel:nth-child(5),
  #tt-day-5:checked ~ .tt-panels > .tt-panel:nth-child(6),
  #tt-day-6:checked ~ .tt-panels > .tt-panel:nth-child(7) {
    display: block;
    animation: tt-panel-in 0.26s cubic-bezier(0.22, 0.8, 0.28, 1);
  }
  .tt-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 0 2px;
  }
  .tt-panel-head h2 { margin: 0; font-size: 17px; }
  .tt-panel-head h2 small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 4px; }
  .tt-agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
  .tt-agenda-item {
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 10px;
    padding: 11px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
  }
  .tt-agenda-time { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
  .tt-agenda-time strong { font-size: 12px; font-weight: 600; letter-spacing: -0.01em; }
  .tt-agenda-time small { font-size: 10.5px; color: var(--muted); }
  .tt-agenda-courses { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .tt-agenda-course {
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--accent-soft);
    border-left: 2px solid var(--accent);
  }
  .tt-agenda-course:nth-child(even) { background: var(--amber-soft); border-left-color: var(--amber); }
  .tt-agenda-course strong { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.4; }
  .tt-agenda-meta { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-2); }
  .tt-agenda-weeks { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
  .tt-panel-empty {
    margin: 0;
    padding: 26px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    background: var(--card);
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
  }
}
@keyframes tt-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 网站导航 ---------------- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.site-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.site-card:hover {
  color: var(--ink);
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.site-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 17px;
  font-weight: 600;
}
.site-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.site-text strong { font-size: 14px; font-weight: 500; }
.site-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-arrow { color: var(--muted); font-size: 14px; transition: transform 0.2s ease, color 0.2s ease; }
.site-card:hover .site-arrow { color: var(--accent); transform: translate(2px, -2px); }

/* ---------------- 折叠面板 ---------------- */
.fold summary { list-style: none; cursor: pointer; }
.fold summary::-webkit-details-marker { display: none; }
.fold-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}
.fold-title { font-size: 17px; font-weight: 600; }
.fold-hint { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.fold-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.28s cubic-bezier(0.22, 0.8, 0.28, 1);
}
.fold[open] .fold-chevron { transform: rotate(90deg); }
.fold[open] .fold-hint { opacity: 0; }
.fold-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s cubic-bezier(0.22, 0.8, 0.28, 1);
}
.fold[open] .fold-body { grid-template-rows: 1fr; }
.fold-inner { overflow: hidden; }
.fold[open] .fold-inner { padding-top: 16px; }

/* 请假页：把折叠头做成显眼的操作按钮 */
.leave-form-card { padding: 10px; }
.leave-form-card .fold[open] .fold-inner { padding: 16px 8px 4px; }
.fold-cta .fold-summary {
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(31, 107, 86, 0.18);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.fold-cta .fold-summary:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(31, 107, 86, 0.24); }
.fold-cta .fold-summary:active { transform: none; }
.fold-cta .fold-plus {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 15px;
  line-height: 1;
}
.fold-cta .fold-title { color: #fff; font-size: 16px; letter-spacing: 0.01em; }
.fold-cta .fold-hint { color: rgba(255, 255, 255, 0.78); }
.fold-cta .fold-chevron { color: #fff; }
.fold-cta[open] .fold-summary { background: var(--accent-soft); box-shadow: none; transform: none; }
.fold-cta[open] .fold-plus { background: rgba(31, 107, 86, 0.14); color: var(--accent); }
.fold-cta[open] .fold-title { color: var(--accent); }
.fold-cta[open] .fold-chevron { color: var(--accent); }
/* 起止日期始终并排，手机也不换行 */
.leave-form-card .leave-dates { grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) {
  .leave-form-card .leave-dates { gap: 8px; }
  .leave-form-card .leave-dates .field input { padding-left: 10px; padding-right: 4px; font-size: 13.5px; }
}

/* ---------------- 入场动画 ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.8, 0.28, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------------- 后台内容管理 ---------------- */
.grid-notice-admin { grid-template-columns: 0.9fr 1.1fr; }
.admin-notice-list { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; }
.admin-notice-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fcfcfa; }
.admin-notice-head { display: flex; align-items: center; gap: 8px; }
.admin-notice-body {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 4px 0 8px;
  font-size: 12.5px;
  white-space: pre-wrap;
}
.admin-notice-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.site-link-ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 扫码弹窗 ---------------- */
.btn-scan .icon { width: 16px; height: 16px; }
body.scan-open { overflow: hidden; }
.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 20, 20, 0.55);
  backdrop-filter: blur(6px);
  animation: scan-fade 0.18s ease;
}
.scan-modal[hidden] { display: none; }
.scan-dialog {
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: scan-pop 0.22s ease;
}
.scan-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.scan-dialog-head h2 { font-size: 18px; margin: 0; }
.scan-close {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f4f3;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.scan-close:hover { background: var(--accent-soft); color: var(--accent); }
.scan-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 58vh;
  background: #06201f;
  border-radius: var(--radius);
  overflow: hidden;
}
.scan-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-frame {
  position: absolute;
  inset: 12%;
  border: 2px solid rgba(20, 184, 166, 0.9);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(3, 22, 21, 0.35);
}
.scan-message {
  min-height: 20px;
  margin: 12px 0;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
}
.scan-message.is-ok { color: var(--accent); }
.scan-message.is-warn { color: var(--amber); }
.scan-message.is-error { color: var(--red); }
@keyframes scan-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scan-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 签到项目 ---------------- */
[hidden] { display: none !important; }
.project-section { margin-bottom: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 12px; }
.section-head h2 { font-size: 17px; margin: 0; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.project-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.project-card h3 { font-size: 16px; margin: 0; }
.project-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.project-note { font-size: 12.5px; color: var(--ink-2); background: #f6faf8; border-radius: 8px; padding: 8px 10px; margin: 0; }
.project-done { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; font-size: 13px; background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; }
.project-done .icon { width: 16px; height: 16px; }
.code-form { display: flex; gap: 8px; margin-top: auto; }
.code-input { flex: 1; letter-spacing: 0.24em; text-align: center; font-size: 16px; font-weight: 700; }
.btn-geo .icon, .btn-scan .icon { width: 16px; height: 16px; }
.geo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.geo-grid input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; }
.geo-message.is-ok { color: var(--accent); }
.geo-message.is-error { color: var(--red); }
.leave-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.leave-banner p { margin: 0; }
.empty-card { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.signin-card { max-width: 520px; margin: 0 auto; }
.signin-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.signin-result { text-align: center; padding: 12px 0 4px; }
.signin-result.is-ok h2 { color: var(--accent); }
.signin-icon .icon { width: 44px; height: 44px; color: var(--accent); }

body.modal-open { overflow: hidden; }
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 20, 20, 0.55);
  backdrop-filter: blur(6px);
  animation: scan-fade 0.18s ease;
}
.project-modal[hidden] { display: none; }
.project-dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: scan-pop 0.22s ease;
}
.form-stack { display: flex; flex-direction: column; gap: 12px; }

.project-admin-list { display: flex; flex-direction: column; gap: 12px; }
.project-admin-item { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.project-admin-main { flex: 1; min-width: 220px; }
.project-admin-main h3 { margin: 6px 0 4px; font-size: 16px; }
.project-admin-stat { text-align: center; min-width: 92px; }
.project-admin-stat strong { display: block; font-size: 22px; }
.project-admin-stat small { color: var(--muted); font-size: 11.5px; }
.project-admin-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.project-admin-actions form { margin: 0; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 4px; vertical-align: middle; }
.live-dot.is-ok { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16); }
.live-dot.is-warn { background: var(--amber); }
.live-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.live-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fcfcfa; }
.live-meta { display: flex; align-items: center; gap: 8px; }
.absent-tags { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow-y: auto; }
.project-ops { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.project-ops form { margin: 0; }
.code-display { font-size: 38px; font-weight: 800; letter-spacing: 0.2em; color: var(--accent); margin: 6px 0 4px; }

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; padding: 32px 28px; }
  .hero h1 { font-size: 34px; }
  .grid-2, .grid-3, .grid-leave { grid-template-columns: 1fr; }
  .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .qr-layout { grid-template-columns: 1fr; }
  .qr-box { max-width: 320px; margin: 0 auto; }
}

@media (max-width: 760px) {
  .topbar-inner { padding: 8px 14px; gap: 12px; flex-wrap: wrap; }
  .brand-text strong { font-size: 13px; }
  .nav { order: 2; width: 100%; margin-left: 0; padding-bottom: 2px; }
  .nav-link { padding: 7px 11px; font-size: 12.5px; }
  .page { padding: 18px 14px 34px; }
  h1 { font-size: 24px; }
  .page-head h1 { font-size: 22px; }
  .hero { padding: 26px 22px; border-radius: 22px; }
  .hero h1 { font-size: 28px; }
  .feature-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .feature { padding: 16px; }
  .card { border-radius: 18px; padding: 18px; }
  .stat-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stat strong { font-size: 24px; }
  .status-card { grid-template-columns: 1fr; gap: 14px; }
  .status-side { flex-direction: row; min-width: 0; }
  .mini-stat { flex: 1; }
  .week-strip { gap: 5px; }
  .week-day { padding: 8px 3px; }
  .week-label { font-size: 11px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-tags { justify-content: center; }
  .field-row { grid-template-columns: 1fr; }
  .bars { height: 160px; }
  .bar-track { height: 104px; }
  .scan-header h1 { font-size: 24px; }
  .admin-nav { flex-wrap: wrap; overflow: visible; }
  .admin-nav .nav-link { white-space: nowrap; padding: 7px 10px; font-size: 12.5px; }
  .filter-bar .field { flex: 1 1 45%; min-width: 120px; }
  .filter-actions { flex: 1 1 100%; }
  .filter-actions .btn { flex: 1; }
  .qr-actions .btn, .qr-actions form { flex: 1; }
  .qr-actions form .btn { width: 100%; }
  .review-form { flex-direction: column; align-items: stretch; }
  .review-actions { justify-content: flex-end; }
}

@media (max-width: 640px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fff;
  }
  .data-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
    text-align: right;
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before {
    content: attr(data-label);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    flex: none;
    text-align: left;
  }
  .table-wrap { overflow: visible; }
  .data-table td[data-label="操作"] { flex-direction: column; align-items: stretch; }
  .data-table td[data-label="操作"]::before { margin-bottom: 4px; }
  .row-actions { justify-content: flex-end; }
  .action-stack { justify-content: flex-start; }
  .inline-edit { width: 100%; text-align: left; }
  .inline-edit form { justify-content: flex-start; }
  .inline-edit form input { flex: 1 1 100%; width: auto; }
  .hero-actions .btn { flex: 1; }
  .status-side { gap: 6px; }
  .mini-stat { padding: 7px 6px; }
  .feature-grid { grid-template-columns: 1fr; }
  .copy-row { flex-wrap: wrap; }
  .copy-row .btn { width: 100%; }
  .project-grid { grid-template-columns: 1fr; }
  .geo-grid { grid-template-columns: 1fr; }
  .project-admin-item { align-items: flex-start; }
  .project-admin-stat { min-width: 76px; }
  .project-admin-actions { width: 100%; }
  .project-admin-actions .btn, .project-admin-actions form { flex: 1 1 auto; }
  .project-admin-actions form .btn { width: 100%; }
  .live-list li { flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .stat-grid-3, .stat-grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .grid-notice-admin { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .home-hero { padding: 60px 20px 72px; min-height: calc(100vh - 150px); }
  .home-hero::after { display: none; }
  .home-eyebrow { margin-bottom: 22px; }
  .home-actions { gap: 6px; }
  .home-action { padding: 10px 12px; gap: 5px; font-size: 12.5px; letter-spacing: 0.02em; }
  .home-action .icon { width: 15px; height: 15px; }
  .page-head-main h1 { font-size: 26px; }
  .site-grid { grid-template-columns: 1fr; }
  .timetable-card { padding: 12px; }
  .card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-eyebrow, .home-class, .home-welcome, .home-actions, .home-action, .home-hint,
  .home-rule, .home-line > span,
  .drawer, .drawer-mask, .scan-modal, .scan-dialog,
  .success-modal, .success-dialog, .success-badge::after {
    animation: none !important;
    transition: none !important;
  }
  .success-ring, .success-check { animation: none !important; stroke-dashoffset: 0 !important; }
  .home-line > span { transform: none !important; }
  .home-rule { opacity: 1 !important; transform: none !important; }
}

/* ---------------- AI 助手 ---------------- */
.page-ai { padding-bottom: 14px; }
.ai-bar { display: flex; align-items: center; gap: 10px; padding: 6px 2px 12px; }
.ai-bar-icon {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  place-items: center;
  cursor: pointer;
}
.ai-bar-icon svg { width: 18px; height: 18px; }
.ai-bar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-bar-main strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-bar-main small { font-size: 11.5px; color: var(--muted); }
.ai-bar-new {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(31, 107, 86, 0.22);
  transition: background 0.18s ease, transform 0.18s ease;
}
.ai-bar-new:hover { background: #1a5d4b; transform: translateY(-1px); }
.ai-bar-new svg { width: 14px; height: 14px; }

.ai-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; }
.ai-backdrop { display: none; }
.ai-side {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(68vh, 620px);
  box-shadow: var(--shadow-soft);
}
.ai-side-label { margin: 0 0 2px; font-size: 11px; letter-spacing: 0.16em; color: var(--muted); }
.ai-chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.ai-chat-list li { display: flex; align-items: center; gap: 2px; border-radius: 10px; transition: background 0.18s ease; }
.ai-chat-list li:hover { background: #f6f5f0; }
.ai-chat-list li.is-active { background: var(--accent-soft); }
.ai-chat-list li a { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; text-decoration: none; color: var(--ink); }
.ai-chat-list li a strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-chat-list li a small { font-size: 11px; color: var(--muted); }
.ai-chat-del {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.18s ease, color 0.18s ease;
}
.ai-chat-list li:hover .ai-chat-del,
.ai-chat-list li.is-active .ai-chat-del { opacity: 1; }
.ai-chat-del:hover { color: var(--red); background: #fbeeee; }
.ai-chat-del svg { width: 14px; height: 14px; }
.ai-side-empty { font-size: 12.5px; color: var(--muted); padding: 8px 4px; }

.ai-main {
  display: flex;
  flex-direction: column;
  height: min(68vh, 620px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.ai-thread { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.ai-msg { max-width: 86%; display: flex; flex-direction: column; gap: 5px; }
.ai-msg.is-user { align-self: flex-end; align-items: flex-end; }
.ai-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f5f4ef;
  color: var(--ink-2);
}
.ai-msg.is-user .ai-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.ai-msg.is-assistant .ai-bubble { border-bottom-left-radius: 6px; }
.ai-msg.is-error .ai-bubble { background: var(--red-soft); color: #8a2f2f; border-bottom-left-radius: 6px; }
.ai-time { font-size: 11px; color: var(--muted); }

/* 思考动画 */
.ai-thinking {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  background: linear-gradient(100deg, #f4f3ed 18%, #e9e7de 38%, #f4f3ed 58%);
  background-size: 240% 100%;
  animation: ai-shimmer 2.4s linear infinite;
}
.ai-think-orb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: ai-orb 1.6s ease-out infinite;
}
.ai-think-text { font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; }
.ai-dots { display: inline-flex; gap: 4px; }
.ai-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.25;
  animation: ai-bounce 1.1s infinite;
}
.ai-dots i:nth-child(2) { animation-delay: 0.16s; }
.ai-dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes ai-shimmer {
  from { background-position: 220% 0; }
  to { background-position: -220% 0; }
}
@keyframes ai-orb {
  0% { box-shadow: 0 0 0 0 rgba(31, 107, 86, 0.4); }
  70% { box-shadow: 0 0 0 9px rgba(31, 107, 86, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 107, 86, 0); }
}
@keyframes ai-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.25; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.ai-empty { margin: auto; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 24px 12px; }
.ai-empty svg { width: 30px; height: 30px; color: var(--accent); opacity: 0.75; }
.ai-empty p { margin: 0; font-size: 15px; color: var(--ink); }
.ai-empty small { font-size: 12.5px; line-height: 1.7; }
.ai-offline {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid #ecdcbd;
  border-radius: 999px;
  padding: 5px 12px;
}
.ai-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.ai-suggest button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.ai-suggest button:hover { border-color: var(--accent); color: var(--accent); }

/* 输入区 */
.ai-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: #fcfcfa; }
.ai-composer-box {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 3px 4px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.ai-composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 107, 86, 0.1); }
.ai-composer textarea {
  width: 100%;
  display: block;
  min-height: 34px;
  max-height: 132px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  padding: 7px 9px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}
.ai-composer-actions { display: flex; align-items: center; gap: 6px; }
.ai-clip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.ai-clip svg { width: 17px; height: 17px; }
.ai-clip:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.ai-clip:disabled { opacity: 0.45; cursor: not-allowed; }
.ai-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.ai-send svg { width: 18px; height: 18px; }
.ai-send:hover:not(:disabled) { background: #1a5d4b; transform: translateY(-1px); }
.ai-send:disabled { background: #cfcec6; cursor: not-allowed; }

.ai-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px 5px 1px; }
.ai-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f4f3ee;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px 6px 3px 4px;
  font-size: 12px;
  color: var(--ink-2);
  max-width: 100%;
}
.ai-file-chip img { width: 26px; height: 26px; object-fit: cover; border-radius: 6px; }
.ai-file-chip span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-file-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.ai-file-chip.is-loading { opacity: 0.6; }

.ai-msg-files { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-msg-files img { max-width: 190px; max-height: 150px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.ai-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
  max-width: 220px;
}
.ai-file svg { width: 14px; height: 14px; flex: none; }
.ai-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 首页右下角悬浮入口 */
.ai-fab {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1f6b56, #2f8a72);
  color: #fff;
  text-decoration: none;
  font-size: 13.5px;
  box-shadow: 0 12px 26px rgba(31, 107, 86, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ai-fab svg { width: 18px; height: 18px; }
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(31, 107, 86, 0.38); }

@media (max-width: 980px) {
  .ai-bar-icon { display: grid; }
  .ai-body { grid-template-columns: 1fr; gap: 0; }
  .ai-side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 78vw;
    max-width: 300px;
    max-height: none;
    z-index: 60;
    border-radius: 0 18px 18px 0;
    padding: 18px 14px;
    transform: translateX(-104%);
    transition: transform 0.26s ease;
    overflow-y: auto;
  }
  body.ai-panel-open .ai-side { transform: none; }
  .ai-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(20, 26, 28, 0.32);
    backdrop-filter: blur(2px);
  }
  body.ai-panel-open .ai-backdrop { display: block; }
  .ai-main { height: calc(100dvh - 168px); min-height: 420px; }
  .ai-thread { padding: 14px 12px; }
  .ai-msg { max-width: 92%; }
  .ai-fab { right: 14px; bottom: 16px; }

  /* 手机上让对话铺满可视区域，只保留顶部栏 + 输入区 */
  body.ai-page .footer { display: none; }
  body.ai-page .page-ai {
    padding: 8px 12px 8px;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  body.ai-page .ai-bar { flex: none; padding-bottom: 8px; }
  body.ai-page .ai-body { flex: 1; min-height: 0; display: flex; }
  body.ai-page .ai-main { flex: 1; height: auto; min-height: 0; }
  body.ai-page .ai-thread { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-thinking { animation: none; }
  .ai-think-orb { animation: none; }
  .ai-dots i { animation: none; opacity: 0.6; }
}

.ai-debug { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.ai-debug summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.ai-debug-pre {
  margin-top: 10px;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  background: #f7f6f1;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------------- 页面内二次确认弹窗 ---------------- */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 20, 20, 0.55);
  backdrop-filter: blur(6px);
  animation: scan-fade 0.18s ease;
}
.app-modal[hidden] { display: none; }
.app-modal-dialog {
  width: min(400px, 100%);
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: scan-pop 0.22s ease;
}
.app-modal-dialog h2 { font-size: 17px; margin: 0 0 8px; }
.app-modal-message { margin: 0 0 18px; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.app-modal-actions { display: flex; gap: 10px; }
.app-modal-actions .btn { flex: 1; }

/* ---------------- 签到项目补充 ---------------- */
.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafaf7;
  font-size: 13px;
  cursor: pointer;
}
.check-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.stat-out { color: var(--amber) !important; }
.project-done.is-out { color: var(--accent); background: var(--accent-soft); }
.project-done.is-warn { color: var(--amber); background: var(--amber-soft); }
.timetable-live { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.timetable-live .live-dot { margin-right: 0; }

@keyframes app-sheet {
  from { transform: translateY(30px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

/* ---------------- 后台移动端适配 ---------------- */
@media (max-width: 760px) {
  .admin-nav { gap: 3px; padding: 5px; }
  .admin-nav .nav-link { flex: 0 1 auto; padding: 7px 10px; font-size: 12.5px; white-space: nowrap; }
  .settings-tabs { border-radius: 14px; }
  .settings-tab { flex: none; padding: 8px 14px; font-size: 13px; }
  .project-admin-stat { text-align: left; }
  .project-admin-stat strong { font-size: 20px; }
}

@media (max-width: 640px) {
  .page-head { align-items: flex-start; gap: 12px; margin-bottom: 18px; }
  .page-head-main { flex: 1 1 0; min-width: 0; }
  .page-head > .avatar { flex: none; width: 46px; height: 46px; font-size: 18px; }
  .page-head > .btn,
  .page-head > .month-form,
  .page-head > form { flex: 1 1 100%; width: 100%; }
  .page-head > .btn { justify-content: center; }
  .month-form { width: 100%; }
  .month-form input { flex: 1; width: 100%; }
  .filter-bar { gap: 10px; }
  .filter-bar .field { flex: 1 1 100%; min-width: 0; }
  .filter-actions { flex: 1 1 100%; }
  .summary-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .summary-chips::-webkit-scrollbar { display: none; }
  .summary-chips .chip { flex: none; }
  .quick-grid { gap: 8px; }
  .quick-item { padding: 11px; gap: 8px; }
  .quick-icon { width: 30px; height: 30px; }
  .quick-item strong { font-size: 12.5px; }
  .quick-item small { font-size: 10.5px; }
  .code-display { font-size: 30px; letter-spacing: 0.14em; overflow-wrap: anywhere; }
  .flash-stack { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .drawer-nav { padding-bottom: env(safe-area-inset-bottom); }
  .app-modal { align-items: flex-end; padding: 0; }
  .app-modal-dialog {
    width: 100%;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
    animation: app-sheet 0.24s ease;
  }
}

/* ---------------- 顶栏公告入口 ---------------- */
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.topbar-actions .topbar-avatar { margin-left: 0; }
.topbar-bell {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.topbar-bell:hover { background: #eeede7; border-color: var(--line); color: var(--ink); }
.topbar-bell .icon { width: 19px; height: 19px; }
.notice-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--topbar);
}
.notice-dot[hidden] { display: none; }

.notice-dialog { width: min(480px, 100%); display: flex; flex-direction: column; gap: 10px; }
.notice-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notice-dialog h2 { font-size: 20px; margin: 2px 0 0; line-height: 1.4; }
.notice-dialog .notice-meta { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.notice-dialog-body {
  max-height: 46vh;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-2);
  background: #fafaf6;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.notice-dialog-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* ---------------- 首页：禁止缩放与横向滑动 ---------------- */
body.is-home { overflow-x: hidden; overscroll-behavior-x: none; touch-action: pan-y; }
body.is-home .page-home { width: 100%; max-width: 100%; overflow-x: clip; }

/* ---------------- 签到卡片美化 ---------------- */
.project-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  gap: 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fbfdfb 100%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #1f6b56, #38b2a1);
}
.project-card.project-qr::before { background: linear-gradient(90deg, #1f6b56, #3aa0d8); }
.project-card.project-geo::before { background: linear-gradient(90deg, #b45309, #f59e0b); }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(20, 26, 28, 0.09); }
.project-card-head { display: flex; align-items: flex-start; gap: 12px; }
.project-icon {
  width: 42px;
  height: 42px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}
.project-icon .icon { width: 20px; height: 20px; }
.project-card-title { min-width: 0; flex: 1; }
.project-card-title h3 { font-size: 17px; margin: 0 0 3px; line-height: 1.35; }
.project-window { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; color: var(--muted); }
.project-window .icon { width: 13px; height: 13px; }
.project-card .code-form { margin-top: 6px; }
.project-card .btn-block,
.project-card .btn-scan,
.project-card .btn-geo { width: 100%; }
.project-card .project-done { margin-top: 2px; }

/* ---------------- 后台分组导航 ---------------- */
.admin-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.admin-nav-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.admin-nav-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; padding: 0 2px; white-space: nowrap; }
.admin-nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-nav .nav-link { white-space: nowrap; }

/* ---------------- 用户管理卡片 ---------------- */
.user-card-list { display: flex; flex-direction: column; gap: 10px; }
.user-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.user-card[open] { border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.user-card-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
}
.user-card-summary::-webkit-details-marker { display: none; }
.user-avatar { width: 42px; height: 42px; font-size: 16px; flex: none; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-card-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }
.user-card-name .chip { font-size: 10.5px; }
.user-card-main small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-side { display: flex; align-items: center; gap: 6px; flex: none; }
.user-card-side .chip { font-size: 10.5px; }
.user-card-chevron { width: 16px; height: 16px; color: var(--muted); transition: transform 0.22s ease; }
.user-card[open] .user-card-chevron { transform: rotate(90deg); }
.user-card-body { padding: 4px 16px 16px; border-top: 1px dashed var(--line); }
.user-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 16px; margin: 14px 0; }
.user-facts div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-facts dt { font-size: 11px; color: var(--muted); }
.user-facts dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.user-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.user-action { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.user-action label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.user-action-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.user-action-row input,
.user-action-row select {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
}
.user-action-row form { margin: 0; display: flex; }
.user-action-row .btn { flex: none; }
.chip-title {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fcd34d;
  font-weight: 600;
}

/* ---------------- 个人中心面板 ---------------- */
.profile-panels { display: flex; flex-direction: column; gap: 12px; }
.profile-panel { padding: 0; overflow: hidden; }
.profile-panel .fold-summary { padding: 16px 18px; }
.profile-panel .fold-inner { padding: 0 18px; }
.profile-panel .fold[open] .fold-inner { padding: 14px 18px 18px; }
.profile-stats { margin-bottom: 16px; grid-template-columns: repeat(2, 1fr); }
.profile-stats .stat { background: #fafaf7; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.profile-panel-head { margin: 6px 0 8px; }
.profile-panel-link { margin-top: 12px; }

/* ---------------- 课表：地点与时长 ---------------- */
.tt-room {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 10.5px;
  white-space: nowrap;
}
.tt-room .icon { width: 11px; height: 11px; }
.tt-room-sm { margin-left: 4px; font-size: 10.5px; }
.tt-period-duration {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #f1f7f5;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 600;
}
.tt-duration {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
}

/* ---------------- 后台补充 ---------------- */
.record-fold { flex: 1 1 100%; }
.record-fold .fold-summary { padding: 4px 0; }
.admin-tabs { margin-bottom: 14px; }
.stat-range { font-size: 18px !important; }
.path-cell { word-break: break-all; font-size: 12px; color: var(--ink-2); }

@media (max-width: 760px) {
  .admin-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
  }
  .admin-nav-group,
  .admin-nav-links { display: contents; }
  .admin-nav-label { grid-column: 1 / -1; margin: 6px 0 0 2px; font-size: 10.5px; letter-spacing: 0.08em; }
  .admin-nav .nav-link { display: flex; align-items: center; justify-content: center; padding: 9px 6px; font-size: 12.5px; text-align: center; border-radius: 9px; background: #f6f6f1; }
  .admin-nav .nav-link.is-active { background: var(--ink); color: #fff; }
  .notice-dialog h2 { font-size: 18px; }
}

@media (max-width: 640px) {
  .notice-modal { align-items: flex-end; padding: 0; }
  .notice-dialog {
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
    animation: app-sheet 0.24s ease;
  }
  .notice-dialog-body { max-height: 40vh; }
  .user-card-summary { padding: 12px 13px; gap: 10px; }
  .user-card-side { flex-direction: column; align-items: flex-end; gap: 4px; }
  .user-card-side .chip:first-child { display: none; }
  .user-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-action-grid { grid-template-columns: 1fr; }
  .profile-panel .fold-summary { padding: 14px 15px; }
  .profile-panel .fold-inner,
  .profile-panel .fold[open] .fold-inner { padding-left: 15px; padding-right: 15px; }
  .project-card { padding: 16px; }
  .profile-stats { grid-template-columns: 1fr; }
}

