/* 九龙门户统一配色（与 misterduan.com 首页一致） */
:root {
  --ink: #1c2333;
  --ink-soft: #5a6478;
  --muted: #5a6478;
  --muted-2: #8b93a7;
  --line: #e6ebf3;
  --line-soft: #eef1f7;
  --card: #ffffff;
  --bg: #f3f6fa;
  --bg-deep: #eef1f7;
  --brand: #005bac;
  --brand-mid: #003e7e;
  --brand-dark: #003e7e;
  --brand-deep: #0a2d5c;
  --brand-soft: #e8f2fb;
  --accent: #005bac;
  --accent-deep: #003e7e;
  --ok: #1a9e4b;
  --ok-soft: #e9f8ef;
  --bad: #d4000f;
  --bad-soft: #fdeaea;
  --warn-soft: #fdf3e2;
  --warn-ink: #b25e00;
  --gold: #f0a92e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28,35,51,.04), 0 8px 24px rgba(10,45,92,.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Noto Sans CJK SC", sans-serif;
  background:
    radial-gradient(circle at 12% -5%, rgba(0,91,172,.08), transparent 40%),
    radial-gradient(circle at 88% 0%, rgba(240,169,46,.06), transparent 32%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  padding: 14px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  min-height: 100dvh;
  letter-spacing: 0.01em;
}
a { color: var(--brand-mid); text-decoration: none; }
.container { max-width: 680px; margin: 0 auto; width: 100%; }

/* 品牌区 */
.page-home { padding-top: 8px; padding-bottom: 28px; }
.home-wrap { max-width: 720px; }
.home-brand { margin: 6px 4px 16px; }
.home-eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--brand-mid);
  font-weight: 700;
  margin-bottom: 10px;
  padding: 4px 10px;
  border: 1px solid rgba(42, 64, 104, 0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.65);
}
.home-title {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: clamp(18px, 5vw, 22px);
  line-height: 1.35;
  color: var(--brand-dark);
  font-weight: 700;
  margin: 0;
}
.home-lead {
  color: var(--muted);
  font-size: 15px;
  max-width: 28em;
  line-height: 1.65;
}
.home-foot {
  margin: 20px 6px 0;
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
  line-height: 1.5;
}

