/* ============================================================
   卡密登记系统（权益激活）— 用户端样式
   视觉：简约高级，深蓝主色 + 金色点缀，移动端优先
   ============================================================ */

:root {
  --ink: #161d2e;
  --ink2: #45506a;
  --muted: #8a92a6;
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e5e8f0;
  --brand: #1d3a6e;
  --brand-2: #2c56a8;
  --gold: #c9a15c;
  --gold-bg: #faf4e8;
  --ok: #178f63;
  --ok-bg: #e8f6ef;
  --err: #d64545;
  --err-bg: #fdeeee;
  --warn: #c77800;
  --warn-bg: #fdf3e3;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(22, 29, 46, .07);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { min-height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--brand-2); text-decoration: none; }
img { display: block; }

/* ============ 通用组件 ============ */

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 16px 16px 96px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin-bottom: 14px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}

.card-title svg { flex: none; }

.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.field { margin-bottom: 14px; }

.field-label {
  display: block;
  font-size: 13px;
  color: var(--ink2);
  margin-bottom: 6px;
  font-weight: 500;
}

.field-label .req { color: var(--err); margin-left: 2px; }

.input, .select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}

.input:focus, .select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(44, 86, 168, .12);
  background: #fff;
}

.input[readonly] { background: #f2f4f8; color: var(--ink2); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  transition: opacity .15s, transform .05s;
  user-select: none;
}

.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-gold { background: linear-gradient(135deg, #d8b878, #b98f45); }
.btn-ghost {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 8px; }

.tip { font-size: 12px; color: var(--muted); margin-top: 6px; }

.alert {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.alert.show { display: block; }
.alert-err { background: var(--err-bg); color: var(--err); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }

/* ============ 登录页 ============ */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background:
    radial-gradient(600px 300px at 50% -80px, rgba(44, 86, 168, .14), transparent),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 36px 28px 30px;
}

.brand { text-align: center; margin-bottom: 26px; }

.brand img { width: 64px; height: 64px; margin: 0 auto 12px; }

.brand h1 { font-size: 22px; letter-spacing: 6px; margin-left: 6px; }

.brand p { font-size: 12px; color: var(--muted); letter-spacing: 2px; margin-top: 4px; }

.auth-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted); }

.wx-btn {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #d7e8d2;
  background: #f0f8ee;
  color: #3c7a2e;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 12px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0 4px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ============ 顶部导航（登记页/个人中心） ============ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 620px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-inner img { width: 34px; height: 34px; }

.topbar-title { font-size: 16px; font-weight: 600; letter-spacing: 2px; }

.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink2);
}

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ============ 套餐展示卡 ============ */

.pkg-card {
  display: none;
  background: linear-gradient(135deg, #1d3a6e, #101d38);
  border-radius: var(--radius);
  color: #fff;
  padding: 18px;
  margin-top: 14px;
  position: relative;
  overflow: hidden;
}
.pkg-card.show { display: block; }

.pkg-card::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 161, 92, .35), transparent 70%);
}

.pkg-name { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }

.pkg-quota {
  font-size: 28px;
  font-weight: 700;
  color: #e8c98a;
  margin: 8px 0 2px;
}
.pkg-quota small { font-size: 13px; font-weight: 400; margin-left: 4px; }

.pkg-remark { font-size: 12px; color: rgba(255, 255, 255, .65); }

/* ============ 视频拍摄 ============ */

.video-box {
  border: 1.5px dashed #cdd4e2;
  border-radius: 12px;
  background: #fbfcfe;
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s;
}
.video-box:active { border-color: var(--brand-2); }
.video-box.has-video { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }

.video-box svg { margin: 0 auto 8px; }
.video-box p { font-size: 13px; color: var(--ink2); }
.video-box .tip { margin-top: 2px; }

.video-preview {
  display: none;
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.video-preview video { width: 100%; max-height: 300px; display: block; }

/* ============ 结果页 ============ */

.result-icon {
  width: 72px; height: 72px;
  margin: 26px auto 16px;
  border-radius: 50%;
  background: var(--ok-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-title { text-align: center; font-size: 19px; font-weight: 600; }
.result-desc { text-align: center; font-size: 13px; color: var(--muted); margin: 8px 0 20px; }

/* ============ 个人中心 ============ */

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 2px 16px;
}

.avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.profile-name { font-size: 17px; font-weight: 600; }
.profile-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.row-item:last-child { border-bottom: none; }
.row-item .val { color: var(--muted); font-size: 13px; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-gray { background: #eef0f5; color: var(--muted); }

/* ============ 弹窗（改密码等） ============ */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 21, 34, .5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.modal-mask.show { display: flex; }

.modal {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .22s ease;
}

@keyframes slideUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close { border: none; background: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }

/* PC 端微调 */
@media (min-width: 768px) {
  .modal-mask { align-items: center; }
  .modal { border-radius: 18px; max-width: 460px; }
}

/* ============ 加载态 ============ */

.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
