/* 武设新生报到系统 - 学生端样式（移动优先） */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1e40af;
  --color-bg: #f5f7fa;
  --color-card: #fff;
  --color-success: #16a34a;
  --color-text: #111827;
  --color-text-secondary: #6b7280;
  --color-border: #e5e7eb;
  --color-danger: #dc2626;
  --color-success-bg: #dcfce7;
  --color-success-text: #15803d;
  --color-warning: #f59e0b;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #92400e;
  --font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius-card: 16px;
  --radius-control: 10px;
  --shadow-card: 0 4px 16px rgba(17, 24, 39, .06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ============ 头部 ============ */
.site-header {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  border-radius: 0 0 24px 24px;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 20px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  animation: fadeInUp .4s ease both;
}
.site-header::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}
.site-header::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
}
.header-emblem {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
}
.header-emblem img {
  display: block;
  max-width: 220px;
  width: auto;
  height: auto;
  max-height: 60px;
  object-fit: contain;
  filter: brightness(0) invert(1); /* 校徽原图深色，叠白底反白为白 */
  opacity: .95;
}
.header-content { text-align: center; position: relative; z-index: 1; }
.header-title { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.header-subtitle { font-size: 13px; opacity: .85; margin-top: 6px; }

/* ============ 主体 ============ */
.page-main {
  padding: 24px 16px calc(env(safe-area-inset-bottom, 0px) + 40px);
}

/* ============ 卡片 ============ */
.card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px 20px;
  animation: fadeInUp .4s ease .1s both;
}
.card-title { font-size: 18px; font-weight: 700; }
.card-desc { font-size: 13px; color: var(--color-text-secondary); margin-top: 6px; margin-bottom: 20px; }

/* ============ 表单 ============ */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 14px;
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}
.field-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 16px; /* 防止 iOS 聚焦缩放 */
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field-input:focus { border-color: var(--color-primary); }
.field-input:focus-visible { box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.field-input:disabled {
  background: #f5f7fa;
  color: #9ca3af;
  cursor: not-allowed;
}
.field-error {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 6px;
}

/* 下拉选择 */
.select-wrap { position: relative; }
.select-wrap .field-input { padding-right: 40px; }
.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 8px;
  color: var(--color-text-secondary);
  pointer-events: none;
}
.field-input:disabled ~ .select-arrow { opacity: .4; }

/* 缴费状态分段控件 */
.segmented {
  display: flex;
  background: #f5f7fa;
  border-radius: var(--radius-control);
  padding: 3px;
  border: 1px solid var(--color-border);
}
.segmented-item { flex: 1; position: relative; }
.segmented-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all .2s ease;
  min-height: 44px;
}
.segmented-item input:checked + .segmented-label {
  background: #fff;
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(17, 24, 39, .08);
}
.segmented-item input:focus-visible + .segmented-label {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============ 按钮 ============ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: var(--radius-control);
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }
.btn-secondary {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-secondary:hover { background: #eff6ff; }
.btn:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }

/* ============ 未开放提示 ============ */
.info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--color-warning);
  font-size: 15px;
  margin-bottom: 16px;
  animation: fadeInUp .4s ease both;
}
.info-banner[hidden] { display: none; }
.info-banner svg { width: 20px; height: 20px; color: var(--color-warning); flex-shrink: 0; }

/* ============ 成功页 ============ */
.success-card { text-align: center; padding: 32px 24px; }
.success-check { width: 68px; height: 68px; margin: 0 auto 16px; animation: scaleIn .5s ease both; }
.success-check svg { width: 100%; height: 100%; }
.success-label { font-size: 14px; color: var(--color-text-secondary); margin-bottom: 8px; }
.report-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.report-number {
  font-size: 56px;
  font-weight: 800;
  color: var(--color-success);
  letter-spacing: .08em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  animation: fadeInUp .4s ease .15s both;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #f5f7fa;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  transition: all .2s ease;
  color: var(--color-text-secondary);
  margin: 0 auto 24px;
}
.copy-btn svg { width: 18px; height: 18px; }
.copy-btn:hover { background: #eff6ff; color: var(--color-primary); border-color: var(--color-primary); }
.copy-btn:active { transform: scale(.94); }

.info-list { margin: 0 0 20px; text-align: left; }
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
}
.info-row:last-child { border-bottom: none; }
.info-row dt { color: var(--color-text-secondary); font-size: 14px; flex-shrink: 0; }
.info-row dd { margin: 0; color: var(--color-text); font-weight: 500; text-align: right; word-break: break-all; }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.badge-paid { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-unpaid { background: var(--color-warning-bg); color: var(--color-warning-text); }

.rank-line { font-size: 15px; margin-bottom: 6px; }
.rank-line strong { color: var(--color-primary); }
.created-at { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 24px; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 32px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-control);
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(17, 24, 39, .25);
  z-index: 1000;
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  max-width: 88vw;
  text-align: center;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============ 动画 ============ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  0% { opacity: 0; transform: scale(.5); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ============ 平板/桌面 ============ */
@media (min-width: 768px) {
  .page-main { max-width: 480px; margin: 0 auto; padding-top: 32px; }
  .site-header { border-radius: 0 0 28px 28px; }
  .header-title { font-size: 26px; }
  .report-number { font-size: 62px; }
}
