/* ============================================================
   圣诞礼物互换 · 全局样式
   ============================================================ */

:root {
  --bg: #06110d;
  --panel: rgba(12, 32, 24, 0.72);
  --panel-solid: #0d241b;
  --gold: #d8b26a;
  --gold-bright: #f0d9a4;
  --gold-dim: rgba(216, 178, 106, 0.35);
  --line: rgba(216, 178, 106, 0.2);
  --line-strong: rgba(216, 178, 106, 0.42);
  --red: #b23a3a;
  --red-deep: #6f1f1f;
  --text: #eef3ea;
  --muted: #9db2a4;
  --muted-dim: #74897c;
  --ok: #8fd6a8;
  --danger: #ff9b8f;
  --radius-lg: 28px;
  --radius: 16px;
  --radius-sm: 12px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

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

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 560px at 12% -8%, rgba(178, 58, 58, 0.16), transparent 62%),
    radial-gradient(900px 500px at 92% -4%, rgba(216, 178, 106, 0.1), transparent 58%),
    radial-gradient(900px 760px at 50% 118%, rgba(30, 96, 70, 0.34), transparent 62%),
    linear-gradient(165deg, #06110d 0%, #0a1a14 46%, #050f0b 100%);
  background-attachment: fixed;
}

body.no-scroll {
  overflow: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.btn,
.tabs button,
.link-btn,
.icon-btn {
  touch-action: manipulation;
}

::selection {
  background: rgba(216, 178, 106, 0.28);
}

/* ---------------- 飘雪背景 ---------------- */

.snow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.snow span {
  position: absolute;
  top: -12vh;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, rgba(255, 255, 255, 0));
  opacity: 0.5;
  animation: snow-fall linear infinite;
}

@keyframes snow-fall {
  0% {
    transform: translate3d(0, -10vh, 0);
  }
  100% {
    transform: translate3d(18px, 118vh, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .snow span {
    animation: none;
    opacity: 0.18;
  }
}

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

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 28px 10px;
}

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

.brand svg {
  width: 30px;
  height: 30px;
  color: var(--gold);
  flex: none;
}

.brand b {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.brand small {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--gold-dim);
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}

.topbar-right .who {
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 2px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.link-btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold-dim);
}

