/*
 * 通行证 v2 公共样式（单套响应式模板）
 * 主题色由 header_public.html 注入：--brand / --brand-soft
 * 断点：<768px 为手机布局
 */
:root {
  --brand: #2F5BEA;
  --brand-soft: rgba(47, 91, 234, .1);
  --ink: #1B2230;
  --ink-2: #5A6372;
  --ink-3: #98A0AB;
  --line: #E2E6EC;
  --bg: #F1F3F6;
  --surface: #FFFFFF;
  --danger: #D6453D;
  --danger-soft: #FDECEA;
  --ok: #1E9E5A;
  --ok-soft: #E5F5EC;
  --warn: #9A5B00;
  --warn-soft: #FFF3DE;
  --radius: 10px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.pp {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 var(--font);
}
.pp a { color: inherit; text-decoration: none; }
.pp button, .pp input { font: inherit; color: inherit; }
.pp [hidden] { display: none !important; }
.pp :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- 顶栏 ---------- */
.pp-top {
  height: 60px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.pp-logo { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.pp-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--brand); color: #fff;
  font-size: 15px; font-weight: 700;
}
.pp-top-link { color: var(--ink-2); font-size: 13px; }
.pp-top-link:hover { color: var(--brand); }
.pp-back, .pp-top-title { display: none; }

/* ---------- 主体与票根卡片 ---------- */
.pp-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 20px;
}
.pp-pass {
  width: 100%;
  max-width: 780px;
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(27, 34, 48, .05), 0 18px 40px -18px rgba(27, 34, 48, .22);
  overflow: hidden;
}
.pp-stub {
  width: 250px;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 36px 30px;
  background: var(--brand);
  color: #fff;
}
.pp-stub-mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  font-size: 21px; font-weight: 700;
}
.pp-stub-name { margin-top: 30px; font-size: 30px; font-weight: 700; line-height: 1.25; letter-spacing: .04em; }
.pp-stub-name span { display: block; }
.pp-stub-slogan { margin: 12px 0 0; font-size: 13px; opacity: .85; }
.pp-stub-foot {
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, .35);
  font-size: 12px; line-height: 1.8; opacity: .75;
}
.pp-perf { position: relative; width: 0; flex: none; border-left: 2px dashed var(--line); }
.pp-perf::before, .pp-perf::after {
  content: "";
  position: absolute; left: -12px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg);
}
.pp-perf::before { top: -11px; }
.pp-perf::after { bottom: -11px; }
.pp-panel { flex: 1; min-width: 0; min-height: 470px; padding: 40px 52px; }
.pp-title { margin: 0 0 20px; font-size: 22px; font-weight: 700; line-height: 1.35; }
.pp-foot { padding: 0 20px 22px; text-align: center; color: var(--ink-3); font-size: 12px; }
.pp-foot a { margin-left: 14px; }
.pp-foot a:hover { color: var(--ink-2); }

