:root {
  --accent: #e76f51;
  --accent-2: #f2a65a;
  --accent-gradient: linear-gradient(135deg, #f2a65a 0%, #e76f51 100%);
  --sidebar-bg: #3c2922;
  --sidebar-2: #5a3a2b;
  --text: #453028;
  --muted: #8a7265;
  --border: #eadfd6;
  --bg: #fbf5ec;
  --danger: #dc5b4b;
  --success: #72a376;
  --info: #c17f3e;
  --shadow: 0 10px 30px rgba(76, 47, 33, .08);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }

/* ---------- 布局 ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  flex: 0 0 250px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  color: #f2e3d7;
  background:
    radial-gradient(circle at 20% -10%, rgba(242, 166, 90, .22), transparent 38%),
    linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-2));
  box-shadow: 6px 0 30px rgba(76, 47, 33, .20);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 20px 18px;
  font-size: 17px;
  font-weight: 700;
  color: #fff7ee;
  letter-spacing: .5px;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: var(--accent-gradient);
  box-shadow: 0 0 18px rgba(242, 166, 90, .55);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 5px;
}

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 14px 18px; }

.nav-section {
  padding: 10px 10px 8px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #c7a996;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #f2e3d7;
  font-size: 16px;
  border: 1px solid transparent;
  transition: all .2s ease;
}

.side-nav a svg {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-nav a:hover {
  color: #fff;
  background: rgba(255, 235, 219, .12);
  transform: translateX(2px);
}

.side-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(242, 166, 90, .28), rgba(231, 111, 81, .22));
  border-color: rgba(242, 166, 90, .42);
  box-shadow: 0 8px 22px rgba(231, 111, 81, .20);
}

.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255, 235, 219, .12); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 235, 219, .12);
}

.avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  background: var(--accent-gradient);
  box-shadow: 0 6px 16px rgba(242, 166, 90, .32);
}

.user-meta { min-width: 0; flex: 1; }
.user-meta strong { display: block; color: #fff4e8; font-size: 13px; }
.user-meta span { color: #d8bda9; font-size: 12px; }
.logout-btn { color: #d8bda9; font-size: 18px; padding: 6px; }
.logout-btn:hover { color: #fff; }

.main-area { flex: 1; margin-left: 250px; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: rgba(255, 252, 247, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-title { font-size: 16px; font-weight: 700; color: #5c4538; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(114, 163, 118, .5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(114, 163, 118, .45); }
  70% { box-shadow: 0 0 0 7px rgba(114, 163, 118, 0); }
  100% { box-shadow: 0 0 0 0 rgba(114, 163, 118, 0); }
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  font-size: 20px;
  color: #5c4538;
  cursor: pointer;
}

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(60, 41, 34, .42);
  backdrop-filter: blur(2px);
}

.content { flex: 1; padding: 26px 28px 40px; }

/* ---------- 标题与操作区 ---------- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

h1 {
  margin: 0 0 18px;
  font-size: 24px;
  letter-spacing: .5px;
  color: #453028;
}

.page-head h1 { margin: 0; }

/* ---------- 卡片与网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: block;
  padding: 20px;
  color: var(--text);
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity .2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(231, 111, 81, .42);
  box-shadow: 0 16px 36px rgba(231, 111, 81, .12);
}

.card:hover::before { opacity: 1; }
.card strong { display: block; margin-bottom: 8px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 16px; box-shadow: var(--shadow); }

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f2e8df;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

.table th {
  background: #f8efe5;
  color: #8a7265;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}

.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: #fff7ef; }
.table tr:last-child td { border-bottom: none; }
.table .empty { text-align: center; color: var(--muted); padding: 28px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { display: inline; margin: 0; }

/* ---------- 表单 ---------- */
form label {
  display: block;
  margin-bottom: 15px;
  font-size: 13px;
  color: #6c574b;
  font-weight: 600;
}

input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid #e3d4c6;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fffdf8;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(231, 111, 81, .14);
}

textarea { resize: vertical; }

.form-narrow { max-width: 640px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffdf8;
  color: #5c4538;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .2s ease;
}

.btn:hover { border-color: #e2d2c4; box-shadow: 0 6px 16px rgba(76, 47, 33, .08); }

.btn-primary {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px rgba(231, 111, 81, .28);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(231, 111, 81, .34); }

button {
  font-family: inherit;
  font-size: 13px;
  border: 0;
  background: none;
  color: var(--info);
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}

button.danger { color: var(--danger); }

/* ---------- 提示 ---------- */
.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  background: #fdf3e7;
  color: #a55f2c;
  border: 1px solid #f4d7b6;
}

