/* ===================================================
   亲密关系模式档案 — 米白暖橘 · 单页 SPA
   Relationship Pattern Archive · single-page app
   =================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #faf6f0;
  color: #3a2e2a;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== Desktop guard ===== */
@media (min-width: 768px) {
  #app { display: none !important; }
  body::before {
    content: "请用手机打开此页面 / Please open on mobile";
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: #faf6f0;
    color: #888;
    font-size: 16px;
    padding: 20px;
    text-align: center;
  }
}

/* ===== Shell ===== */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 20px 80px;
  position: relative;
}

/* ===== Screen system ===== */
.screen { display: none; }
.screen.active { display: block; }

/* ===== Buttons ===== */
.btn-primary {
  width: 100%;
  background: #b87850;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(184, 120, 80, 0.2);
  font-family: inherit;
}
.btn-primary:active { opacity: 0.7; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: #b87850;
  border: 1px solid #e0c9b0;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(58, 46, 42, 0.04);
  margin-bottom: 16px;
}

/* ===== Loading ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f5e6d3;
  border-top-color: #b87850;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #b89878; font-size: 14px; }

.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   GATE SCREEN — 激活首页
   =================================================== */
.gate-screen { padding-top: 50px; }

.gate-icon {
  width: 60px;
  height: 60px;
  border: 1.5px solid #c9a888;
  border-radius: 50%;
  margin: 0 auto 24px;
  position: relative;
}
.gate-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #b87850;
  border-radius: 50%;
}

.gate-eyebrow {
  text-align: center;
  color: #b89878;
  font-size: 12px;
  letter-spacing: 4px;
  margin-bottom: 18px;
}

.gate-title {
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  color: #3a2e2a;
  line-height: 1.35;
  margin-bottom: 14px;
}
.gate-title em {
  font-style: normal;
  color: #b87850;
}

.gate-subtitle {
  text-align: center;
  color: #8a7868;
  font-size: 14px;
  margin-bottom: 32px;
  padding: 0 8px;
}

