:root {
  --brand: #2f6bff;
  --brand-dark: #1e50d8;
  --brand-soft: #eef3ff;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #98a2b3;
  --line: #e4e7ec;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ok: #0f9d58;
  --ok-soft: #e9f7ef;
  --warn: #d97706;
  --warn-soft: #fef4e6;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 28px -12px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 64px; }
.wrap-wide { max-width: 1180px; }

/* ---------- 顶部 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #6f9bff);
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.brand-block { min-width: 0; }
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--ink-3); }
.topbar .spacer { flex: 1; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}
.card-tight { padding: 16px; }
.card-title { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.card-desc { font-size: 13px; color: var(--ink-2); margin: 0 0 18px; }

/* ---------- 步骤条 ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.step-pill {
  flex: 1; text-align: center; font-size: 12px; color: var(--ink-3);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 4px; transition: .2s;
}
.step-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.step-pill.done { background: var(--brand-soft); border-color: #cfdcff; color: var(--brand-dark); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field > label {
  display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink);
}
.field .hint { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.req { color: var(--danger); }

input[type="text"], input[type="tel"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; padding: 12px 13px; font-size: 15px; font-family: inherit;
  color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 11px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .13);
}
input:disabled, input[readonly] { background: #f8fafc; color: var(--ink-2); }
textarea { resize: vertical; min-height: 76px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; gap: 0; } }

/* ---------- 俱乐部下拉框 ---------- */
.club-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 42px !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5 7 7.5l6-6' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}
.club-select::-ms-expand { display: none; }

/* ---------- 联系电话回显（俱乐部负责人，低亮不可编辑） ---------- */
.phone-locked,
.phone-locked:focus {
  background: #f2f4f7 !important;
  color: var(--ink-3) !important;
  border-color: #eaecf0 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  letter-spacing: .3px;
  user-select: all;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 13px 18px; font-size: 15.5px; font-weight: 600;
  font-family: inherit; border-radius: 12px; border: 1.5px solid transparent;
  cursor: pointer; transition: .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c6d4ff; background: #fafbff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(.94); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f7cdc8; }
.btn-danger:hover { background: #fbdbd7; }
.btn-sm { width: auto; padding: 7px 13px; font-size: 13px; border-radius: 9px; font-weight: 600; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.link-btn {
  background: none; border: none; padding: 0; font: inherit; font-size: 13.5px;
  color: var(--ink-2); cursor: pointer; text-decoration: underline;
}

/* ---------- 提示条 ---------- */
.alert {
  border-radius: 11px; padding: 12px 14px; font-size: 13.5px;
  display: flex; gap: 9px; align-items: flex-start; margin-bottom: 16px;
}
.alert-warn { background: var(--warn-soft); color: #92400e; border: 1px solid #fadfb2; }
.alert-info { background: var(--brand-soft); color: #1b3fa8; border: 1px solid #cfdcff; }
.alert-err { background: var(--danger-soft); color: #912018; border: 1px solid #f7cdc8; }
.alert-ok { background: var(--ok-soft); color: #0b6b3d; border: 1px solid #bfe6d2; }
.hidden { display: none !important; }

/* ---------- 收款 ---------- */
.pay-amount { text-align: center; margin: 4px 0 18px; }
.pay-amount .pa-num { font-size: 34px; font-weight: 800; color: var(--brand-dark); letter-spacing: -.5px; }
.pay-amount .pa-num small { font-size: 17px; font-weight: 600; }
.pay-amount .pa-note { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.qr-frame {
  width: 230px; height: 230px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.qr-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr-empty {
  width: 230px; height: 230px; margin: 0 auto; border: 1.5px dashed var(--line);
  border-radius: 14px; display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center; color: var(--ink-3); font-size: 13px; text-align: center; padding: 18px;
}

/* ---------- 报名二维码预览 ---------- */
.poster-frame {
  width: 100%; max-width: 300px; margin: 0 auto; aspect-ratio: 16 / 21;
  border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.poster-frame img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 8px; }
.poster-frame.is-empty { color: var(--ink-3); font-size: 13px; aspect-ratio: auto; min-height: 160px; }
.dl-list { display: flex; flex-direction: column; gap: 10px; }
.dl-list .btn { width: 100%; }
.dl-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 560px) {
  .poster-frame { max-width: 230px; }
}

/* ---------- 成功 / 身份码 ---------- */
.done-hero { text-align: center; padding: 10px 0 4px; }
.done-ico {
  width: 66px; height: 66px; border-radius: 50%; background: var(--ok-soft); color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  font-size: 33px; margin: 0 auto 14px; border: 2px solid #bfe6d2;
}
.done-hero h2 { margin: 0 0 6px; font-size: 22px; }
.done-hero p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

.id-card-wrap {
  margin: 20px auto 14px; text-align: center;
}
.id-card-wrap canvas {
  max-width: 100%; height: auto; border-radius: 14px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.save-tip {
  background: var(--warn-soft); border: 1px solid #fadfb2; color: #92400e;
  border-radius: 11px; padding: 13px 15px; font-size: 13.5px; font-weight: 600;
  text-align: center; line-height: 1.55;
}

/* ---------- 信息摘要 ---------- */
.kv { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; font-size: 14px; }
.kv-row + .kv-row { border-top: 1px solid var(--line); }
.kv-row .k { color: var(--ink-2); flex: 0 0 auto; }
.kv-row .v { font-weight: 600; text-align: right; word-break: break-all; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: #0b6b3d; }
.badge-warn { background: var(--warn-soft); color: #92400e; }
.badge-mute { background: #f2f4f7; color: var(--ink-2); }

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 860px; }
table.data th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2);
  padding: 10px 12px; background: #f9fafb; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid #f2f4f7; vertical-align: middle; }
table.data tr:hover td { background: #fcfdff; }
table.data td.actions { white-space: nowrap; }
.code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; background: #f2f4f7; padding: 3px 7px; border-radius: 6px; color: var(--ink);
}
.empty-state { text-align: center; padding: 44px 16px; color: var(--ink-3); font-size: 14px; }

/* ---------- 统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.stat .s-num { font-size: 25px; font-weight: 800; letter-spacing: -.5px; }
.stat .s-label { font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.tab {
  flex: 1; text-align: center; padding: 9px 8px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; border: none;
  background: none; font-family: inherit; transition: .15s;
}
.tab.active { background: var(--brand); color: #fff; }

/* ---------- 模态 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .55);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100;
}
.modal {
  background: #fff; border-radius: 18px; padding: 22px; width: 100%; max-width: 400px;
  max-height: 90vh; overflow-y: auto; text-align: center;
}
.modal h3 { margin: 0 0 4px; font-size: 17px; }
.modal .m-sub { color: var(--ink-2); font-size: 13px; margin-bottom: 14px; }
.modal canvas { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- 工具 ---------- */
.grid-form { display: grid; gap: 14px; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; }
.spin {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
.spin-dark { border-color: rgba(16,24,40,.2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { text-align: center; padding: 50px 16px; color: var(--ink-3); font-size: 14px; }
.foot-note { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 22px; }

/* ---- 报名号展示块 ---- */
.order-box {
  border: 1px dashed #9ec4f5;
  background: #f2f8ff;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  margin-bottom: 18px;
}
.ob-label { font-size: 12px; color: #4b6b93; letter-spacing: .5px; }
.ob-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #1d4f91;
  margin: 4px 0 6px;
  word-break: break-all;
}
.ob-tip { font-size: 12px; color: #6b7f96; line-height: 1.6; }