.alert-success { background: #f3f7ec; color: #5c865f; border-color: #cfe0c3; }
.alert-error { background: #fdf1ef; color: #c04a3b; border-color: #f5c4bb; }
.alert-info { background: #fdf3e7; color: #a55f2c; border-color: #f4d7b6; }

.hint { color: var(--muted); font-size: 12px; }
.answer-text { white-space: pre-wrap; line-height: 1.8; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.check-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
  background: #fffdf8;
  cursor: pointer;
  transition: all .15s ease;
}

.check-grid label:hover { border-color: var(--accent); }
.check-grid input { width: auto; margin: 0; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(242, 166, 90, .22), transparent 34%),
    radial-gradient(circle at 80% 80%, rgba(231, 111, 81, .20), transparent 34%),
    linear-gradient(135deg, #3c2922, #5a3a2b);
}

.login-wrap .card {
  width: 380px;
  max-width: 100%;
  padding: 32px;
  border: 1px solid rgba(255, 235, 219, .16);
  background: rgba(255, 247, 238, .08);
  backdrop-filter: blur(18px);
  color: #f7e7da;
  box-shadow: 0 24px 60px rgba(60, 41, 34, .42);
}

.login-wrap .card::before { display: none; }
.login-wrap h1 {
  margin-bottom: 24px;
  text-align: center;
  color: #fff7ee;
  font-size: 22px;
}

.login-wrap label { color: #d9bfae; }
.login-wrap input {
  background: rgba(255, 247, 238, .10);
  border-color: rgba(255, 235, 219, .22);
  color: #fff7ee;
}

.login-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 166, 90, .22); }
.login-wrap .btn-primary { width: 100%; margin-top: 6px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .backdrop.show { display: block; }
  .main-area { margin-left: 0; }
  .menu-toggle { display: block; }
}

@media (max-width: 640px) {
  .content { padding: 18px 14px 30px; }
  .topbar { padding: 0 14px; }
  .grid { grid-template-columns: 1fr; }
}

.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; }
.login-brand h1 { margin: 0; }

/* ---------- 科技感背景与动效 ---------- */
.app-shell {
  position: relative;
  z-index: 1;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
}

.main-area {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, .32), transparent 32%),
    linear-gradient(180deg, rgba(255, 252, 247, .84), rgba(250, 240, 230, .88)),
    url('../img/sunshine-bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.brand-mark {
  animation: brandPulse 3.2s ease-in-out infinite;
}

@keyframes brandPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(242, 166, 90, .52); }
  50% { box-shadow: 0 0 28px rgba(231, 111, 81, .68); }
}

.side-nav a {
  animation: navIn .4s ease both;
}

.side-nav a:nth-child(1) { animation-delay: .02s; }
.side-nav a:nth-child(2) { animation-delay: .06s; }
.side-nav a:nth-child(3) { animation-delay: .10s; }
.side-nav a:nth-child(4) { animation-delay: .14s; }
.side-nav a:nth-child(5) { animation-delay: .18s; }
.side-nav a:nth-child(6) { animation-delay: .22s; }

@keyframes navIn {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}

.content > * {
  animation: fadeUp .5s ease both;
}

.content > *:nth-child(1) { animation-delay: .03s; }
.content > *:nth-child(2) { animation-delay: .08s; }
.content > *:nth-child(3) { animation-delay: .13s; }
.content > *:nth-child(4) { animation-delay: .18s; }
.content > *:nth-child(5) { animation-delay: .23s; }
.content > *:nth-child(6) { animation-delay: .28s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.grid .card:hover {
  border-color: rgba(231, 111, 81, .42);
  box-shadow: 0 18px 42px rgba(231, 111, 81, .14), 0 0 0 1px rgba(242, 166, 90, .14) inset;
}

.table {
  box-shadow: 0 12px 32px rgba(76, 47, 33, .08);
}

.login-wrap {
  background:
    radial-gradient(circle at 18% 20%, rgba(242, 166, 90, .18), transparent 34%),
    radial-gradient(circle at 82% 80%, rgba(231, 111, 81, .18), transparent 34%),
    linear-gradient(rgba(60, 41, 34, .80), rgba(90, 58, 43, .88)),
    url('../img/sunshine-bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  animation: bgDrift 22s ease-in-out infinite;
}

@keyframes bgDrift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark, .side-nav a, .content > *, .login-wrap, .pulse-dot {
    animation: none !important;
  }
}

/* ---------- 台账批量操作与行内编辑 ---------- */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6c574b;
  font-weight: 600;
}

.inline-check input { width: auto; margin: 0; }

.check-col { width: 42px; text-align: center; }
.check-col input { width: auto; margin: 0; }

