/* ============================================================
   声屿 FM · 校园广播投票站
   ============================================================ */

:root {
  --bg: #f6f1e7;
  --bg-deep: #efe8d8;
  --ink: #24343d;
  --ink-soft: #5c6b72;
  --ink-faint: #8d99a0;
  --card: #fffdf8;
  --line: #e4dcc9;
  --teal: #0f766e;
  --teal-deep: #0b5f59;
  --teal-soft: #e3f1ef;
  --orange: #d97706;
  --orange-soft: #fdeeda;
  --red: #c2410c;
  --red-soft: #fde8e4;
  --green: #15803d;
  --shadow-sm: 0 1px 2px rgba(36, 52, 61, 0.06), 0 2px 8px rgba(36, 52, 61, 0.05);
  --shadow-md: 0 4px 12px rgba(36, 52, 61, 0.08), 0 12px 32px rgba(36, 52, 61, 0.1);
  --shadow-lg: 0 8px 24px rgba(36, 52, 61, 0.12), 0 24px 64px rgba(36, 52, 61, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(217, 119, 6, 0.07), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(15, 118, 110, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--teal);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}

.skip-link:focus {
  left: 0;
  color: #fff;
  text-decoration: none;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
  text-align: center;
  font-size: 16px;
}

/* ---------------- 启动画面 ---------------- */

.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.boot-screen p {
  margin: 14px 0 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.boot-screen small {
  color: var(--ink-faint);
}

.boot-mark {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 46px;
}

.boot-mark span {
  width: 7px;
  border-radius: 4px;
  background: var(--teal);
  animation: bounce 1s ease-in-out infinite;
}

.boot-mark span:nth-child(1) { height: 16px; animation-delay: 0s; }
.boot-mark span:nth-child(2) { height: 30px; animation-delay: 0.1s; }
.boot-mark span:nth-child(3) { height: 22px; animation-delay: 0.2s; }
.boot-mark span:nth-child(4) { height: 38px; animation-delay: 0.3s; }
.boot-mark span:nth-child(5) { height: 14px; animation-delay: 0.4s; }

@keyframes bounce {
  0%, 100% { transform: scaleY(0.6); opacity: 0.7; }
  50% { transform: scaleY(1.15); opacity: 1; }
}

/* ---------------- 布局 ---------------- */

.shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--ink);
  cursor: pointer;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), #0d9488);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}

.brand-sub {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 500;
  letter-spacing: 0.18em;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.user-chip:hover {
  border-color: var(--teal);
  text-decoration: none;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-deep);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.role-user { background: var(--teal-soft); color: var(--teal-deep); }
.role-admin { background: var(--orange-soft); color: var(--orange); }
.role-superadmin { background: var(--red-soft); color: var(--red); }

main {
  margin-top: 8px;
}

.view-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 14px 0 20px;
  flex-wrap: wrap;
}

.view-head h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.02em;
}

.view-head .sub {
  color: var(--ink-faint);
  font-size: 13px;
}

/* ---------------- 首页四宫格 ---------------- */

.hero {
  text-align: center;
  padding: 30px 0 8px;
}

.hero h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0.04em;
}

.hero p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.grid-home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 30px 0 10px;
}

.block-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.block-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
  text-decoration: none;
}

.block-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  opacity: 0.55;
}

