:root {
  --bg: #fff9f0;
  --bg-grad: linear-gradient(180deg, #fff9ee 0%, #fff2df 52%, #f5f9ff 100%);
  --card: #ffffff;
  --border: #f2dfc8;
  --cocoa: #563d2d;
  --cocoa-light: #8c6f5a;
  --honey: #ea9846;
  --honey-deep: #d17924;
  --honey-soft: #ffefd9;
  --cream: #fff6dc;
  --sky-soft: #eaf4ff;
  --sky-text: #3a75a8;
  --mint-soft: #e7f6ee;
  --mint-text: #35835d;
  --shadow: 0 10px 28px rgba(173, 121, 68, 0.11);
  --radius: 22px;
}

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

body {
  background: var(--bg-grad);
  color: var(--cocoa);
  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(--cocoa);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Hero */
.hero-card {
  background: linear-gradient(180deg, #fffdf9 0%, #fff4e2 100%);
  border: 1.5px solid #f4d9b5;
  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(--honey-soft);
  color: #a35a12;
  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 #f5dfc0;
  background: #fff9ee;
}

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

.hero-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--cocoa);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.hero-sub {
  font-size: 13px;
  color: var(--cocoa-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(--cocoa);
  font-weight: 600;
}

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

.avatar-uploader {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2px dashed #e6b47e;
  background: #fffaf0;
  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(--honey-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: #fffbf4;
  border: 1.5px solid #efd9be;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--cocoa);
  outline: none;
  font-family: inherit;
}

.soft-input:focus {
  border-color: var(--honey);
  background: #fff;
}

/* 卡密门禁 */
.gate-card {
  background: linear-gradient(180deg, #fffdf9 0%, #fff4e0 100%);
  border-color: #f3d29e;
}

.gate-input-row {
  display: flex;
  gap: 8px;
}

.code-input {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.honey-btn {
  background: linear-gradient(135deg, #f3ae59, #db7d25);
  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(219, 125, 37, 0.28);
  transition: transform 0.14s ease;
}

.honey-btn:active {
  transform: scale(0.97);
}

.honey-btn.full-btn {
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
}

.honey-btn.sm-btn {
  padding: 8px 13px;
  font-size: 12.5px;
  border-radius: 99px;
}

.gate-msg {
  font-size: 12px;
  color: var(--cocoa-light);
  margin-top: 8px;
}

.gate-msg.err { color: #d64550; font-weight: 700; }
.gate-msg.ok { color: var(--mint-text); font-weight: 700; }

.preview-bypass {
  margin-top: 10px;
  border-top: 1px dashed #ecd0a8;
  padding-top: 8px;
  text-align: center;
}

.ghost-link-btn {
  background: transparent;
  border: none;
  color: #a8641f;
  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, #fffdf9 0%, #fff2df 100%);
  border-color: #f3caa0;
}

.mode-fast {
  background: linear-gradient(135deg, #fffdf9 0%, #eef6ff 100%);
  border-color: #c7dff7;
}

.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(--cocoa); }

.mode-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--sky-soft);
  color: var(--sky-text);
}

.mode-tag.hot {
  background: var(--honey-soft);
  color: var(--honey-deep);
}

.mode-info p { font-size: 12px; color: var(--cocoa-light); line-height: 1.5; }
.mode-arrow { font-size: 18px; color: var(--honey-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(--cocoa-light);
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed var(--border);
}

.owner-tools-bar a { color: var(--honey-deep); font-weight: 700; text-decoration: none; }
.mini-reset-btn { background: transparent; border: none; color: var(--cocoa-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(--cocoa);
  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(--honey-soft);
  color: var(--honey-deep);
  padding: 5px 12px;
  border-radius: 99px;
}

.progress-counter { font-size: 13px; font-weight: 800; color: var(--cocoa-light); }

.paw-progress-track {
  height: 10px;
  background: #f5e3cc;
  border-radius: 99px;
  position: relative;
  margin: 2px 0 4px;
}

.paw-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #f7c772, #ea8d3b);
  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(--honey-soft);
  color: #a35a12;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: 99px;
}

.scene-tag { font-size: 12px; color: var(--cocoa-light); font-weight: 600; }
.q-title { font-size: 17.5px; font-weight: 800; line-height: 1.55; color: var(--cocoa); }

.q-options { display: flex; flex-direction: column; gap: 10px; }

.opt-btn {
  width: 100%;
  text-align: left;
  background: #fffcf6;
  border: 1.5px solid #efd8be;
  border-radius: 15px;
  padding: 13px 15px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cocoa);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.14s ease;
}

.opt-btn:hover, .opt-btn.selected {
  background: #fff3e0;
  border-color: var(--honey);
  color: #9e540d;
  transform: translateY(-1px);
}

.opt-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #e6c6a4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--cocoa-light);
  flex-shrink: 0;
}

.opt-btn.selected .opt-dot {
  background: var(--honey);
  border-color: var(--honey);
  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(--honey-deep); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.q-tip { font-size: 11.5px; color: var(--cocoa-light); }

/* 边测边学微科普卡 */
.science-pop {
  background: linear-gradient(180deg, #fffdf9 0%, #fff4e2 100%);
  border: 2px solid #f2ca98;
  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: #a65c14;
}

.sci-dim {
  font-size: 11.5px;
  background: #fff;
  padding: 2px 9px;
  border-radius: 99px;
  border: 1px solid #f0d3b3;
}

.sci-body { font-size: 13.5px; line-height: 1.75; color: var(--cocoa); }

.dog-translate-bubble {
  background: #fff;
  border: 1.5px solid #cde2f7;
  border-radius: 16px;
  padding: 11px 13px;
}

.dog-bubble-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--sky-text);
  margin-bottom: 3px;
}

.dog-translate-bubble p { font-size: 13.5px; font-weight: 700; color: var(--cocoa); line-height: 1.55; }

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

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

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

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

.result-avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(209, 121, 36, 0.25);
  background: var(--honey-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(86, 61, 45, 0.72);
  color: #fff;
  font-size: 10px;
  text-align: center;
  padding: 2px 0;
}

.res-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--honey-deep);
  background: #fff;
  padding: 2px 9px;
  border-radius: 99px;
  border: 1px solid #f4d6b0;
  margin-bottom: 4px;
}

.result-name-box h2 { font-size: 17px; font-weight: 900; }
.res-score-line { font-size: 13px; color: var(--cocoa-light); }
.res-score-line strong { font-size: 18px; color: var(--honey-deep); }
.res-archetype-title { font-size: 19px; font-weight: 900; color: var(--cocoa); text-align: center; }

.res-tagline {
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  color: #a15a14;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 8px 12px;
}

.res-summary { font-size: 13.5px; line-height: 1.75; color: var(--cocoa); }

.res-highlight {
  font-size: 13px;
  font-weight: 700;
  color: var(--sky-text);
  background: var(--sky-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: 78px; font-weight: 700; white-space: nowrap; }
.dim-bar-track { flex: 1; height: 9px; background: #f4e6d6; border-radius: 99px; overflow: hidden; }
.dim-bar-fill { height: 100%; border-radius: 99px; }
.dim-bar-val { width: 36px; text-align: right; font-weight: 800; color: var(--cocoa-light); }

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

.wiki-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.wiki-tab {
  background: #fff7ec;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cocoa-light);
  white-space: nowrap;
  cursor: pointer;
}
.wiki-tab.active { background: var(--honey); border-color: var(--honey); color: #fff; }
.wiki-list { display: flex; flex-direction: column; gap: 10px; }
.wiki-item { background: #fffdf9; 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(--honey-deep); }
.wiki-ans-chip { font-size: 11px; background: var(--mint-soft); color: var(--mint-text); padding: 2px 8px; border-radius: 99px; font-weight: 700; }
.wiki-q { font-size: 13.5px; font-weight: 800; color: var(--cocoa); }
.wiki-sci { font-size: 12.5px; color: var(--cocoa-light); line-height: 1.65; }
.wiki-trans { font-size: 12.5px; font-weight: 700; color: var(--sky-text); background: var(--sky-soft); border-radius: 10px; padding: 7px 10px; }

/* 海报弹窗（三层长按保存优化） */
.poster-modal {
  position: fixed;
  inset: 0;
  background: rgba(54, 34, 22, 0.72);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.poster-sheet {
  background: #fffcf6;
  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(--cocoa); font-size: 14px; cursor: pointer; }

.poster-save-guide {
  font-size: 12.5px;
  font-weight: 700;
  color: #a35a12;
  background: #fff3df;
  border: 1px dashed #e9bf87;
  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(--honey-deep);
  box-shadow: 0 0 0 4px rgba(209, 121, 36, 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;
}