.ledger-editable td.editable {
  min-width: 90px;
  cursor: text;
  position: relative;
}

.ledger-editable td.editable:hover {
  background: #fff2e5;
  box-shadow: inset 0 0 0 1px rgba(231, 111, 81, .22);
}

.cell-input {
  width: 100%;
  min-width: 160px;
  padding: 5px 8px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 0 0 3px rgba(231, 111, 81, .12);
}

.btn.danger {
  color: var(--danger);
  border-color: #f3c1b7;
  background: #fffdf8;
}

.btn.danger:hover {
  background: #fdf1ef;
  border-color: #f0a89b;
}

.filter-input {
  flex: 1;
  min-width: 220px;
  padding: 9px 12px;
  border: 1px solid #e3d4c6;
  border-radius: 10px;
  font-size: 13px;
  background: #fffdf8;
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(231, 111, 81, .14);
}

/* ---------- 心理问题台账：列宽优化 ---------- */
.ledger-editable[data-category="psychological"] {
  table-layout: auto;
}

.ledger-editable[data-category="psychological"] th[data-field="序号"],
.ledger-editable[data-category="psychological"] td[data-field="序号"] {
  min-width: 56px;
  width: 56px;
  text-align: center;
}

.ledger-editable[data-category="psychological"] th[data-field="性别"],
.ledger-editable[data-category="psychological"] td[data-field="性别"] {
  min-width: 62px;
  width: 62px;
  text-align: center;
}

.ledger-editable[data-category="psychological"] th[data-field="关注等级"],
.ledger-editable[data-category="psychological"] td[data-field="关注等级"],
.ledger-editable[data-category="psychological"] th[data-field="关注等级（现状）"],
.ledger-editable[data-category="psychological"] td[data-field="关注等级（现状）"] {
  min-width: 96px;
  width: 96px;
  text-align: center;
}

.ledger-editable[data-category="psychological"] th[data-field="家庭详细住址"],
.ledger-editable[data-category="psychological"] td[data-field="家庭详细住址"],
.ledger-editable[data-category="psychological"] th[data-field="普测结果"],
.ledger-editable[data-category="psychological"] td[data-field="普测结果"] {
  min-width: 190px;
  white-space: normal;
  word-break: break-word;
}

.ledger-editable[data-category="psychological"] th[data-field="2025年11月学生现状"],
.ledger-editable[data-category="psychological"] td[data-field="2025年11月学生现状"] {
  min-width: 250px;
  white-space: normal;
  word-break: break-word;
}

.ledger-editable[data-category="psychological"] th[data-field="具体情况描述"],
.ledger-editable[data-category="psychological"] td[data-field="具体情况描述"] {
  min-width: 430px;
  width: 36%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.75;
}

/* ---------- 登录后欢迎合照 ---------- */
.welcome-photo {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 38%, rgba(242, 166, 90, .22), transparent 42%),
    rgba(60, 41, 34, .94);
  opacity: 1;
  transition: opacity .55s ease;
}

.welcome-photo.is-hidden {
  opacity: 0;
}

.welcome-photo__inner {
  width: min(94vw, 1000px);
  max-height: 88vh;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 235, 219, .24);
  background: rgba(255, 247, 238, .10);
  box-shadow: 0 32px 90px rgba(60, 41, 34, .60);
  backdrop-filter: blur(8px);
}

.welcome-photo__inner img {
  display: block;
  width: 100%;
  max-height: calc(88vh - 24px);
  object-fit: contain;
  border-radius: 14px;
}

/* ---------- 制度文件在线预览 ---------- */
.document-preview {
  padding: 20px;
  background: #fffdf8;
}

.document-preview__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #f2e8df;
  color: #8a7265;
  font-size: 13px;
}

.document-preview__pdf {
  display: block;
  width: 100%;
  min-height: 72vh;
  margin-bottom: 16px;
  border: 1px solid #eadfd6;
  border-radius: 12px;
  background: #f8efe5;
}

.document-preview__body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
  color: #453028;
  font-size: 14px;
}

.document-preview__rich {
  color: #453028;
  font-size: 14px;
  line-height: 1.85;
}

.document-preview__rich h1,
.document-preview__rich h2,
.document-preview__rich h3,
.document-preview__rich h4 {
  margin: 18px 0 10px;
  color: #3e2a23;
  font-weight: 700;
}

.document-preview__rich h1 { font-size: 22px; }
.document-preview__rich h2 { font-size: 19px; }
.document-preview__rich h3 { font-size: 16px; }
.document-preview__rich h4 { font-size: 15px; }