.card {
  position: relative;
  background: linear-gradient(165deg, rgba(17, 42, 32, 0.86), rgba(8, 22, 17, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  background: linear-gradient(180deg, #efd7a2 0%, #d3ac63 100%);
  color: #241a08;
  box-shadow: 0 12px 30px -14px rgba(216, 178, 106, 0.75);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 16px 34px -12px rgba(216, 178, 106, 0.9);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  color: var(--gold-bright);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(216, 178, 106, 0.08);
}

.btn-danger {
  background: linear-gradient(180deg, #b64747, #8d2c2c);
  color: #fff4f1;
}

.btn-danger:hover:not(:disabled) {
  box-shadow: 0 14px 30px -14px rgba(178, 58, 58, 0.8);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* ---------------- 登录 / 报名页 ---------------- */

.auth-shell {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 48px));
  margin: 5vh auto;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  border: 1px solid var(--line);
  border-radius: 32px;
  overflow: hidden;
  background: rgba(6, 17, 13, 0.55);
  box-shadow: 0 50px 120px -60px rgba(0, 0, 0, 1);
  backdrop-filter: blur(6px);
}

.brand-panel {
  position: relative;
  padding: 68px 58px 60px;
  background:
    radial-gradient(520px 380px at 8% 0%, rgba(178, 58, 58, 0.2), transparent 62%),
    radial-gradient(460px 420px at 100% 100%, rgba(216, 178, 106, 0.12), transparent 60%),
    linear-gradient(160deg, rgba(13, 36, 27, 0.9), rgba(6, 16, 12, 0.95));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.06;
  pointer-events: none;
}

.mark {
  width: 58px;
  height: 58px;
  color: var(--gold);
  filter: drop-shadow(0 6px 18px rgba(216, 178, 106, 0.25));
}

.eyebrow {
  margin: 26px 0 14px;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
}

.brand-panel h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", "STSong", serif;
  font-size: clamp(23px, 4.6vw, 36px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-panel h1 em {
  font-style: normal;
  color: var(--gold-bright);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--muted);
}

.steps .n {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 12px;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.steps b {
  color: var(--text);
  font-weight: 600;
}

.auth-card {
  padding: 56px 50px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, rgba(8, 22, 17, 0.35), rgba(6, 16, 12, 0.6));
}

.tabs {
  display: flex;
  padding: 5px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  margin-bottom: 30px;
}

.tabs button {
  flex: 1;
  appearance: none;
  border: 0;
  background: none;
  padding: 10px 8px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tabs button[aria-selected="true"] {
  background: linear-gradient(180deg, #efd7a2, #d3ac63);
  color: #241a08;
  font-weight: 600;
  box-shadow: 0 8px 20px -12px rgba(216, 178, 106, 0.9);
}

.form-head {
  margin-bottom: 22px;
}

.form-head h2 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.form-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted-dim);
}

form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.field input {
  width: 100%;
  appearance: none;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(216, 178, 106, 0.16);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: #62766a;
}

.field input:focus {
  outline: none;
  border-color: var(--gold-dim);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 3px rgba(216, 178, 106, 0.1);
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  transition: background-color 9999s ease-out;
}

.wish-grid {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.wish-row {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 10px;
}

.wish-row .idx {
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
  opacity: 0.7;
  text-align: center;
}

.wish-row.added {
  grid-template-columns: 26px 1fr 28px;
}

.wish-remove {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px;
  border-radius: 6px;
  color: var(--muted-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.wish-remove:hover {
  color: var(--danger);
  background: rgba(178, 58, 58, 0.12);
}

.add-wish {
  appearance: none;
  justify-self: start;
  margin-top: 2px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px dashed rgba(216, 178, 106, 0.32);
  background: none;
  color: var(--gold);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.add-wish:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(216, 178, 106, 0.07);
  color: var(--gold-bright);
}

.add-wish:disabled {
  opacity: 0.45;
  cursor: default;
}

.wish-row input::placeholder {
  color: #5d7065;
}

.auth-foot {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 24px 42px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: rgba(157, 178, 164, 0.5);
}

.form-error {
  min-height: 20px;
  margin: 0;
  font-size: 13px;
  color: var(--danger);
}

.form-note {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted-dim);
  line-height: 1.8;
}

/* ---------------- 个人主页 ---------------- */

.page {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 24px 80px;
}

.page-head {
  text-align: center;
  margin: 34px 0 34px;
}

.page-head h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.page-head p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.page-head .pill {
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  background: rgba(216, 178, 106, 0.07);
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(143, 214, 168, 0.12);
}

.pill.closed {
  color: var(--danger);
  border-color: rgba(255, 155, 143, 0.3);
  background: rgba(178, 58, 58, 0.1);
}

.pill.closed .dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 155, 143, 0.12);
}

.section-card {
  padding: 34px 34px 30px;
  margin-bottom: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.section-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.count {
  font-family: Georgia, serif;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.roster {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(216, 178, 106, 0.16);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13.5px;
  color: var(--text);
}

.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.6;
}

.empty {
  padding: 30px 0;
  text-align: center;
  color: var(--muted-dim);
  font-size: 13.5px;
}

.hint {
  margin: 22px 0 0;
  padding: 14px 18px;
  border-left: 2px solid var(--gold-dim);
  background: rgba(216, 178, 106, 0.05);
  border-radius: 0 10px 10px 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.9;
}

/* 抽签结果 */

.reveal {
  padding: 44px 34px 40px;
  text-align: center;
}

.reveal-label {
  font-size: 11.5px;
  letter-spacing: 0.34em;
  color: var(--muted);
  text-transform: uppercase;
}

.num {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-shadow: 0 8px 34px rgba(216, 178, 106, 0.25);
}

.num-xl {
  display: block;
  font-size: clamp(64px, 12vw, 92px);
  line-height: 1.05;
  margin: 6px 0 4px;
}

.num-lg {
  font-size: clamp(44px, 9vw, 60px);
  line-height: 1.1;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 30px auto;
  max-width: 340px;
  color: var(--gold);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.divider svg {
  width: 22px;
  height: 22px;
  opacity: 0.85;
}

.target-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 15px;
  color: var(--muted);
}

.target-line .num {
  font-size: clamp(34px, 7vw, 46px);
  padding: 0 4px;
}

.wish-list {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  text-align: left;
}

.wish-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 20px;
  border: 1px solid rgba(216, 178, 106, 0.14);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.wish-list .idx {
  flex: none;
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--gold);
  opacity: 0.75;
  padding-top: 3px;
}

.wish-list .txt {
  font-size: 14.5px;
  line-height: 1.75;
  word-break: break-word;
}

.reveal .hint {
  text-align: left;
  margin-top: 28px;
}

.reveal .hint b {
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 15px;
  padding: 0 2px;
}

/* ---------------- 后台 ---------------- */

.admin-wrap {
  position: relative;
  z-index: 2;
  width: min(1080px, calc(100% - 40px));
  margin: 4vh auto 80px;
}

.admin-login {
  width: min(420px, 100%);
  margin: 8vh auto 0;
  padding: 42px 36px 36px;
}

.admin-login h2 {
  margin: 0 0 6px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: center;
}

.admin-login p {
  margin: 0 0 26px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted-dim);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(17, 42, 32, 0.8), rgba(8, 22, 17, 0.8));
}

.stat .k {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--muted-dim);
  text-transform: uppercase;
}