.block-vote::after { background: var(--teal-soft); }
.block-plans::after { background: var(--orange-soft); }
.block-me::after { background: #e7e9f4; }
.block-contact::after { background: #f3e6f5; }

.block-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.block-vote .block-icon { background: linear-gradient(135deg, #0f766e, #0d9488); }
.block-plans .block-icon { background: linear-gradient(135deg, #d97706, #ea8a1a); }
.block-me .block-icon { background: linear-gradient(135deg, #4f5b9e, #6a75c0); }
.block-contact .block-icon { background: linear-gradient(135deg, #a3529e, #bd71b8); }

.block-card h2 {
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: 0.03em;
}

.block-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.block-meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--ink-faint);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* ---------------- 通用组件 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--teal-deep); }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover:not(:disabled) { filter: brightness(1.06); }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: #fad9d2; }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.field textarea { width: 100%; resize: vertical; min-height: 96px; }
.announcement-body { white-space: pre-wrap; line-height: 1.7; color: var(--ink); }
}

.field .hint {
  font-size: 12px;
  color: var(--ink-faint);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.form-card {
  max-width: 420px;
  margin: 26px auto;
  padding: 30px 28px;
}

.form-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.form-card .sub {
  margin: 0 0 22px;
  color: var(--ink-faint);
  font-size: 13px;
}

.form-foot {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-soft);
}

.password-meter {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.password-meter i {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}

.password-meter i.on-1 { background: #f0b429; }
.password-meter i.on-2 { background: #66b6a8; }
.password-meter i.on-3 { background: var(--green); }

/* ---------------- 投票列表 ---------------- */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-card b {
  font-size: 22px;
  letter-spacing: 0.02em;
}

.stat-card span {
  font-size: 12px;
  color: var(--ink-faint);
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.track-row:hover {
  border-color: rgba(15, 118, 110, 0.4);
  box-shadow: var(--shadow-md);
}

.track-note {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--teal-soft);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.track-main {
  flex: 1;
  min-width: 0;
}

.track-title {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-sub {
  font-size: 12px;
  color: var(--ink-faint);
}

.track-artist {
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-votes {
  flex: none;
  text-align: center;
  min-width: 64px;
}

.track-votes b {
  font-size: 18px;
  color: var(--teal-deep);
}

.track-votes span {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
}

.track-actions {
  flex: none;
  display: flex;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink-faint);
}

.empty-state .icon {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}

/* ---------------- 弹窗 ---------------- */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 35, 0.45);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 60;
  animation: fadeIn 0.16s ease;
}

.dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.18s ease;
}

.dialog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px 0;
}

.dialog-head h2 {
  margin: 0;
  font-size: 18px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-close {
  border: none;
  background: var(--bg-deep);
  color: var(--ink-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
}

.dialog-body {
  padding: 14px 22px 22px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 投票详情 ---------------- */

.detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-title .track-note {
  width: 52px;
  height: 52px;
  font-size: 24px;
}

.detail-title h2 {
  margin: 0;
  font-size: 20px;
  word-break: break-all;
}

.detail-title small {
  color: var(--ink-faint);
}

.player-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.player-box audio {
  width: 100%;
  display: block;
}

.detail-stats {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.detail-stat {
  flex: 1;
  min-width: 110px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
}

.detail-stat b {
  display: block;
  font-size: 20px;
  color: var(--teal-deep);
}

.detail-stat span {
  font-size: 12px;
  color: var(--ink-faint);
}

.vote-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.vote-zone .tip {
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------------- 播音安排 ---------------- */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.plan-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.plan-card.today {
  border-color: var(--teal);
  background: linear-gradient(180deg, #f0faf8, var(--card) 60%);
}

.plan-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.plan-weekday {
  font-weight: 800;
  font-size: 16px;
}

.today-pill {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--teal);
  padding: 2px 9px;
  border-radius: 999px;
}

.plan-time {
  font-weight: 700;
  color: var(--orange);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.plan-title {
  font-weight: 600;
  margin: 2px 0;
}

.plan-desc {
  color: var(--ink-soft);
  font-size: 13px;
}

.plan-empty {
  color: var(--ink-faint);
  font-size: 13px;
}

.plan-updated {
  margin-top: 18px;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ---------------- 我的 ---------------- */

.me-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 760px) {
  .me-grid {
    grid-template-columns: 320px 1fr;
    align-items: start;
  }
}

.ticket-hero {
  text-align: center;
  padding: 26px 18px;
  background: linear-gradient(160deg, #0f766e, #0b5f59);
  color: #fff;
  border: none;
}

.ticket-hero .ticket-num {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.ticket-hero .ticket-label {
  font-size: 13px;
  opacity: 0.85;
}

.ticket-hero .role-line {
  margin-top: 14px;
  font-size: 13px;
  opacity: 0.9;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.record-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.record-row .track-title {
  flex: 1;
  font-size: 14px;
}

.record-row time {
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.record-row .gone {
  color: var(--red);
  font-size: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 16px;
}

.section-title .count-pill {
  font-size: 12px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  border-radius: 999px;
  padding: 2px 9px;
  font-weight: 600;
}

/* ---------------- 联系管理员 ---------------- */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.admin-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-card:hover {
  border-color: rgba(160, 82, 158, 0.5);
  box-shadow: var(--shadow-md);
}

.admin-card .who {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-card .avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f3e6f5;
  color: #a3529e;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.admin-card b {
  font-size: 15px;
}

.admin-qq {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

details.admin-qq { display: block; }
.admin-qq summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.admin-qq[open] summary { margin-bottom: 10px; }
.admin-qq .qq-value {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.06em;
}

/* ---------------- 管理后台 ---------------- */

.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.admin-tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 30px 18px;
  text-align: center;
  color: var(--ink-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.upload-zone.drag {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.upload-zone .icon {
  font-size: 30px;
  display: block;
  margin-bottom: 6px;
}

.upload-zone small {
  display: block;
  color: var(--ink-faint);
  margin-top: 4px;
}

.admin-list-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-row-editor {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-row-editor input {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
}

.admin-row-editor input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.plan-editor-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.plan-editor-row .weekday {
  width: 58px;
  flex: none;
  font-weight: 700;
  font-size: 14px;
  padding-top: 12px;
}

.plan-editor-row textarea {
  flex: 1;
  min-height: 52px;
  resize: vertical;
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: #fff;
}

.plan-editor-row textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

/* ---------------- 提示与确认 ---------------- */

.toast-stack {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 120;
  width: min(480px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.22s ease;
  pointer-events: auto;
}

.toast.ok { background: var(--teal-deep); }
.toast.err { background: #8f2f16; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.muted {
  color: var(--ink-faint);
  font-size: 12.5px;
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 细腻的校园编辑风格，保留暖纸色与青绿主色。 */
:root { --ink-faint: #67777c; --radius: 20px; }
html { scroll-behavior: smooth; }
body { background-attachment: fixed; }
button, input, textarea { font: inherit; }
a, button, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #bc780d; outline-offset: 4px; }
.shell { max-width: 1180px; padding-bottom: 28px; }
.topbar { min-height: 88px; padding: 20px 0; }
.brand-logo { width: 44px; height: 44px; font-size: 27px; border-radius: 14px; }
.brand-sub { display: block; font-size: 10px; letter-spacing: .15em; margin-top: 1px; }
.topbar-right { min-width: 0; }
.user-chip { min-width: 0; max-width: 340px; }
.account-label { overflow: hidden; text-overflow: ellipsis; }
.main-nav { display: flex; gap: 6px; padding: 8px 0 17px; border-bottom: 1px solid var(--line); margin-bottom: 28px; overflow-x: auto; scrollbar-width: thin; }
.main-nav a { padding: 8px 17px; border-radius: 99px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.main-nav a:hover { text-decoration: none; background: #ffffff80; }
.main-nav a[aria-current] { background: var(--ink); color: #fff; }
.hero { position: relative; overflow: hidden; text-align: left; padding: 48px 46px; border-radius: 28px; background: linear-gradient(110deg, #e2ede6, #eef0df); border: 1px solid #d5dfd1; min-height: 310px; }
.hero h1 { position: relative; z-index: 1; font-size: clamp(28px, 3.6vw, 44px); letter-spacing: -.025em; line-height: 1.4; max-width: 760px; }
.hero p { position: relative; z-index: 1; max-width: 660px; }
.eyebrow { color: var(--teal-deep); font-size: 11px; font-weight: 700; letter-spacing: .18em; margin-bottom: 15px; }
.hero-actions { position: relative; z-index: 1; justify-content: flex-start; margin-top: 25px; }
.hero-disc { position: absolute; width: 245px; height: 245px; right: -85px; bottom: -80px; border-radius: 50%; background: repeating-radial-gradient(circle, #26423b 0 3px, #355349 4px 6px); opacity: .15; display: grid; place-items: center; transform: rotate(-20deg); }
.hero-disc span { display: grid; place-items: center; width: 82px; height: 82px; border-radius: 50%; background: #d99e4f; font-size: 40px; }
.mobile-break { display: none; }
.rule-strip { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 18px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.rule-strip > span:first-child { flex-basis: 100%; }
.rule-strip b { color: var(--teal-deep); font-weight: 600; }
.grid-home { margin-top: 18px; gap: 16px; }
.block-card { min-height: 242px; padding: 25px; color: var(--ink); }
.block-card::after { opacity: .3; }
.block-icon { background: var(--teal-soft) !important; box-shadow: none; color: var(--teal-deep); width: 44px; height: 44px; font-size: 25px; }
.block-plans .block-icon { background: var(--orange-soft) !important; color: #99601a; }
.block-me .block-icon { background: #e7e9f4 !important; color: #59648d; }
.block-contact .block-icon { background: #f3e6f5 !important; color: #92558b; }
.block-meta { padding-top: 12px; }
.btn { min-height: 42px; border-radius: 12px; }
.btn-sm { min-height: 36px; }
.btn:hover { text-decoration: none; }
.view-head { margin-bottom: 24px; }
.view-head .sub { color: var(--ink-soft); }
.view-head h1 { font-size: 28px; }
.card { padding: 24px; }
.stacked-card { margin-top: 18px; }
.panel-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.full-width { width: 100%; }
.form-card { max-width: 470px; padding: 32px; margin: 36px auto; }
.form-card h1 { font-size: 27px; }
.form-card form > .btn { width: 100%; }
.field input { min-width: 0; width: 100%; }
.field input[type=file] { background: var(--bg); }
.form-error { color: #a4311b; font-size: 13px; line-height: 1.6; margin-bottom: 0; }
.form-error:empty { display: none; }
.hint { color: var(--ink-soft); font-size: 12px; }
.check-line { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; font-size: 13px; }
.check-line input { flex: none; width: 18px; height: 18px; accent-color: var(--teal); }
.search-field { max-width: 460px; }
.track-row { padding: 18px 20px; }
.track-rank { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-faint); }
.track-title { font-size: 16px; }
.track-sub { margin-top: 4px; }
.track-votes { margin: 0 15px; }
.track-votes b { font-size: 24px; }
.period-card { margin-bottom: 22px; }
.period-card p { font-size: 14px; color: var(--ink-soft); }
.period-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 12px; color: var(--teal-deep); }
.plan-card { min-height: 160px; padding: 22px; }
.plan-title, .account-text, .qq-value { overflow-wrap: anywhere; }
.plan-title { font-size: 18px; margin-top: 12px; }
.ticket-hero { padding: 32px 20px; }
.ticket-hero .ticket-num { font-size: 64px; padding: 12px 0; }
.grant-amount { color: var(--teal-deep); font-weight: 700; white-space: nowrap; }
.contact-edit { padding: 16px 0 4px; border-top: 1px solid var(--line); }
.contact-edit > b { display: block; margin-bottom: 12px; overflow-wrap: anywhere; }
.contact-edit .field { max-width: 460px; }
.table-wrap { max-width: 100%; border-radius: 10px; }
th { background: var(--bg); }
td { overflow-wrap: anywhere; min-width: 80px; }
td:last-child { min-width: 200px; }
.row-actions .btn { font-size: 12px; padding: 7px 12px; }
.admin-tabs { gap: 8px; }
.admin-card { cursor: default; }
.admin-card .who b { overflow-wrap: anywhere; min-width: 0; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-faint); }
.dialog-backdrop { background: #182d2a80; backdrop-filter: blur(5px); }
.dialog { max-height: calc(100dvh - 40px); }
.dialog-close { min-width: 40px; height: 40px; }
.dialog-body { padding-top: 20px; }
.player-box { padding: 12px; }
.record-row { flex-wrap: wrap; }
.record-row .track-title { min-width: 80px; }
@media (max-width: 760px) {
  .grid-home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 32px; }
  .hero h1 { max-width: 560px; }
  .main-nav { gap: 0; }
  .main-nav a { padding: 8px 13px; }
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
  .admin-tabs .btn { flex: none; }
}
@media (max-width: 560px) {
  .shell { padding: 0 16px 24px; }
  .topbar { gap: 10px; flex-wrap: wrap; padding: 18px 0 12px; }
  .brand { font-size: 17px; }
  .brand-logo { width: 36px; height: 36px; }
  .topbar-right { gap: 6px; max-width: 100%; }
  .topbar-right .btn { font-size: 12px; padding: 7px 10px; min-height: 36px; }
  .user-chip { max-width: 200px; padding: 6px 8px; gap: 5px; }
  .user-chip .role-badge { font-size: 10px; }
  .main-nav { margin-bottom: 20px; margin-right: -16px; padding-right: 16px; }
  .hero { padding: 28px 22px; min-height: 0; border-radius: 22px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 13px; }
  .mobile-break { display: block; }
  .hero-actions { gap: 9px; }
  .hero-actions .btn { padding: 11px 14px; font-size: 13px; }
  .eyebrow { font-size: 10px; letter-spacing: .1em; }
  .grid-home { gap: 12px; }
  .block-card { min-height: 230px; padding: 18px 15px; gap: 8px; }
  .block-card h2 { font-size: 18px; }
  .block-card p { font-size: 12px; }
  .block-meta { font-size: 11px; }
  .view-head { gap: 5px; flex-direction: column; }
  .view-head h1 { font-size: 25px; }
  .card { padding: 20px 17px; }
  .form-card { padding: 26px 20px; margin: 24px auto; }
  .field input { font-size: 16px; }
  .track-row { flex-wrap: wrap; gap: 10px; padding: 15px; }
  .track-rank { display: none; }
  .track-note { width: 36px; height: 36px; }
  .track-votes { min-width: 48px; margin: 0; }
  .track-actions { width: 100%; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
  .track-actions .btn { width: 100%; }
  .plan-grid { gap: 10px; }
  .plan-card { padding: 16px; min-height: 140px; }
  .plan-title { font-size: 15px; }
  .plan-weekday { font-size: 14px; }
  .plan-head { flex-wrap: wrap; gap: 4px; }
  .dialog-backdrop { padding: 12px; }
  .dialog { border-radius: 20px; max-height: calc(100dvh - 24px); }
  .dialog-head { padding: 14px 17px 0; }
  .dialog-body { padding: 16px 17px 22px; }
  .detail-stat { min-width: 70px; padding: 12px 7px; }
  .detail-stats { gap: 8px; }
  .record-row time { width: 100%; padding-left: 0; }
  .site-footer { margin-top: 36px; }
}
@media (max-width: 350px) { .grid-home, .plan-grid { grid-template-columns: 1fr; } .block-card { min-height: 190px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