.feature-list { margin: 24px 0; }
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0e8db;
}
.feature-item:last-child { border-bottom: none; }
.feature-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #f5e6d3;
  color: #b87850;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
}
.feature-text { font-size: 14px; color: #5a4a3e; line-height: 1.6; }

/* ===== Tabs ===== */
.tab-bar {
  display: flex;
  margin-bottom: 0;
  border-bottom: 2px solid #ece0ce;
}
.tab-item {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  color: #b0a08e;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-item.active {
  color: #b87850;
  border-bottom-color: #b87850;
  font-weight: 500;
}
.tab-panel { display: none; padding: 20px 0 0; }
.tab-panel.active { display: block; }

/* ===== Inputs ===== */
.input-group { margin-bottom: 16px; }
.input-label {
  font-size: 13px;
  color: #8a7868;
  margin-bottom: 8px;
  display: block;
}
.input-field {
  width: 100%;
  border: 1.5px solid #ece0ce;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  color: #3a2e2a;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.input-field:focus { border-color: #b87850; }
.input-field::placeholder { color: #c9b8a8; }

.error-msg {
  color: #d4654a;
  font-size: 13px;
  margin-top: 8px;
  display: none;
}
.error-msg.show { display: block; }

.message {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  color: #7ba88a;
}
.message.error { color: #d4654a; }

/* ===== Claimed code box ===== */
.claimed-code-box {
  background: #fdf6ec;
  border: 1.5px dashed #d4b896;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin: 16px 0;
  display: none;
}
.claimed-code-box.show { display: block; }
.claimed-code-label {
  font-size: 12px;
  color: #8a7868;
  margin-bottom: 6px;
}
.claimed-code-value {
  font-size: 20px;
  font-weight: 600;
  color: #b87850;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
}
.claimed-code-hint {
  font-size: 11px;
  color: #a89880;
  margin-top: 8px;
}

/* ===== Info / Disclaimer / FAQ ===== */
.info-section {
  margin: 20px 0;
  padding: 14px 16px;
  background: #fdf6ec;
  border-radius: 12px;
  font-size: 12px;
  color: #7a6858;
  line-height: 1.8;
}
.info-section strong { color: #b87850; }

.disclaimer {
  text-align: center;
  font-size: 11px;
  color: #b0a08e;
  margin: 16px 0;
  line-height: 1.7;
}

.faq-section { margin: 16px 0; }
.faq-item {
  border-bottom: 1px solid #f0e8db;
  padding: 12px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-size: 14px;
  color: #5a4a3e;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::after {
  content: "+";
  font-size: 18px;
  color: #c9a888;
  transition: transform 0.2s;
}
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a {
  font-size: 13px;
  color: #8a7868;
  line-height: 1.7;
  margin-top: 8px;
  display: none;
}
.faq-item.open .faq-a { display: block; }

.demo-notice {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #8a6d3b;
  text-align: center;
  margin-bottom: 16px;
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}
.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ===================================================
   QUIZ SCREEN — 答题页
   =================================================== */
.quiz-header {
  position: sticky;
  top: 0;
  background: #faf6f0;
  padding: 16px 0 8px;
  z-index: 10;
}
.progress-bar {
  height: 3px;
  background: #ece0ce;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: #b87850;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 12px;
  color: #b89878;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dim-tag {
  background: #f5e6d3;
  color: #b87850;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}
.phase-label {
  font-size: 12px;
  color: #b89878;
  margin-top: 6px;
}

.question-text {
  font-size: 17px;
  font-weight: 500;
  color: #3a2e2a;
  line-height: 1.5;
  margin: 28px 0 28px;
  min-height: 60px;
}

.option-list { display: flex; flex-direction: column; gap: 12px; }
.option {
  background: #fff;
  border: 1.5px solid #ece0ce;
  border-radius: 14px;
  padding: 16px;
  font-size: 14px;
  color: #4a3a2e;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.5;
}
.option:active { transform: scale(0.98); }
.option.selected {
  border-color: #b87850;
  background: #fdf6ec;
}
.option.locked { pointer-events: none; }
.option-letter {
  display: inline-block;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: #f5e6d3;
  color: #b87850;
  font-size: 11px;
  font-weight: 500;
  margin-right: 10px;
  vertical-align: middle;
}
.option.selected .option-letter {
  background: #b87850;
  color: #fff;
}

.back-btn {
  position: fixed;
  top: 16px;
  left: 20px;
  z-index: 11;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #ece0ce;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #b87850;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(58,46,42,0.06);
  transition: all 0.2s;
}
.back-btn:active { transform: scale(0.92); }
.back-btn.hidden { opacity: 0; pointer-events: none; }

.quiz-exit-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #c9b8a8;
  text-align: center;
  z-index: 5;
}

/* ===================================================
   RESULT SCREEN — 结果页
   =================================================== */
.result-header {
  text-align: center;
  padding: 36px 0 20px;
}
.result-eyebrow {
  font-size: 11px;
  color: #b89878;
  letter-spacing: 3px;
  margin-bottom: 10px;
}
.result-title {
  font-size: 30px;
  font-weight: 600;
  margin-bottom: 8px;
}
.result-subtitle {
  font-size: 13px;
  color: #8a7868;
  padding: 0 16px;
}

.result-section-title {
  font-size: 12px;
  color: #b89878;
  letter-spacing: 2px;
  margin-bottom: 12px;
  font-weight: 500;
}
.result-text {
  font-size: 15px;
  color: #3a2e2a;
  line-height: 1.85;
  text-align: justify;
}

/* ===== Radar chart ===== */
.radar-wrapper {
  display: flex;
  justify-content: center;
  margin: 8px 0 16px;
}
.score-bars { display: flex; flex-direction: column; gap: 14px; margin: 12px 0 4px; }
.score-row { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #5a4a3e; }
.score-label { flex-shrink: 0; width: 80px; }
.score-track {
  flex: 1;
  height: 8px;
  background: #f5e6d3;
  border-radius: 4px;
  overflow: hidden;
}
.score-fill {
  height: 100%;
  background: #b87850;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.score-value { flex-shrink: 0; width: 36px; text-align: right; font-weight: 500; color: #b87850; }

/* ===== Deep report ===== */
.deep-report { margin: 20px 0; }
.deep-report-header {
  text-align: center;
  margin-bottom: 22px;
}
.deep-report-tag {
  display: inline-block;
  background: #b87850;
  color: #fff;
  font-size: 11px;
  letter-spacing: 3px;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.deep-report-title {
  font-size: 22px;
  font-weight: 600;
  color: #3a2e2a;
  margin-bottom: 6px;
}
.deep-report-subtitle {
  font-size: 12px;
  color: #8a7868;
}
.deep-section {
  background: #fff;
  border-radius: 16px;
  padding: 20px 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(58, 46, 42, 0.04);
}
.deep-section-num {
  display: inline-block;
  background: #fdf6ec;
  color: #b87850;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.deep-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #3a2e2a;
  margin-bottom: 12px;
  line-height: 1.4;
}
.deep-section-text {
  font-size: 14px;
  color: #4a3a2e;
  line-height: 1.85;
  margin-bottom: 8px;
  text-align: justify;
}
.deep-tip {
  background: #fdf6ec;
  border-left: 3px solid #b87850;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 13px;
  color: #5a4a3e;
  line-height: 1.7;
  border-radius: 0 8px 8px 0;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  margin: 14px 0 4px;
  padding-left: 18px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: #ece0ce;
}
.timeline-item {
  position: relative;
  margin-bottom: 18px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -18px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #b87850;
  box-shadow: 0 0 0 3px #faf6f0;
}
.timeline-phase {
  font-size: 12px;
  font-weight: 600;
  color: #b87850;
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.timeline-content {
  font-size: 14px;
  color: #4a3a2e;
  line-height: 1.7;
}

/* ===== Partner card ===== */
.partner-card {
  background: #fdf6ec;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 8px 0;
}
.partner-row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #f0e2cc;
  font-size: 13px;
  line-height: 1.6;
}
.partner-row:last-child { border-bottom: none; }
.partner-label {
  flex-shrink: 0;
  width: 88px;
  color: #8a7868;
}
.partner-value {
  flex: 1;
  color: #3a2e2a;
}

/* ===== Dialogue ===== */
.dialogue-box {
  background: #fdf6ec;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 12px 0;
  font-size: 14px;
  color: #5a4a3e;
  line-height: 1.7;
  position: relative;
}
.dialogue-box::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 16px;
  width: 3px;
  height: 24px;
  background: #b87850;
  border-radius: 2px;
}
.dialogue-box + .dialogue-box { margin-top: 10px; }

/* ===== Share ===== */
.share-section {
  text-align: center;
  margin-top: 24px;
}
.share-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(255,107,107,0.25);
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.share-btn:active { transform: scale(0.97); }
.share-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.copy-btn {
  background: transparent;
  color: #b87850;
  border: 1px solid #e0c9b0;
  border-radius: 12px;
  padding: 13px 28px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
  font-family: inherit;
}
.copy-btn:active { transform: scale(0.97); }
.copy-btn.copied {
  background: #7ba88a;
  color: #fff;
  border-color: #7ba88a;
}

.share-hint {
  font-size: 12px;
  color: #8b7a6a;
  margin-top: 10px;
  line-height: 1.7;
}
.hashtag {
  color: #b87850;
  font-weight: 500;
}

.compliance-footer {
  text-align: center;
  font-size: 11px;
  color: #b0a08e;
  margin: 24px 0;
  line-height: 1.8;
  padding-top: 16px;
  border-top: 1px solid #f0e8db;
}
