/* 亮色：法典蓝 + 朱印红 + 鎏金，宋体标题 */
:root {
  --paper: #f8f5ef;
  --paper-2: #f1ece2;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #6e675b;
  --line: #e6dfd2;
  --navy: #22346b;
  --navy-press: #1a2856;
  --on-navy: #fbf7ee;
  --seal: #b3362b;
  --gold: #a87a2f;
  --gold-soft: #f6ecd8;
  --danger: #b3362b;
  --ok: #2f7a4f;
  --tile: #22346b;
  --tile-2: #2b4180;
  --tile-ink: #fbf7ee;
  --shadow-tile: 0 1px 0 rgba(255,255,255,.08) inset, 0 16px 30px -14px rgba(34,52,107,.55);
  --font: "PingFang SC", "Noto Sans SC", "Source Han Sans SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
  --num: "DIN Alternate", "Bahnschrift", "SF Pro Display", "Roboto Condensed", "PingFang SC", sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink);
  background: var(--paper);
  font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
h1, h2, h3 { margin: 0; line-height: 1.3; }
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* 朱红印章 */
.seal {
  display: inline-grid; place-items: center; width: 46px; height: 46px; flex: none;
  border: 2px solid var(--seal); border-radius: 6px; color: var(--seal);
  font: 700 15px/1.05 var(--kai); letter-spacing: 1px; text-align: center;
  transform: rotate(-6deg); box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px rgba(179,54,43,.35);
}

/* 顶栏 */
.bar { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 16px; }
.bar a.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); padding: 10px 8px 10px 0; font-size: 15px; }
.bar .spacer { flex: 1; }
.bar .link { background: none; border: 0; color: var(--navy); font: inherit; font-size: 15px; padding: 10px 0; cursor: pointer; }

.page-head { display: flex; align-items: center; gap: 14px; }
.page-head h1 { font: 700 26px/1.3 var(--serif); letter-spacing: .02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 28px; border-radius: 14px; border: 0;
  font: 600 17px/1 var(--font); letter-spacing: .04em; text-decoration: none; cursor: pointer;
  background: var(--navy); color: var(--on-navy); touch-action: manipulation;
  box-shadow: 0 8px 18px -10px rgba(34,52,107,.7);
  transition: transform .15s var(--ease), background .2s;
}
.btn:active { transform: scale(.97); background: var(--navy-press); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--surface); color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.block { width: 100%; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 15px; border-radius: 10px; }
:focus-visible { outline: 3px solid rgba(34,52,107,.35); outline-offset: 2px; }

/* 表单 */
.section { margin-top: 28px; }
.section > h2 { font: 600 16px/1.4 var(--serif); color: var(--ink); margin: 0 0 10px 2px; display: flex; align-items: center; gap: 8px; }
.section > h2::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--seal); }
.panel { background: var(--surface); border-radius: 18px; padding: 6px 18px; border: 1px solid var(--line); box-shadow: 0 10px 30px -24px rgba(60,45,20,.35); }
.field { padding: 14px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field > label, .field > .label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.field input[type=text], .field input[type=tel], .field input[type=password], .field input[type=datetime-local], .field select {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink); font: 17px var(--font); outline: none;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus { border-color: var(--navy); background: var(--surface); }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.field .err { font-size: 13px; color: var(--danger); margin-top: 6px; }
.field.invalid input { border-color: var(--danger); }
.field.invalid .seg { box-shadow: 0 0 0 1.5px var(--danger); border-radius: 12px; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; flex: 1 1 auto; min-width: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 6px 10px; text-align: center;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper);
  font-size: 15px; line-height: 1.3; cursor: pointer; transition: all .18s var(--ease);
}
.seg input:checked + span { border-color: var(--navy); background: #eef1f9; color: var(--navy); font-weight: 600; }
.seg input:focus-visible + span { outline: 3px solid rgba(34,52,107,.35); outline-offset: 2px; }

/* 首次报名 / 修改报名 切换 */
.tabs { display: flex; padding: 4px; background: var(--paper-2); border-radius: 14px; margin-top: 20px; }
.tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: none; font: 600 15px var(--font); color: var(--muted); cursor: pointer; transition: all .2s var(--ease); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--navy); box-shadow: 0 2px 8px -4px rgba(60,45,20,.4); }

.notice { border-radius: 14px; padding: 14px 16px; font-size: 15px; background: var(--gold-soft); color: var(--ink); border: 1px solid #ead9b5; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: all .25s var(--ease); z-index: 200; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

/* 自定义弹窗 */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px;
  background: rgba(29,36,51,.42); opacity: 0; transition: opacity .18s var(--ease); }
.modal.on { opacity: 1; }
.modal-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 18px; padding: 24px 22px 20px;
  box-shadow: 0 30px 60px -20px rgba(29,36,51,.45); transform: translateY(10px) scale(.97); transition: transform .22s var(--ease); }
.modal.on .modal-card { transform: none; }
.modal-card h3 { font: 700 19px/1.4 var(--serif); }
.modal-body { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.modal-body b { color: var(--ink); }
.modal-ops { display: flex; gap: 10px; margin-top: 22px; }
.modal-ops .btn { flex: 1; min-height: 46px; padding: 0 12px; font-size: 16px; }
.btn.danger { background: var(--seal); color: #fff; box-shadow: 0 8px 18px -10px rgba(179,54,43,.7); }
.pw-show { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 16px;
  border-radius: 12px; background: var(--paper); border: 1.5px dashed var(--line); }
.pw-show code { font: 700 30px/1 var(--num); letter-spacing: .18em; color: var(--navy); }
.pw-show button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--navy); color: var(--on-navy); font: 600 14px var(--font); cursor: pointer; }

/* iOS Safari 的日期时间框自带最小宽度，会撑出卡片 */
input[type=datetime-local] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; }
input[type=datetime-local]::-webkit-date-and-time-value { text-align: left; }