/* ---------- 表单 ---------- */
.pp-field {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.pp-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pp-field.is-error { border-color: var(--danger); }
.pp-input {
  flex: 1; min-width: 0; height: 100%;
  padding: 0; border: 0; outline: 0;
  background: transparent;
  font-size: 15px;
}
.pp-input:focus-visible { outline: none; }
.pp-input::placeholder { color: var(--ink-3); }
.pp-prefix { padding-right: 10px; border-right: 1px solid var(--line); white-space: nowrap; }
.pp-aux {
  flex: none;
  padding: 0; border: 0; background: none;
  color: var(--brand); font-size: 13px; white-space: nowrap;
  cursor: pointer;
}
.pp-aux:disabled { color: var(--ink-3); cursor: default; }
.pp-aux.is-muted { color: var(--ink-3); }
.pp-error { margin: -4px 0 12px; color: var(--danger); font-size: 13px; }
.pp-hint { margin: -6px 0 14px; color: var(--ink-3); font-size: 12px; }
.pp-muted { color: var(--ink-3); font-size: 13px; }

.pp-btn {
  width: 100%; height: 46px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 6px; padding: 0 20px;
  border: 0; border-radius: var(--radius);
  background: var(--brand); color: #fff;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  transition: filter .15s;
}
.pp .pp-btn { color: #fff; }
.pp-btn:hover { filter: brightness(1.06); }
.pp-btn:disabled { opacity: .6; cursor: default; filter: none; }
.pp .pp-btn.is-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

.pp-links {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px;
  color: var(--ink-2); font-size: 13px;
}
.pp-links a:hover { color: var(--brand); }
.pp .pp-links .is-brand { color: var(--brand); }

.pp-agree {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 22px;
  color: var(--ink-3); font-size: 12px;
  cursor: pointer;
}
.pp-agree input { width: 14px; height: 14px; flex: none; margin: 3px 0 0; accent-color: var(--brand); }
.pp-agree a { color: var(--ink-2); }
.pp-agree a:hover { color: var(--brand); }

/* ---------- 步骤条（注册、找回密码） ---------- */
.pp-steps { display: flex; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.pp-steps li { flex: 1; display: flex; flex-direction: column; gap: 7px; color: var(--ink-3); font-size: 12px; }
.pp-steps li::before { content: ""; height: 3px; border-radius: 3px; background: var(--line); }
.pp-steps .is-done::before, .pp-steps .is-current::before { background: var(--brand); }
.pp-steps .is-current { color: var(--ink); font-weight: 500; }

/* ---------- 规则提示 ---------- */
.pp-rules { display: grid; gap: 2px; margin: -6px 0 16px; padding: 0; list-style: none; color: var(--ink-3); font-size: 12px; }
.pp-rules li::before { content: "○ "; }
.pp-rules .is-ok { color: var(--ok); }
.pp-rules .is-ok::before { content: "✓ "; }
.pp-rules .is-bad { color: var(--danger); }
.pp-rules .is-bad::before { content: "✕ "; }

/* ---------- 验证码格子 ---------- */
.pp-sent { margin: 0 0 14px; color: var(--ink-2); font-size: 13px; }
.pp-sent b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.pp-code { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 4px 0 12px; }
.pp-code span {
  height: 52px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.pp-code span.is-current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pp-code input {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  border: 0; opacity: 0;
  font-size: 16px;
}

/* ---------- 单选卡片 ---------- */
.pp-opt {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
}
.pp-opt input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--brand); }
.pp-opt.is-checked { border-color: var(--brand); background: var(--brand-soft); }
.pp-opt small { display: block; color: var(--ink-3); font-size: 12px; line-height: 1.4; }

/* ---------- 结果页 ---------- */
.pp-result { text-align: center; padding-top: 64px; }
.pp-result-icon {
  width: 60px; height: 60px;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
}
.pp-result-icon.is-error { background: var(--danger-soft); color: var(--danger); }
.pp-result-icon svg { width: 28px; height: 28px; }
.pp-result .pp-title { margin-bottom: 6px; }
.pp-result .pp-btn { margin-top: 24px; }

/* ---------- 标签 ---------- */
.pp-tag { display: inline-block; padding: 0 9px; border-radius: 20px; background: var(--warn-soft); color: var(--warn); font-size: 12px; line-height: 1.8; font-weight: 400; }
.pp-tag.is-ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- 个人中心 ---------- */
.pp-center { flex: 1; width: 100%; max-width: 760px; margin: 30px auto; padding: 0 20px; display: grid; gap: 16px; align-content: start; }
.pp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pp-profile { display: flex; align-items: center; gap: 20px; padding: 26px 28px; }
.pp-avatar { position: relative; width: 72px; height: 72px; flex: none; border-radius: 50%; background: var(--brand-soft); }
.pp-avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pp-avatar-edit {
  position: absolute; right: -2px; bottom: -2px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--ink-2);
  cursor: pointer;
}
.pp-avatar-edit svg { width: 13px; height: 13px; }
.pp-profile-name { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.pp-uid { margin: 2px 0 6px; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.pp-text-btn { padding: 0; border: 0; background: none; color: var(--brand); font-size: 13px; font-weight: 400; cursor: pointer; }
.pp-section-title { margin: 0; padding: 18px 28px 12px; font-size: 15px; font-weight: 500; }
.pp-row { display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 16px; padding: 16px 28px; border-top: 1px solid var(--line); }
.pp-row-key { color: var(--ink-2); }
.pp-row-value small { display: block; color: var(--ink-3); font-size: 12px; }
.pp-row-chevron { display: none; }
.pp-btn-sm {
  height: 32px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface);
  font-size: 13px; white-space: nowrap;
  cursor: pointer;
}
.pp .pp-btn-sm.is-primary { border-color: var(--brand); background: var(--brand); color: #fff; }

/* ---------- 弹窗 ---------- */
.pp-dialog {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(20, 26, 36, .45);
}
.pp-dialog-box {
  width: 100%; max-width: 420px;
  max-height: calc(100vh - 40px); overflow: auto;
  padding: 24px 28px 26px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .3);
}
.pp-dialog.is-alert .pp-dialog-box { max-width: 360px; }
.pp-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pp-dialog-title { margin: 0; font-size: 18px; font-weight: 700; }
.pp-dialog-close { padding: 0; border: 0; background: none; color: var(--ink-3); font-size: 24px; line-height: 1; cursor: pointer; }
.pp-dialog-text { margin: 0 0 8px; color: var(--ink-2); }
.pp-dialog-text a { color: var(--brand); }
.pp-dialog-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.pp-dialog-foot .pp-btn { width: auto; height: 40px; margin: 0; font-size: 14px; }
body.pp-lock { overflow: hidden; }

/* ---------- 轻提示 ---------- */
.pp-toast {
  position: fixed; left: 50%; top: 20%; z-index: 200;
  max-width: 80%;
  padding: 10px 18px;
  transform: translateX(-50%);
  border-radius: 8px;
  background: rgba(27, 34, 48, .88); color: #fff;
  font-size: 14px; text-align: center;
}

/* ---------- 弹窗登录（iframe 内页面） ---------- */
body.pp-widget { min-height: 0; background: var(--surface); }
.pp-widget .pp-panel { min-height: 0; padding: 24px 28px; }

/* ================= 手机 ================= */
@media (max-width: 767px) {
  body.pp { background: var(--surface); }
  body.pp.pp-gray { background: var(--bg); }

  .pp-top { height: 48px; display: grid; grid-template-columns: 44px 1fr 44px; padding: 0 4px; border-bottom: 0; background: transparent; }
  .pp-logo, .pp-top-link { display: none; }
  .pp-back { display: grid; place-items: center; width: 44px; height: 44px; color: var(--ink); }
  .pp-back svg { width: 22px; height: 22px; }
  .pp-top-title { display: block; text-align: center; font-size: 16px; font-weight: 500; }

  .pp-main { align-items: flex-start; padding: 4px 22px 28px; }
  .pp-pass { display: block; max-width: none; background: transparent; border-radius: 0; box-shadow: none; overflow: visible; }

  /* 票根变成顶部小票 */
  .pp-stub { position: relative; width: auto; flex-direction: row; align-items: center; gap: 14px; margin-bottom: 26px; padding: 16px 20px; border-radius: 14px; }
  .pp-stub::before, .pp-stub::after { content: ""; position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--surface); }
  .pp-stub::before { left: -8px; }
  .pp-stub::after { right: -8px; }
  .pp-stub-mark { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; }
  .pp-stub-name { margin: 0; font-size: 17px; letter-spacing: 0; }
  .pp-stub-name span { display: inline; }
  .pp-stub-slogan { margin: 0; font-size: 12px; }
  .pp-stub-foot, .pp-perf, .pp-foot { display: none; }

  .pp-panel { min-height: 0; padding: 0; }
  .pp-title { font-size: 24px; }
  .pp-field, .pp-btn { height: 48px; }
  .pp-input { font-size: 16px; } /* 防止 iOS 聚焦时页面放大 */
  .pp-result { padding-top: 48px; }

  /* 个人中心：列表样式 */
  .pp-center { margin: 0; padding: 6px 14px 28px; gap: 12px; }
  .pp-card { border: 0; border-radius: 12px; }
  .pp-profile { gap: 14px; padding: 16px; }
  .pp-avatar { width: 58px; height: 58px; }
  .pp-profile-name { font-size: 18px; }
  .pp-section-title { display: none; }
  .pp-section-title + .pp-row, .pp-card > .pp-row:first-child { border-top: 0; }
  .pp-row { grid-template-columns: auto 1fr auto; gap: 10px; padding: 14px 16px; cursor: pointer; }
  .pp-row-value { text-align: right; color: var(--ink-3); font-size: 13px; }
  .pp-row-value small, .pp-row .pp-btn-sm { display: none; }
  .pp-row-chevron { display: block; color: var(--ink-3); font-size: 20px; line-height: 1; }

  /* 表单弹窗在手机上全屏；确认类弹窗保持居中 */
  .pp-dialog:not(.is-alert) { align-items: stretch; padding: 0; background: var(--surface); }
  .pp-dialog:not(.is-alert) .pp-dialog-box { max-width: none; max-height: none; padding: 0 22px 28px; border-radius: 0; box-shadow: none; }
  .pp-dialog:not(.is-alert) .pp-dialog-head { position: relative; height: 48px; justify-content: center; margin: 0 -22px 12px; }
  .pp-dialog:not(.is-alert) .pp-dialog-title { font-size: 16px; font-weight: 500; }
  .pp-dialog:not(.is-alert) .pp-dialog-close { position: absolute; left: 0; top: 0; width: 48px; height: 48px; }
  .pp-dialog:not(.is-alert) .pp-dialog-foot { display: block; }
  .pp-dialog:not(.is-alert) .pp-dialog-foot .pp-btn { width: 100%; height: 48px; }
  .pp-dialog:not(.is-alert) .pp-dialog-foot .is-ghost { display: none; }

  .pp-widget .pp-panel { padding: 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-field, .pp-btn { transition: none; }
}

/* =====================================================================
 * 第 2 批新增：注册、找回密码、个人中心、协议页
 * ===================================================================== */

/* 切换标签（注册：手机号 / 邮箱） */
.pp-tabs { display: flex; gap: 26px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.pp-tab { position: relative; padding: 0 0 10px; color: var(--ink-2); font-size: 15px; }
.pp-tab:hover { color: var(--ink); }
.pp .pp-tab.is-current { color: var(--ink); font-weight: 500; }
.pp-tab.is-current::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }

/* 国家码下拉 */
.pp-select {
  max-width: 128px; height: 100%;
  padding: 0; border: 0; outline: 0;
  background: transparent;
  font-size: 15px;
  cursor: pointer;
}

/* 验证码下方的操作行 */
.pp-code-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; color: var(--ink-2); font-size: 13px; }
.pp-code-actions a:hover { color: var(--brand); }

/* 顶栏已登录用户 */
.pp-user { display: flex; align-items: center; gap: 10px; }
.pp-user img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); }
.pp-user .pp-top-link { margin-left: 14px; }