/* 与门户首页一致的顶栏 */
.portal-bar{
  display:flex;align-items:center;gap:12px;
  height:56px;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
  padding:0 16px;
  margin:-14px -14px 16px;
  position:sticky;top:0;z-index:80;
}
body.page-flow .portal-bar{margin:0;position:relative}
.portal-logo{
  width:36px;height:36px;border-radius:10px;flex:none;
  background:linear-gradient(135deg,var(--brand),var(--brand-dark));
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 16px rgba(0,91,172,.35);
}
.portal-logo svg{width:20px;height:20px;stroke:#fff;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.portal-titles{min-width:0;flex:1}
.portal-name{font-size:15px;font-weight:700;color:var(--brand-dark);letter-spacing:.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.portal-sub{font-size:11px;color:var(--muted-2);margin-top:-1px}
.portal-back{
  flex:none;font-size:12px;font-weight:700;color:var(--brand);
  text-decoration:none;padding:6px 10px;border-radius:8px;border:1px solid var(--line);background:#fff;
}

/* 两大板块 */
.home-plates { display: grid; gap: 14px; }
.home-plate {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 18px;
  padding: 22px 20px 20px;
  border: 1px solid rgba(18, 26, 34, 0.08);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}
.home-plate:active { transform: scale(0.985); }
.home-plate .home-tile-kicker,
.home-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-mid);
  margin-bottom: 10px;
}
.home-plate h2 {
  font-family: inherit;
  font-size: 20px;
  color: var(--brand-dark);
  margin: 0 0 10px;
  line-height: 1.3;
}
.home-plate > p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.6;
}
.home-plate-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  margin-top: 4px;
}
.home-plate-learn {
  background: linear-gradient(155deg, #ffffff 0%, #f1f3f7 100%);
  border-top: 3px solid var(--brand);
}
.home-plate-intake {
  background: linear-gradient(155deg, #ffffff 0%, #e8f2fb 100%);
  border-top: 3px solid var(--brand-dark);
}
.home-plate-intake .home-kicker,
.home-plate-intake .home-tile-kicker { color: var(--brand-dark); }
.home-plate-list {
  margin: 0 0 14px 1.1em;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.7;
}
.home-plate-list li { margin-bottom: 2px; }

/* 卡片与表单 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-bottom: 14px;
  border: 1px solid rgba(18, 26, 34, 0.06);
  box-shadow: var(--shadow);
}
.card h1 {
  font-family: inherit;
  font-size: 22px;
  color: var(--brand-dark);
  margin-bottom: 6px;
  line-height: 1.3;
}
.card h2 {
  font-size: 15px;
  color: var(--brand-mid);
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.6;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  background: #fbfcfd;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand-mid);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(42, 64, 104, 0.14);
}
.form-section {
  margin: 0 0 18px;
  padding: 14px 12px 4px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
}
.form-section-title {
  font-size: 14px !important;
  margin: 0 0 12px !important;
  color: var(--brand);
  letter-spacing: 0.04em;
}
.form-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted-2);
}

.btn-primary, .btn-link, .btn-disabled, .btn-test {
  display: inline-block;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 50px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 91, 172, 0.28);
}
.btn-primary:active { opacity: 0.92; }
.btn-primary:disabled,
.btn-disabled {
  background: #cfd6dd;
  color: #8a95a1;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-link {
  background: var(--line-soft);
  color: var(--brand);
  margin-top: 10px;
}
.btn-large { padding: 16px 20px; font-size: 17px; }
.btn-test {
  background: #fff8ef;
  color: #8a4b16;
  border: 1px dashed #d4a574;
  margin-top: 10px;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.65;
}
.alert-error { background: var(--bad-soft); color: var(--bad); border: 1px solid #ecd2d2; }
.alert-warn { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid #eadcc3; }
.alert-success { background: var(--ok-soft); color: var(--ok); border: 1px solid #cfe5d9; }

.tips {
  margin-top: 18px;
  padding: 14px;
  background: #f3f5f8;
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--line-soft);
}
.tips p { margin-bottom: 4px; }
.tips p:first-child { color: var(--ink-soft); font-weight: 700; }

.step-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.step-bar span {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--line-soft);
}
.step-bar span.on { background: var(--brand-mid); }

.profile-strip {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--brand-soft);
  border: 1px solid rgba(42, 64, 104, 0.12);
  margin: 12px 0 16px;
}
.profile-photos {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.profile-photos figure {
  margin: 0;
  text-align: center;
}
.profile-photos img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: block;
}
.profile-photos figcaption {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.2;
}
.profile-strip img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.profile-meta { min-width: 0; }
.profile-meta strong {
  display: block;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 4px;
}
.profile-meta p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  word-break: break-all;
}

.welcome { margin-bottom: 8px; }
.welcome h1 {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 24px;
  color: var(--ink);
}
.welcome p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.dash-ok { color: var(--ok); font-weight: 700; margin-top: 10px; }
.dash-photo { display: none; }

.exam-list { margin: 8px 0 4px; }
.exam-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  align-items: center;
  background: #fff;
}
.exam-item.passed {
  border-color: rgba(31, 107, 69, 0.35);
  background: var(--ok-soft);
}
.exam-item.locked-item {
  opacity: 0.78;
  background: #f7f9fb;
}
.exam-info { flex: 1; min-width: 0; }
.exam-info h3 {
  font-size: 15.5px;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.4;
}
.exam-info p { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.exam-result { margin-top: 8px; font-size: 13px; }
.exam-action { flex-shrink: 0; }
.exam-action .btn-primary,
.exam-action .btn-disabled,
.exam-action .btn-link {
  width: auto;
  min-width: 92px;
  padding: 10px 12px;
  font-size: 13.5px;
  min-height: 42px;
  margin-top: 0;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  margin-left: 4px;
  font-weight: 700;
  vertical-align: middle;
}
.tag-pass { background: var(--ok); color: #fff; }
.tag-fail { background: #8a95a1; color: #fff; }
.tag-wait { background: #e7edf2; color: #526171; }

.notice {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--brand-soft);
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid rgba(42, 64, 104, 0.12);
}
.notice h3 {
  color: var(--brand);
  font-size: 13px;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.notice ol { margin-left: 1.15em; color: var(--ink-soft); }
.notice li { margin-bottom: 4px; line-height: 1.55; }
.actions { margin-top: 14px; text-align: center; }

.learn-placeholder {
  margin: 12px 0 8px;
  padding: 16px;
  border: 1px dashed rgba(42, 64, 104, 0.28);
  border-radius: 12px;
  background: rgba(238, 241, 246, 0.65);
}
.learn-placeholder h3 { font-size: 15px; margin-bottom: 8px; color: var(--ink); }
.learn-placeholder ul { margin: 0 0 10px 18px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.learn-note { font-size: 13px; color: var(--brand-mid); }

.confirm-box {
  margin-top: 16px;
  padding: 14px;
  background: #f4f6f8;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.confirm-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.confirm-check input {
  margin-top: 3px;
  transform: scale(1.15);
  flex-shrink: 0;
}
.locked-item { opacity: 0.78; }
.reading-body { min-height: 120px; }

/* 拍照 */
.page-photo { padding-bottom: 0; }
.photo-card { padding-bottom: 120px; }
.photo-stage {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 12px;
  aspect-ratio: 3 / 4;
  max-height: min(62vh, 520px);
  background: #111827;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  border: 1px solid #111;
}
.photo-stage video.cam-live,
.photo-stage .photo-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111827;
}
.photo-stage video.cam-live { z-index: 1; transform: scaleX(-1); }
.photo-stage .photo-preview {
  z-index: 2; transform: none; opacity: 0; pointer-events: none;
}
.photo-stage .photo-preview.is-show { opacity: 1; }
.photo-stage video.cam-live.is-hide { opacity: 0; }
.photo-stage canvas {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.photo-guide {
  pointer-events: none;
  position: absolute; inset: 10% 14%;
  border: 2px dashed rgba(255,255,255,0.45);
  border-radius: 50% / 42%;
  z-index: 3;
}
.photo-guide-id {
  inset: 22% 6%;
  border-radius: 10px;
  border-style: solid;
  border-color: rgba(255,255,255,0.55);
}
.photo-guide.is-hide { display: none; }
.page-photo-id .cam-live {
  object-fit: cover;
}
.photo-tip {
  font-size: 13px; color: var(--muted); text-align: center;
  margin: 0 4px 14px; min-height: 2.6em; line-height: 1.5;
}
.photo-dock {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(0,0,0,0.06);
  z-index: 40;
}
.photo-dock .btn-primary,
.photo-dock .btn-link { margin-top: 0; min-height: 48px; font-size: 16px; }
.photo-dock-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px;
}
.photo-dock-row.single { grid-template-columns: 1fr; }
.photo-fallback-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 600; z-index: 2; padding: 20px;
  text-align: center; background: rgba(17,24,39,.72);
}