.document-preview__rich p {
  margin: 0 0 10px;
}

.document-preview__rich p.doc-empty {
  height: 12px;
  margin: 0;
}

.document-preview__rich .doc-table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  font-size: 13px;
}

.document-preview__rich .doc-table td {
  padding: 8px 10px;
  border: 1px solid #eadfd6;
  vertical-align: top;
  line-height: 1.65;
}

.document-preview__rich .doc-table tr:nth-child(even) td {
  background: #fbf5ec;
}

.document-preview__rich .doc-table td p,
.document-preview__rich .doc-table td div {
  margin: 0;
}

/* ---------- 学生信息表：列宽与批量操作 ---------- */
.student-editable td.editable {
  min-width: 120px;
  white-space: normal;
  word-break: break-word;
}

.student-id-col {
  width: 60px;
  min-width: 60px;
  text-align: center;
}

.student-time-col {
  width: 150px;
  min-width: 150px;
  white-space: nowrap;
}

.student-editable th[data-field="姓名"],
.student-editable td[data-field="姓名"] {
  min-width: 100px;
}

.student-editable th[data-field="学号"],
.student-editable td[data-field="学号"] {
  min-width: 130px;
}

.student-editable th[data-field="班级"],
.student-editable td[data-field="班级"],
.student-editable th[data-field="年级专业班级"],
.student-editable td[data-field="年级专业班级"] {
  min-width: 150px;
}

.student-editable th[data-field="联系电话"],
.student-editable td[data-field="联系电话"],
.student-editable th[data-field="手机号"],
.student-editable td[data-field="手机号"],
.student-editable th[data-field="联系方式"],
.student-editable td[data-field="联系方式"] {
  min-width: 130px;
}

.student-editable th[data-field="备注"],
.student-editable td[data-field="备注"] {
  min-width: 200px;
}

/* ---------- 右下角页面宠物 ---------- */
.page-pet {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  cursor: pointer;
  border: 1px solid rgba(231, 111, 81, .30);
  border-radius: 50%;
  background: linear-gradient(145deg, #fff8ef, #ffe9d4);
  box-shadow: 0 12px 30px rgba(76, 47, 33, .18);
  transition: transform .2s ease, box-shadow .2s ease;
}

.page-pet::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 34px;
  height: 10px;
  border-radius: 50%;
  background: rgba(76, 47, 33, .16);
  transform: translateX(-50%);
  animation: petShadow 2.8s ease-in-out infinite;
}

.page-pet:hover,
.page-pet:focus {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 36px rgba(231, 111, 81, .22);
  outline: none;
}

.page-pet__emoji {
  display: inline-block;
  font-size: 34px;
  line-height: 1;
  user-select: none;
  animation: petBounce 2.8s ease-in-out infinite;
}

.page-pet:hover .page-pet__emoji,
.page-pet:focus .page-pet__emoji {
  animation-duration: 1.4s;
}

.page-pet.pop .page-pet__emoji {
  animation: petPop .45s ease;
}

.page-pet__bubble {
  position: absolute;
  right: 74px;
  bottom: 6px;
  width: max-content;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid #f2e0d1;
  border-radius: 14px;
  background: #fffaf3;
  color: #5c4538;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 10px 24px rgba(76, 47, 33, .12);
  opacity: 0;
  transform: translateY(8px) scale(.96);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.page-pet__bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes petBounce {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(1); }
  12% { transform: translateY(-11px) rotate(5deg) scale(1.06); }
  24% { transform: translateY(0) rotate(-5deg) scale(1); }
  36% { transform: translateY(-7px) rotate(-5deg) scale(1.04); }
  48% { transform: translateY(0) rotate(4deg) scale(.98); }
  62% { transform: translateY(-3px) rotate(-2deg) scale(1.02); }
  76% { transform: translateY(0) rotate(3deg) scale(1); }
  88% { transform: translateY(-2px) rotate(-3deg) scale(1.01); }
}

@keyframes petShadow {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: .16; }
  50% { transform: translateX(-50%) scale(.72); opacity: .10; }
}

@keyframes petPop {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-14px) scale(1.18) rotate(7deg); }
  100% { transform: translateY(0) scale(1) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .page-pet {
    animation: none;
  }
  .page-pet::before,
  .page-pet__emoji {
    animation: none;
  }
}


/* ---------- 查宿（手机端优先） ---------- */
.dorm-check-form {
  max-width: 760px;
}

.dorm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.dorm-card {
  position: relative;
  display: block;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  overflow: hidden;
}

.dorm-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-gradient);
  opacity: .7;
}