.pp-profile-meta { min-width: 0; }
.pp-profile-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-profile-home { margin-left: auto; align-self: flex-start; }
.pp-row-links a { margin-right: 18px; color: var(--ink-2); }
.pp-row-links a:hover { color: var(--brand); }
.pp .pp-row-danger { display: block; text-align: center; color: var(--danger); }
.pp-only-m { display: none; }

/* 头像上传 */
.pp-drop {
  position: relative;
  display: block;
  margin-bottom: 14px; padding: 22px;
  border: 1.5px dashed var(--line); border-radius: 12px;
  text-align: center; color: var(--ink-2);
  cursor: pointer;
}
.pp-drop:hover, .pp-drop:focus-within { border-color: var(--brand); }
.pp-drop img { display: block; width: 88px; height: 88px; margin: 0 auto 10px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); }
.pp-drop small { display: block; color: var(--ink-3); font-size: 12px; }
.pp-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* 协议页 */
.pp-doc-main { flex: 1; width: 100%; max-width: 860px; margin: 30px auto; padding: 0 20px; }
.pp-doc { padding: 36px 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--ink-2); line-height: 1.9; }
.pp-doc h1 { margin: 0 0 22px; color: var(--ink); font-size: 24px; line-height: 1.4; }
.pp-doc h2 { margin: 0 0 14px; color: var(--ink); font-size: 15px; font-weight: 500; }
.pp-doc h3 { margin: 28px 0 10px; color: var(--ink); font-size: 16px; }
.pp-doc p { margin: 0 0 12px; }

@media (max-width: 767px) {
  .pp-user, .pp-only-pc { display: none; }
  .pp-only-m { display: block; }
  .pp-doc-main { margin: 0; padding: 0 18px 28px; }
  .pp-doc { padding: 0; border: 0; background: transparent; }
  .pp-doc h1 { font-size: 20px; }
}

/* =====================================================================
 * 第 3 批：顶栏右侧（登录状态 + 返回首页）
 * ===================================================================== */
.pp-top-right { display: flex; align-items: center; gap: 18px; }
.pp-user a[data-pp-user-name] { max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) {
  .pp-top-right { display: none; }
}