/* 答题页 */
.quiz-container { padding: 0; }
.quiz-header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 14px; background: var(--brand); color: #fff;
  border-radius: 12px 12px 0 0;
  position: sticky; top: 0; z-index: 20;
}
.quiz-header h2 { font-size: 15px; color: #fff; margin: 0; }
.quiz-header p { font-size: 12px; margin: 2px 0 0; opacity: 0.9; }
.timer { font-size: 16px; font-weight: bold; white-space: nowrap; }
.timer.warning { color: #ffd700; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.5; } }

.progress-bar {
  position: relative; height: 28px; background: #e0e0e0; margin-bottom: 12px;
}
.progress-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--ok); width: 0;
}
.progress-text {
  position: relative; z-index: 2; line-height: 28px;
  text-align: center; color: #333; font-size: 12px; font-weight: 600;
}

.question {
  background: #fff; border-radius: 12px; padding: 14px;
  margin-bottom: 10px; border: 1px solid var(--line-soft);
}
.q-title { font-size: 15px; font-weight: 600; color: #333; margin-bottom: 10px; line-height: 1.55; }
.q-num {
  display: inline-block; width: 24px; height: 24px;
  background: var(--brand); color: #fff; border-radius: 50%;
  text-align: center; line-height: 24px; font-size: 12px; margin-right: 6px;
}
.q-type {
  display: inline-block; padding: 1px 6px; font-size: 11px;
  background: var(--brand-soft); color: var(--brand); border-radius: 4px; margin-right: 6px;
}
.q-options { display: flex; flex-direction: column; gap: 8px; }
.q-option {
  display: flex; align-items: flex-start; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; min-height: 48px;
}
.q-option:has(input:checked) {
  border-color: var(--brand-mid); background: #f3f5f9;
}
.q-option input[type=radio] {
  margin-right: 10px; margin-top: 4px; transform: scale(1.15); flex-shrink: 0;
}
.opt-letter {
  display: inline-block; width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%; background: #f0f2f5; color: #555;
  text-align: center; line-height: 26px; font-size: 13px;
  font-weight: bold; margin-right: 10px;
}
.q-option input[type=radio]:checked + .opt-letter {
  background: var(--brand); color: #fff;
}
.opt-text { flex: 1; font-size: 15px; padding-top: 2px; line-height: 1.45; }

.submit-area {
  margin-top: 12px; text-align: center;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
.submit-tip { color: var(--bad); font-size: 13px; margin-bottom: 10px; }

.result-card { text-align: center; padding: 28px 16px; }
.result-icon { font-size: 48px; margin-bottom: 8px; }
.result-card h1 { font-size: 44px; margin-bottom: 4px; }
.result-pass h1 { color: var(--ok); }
.result-fail h1 { color: var(--bad); }
.result-status { font-size: 16px; color: #555; margin-bottom: 14px; }
.result-stats {
  display: flex; justify-content: space-around; flex-wrap: wrap; gap: 8px;
  padding: 12px 0; margin-bottom: 14px;
  border-top: 1px solid #eee; border-bottom: 1px solid #eee;
}
.result-stats div { font-size: 13px; color: #666; }
.answer-review-title { border-bottom: 2px solid var(--brand); padding-bottom: 6px; margin-bottom: 10px; }
.answer-item {
  padding: 12px; border-left: 4px solid; margin-bottom: 10px; border-radius: 4px;
}
.answer-item.correct { border-color: var(--ok); background: var(--ok-soft); }
.answer-item.wrong { border-color: var(--bad); background: var(--bad-soft); }
.answer-q { font-size: 14px; margin-bottom: 6px; line-height: 1.5; }
.answer-num {
  display: inline-block; width: 22px; height: 22px;
  background: var(--brand); color: #fff; border-radius: 50%;
  text-align: center; line-height: 22px; font-size: 11px; margin-right: 6px;
}
.answer-status { font-weight: bold; margin-right: 6px; }
.answer-detail { font-size: 12px; color: #666; padding-left: 28px; }
.user-ans { color: var(--bad); font-weight: 600; }
.right-ans { color: var(--ok); font-weight: 600; }
.explain { color: var(--brand-mid); font-style: italic; padding: 4px 0; }
code { background: #f0f2f5; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

@media (max-width: 420px) {
  .exam-item { flex-wrap: wrap; }
  .exam-action { width: 100%; }
  .exam-action .btn-primary,
  .exam-action .btn-disabled,
  .exam-action .btn-link { width: 100%; }
}

/* ===== 进场七步冻结导航（横向 1→7，省高度） ===== */
body.page-flow {
  padding: 0;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}
.flow-layout {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}
.flow-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 720px;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(26,31,38,.07);
  padding: 6px 10px 8px;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
}
.flow-nav-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.flow-nav-name { flex: 1; font-size: 13px; color: var(--ink); }
.flow-logout { font-size: 12px; color: var(--muted); padding: 4px 6px; }
.flow-steps {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  width: 100%;
}
.flow-step-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  padding: 2px 0;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
}
.flow-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 2px solid #c5ced6;
  background: #fff;
  color: #8b949e;
  box-sizing: border-box;
}
.flow-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}
.flow-step-main.is-todo { color: #8b949e; }
.flow-step-main.is-done { color: var(--ok); font-weight: 600; }
.flow-step-main.is-done .flow-num {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.flow-step-main.is-active .flow-num {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.flow-step-main.is-active.is-todo {
  color: var(--brand);
  font-weight: 700;
}
.flow-step-main.is-active.is-todo .flow-num {
  background: var(--brand);
  color: #fff;
}
.flow-step-main.is-active.is-done .flow-num {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.flow-step-rail {
  flex: 0 0 6px;
  align-self: center;
  height: 2px;
  margin-top: -12px;
  background: #d7dde4;
  border-radius: 1px;
}
.flow-nav-current {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
}
.flow-nav-msg {
  margin-top: 6px; font-size: 12px; color: var(--warn-ink);
  background: var(--warn-soft); border: 1px solid #eadcc3; border-radius: 10px; padding: 8px 10px;
}
.flow-main {
  padding: 12px 14px 24px;
  padding-top: calc(var(--flow-nav-h, 96px) + 10px);
}
.flow-card { margin: 0; }
.flow-step-head h1 { font-size: 22px; margin-bottom: 6px; }
.flow-subtabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px;
}
.flow-subtab {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: #fafbfd; text-decoration: none; font-size: 13px; color: #8b949e;
}
.flow-subtab.is-done { color: var(--ok); border-color: #b7d4c2; background: #f3faf5; font-weight: 600; }
.flow-subtab.is-on {
  border-color: rgba(42,64,104,.35);
  box-shadow: 0 0 0 2px var(--brand-soft);
  color: var(--brand); font-weight: 700;
}
.flow-subtab.is-on.is-done { color: var(--ok); }
.flow-thumb { margin: 10px 0; text-align: center; }
.flow-thumb img { max-width: 160px; border-radius: 12px; border: 1px solid var(--line); }
.flow-thumb figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.flow-photo-dock {
  position: static; margin-top: 12px; box-shadow: none; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; background: #fff;
}
.flow-photo-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 100%;
  margin: 0;
}
.flow-photo-btn.is-busy {
  opacity: .7;
  pointer-events: none;
}

/* 双格拍照：方框 + 中央按钮 + 缩略图背景 */
.photo-duo {
  display: grid;
  gap: 14px;
  margin: 8px 0 4px;
}
.photo-slot {
  position: relative;
  border: 2px dashed #c5ced6;
  border-radius: 16px;
  background: #f4f6f9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.photo-slot-face { aspect-ratio: 3 / 4; max-height: 420px; }
.photo-slot-id { aspect-ratio: 1.6 / 1; max-height: 260px; }
.photo-slot-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity .2s ease;
}
.photo-slot.has-photo {
  border-style: solid;
  border-color: #b7d4c2;
  background: #111;
}
.photo-slot.has-photo .photo-slot-bg { opacity: 1; }
.photo-slot-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a0a8b3;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  pointer-events: none;
}
.photo-slot.has-photo .photo-slot-empty { display: none; }
.photo-slot-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(30,47,77,.22);
  user-select: none;
}
.photo-slot.has-photo .photo-slot-btn {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(20, 28, 40, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.photo-slot.is-busy { opacity: .75; pointer-events: none; }
.photo-slot.is-busy .photo-slot-btn::after { content: "…"; }
@media (min-width: 560px) {
  .photo-duo {
    grid-template-columns: 1fr 1.35fr;
    align-items: stretch;
  }
  .photo-slot-face { max-height: none; }
  .photo-slot-id { max-height: none; align-self: center; }
}
.flow-summary { display: grid; gap: 8px; margin: 12px 0; }
.flow-sum-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fafbfd;
  font-size: 13px;
}
.flow-sum-item.ok { border-color: #b7d4c2; background: #f3faf5; }
.flow-sum-item.bad { border-color: #e5e7eb; }
.flow-sum-item strong { color: inherit; }
.flow-sum-item.ok strong { color: var(--ok); }
.flow-sum-item.bad strong { color: #8b949e; }
.flow-sum-item a { font-size: 12px; font-weight: 700; }
@media (max-width: 480px) {
  .flow-sum-item { grid-template-columns: 1fr auto; }
  .flow-sum-item span { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
  .flow-subtabs { grid-template-columns: 1fr; }
  .flow-step-rail { flex-basis: 4px; }
  .flow-num { width: 24px; height: 24px; font-size: 11px; }
}

body.page-flow.page-photo .flow-main { padding-bottom: 20px; }

/* —— PWA 添加到桌面引导 —— */
.pwa-banner {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.pwa-banner[hidden] { display: none !important; }
.pwa-dismiss {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.pwa-banner-inner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-right: 20px;
}
.pwa-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex: 0 0 auto;
  background: var(--brand);
}
.pwa-copy { flex: 1; min-width: 0; }
.pwa-copy strong {
  display: block;
  font-size: 16px;
  color: var(--brand);
  margin-bottom: 6px;
}
.pwa-steps {
  margin: 0 0 10px 1.1em;
  padding: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.pwa-steps b { color: var(--accent-deep); }
.pwa-install-btn {
  display: inline-block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #334e78 0%, var(--brand) 100%);
}
.pwa-install-btn:active { opacity: 0.92; }