.dorm-card:hover {
  transform: translateY(-3px);
  border-color: rgba(231, 111, 81, .42);
  box-shadow: 0 16px 34px rgba(231, 111, 81, .14);
}

.dorm-card strong {
  display: block;
  font-size: 20px;
  color: #4a332b;
  margin-bottom: 6px;
}

.dorm-card span {
  color: var(--muted);
  font-size: 13px;
}

.dorm-card.is-ok {
  border-color: #cfe0c3;
  background: #f6faef;
}

.dorm-card.is-ok::before {
  background: linear-gradient(180deg, #82ab78, #72a376);
}

.dorm-card.is-ok strong {
  color: #4d7149;
}

.dorm-card.is-issue {
  border-color: #f5c4bb;
  background: #fdf4f1;
}

.dorm-card.is-issue::before {
  background: linear-gradient(180deg, #ed8a72, #dc5b4b);
}

.dorm-card.is-issue strong {
  color: #b64837;
}

.student-check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.student-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.student-check-item:hover {
  border-color: rgba(231, 111, 81, .5);
  background: #fff8ef;
}

.student-check-item input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  accent-color: var(--accent);
}

.student-check-item span {
  font-size: 16px;
}

.student-check-item small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.dorm-student-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dorm-student-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8ef;
  color: #5c4538;
  font-weight: 600;
}

.dorm-student-list small {
  color: var(--muted);
  font-weight: 400;
}

.signature-card {
  margin-top: 20px;
}

.signature-pad {
  display: block;
  width: 100%;
  height: 260px;
  margin: 10px 0 12px;
  border: 1.5px dashed #dcb99f;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: inset 0 2px 12px rgba(76, 47, 33, .06);
  touch-action: none;
  cursor: crosshair;
}

.dorm-submit {
  width: 100%;
  margin-top: 14px;
  padding: 14px 20px;
  font-size: 16px;
}

.student-check-item {
  display: block;
  cursor: default;
}

.student-check-main {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.student-check-main input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  accent-color: var(--accent);
}

.student-check-main span {
  font-size: 16px;
}

.student-check-main small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.absence-reason {
  display: none;
  width: 100%;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid #e3d4c6;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fffdf8;
}

.absence-reason.show {
  display: block;
}

.dorm-filter {
  margin-bottom: 18px;
}

.dorm-filter__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.dorm-filter__row label {
  margin-bottom: 0;
}

.dorm-filter input[type="date"],
.dorm-filter input[type="text"],
.dorm-filter select {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid #e3d4c6;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fffdf8;
}

.dorm-filter .btn {
  width: 100%;
  height: 42px;
}

@media (max-width: 640px) {
  .dorm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .dorm-card {
    padding: 16px;
  }

  .dorm-card strong {
    font-size: 18px;
  }

  .student-check-item {
    padding: 12px;
  }

  .signature-pad {
    height: 220px;
  }

  .dorm-filter__row {
    grid-template-columns: 1fr;
  }

  .dorm-filter .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dorm-card,
  .student-check-item {
    transition: none;
  }
}


/* ---------- 查寝记录详情 ---------- */
.dorm-detail-cell {
  min-width: 240px;
}

.dorm-absence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dorm-absence-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 9px;
  background: #fff4e9;
}

.dorm-absence-list strong {
  color: #4a332b;
}

.dorm-absence-list span {
  color: var(--muted);
  font-size: 12px;
}

.dorm-absence-list em {
  font-style: normal;
  font-weight: 600;
  color: #b64837;
  background: #fde2db;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
}

.dorm-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dorm-signature-thumb {
  display: block;
  max-width: 130px;
  max-height: 76px;
  border: 1px solid #e3d4c6;
  border-radius: 10px;
  background: #ffffff;
  padding: 4px;
}


/* ---------- 查寝名单文本 ---------- */
.absence-text-card {
  padding: 16px;
}

.absence-text {
  width: 100%;
  min-height: 300px;
  padding: 14px;
  border: 1px solid #e3d4c6;
  border-radius: 12px;
  background: #fffdf8;
  color: #4a332b;
  font-size: 16px;
  line-height: 1.8;
  font-family: inherit;
  resize: vertical;
}

/* ---------- 查学生所在宿舍 ---------- */
.dorm-search-card {
  margin-bottom: 22px;
}

.dorm-search-card .table-wrap {
  margin-top: 14px;
}


/* ---------- 全院学生表格列宽 ---------- */
.college-students-table {
  min-width: 100%;
  table-layout: auto;
}

.college-students-table th,
.college-students-table td {
  min-width: 120px;
}

.college-students-table td {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.college-students-table .check-col {
  width: 44px;
  min-width: 44px;
  text-align: center;
}