.stat .v {
  margin-top: 6px;
  font-family: Georgia, serif;
  font-size: 30px;
  color: var(--gold-bright);
  line-height: 1.2;
}

.stat .v.small {
  font-size: 19px;
  font-family: inherit;
  letter-spacing: 0.04em;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.toolbar .spacer {
  flex: 1;
}

.toolbar .note {
  font-size: 12px;
  color: var(--muted-dim);
}

.table-card {
  padding: 8px 0 0;
  overflow: hidden;
}

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

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

th,
td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(216, 178, 106, 0.1);
}

th {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--muted-dim);
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
  background: rgba(216, 178, 106, 0.035);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.seq-cell {
  font-family: Georgia, serif;
  color: var(--gold-bright);
  font-size: 15px;
  text-align: center;
  white-space: nowrap;
}

td.wishes-cell {
  color: var(--muted);
  min-width: 240px;
}

td.wishes-cell span {
  display: block;
  padding: 1px 0;
}

td.ops-cell {
  white-space: nowrap;
  text-align: right;
}

.icon-btn {
  appearance: none;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.icon-btn:hover {
  color: var(--gold-bright);
  border-color: var(--line);
  background: rgba(216, 178, 106, 0.06);
}

.icon-btn.danger:hover {
  color: var(--danger);
  border-color: rgba(255, 155, 143, 0.3);
  background: rgba(178, 58, 58, 0.1);
}

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

.modal {
  width: min(460px, calc(100% - 36px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(170deg, #102a20, #081710);
  color: var(--text);
  box-shadow: 0 40px 120px -40px #000;
}

.modal::backdrop {
  background: rgba(2, 8, 6, 0.72);
  backdrop-filter: blur(3px);
}

.modal-inner {
  padding: 32px 30px 26px;
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.modal p {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.9;
}

.modal .field {
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    width: min(560px, calc(100% - 32px));
    margin: 3vh auto 6vh;
  }

  .brand-panel {
    padding: 44px 34px 36px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 26px;
  }

  .steps {
    gap: 12px;
  }

  .auth-card {
    padding: 38px 30px 34px;
  }

  .stat-row {
    grid-template-columns: 1fr 1fr;
  }

  .stat-row .stat:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .topbar {
    padding: 20px 18px 6px;
  }

  .brand b {
    font-size: 15px;
  }

  .page {
    padding: 4px 16px 60px;
  }

  .section-card {
    padding: 26px 20px 22px;
    border-radius: 20px;
  }

  .reveal {
    padding: 34px 20px 30px;
  }

  .auth-shell {
    width: calc(100% - 24px);
    border-radius: 24px;
  }

  .brand-panel,
  .auth-card {
    padding-left: 22px;
    padding-right: 22px;
  }

  .admin-wrap {
    width: calc(100% - 24px);
  }

  .admin-login {
    padding: 32px 22px 28px;
  }

  .stat-row {
    gap: 10px;
  }

  .stat {
    padding: 16px 18px;
  }

  .stat .v {
    font-size: 24px;
  }

  .toolbar {
    padding: 16px;
  }
}

/* ---------------- 移动端优先适配 ---------------- */

@media (max-width: 900px) {
  /* 16px 以上可避免 iOS 聚焦输入框时自动放大页面 */
  .field input,
  .modal input {
    font-size: 16px;
    padding: 13px 14px;
  }

  .auth-shell {
    margin: 12px auto 20px;
  }

  .modal {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    width: calc(100% - 20px);
    margin: 10px auto 16px;
    border-radius: 22px;
  }

  /* 手机上压缩首屏，让表单尽快出现 */
  .brand-panel {
    padding: 28px 22px 24px;
    gap: 0;
  }

  .mark {
    width: 40px;
    height: 40px;
  }

  .eyebrow {
    margin: 14px 0 8px;
    font-size: 10px;
    letter-spacing: 0.3em;
  }

  .brand-panel h1 {
    font-size: clamp(22px, 6.6vw, 26px);
    letter-spacing: 0.04em;
  }

  .steps {
    display: none;
  }

  .auth-card {
    padding: 22px 18px 26px;
  }

  .tabs {
    margin-bottom: 20px;
    padding: 4px;
  }

  .tabs button {
    padding: 11px 8px;
  }

  .btn:not(.btn-sm) {
    min-height: 46px;
  }

  .form-head {
    margin-bottom: 18px;
  }

  .form-head h2 {
    font-size: 19px;
  }

  .auth-foot {
    padding-bottom: 28px;
    font-size: 10.5px;
    letter-spacing: 0.1em;
  }

  .topbar {
    padding: 16px 16px 4px;
  }

  .brand svg {
    width: 26px;
    height: 26px;
  }

  .brand b {
    font-size: 14.5px;
    letter-spacing: 0.1em;
  }

  .brand small {
    font-size: 9px;
    letter-spacing: 0.24em;
  }

  .topbar-right {
    gap: 10px;
  }

  .topbar-right .who {
    max-width: 9ch;
    font-size: 12px;
  }

  .link-btn {
    font-size: 12px;
  }

  .page {
    padding: 0 14px 56px;
  }

  .page-head {
    margin: 24px 0 22px;
  }

  .page-head h2 {
    font-size: 24px;
  }

  .page-head p {
    font-size: 12.5px;
  }

  .section-card {
    padding: 22px 18px 20px;
  }

  .section-head {
    margin-bottom: 16px;
  }

  .chip {
    font-size: 13px;
    padding: 7px 14px;
  }

  .reveal {
    padding: 32px 18px 28px;
  }

  .num-xl {
    font-size: clamp(60px, 22vw, 84px);
  }

  .divider {
    margin: 24px auto;
  }

  .wish-list {
    margin-top: 26px;
  }

  .wish-list li {
    padding: 14px 16px;
    border-radius: 12px;
  }

  .wish-list .txt {
    font-size: 14px;
  }

  .hint {
    padding: 12px 14px;
    font-size: 12px;
  }

  /* 后台列表在手机上转为卡片，避免横向裁切 */
  .table-card {
    border-radius: 18px;
    padding: 0;
  }

  thead {
    display: none;
  }

  table {
    min-width: 0;
    font-size: 13.5px;
  }

  tbody {
    display: block;
  }

  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(216, 178, 106, 0.12);
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  tbody td {
    display: block;
    padding: 0;
    border: 0;
  }

  tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--muted-dim);
  }

  tbody td.name-cell {
    grid-area: 1 / 1 / 2 / 3;
    font-size: 16px;
  }

  tbody td.phone-cell {
    grid-area: 2 / 1 / 3 / 3;
    color: var(--muted);
  }

  tbody td.time-cell {
    grid-area: 3 / 1 / 4 / 3;
    color: var(--muted-dim);
    font-size: 12.5px;
  }

  tbody td.ops-cell {
    grid-area: 4 / 1 / 5 / 3;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(216, 178, 106, 0.14);
    text-align: left;
  }

  td.ops-cell .icon-btn {
    min-height: 36px;
    padding: 6px 12px;
    border-color: rgba(216, 178, 106, 0.16);
  }

  /* 心愿汇总表格在手机上同样转为卡片 */
  .stack-table thead {
    display: none;
  }

  .stack-table,
  .stack-table tbody {
    display: block;
    min-width: 0;
  }

  .stack-table tr {
    display: block;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(216, 178, 106, 0.12);
  }

  .stack-table tr:last-child {
    border-bottom: 0;
  }

  .stack-table td {
    display: block;
    padding: 0;
    margin-bottom: 9px;
    border: 0;
  }

  .stack-table td:last-child {
    margin-bottom: 0;
  }

  .stack-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--muted-dim);
  }

  .stack-table td.seq-cell {
    text-align: left;
  }

  .stack-table td.wishes-cell {
    min-width: 0;
  }

  .admin-wrap {
    margin-top: 16px;
  }

  .admin-login {
    margin-top: 4vh;
  }

  .modal-inner {
    padding: 26px 20px 22px;
  }

  .modal-actions .btn {
    flex: 1;
    min-height: 44px;
  }
}

@media (max-width: 380px) {
  .brand-panel {
    padding: 24px 18px 20px;
  }

  .num-xl {
    font-size: 58px;
  }

  .auth-card {
    padding: 20px 15px 24px;
  }

  .page {
    padding-left: 12px;
    padding-right: 12px;
  }
}
