/* ========== 会员认证 · 共用样式（移动优先） ========== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

:root {
  --blue-900: #0E2A52;
  --blue-800: #1259C4;
  --blue-600: #1E6FE0;
  --blue-500: #2F86F0;
  --blue-300: #5DB8FF;
  --blue-100: #EEF5FF;
  --ink: #1A2B45;
  --ink-2: #2C3E5C;
  --body: #4A5B76;
  --muted: #6B7A93;
  --hint: #8FA0B8;
  --line: #DCE7F5;
  --field: #F5F8FD;
  --bg: #F2F6FC;
  --danger: #E0453A;
  --ok: #16A34A;
  --pad: 20px;
  --radius: 16px;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: #E9EEF6;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  padding-bottom: 150px; /* 给固定底部按钮让位 */
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

@media (min-width: 560px) {
  body { background: #DFE6F0; }
  .app { box-shadow: 0 18px 60px rgba(10, 31, 61, .18); }
}

.hidden { display: none !important; }

/* ---------- 头部 ---------- */
.header {
  flex: none;
  position: relative;
  padding: 14px var(--pad) 88px;
  color: #fff;
  background: linear-gradient(160deg, #1259C4 0%, #1E6FE0 55%, #2F86F0 100%);
  border-radius: 0 0 22px 22px;
}
.header.is-short { padding-bottom: 14px; }
.header.is-tall { padding-bottom: 78px; }

.nav { display: flex; align-items: center; height: 32px; }
.nav-back {
  width: 32px; height: 32px; flex: none;
  padding: 0; border: 0; border-radius: 9px;
  background: rgba(255, 255, 255, .14);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.nav-back:active { background: rgba(255, 255, 255, .24); }
.nav-title {
  flex: 1; text-align: center;
  font-size: 16px; font-weight: 600; letter-spacing: 1px;
}
.nav-spacer { width: 32px; flex: none; }

.brand { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.brand-badge {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 11px; opacity: .82; margin-top: 3px; letter-spacing: .5px; }

/* ---------- 步骤条 ---------- */
.steps { display: flex; align-items: center; gap: 6px; margin-top: 16px; }
.step { display: flex; align-items: center; gap: 6px; }
.step-dot {
  width: 18px; height: 18px; flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600;
}
.step.active .step-dot { background: #fff; color: var(--blue-800); }
.step.done .step-dot { background: rgba(255, 255, 255, .92); color: var(--blue-800); }
.step-label { font-size: 11px; }
.step.active .step-label, .step.done .step-label { font-weight: 600; }
.step-line { width: 20px; height: 2px; flex: none; background: rgba(255, 255, 255, .35); }

/* ---------- 头部提示块（第 2 页） ---------- */
.tip { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.tip-icon {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  display: flex; align-items: center; justify-content: center;
}
.tip-t1 { font-size: 15px; font-weight: 700; }
.tip-t2 { font-size: 10.5px; opacity: .85; margin-top: 2px; }

/* ---------- 表单卡片 ---------- */
.card {
  position: relative;
  z-index: 2;
  margin: -72px var(--pad) 0;
  padding: 18px 16px 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(18, 89, 196, .10);
}
.card-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.card-desc { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

.field { margin-top: 16px; }
.field-label {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.req { color: var(--danger); font-size: 13px; }

.input {
  width: 100%; height: 46px;
  padding: 0 14px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-family: inherit; font-size: 15px; color: var(--ink);
  outline: none; appearance: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.input::placeholder { color: #A8B6CC; font-size: 13px; }
.input:focus {
  background: #fff;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(30, 111, 224, .10);
}
.input[readonly] { color: var(--body); }

.field.invalid .input { background: #FFF7F6; border-color: var(--danger); }
.field-hint { font-size: 10.5px; color: var(--hint); margin-top: 6px; }
.field-error { display: none; font-size: 11px; color: var(--danger); margin-top: 6px; }
.field.invalid .field-error { display: block; }
.field.invalid .field-hint { display: none; }

.two { display: flex; gap: 10px; }
.two > .field { flex: 1; min-width: 0; }

/* 性别分段控件 */
.segmented {
  display: flex; align-items: center;
  height: 46px; padding: 3px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.segmented button {
  flex: 1; height: 100%;
  border: 0; border-radius: 9px;
  background: transparent;
  font-family: inherit; font-size: 14px; color: var(--body);
  cursor: pointer; transition: .15s;
}
.segmented button.is-active {
  background: #fff; color: var(--blue-800); font-weight: 600;
  box-shadow: 0 1px 4px rgba(18, 89, 196, .16);
}

/* 协议 */
.agree { display: flex; align-items: flex-start; gap: 9px; margin-top: 20px; }
.agree input { position: absolute; opacity: 0; pointer-events: none; }
.agree-box {
  width: 19px; height: 19px; flex: none; margin-top: 2px;
  border: 1.5px solid #B9C9DE; border-radius: 6px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: .15s;
}
.agree-box svg { opacity: 0; transform: scale(.6); transition: .15s; }
.agree input:checked + .agree-box { background: var(--blue-600); border-color: var(--blue-600); }
.agree input:checked + .agree-box svg { opacity: 1; transform: scale(1); }
.agree.invalid .agree-box { border-color: var(--danger); }
.agree-text { font-size: 11.5px; color: var(--body); line-height: 1.65; }
.agree-text a { color: var(--blue-600); text-decoration: none; }

/* ---------- 底部按钮 ---------- */
.footer {
  position: fixed;
  left: 0; right: 0; bottom: 0; z-index: 6;
  width: 100%; max-width: 430px; margin: 0 auto;
  padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(242, 246, 252, 0) 0%, #F2F6FC 30%);
}
.btn {
  width: 100%; height: 52px;
  border: 0; border-radius: 14px;
  font-family: inherit; font-size: 16px; font-weight: 700; letter-spacing: 2px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  transition: transform .08s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #1259C4 0%, #2F86F0 100%);
  box-shadow: 0 10px 20px rgba(18, 89, 196, .26);
}
.btn-primary:disabled { opacity: .55; box-shadow: none; }
.btn-light {
  color: #fff;
  background: linear-gradient(135deg, #2F86F0 0%, #5DB8FF 100%);
  box-shadow: 0 10px 20px rgba(47, 134, 240, .30);
}
.btn-ghost {
  height: 46px; margin-top: 10px;
  font-size: 15px; font-weight: 500; letter-spacing: 1px;
  color: var(--body);
  background: #fff;
  border: 1.5px solid #C9D8EC;
}
.btn-link {
  display: block; width: 100%; margin-top: 12px;
  border: 0; background: transparent; padding: 4px;
  font-family: inherit; font-size: 11.5px; color: var(--muted);
  cursor: pointer;
}
.btn-link span { color: var(--blue-600); }

/* 深色背景上的次要按钮 */
.btn-ghost--dark {
  color: #fff;
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .22);
}

/* ---------- 第 2 页：会员卡 ---------- */
.member-card {
  position: relative; z-index: 2;
  margin: -56px var(--pad) 0;
  padding: 16px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, #0E4AA8 0%, #1E6FE0 60%, #3D93F5 100%);
  box-shadow: 0 10px 24px rgba(18, 89, 196, .22);
  overflow: hidden;
}
.member-card::after {
  content: ""; position: absolute; right: -34px; top: -34px;
  width: 118px; height: 118px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.mc-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; }
.mc-org { font-size: 10.5px; opacity: .85; letter-spacing: .5px; }
.mc-level {
  font-size: 10px; padding: 4px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
}
.mc-no {
  position: relative; z-index: 1;
  margin-top: 16px;
  font-size: 17px; font-weight: 700; letter-spacing: 1.5px;
}
.mc-bottom { position: relative; z-index: 1; display: flex; justify-content: space-between; margin-top: 14px; }
.mc-field .k { font-size: 9.5px; opacity: .75; }
.mc-field .v { font-size: 12px; font-weight: 600; margin-top: 3px; }

/* 资料明细 */
.list-card {
  margin: 14px var(--pad) 0;
  padding: 2px 16px 6px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(18, 89, 196, .10);
}
.list-title { font-size: 15px; font-weight: 700; padding: 14px 0 2px; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid #EDF2F9;
}
.row:last-child { border-bottom: 0; }
.row-key { font-size: 12.5px; color: var(--muted); flex: none; }
.row-val { font-size: 13.5px; font-weight: 600; color: var(--ink); text-align: right; }
.row-edit {
  margin-left: 8px; font-size: 11.5px; font-weight: 500;
  color: var(--blue-600); text-decoration: none;
}

/* 提示条 */
.notice {
  margin: 14px var(--pad) 0;
  padding: 12px 13px;
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--blue-100);
  border: 1px solid #D6E7FB;
  border-radius: 12px;
}
.notice p { margin: 0; font-size: 11.5px; color: #35507A; line-height: 1.7; }
.notice b { color: var(--blue-800); }
.notice-icon { flex: none; margin-top: 2px; }

/* ---------- 第 3 页：扫脸认证 ---------- */
.app--face {
  color: #fff;
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(47, 134, 240, .55), rgba(14, 42, 82, 0) 60%),
    linear-gradient(180deg, #12396E 0%, #0E2A52 45%, #0A1F3D 100%);
}
.app--face .header { background: transparent; padding-bottom: 0; }
.app--face .footer {
  background: linear-gradient(180deg, rgba(10, 31, 61, 0) 0%, rgba(10, 31, 61, .55) 30%, rgba(10, 31, 61, .9) 100%);
}

.face-head { text-align: center; padding: 0 24px; }
.face-head h1 { margin: 6px 0 0; font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.face-head p { margin: 6px 0 0; font-size: 11.5px; line-height: 1.6; opacity: .8; }

.stage {
  position: relative;
  width: 250px; height: 250px;
  margin: 22px auto 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
}
.stage video, .stage img, .stage canvas {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}
.stage video { transform: scaleX(-1); } /* 前置摄像头镜像预览 */

.corner {
  position: absolute; z-index: 3;
  width: 36px; height: 36px;
  pointer-events: none;
}
.corner svg { width: 100%; height: 100%; display: block; }
.c1 { top: 12px; left: 12px; }
.c2 { top: 12px; right: 12px; transform: scaleX(-1); }
.c3 { bottom: 12px; left: 12px; transform: scaleY(-1); }
.c4 { bottom: 12px; right: 12px; transform: scale(-1, -1); }

.scan {
  position: absolute; z-index: 2; left: 50%;
  width: 150px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #7FC2FF, transparent);
  box-shadow: 0 0 12px rgba(127, 194, 255, .85);
  transform: translateX(-50%);
  animation: scanMove 2.4s ease-in-out infinite;
}
@keyframes scanMove {
  0%, 100% { top: 32px; opacity: .45; }
  50% { top: 208px; opacity: 1; }
}

/* 待机人脸轮廓 */
.face-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.face-oval {
  position: relative;
  width: 104px; height: 134px;
  border: 2px dashed rgba(255, 255, 255, .35);
  border-radius: 50% / 46%;
}
.face-oval .eye {
  position: absolute; top: 54px;
  width: 13px; height: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .4);
}
.face-oval .eye.l { left: 26px; }
.face-oval .eye.r { right: 26px; }
.face-oval .mouth {
  position: absolute; bottom: 33px; left: 50%;
  width: 27px; height: 5px;
  transform: translateX(-50%);
  border-bottom: 2px solid rgba(255, 255, 255, .4);
  border-radius: 0 0 50% 50%;
}

.countdown {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; font-weight: 700;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .55);
}

.status {
  width: fit-content;
  margin: 20px auto 0;
  padding: 10px 18px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
}
.pulse {
  width: 8px; height: 8px; flex: none;
  border-radius: 50%;
  background: var(--blue-300);
  box-shadow: 0 0 0 0 rgba(93, 184, 255, .6);
  animation: pulse 1.6s infinite;
}
.pulse.is-idle { background: rgba(255, 255, 255, .45); animation: none; box-shadow: none; }
.pulse.is-ok { background: #6BE39B; animation: none; box-shadow: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(93, 184, 255, .6); }
  70% { box-shadow: 0 0 0 12px rgba(93, 184, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(93, 184, 255, 0); }
}
.status-text { font-size: 12.5px; }
.status-sub { font-size: 10.5px; opacity: .7; margin-top: 2px; }

.tips { display: flex; justify-content: space-between; gap: 8px; margin: 22px 26px 0; }
.tip-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.tip-circle {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  display: flex; align-items: center; justify-content: center;
}
.tip-label { font-size: 11px; text-align: center; line-height: 1.5; opacity: .9; }

.privacy {
  margin: 18px 26px 0;
  font-size: 10.5px;
  line-height: 1.7;
  text-align: center;
  opacity: .55;
}

/* 遮罩层：加载 / 错误 / 成功 */
.overlay {
  position: absolute; inset: 0; z-index: 30;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(10, 31, 61, .97);
  overflow-y: auto;
}
.overlay.show { display: flex; }

.spinner {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .18);
  border-top-color: var(--blue-300);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { margin-top: 22px; font-size: 16px; font-weight: 600; }
.loading-sub { margin-top: 8px; font-size: 11.5px; opacity: .7; }

.err-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(224, 69, 58, .18);
  border: 1px solid rgba(224, 69, 58, .4);
  display: flex; align-items: center; justify-content: center;
}
.err-title { margin-top: 18px; font-size: 16px; font-weight: 700; }
.err-desc { margin-top: 10px; font-size: 12px; line-height: 1.7; opacity: .8; max-width: 260px; }

.success-ring {
  width: 90px; height: 90px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E6FE0, #5DB8FF);
  box-shadow: 0 16px 40px rgba(47, 134, 240, .4);
  display: flex; align-items: center; justify-content: center;
}
.success-ring svg { width: 44px; height: 44px; }
.success-title { margin-top: 20px; font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.success-desc { margin-top: 8px; font-size: 11.5px; line-height: 1.7; opacity: .8; }
.success-card {
  width: 100%; max-width: 300px;
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
}
.sc-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 12px; }
.sc-row .k { opacity: .7; flex: none; }
.sc-row .v { font-weight: 600; text-align: right; word-break: break-all; }
.sc-row .v.ok { color: #6BE39B; }
.overlay .btn { max-width: 300px; margin-top: 22px; }

/* ---------- 登录页 ---------- */
.app--login { padding-bottom: 182px; }
.header--login { padding-bottom: 96px; }

.login-hero { margin-top: 16px; }
.login-hero .brand-badge {
  width: 46px; height: 46px; border-radius: 13px;
}
.login-title { font-size: 23px; font-weight: 700; letter-spacing: 1.5px; margin-top: 14px; }
.login-sub { font-size: 12px; opacity: .85; margin-top: 7px; letter-spacing: .4px; }

.login-badges { display: flex; gap: 8px; margin-top: 14px; }
.login-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  font-size: 10.5px;
}
.login-badge i {
  width: 5px; height: 5px; border-radius: 50%;
  background: #9FE0FF; display: block;
}

.card--login { margin-top: -74px; }

.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; min-width: 0; }
.code-btn {
  flex: none; width: 110px; height: 46px;
  border: 1px solid var(--blue-600); border-radius: 11px;
  background: #fff; color: var(--blue-800);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: .15s;
}
.code-btn:active { background: var(--blue-100); }
.code-btn:disabled {
  color: var(--hint); border-color: var(--line); background: var(--field); cursor: default;
}

.login-msg {
  display: none;
  margin-top: 10px;
  font-size: 11px; line-height: 1.6;
  color: var(--blue-800);
}
.login-msg.show { display: block; }

.login-foot {
  margin: 18px var(--pad) 0;
  text-align: center;
  font-size: 11.5px; line-height: 1.8;
  color: var(--hint);
}
.login-agree {
  margin-top: 9px;
  font-size: 10.5px; line-height: 1.6; text-align: center;
  color: var(--muted);
}
.login-agree a { color: var(--blue-600); text-decoration: none; }
