:root {
  --bg: #f3f8ff;
  --bg-grad: linear-gradient(180deg, #edf5ff 0%, #f8f5ff 52%, #fffcf4 100%);
  --card: #ffffff;
  --border: #d7e5f5;
  --ink: #2f3f54;
  --ink-light: #64768c;
  --sky: #5592cf;
  --sky-deep: #356fa8;
  --sky-soft: #e6f2ff;
  --lav-soft: #f1ecff;
  --lav-text: #624ca8;
  --cream: #fff5db;
  --amber-text: #a16214;
  --coral-soft: #ffecee;
  --coral-text: #c44754;
  --shadow: 0 10px 28px rgba(68, 108, 158, 0.1);
  --radius: 22px;
}

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

body {
  background: var(--bg-grad);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  line-height: 1.6;
}

.phone-shell {
  max-width: 460px;
  margin: 0 auto;
  padding: 16px 14px 44px;
  min-height: 100vh;
}

.view {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.28s ease;
}

.view.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

.soft-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Hero */
.hero-card {
  background: linear-gradient(180deg, #ffffff 0%, #ebf4ff 100%);
  border: 1.5px solid #cde0f5;
  border-radius: 26px;
  padding: 16px 16px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hero-badge {
  background: var(--sky-soft);
  color: var(--sky-deep);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
}

.hero-art-wrap {
  width: 100%;
  height: 182px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid #d5e6f8;
  background: #f3f8ff;
}

.hero-art { width: 100%; height: 100%; object-fit: cover; }

.hero-title { font-size: 20.5px; font-weight: 900; color: var(--ink); line-height: 1.35; margin-top: 2px; }
.hero-sub { font-size: 13px; color: var(--ink-light); line-height: 1.65; padding: 0 4px; }

.feature-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 2px; }
.feature-pills span {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--ink);
  font-weight: 600;
}

.safety-notice {
  background: #fff9ec;
  border: 1.5px solid #f2dca8;
  border-radius: 16px;
  padding: 11px 13px;
  font-size: 12px;
  color: #7d5318;
  line-height: 1.6;
}
.safety-notice strong { color: #9e560b; }

/* 登记卡片 */
.profile-row { display: flex; align-items: center; gap: 12px; }

.avatar-uploader {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2px dashed #99bee6;
  background: #f2f8ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-placeholder { display: flex; flex-direction: column; align-items: center; color: var(--sky-deep); font-size: 18px; line-height: 1.2; }
.avatar-placeholder small { font-size: 11px; font-weight: 700; }
.avatar-preview { width: 100%; height: 100%; object-fit: cover; }
.profile-inputs { flex: 1; display: flex; flex-direction: column; gap: 8px; }

.soft-input {
  width: 100%;
  background: #f8fbff;
  border: 1.5px solid #d5e4f4;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
}
.soft-input:focus { border-color: var(--sky); background: #fff; }

/* 卡密门禁 */
.gate-card { background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%); border-color: #c2dcf5; }
.gate-input-row { display: flex; gap: 8px; }
.code-input { text-transform: uppercase; font-weight: 700; letter-spacing: 0.6px; }

.sky-btn {
  background: linear-gradient(135deg, #68a5e0, #3b76b0);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(59, 118, 176, 0.25);
  transition: transform 0.14s ease;
}
.sky-btn:active { transform: scale(0.97); }
.sky-btn.full-btn { width: 100%; padding: 13px 18px; font-size: 15px; }
.sky-btn.sm-btn { padding: 8px 13px; font-size: 12.5px; border-radius: 99px; }

.gate-msg { font-size: 12px; color: var(--ink-light); margin-top: 8px; }
.gate-msg.err { color: var(--coral-text); font-weight: 700; }
.gate-msg.ok { color: #2f7d61; font-weight: 700; }

.preview-bypass { margin-top: 10px; border-top: 1px dashed #c7dcf2; padding-top: 8px; text-align: center; }
.ghost-link-btn { background: transparent; border: none; color: var(--sky-deep); font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: underline; }

/* 双模式入口 */
.mode-section { display: flex; flex-direction: column; gap: 10px; }
.mode-section.locked { opacity: 0.55; }

.mode-card {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  transition: transform 0.15s ease;
}
.mode-card:active { transform: scale(0.98); }
.mode-learn { background: linear-gradient(135deg, #ffffff 0%, #ebf4ff 100%); border-color: #bbd7f4; }
.mode-fast { background: linear-gradient(135deg, #ffffff 0%, #f3eeff 100%); border-color: #d6c8f5; }

.mode-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.mode-info { flex: 1; }
.mode-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 4px; }
.mode-head strong { font-size: 16px; color: var(--ink); }
.mode-tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--lav-soft); color: var(--lav-text); }
.mode-tag.hot { background: var(--sky-soft); color: var(--sky-deep); }
.mode-info p { font-size: 12px; color: var(--ink-light); line-height: 1.5; }
.mode-arrow { font-size: 18px; color: var(--sky-deep); font-weight: 800; }

.owner-tools-bar {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-light);
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--border);
}
.owner-tools-bar a { color: var(--sky-deep); font-weight: 700; text-decoration: none; }
.mini-reset-btn { background: transparent; border: none; color: var(--ink-light); font-size: 12px; cursor: pointer; text-decoration: underline; }

/* 答题页 */
.quiz-topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pill-back-btn { background: #fff; border: 1.5px solid var(--border); color: var(--ink); border-radius: 99px; padding: 6px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.mode-pill { font-size: 12px; font-weight: 700; background: var(--sky-soft); color: var(--sky-deep); padding: 5px 12px; border-radius: 99px; }
.progress-counter { font-size: 13px; font-weight: 800; color: var(--ink-light); }

.paw-progress-track { height: 10px; background: #dbe8f7; border-radius: 99px; position: relative; margin: 2px 0 4px; }
.paw-progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #86b9ec, #4a86c2); position: relative; transition: width 0.3s ease; }
.paw-runner { position: absolute; right: -10px; top: -7px; font-size: 16px; }

.question-card { display: flex; flex-direction: column; gap: 14px; padding: 18px 16px; }
.q-meta { display: flex; align-items: center; justify-content: space-between; }
.dim-badge { background: var(--sky-soft); color: var(--sky-deep); font-size: 12px; font-weight: 800; padding: 4px 11px; border-radius: 99px; }
.scene-tag { font-size: 12px; color: var(--ink-light); font-weight: 600; }
.q-title { font-size: 17px; font-weight: 800; line-height: 1.55; color: var(--ink); }

.q-options { display: flex; flex-direction: column; gap: 10px; }
.opt-btn {
  width: 100%;
  text-align: left;
  background: #f8fbff;
  border: 1.5px solid #d5e4f4;
  border-radius: 15px;
  padding: 13px 15px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.14s ease;
}
.opt-btn:hover, .opt-btn.selected { background: #e8f3ff; border-color: var(--sky); color: #204d7a; transform: translateY(-1px); }
.opt-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #b9d2ec;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-light);
  flex-shrink: 0;
}
.opt-btn.selected .opt-dot { background: var(--sky); border-color: var(--sky); color: #fff; }

.q-nav-row { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.text-nav-btn { background: transparent; border: none; color: var(--sky-deep); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.q-tip { font-size: 11.5px; color: var(--ink-light); }

/* 边测边学微科普卡 */
.science-pop {
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  border: 2px solid #b6d3f2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: popSlide 0.25s ease;
}
@keyframes popSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.science-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; color: var(--sky-deep); }
.sci-dim { font-size: 11.5px; background: #fff; padding: 2px 9px; border-radius: 99px; border: 1px solid #c9dff5; }
.sci-body { font-size: 13.5px; line-height: 1.75; color: var(--ink); }

.dog-translate-bubble { background: #fff; border: 1.5px solid #dacdf5; border-radius: 16px; padding: 11px 13px; }
.dog-bubble-label { display: block; font-size: 11px; font-weight: 800; color: var(--lav-text); margin-bottom: 3px; }
.dog-translate-bubble p { font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.55; }

/* 结果页 */
.result-top-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.result-hero {
  background: linear-gradient(180deg, #ffffff 0%, #edf5ff 100%);
  border: 2px solid #bed8f4;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2.5px solid var(--sky-deep);
  color: var(--sky-deep);
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  transform: rotate(10deg);
}

.result-profile-row { display: flex; align-items: center; gap: 13px; padding-right: 58px; }

.result-avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(53, 111, 168, 0.22);
  background: var(--sky-soft);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.res-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.res-avatar-fallback { font-size: 34px; }
.change-photo-chip { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(47, 63, 84, 0.75); color: #fff; font-size: 10px; text-align: center; padding: 2px 0; }

.res-badge { display: inline-block; font-size: 11px; font-weight: 800; color: var(--sky-deep); background: #fff; padding: 2px 9px; border-radius: 99px; border: 1px solid #c3dcf5; margin-bottom: 4px; }
.result-name-box h2 { font-size: 16.5px; font-weight: 900; }
.res-score-row { font-size: 12.5px; color: var(--ink-light); display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.good-num { color: #2f8a6b; font-size: 16px; }
.warn-num { color: #d17428; font-size: 16px; }
.sep { color: #b9cadc; }

.res-archetype-title { font-size: 18.5px; font-weight: 900; color: var(--ink); text-align: center; }
.res-tagline { text-align: center; font-size: 13.5px; font-weight: 700; color: var(--sky-deep); background: rgba(255, 255, 255, 0.85); border-radius: 12px; padding: 8px 12px; }
.res-summary { font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.res-highlight { font-size: 13px; font-weight: 700; color: var(--lav-text); background: var(--lav-soft); border-radius: 12px; padding: 10px 12px; line-height: 1.6; }

.radar-canvas-wrap { display: flex; justify-content: center; margin: 4px 0 8px; }
.dim-bars { display: flex; flex-direction: column; gap: 8px; }
.dim-bar-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.dim-bar-name { width: 82px; font-weight: 700; white-space: nowrap; }
.dim-bar-track { flex: 1; height: 9px; background: #e6eff9; border-radius: 99px; overflow: hidden; }
.dim-bar-fill { height: 100%; border-radius: 99px; }
.dim-bar-val { width: 38px; text-align: right; font-weight: 800; color: var(--ink-light); }

.rx-intro { font-size: 12.5px; color: var(--ink-light); margin-bottom: 10px; }
.rx-list { display: flex; flex-direction: column; gap: 10px; }
.rx-item { background: #f8fbff; border: 1.5px solid var(--border); border-left: 4px solid var(--sky); border-radius: 14px; padding: 11px 13px; }
.rx-item strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.rx-item p { font-size: 12.5px; color: var(--ink-light); line-height: 1.65; }

.wiki-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.wiki-tab { background: #f2f7fe; border: 1px solid var(--border); border-radius: 99px; padding: 5px 11px; font-size: 12px; font-weight: 700; color: var(--ink-light); white-space: nowrap; cursor: pointer; }
.wiki-tab.active { background: var(--sky); border-color: var(--sky); color: #fff; }
.wiki-list { display: flex; flex-direction: column; gap: 10px; }
.wiki-item { background: #fafdff; border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.wiki-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.wiki-scene { font-weight: 800; color: var(--sky-deep); }
.wiki-ans-chip { font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 700; }
.wiki-ans-chip.safe { background: #e3f5ec; color: #2f7d61; }
.wiki-ans-chip.risk { background: var(--coral-soft); color: var(--coral-text); }
.wiki-q { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.wiki-sci { font-size: 12.5px; color: var(--ink-light); line-height: 1.65; }
.wiki-trans { font-size: 12.5px; font-weight: 700; color: var(--lav-text); background: var(--lav-soft); border-radius: 10px; padding: 7px 10px; }

/* 海报弹窗 */
.poster-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 39, 58, 0.72);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.poster-sheet {
  background: #fafdff;
  border-radius: 22px;
  max-width: 420px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.poster-sheet-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.close-x { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; }

.poster-save-guide {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sky-deep);
  background: var(--sky-soft);
  border: 1px dashed #a7c9ec;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
  line-height: 1.5;
}

.poster-img-box {
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: #fff;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.poster-img-box.pulse-guide {
  border-color: var(--sky-deep);
  box-shadow: 0 0 0 4px rgba(53, 111, 168, 0.28);
}

.poster-img-box img {
  width: 100%;
  display: block;
  -webkit-touch-callout: default !important;
  -webkit-user-select: auto !important;
  user-select: auto !important;
  pointer-events: auto !important;
  touch-action: auto;
}
