/* components.css — 组件样式 · 温暖明亮主题 */

/* ── Card ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px 20px;
  margin-top: 16px;
  box-shadow: var(--shadow-md);
}
.card.centered { text-align: center; padding: 32px 24px; }

/* ── Buttons ── */
.btn {
  display: inline-block; padding: 14px 32px; border-radius: var(--radius-btn);
  font-size: .92rem; font-weight: 600; cursor: pointer; text-align: center;
  border: none; transition: all .25s ease; letter-spacing: .5px;
  font-family: var(--font-stack);
}
.btn-primary {
  background: linear-gradient(135deg, var(--btn-primary), var(--btn-primary-hover));
  color: var(--btn-text); width: 100%;
  box-shadow: 0 4px 14px var(--btn-shadow);
}
.btn-primary:active { transform: scale(.97); opacity: .92; }
.btn-ghost {
  background: var(--card-bg); color: var(--text-accent);
  border: 1.5px solid var(--btn-primary); width: 100%;
}
.btn-ghost:active { background: var(--bg-warm); }
.btn-sm { padding: 10px 24px; font-size: .78rem; width: auto; }
.btn-group { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }

/* ── Progress ── */
.progress-wrap { padding: 8px 0 12px; }
.progress-bar {
  height: 4px; background: rgba(180, 150, 110, 0.12);
  border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--btn-primary), var(--btn-primary-hover));
  border-radius: 2px; transition: width .5s ease;
}
.progress-label {
  font-size: .72rem; color: var(--text-secondary); text-align: right; margin-top: 6px;
}

/* ── Question ── */
.q-title {
  font-size: 1.05rem; font-weight: 600; color: var(--text);
  margin-bottom: 8px; line-height: 1.7;
}
.q-subtitle {
  font-size: .84rem; color: var(--text-secondary);
  margin-bottom: 20px; font-style: italic; line-height: 1.6;
}

/* ── Text Options ── */
.options { display: flex; flex-direction: column; gap: 9px; }
.option {
  display: block; width: 100%; padding: 15px 18px;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm); background: var(--card-bg);
  font-size: .92rem; color: var(--text); text-align: left; cursor: pointer;
  transition: all .18s ease; font-family: var(--font-stack); line-height: 1.6;
  box-shadow: var(--shadow-sm);
}
.option:active, .option.selected {
  background: rgba(200, 150, 80, 0.06);
  border-color: var(--btn-primary);
  box-shadow: 0 0 0 3px rgba(200, 150, 80, 0.08);
}
.option input[type=radio], .option input[type=checkbox] { display: none; }

/* ── OH Card Grid ── */
.oh-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 16px;
}
.oh-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer;
  transition: all .2s ease;
  border: 1.5px solid var(--card-border);
  box-shadow: var(--shadow-sm);
}
.oh-card:active, .oh-card.selected {
  border-color: var(--oh-card-selected);
  box-shadow: 0 0 0 3px rgba(200, 150, 80, 0.1), var(--shadow-md);
}
.oh-card .oh-image {
  height: 110px; display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; background: var(--card-bg-alt);
}
.oh-card .oh-label {
  padding: 10px 8px; text-align: center; font-size: .80rem;
  color: var(--text-secondary);
}
.oh-card.selected .oh-label { color: var(--text-accent); font-weight: 600; }

/* ── Body Map ── */
.body-map-wrap { text-align: center; margin: 16px 0; }
.body-map {
  position: relative; width: 160px; height: 280px; margin: 0 auto;
}
.body-map svg { width: 100%; height: 100%; }
.body-part {
  fill: rgba(180, 150, 110, 0.08); stroke: rgba(180, 150, 110, 0.2);
  stroke-width: 1; cursor: pointer; transition: all .25s;
}
.body-part:hover, .body-part.selected {
  fill: rgba(200, 150, 80, 0.15); stroke: var(--btn-primary);
  filter: drop-shadow(0 0 6px rgba(200, 150, 80, 0.25));
}
.body-label { font-size: .72rem; color: var(--text-secondary); margin-top: 8px; }

/* ── Text Input ── */
.text-input {
  width: 100%; min-height: 100px; padding: 14px 16px;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm); font-size: .92rem;
  font-family: var(--font-stack); line-height: 1.75;
  color: var(--text); background: var(--card-bg);
  resize: vertical; transition: border-color .25s, box-shadow .25s;
}
.text-input:focus {
  outline: none; border-color: var(--btn-primary);
  box-shadow: 0 0 0 3px rgba(200, 150, 80, 0.08);
}
.text-input::placeholder { color: rgba(140, 128, 112, 0.3); }
.text-input-sm {
  min-height: 56px; margin-top: 10px;
  border-style: dashed;
  font-size: .84rem;
}

/* ── Fallback hint for open_first questions ── */
.q-fallback-hint {
  font-size: .78rem; color: var(--text-secondary);
  margin: 16px 0 8px; font-style: italic;
}

/* ── No-option style (说不清/我不确定 etc.) ── */
.option.no-option {
  color: var(--text-secondary);
  border-style: dashed;
  font-size: .82rem;
}
.option.no-option.selected {
  color: var(--text-accent);
  border-color: var(--btn-primary);
}

/* ── Question Nav ── */
.q-nav { display: flex; gap: 10px; margin-top: 24px; }
.q-nav button {
  flex: 1; padding: 13px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--card-border);
  background: var(--card-bg); font-size: .88rem;
  color: var(--text); cursor: pointer; font-family: var(--font-stack);
  transition: all .2s; box-shadow: var(--shadow-sm);
}
.q-nav button:active { background: var(--bg-warm); }
.q-nav button.primary {
  background: linear-gradient(135deg, var(--btn-primary), var(--btn-primary-hover));
  border-color: transparent; color: var(--btn-text); font-weight: 600;
  box-shadow: 0 4px 14px var(--btn-shadow);
}

/* ── Loading ── */
.loading { text-align: center; padding: 60px 20px; }
.dot-pulse { display: flex; justify-content: center; gap: 10px; margin: 28px 0; }
.dot-pulse span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--btn-primary);
  animation: bounce 1.2s infinite;
}
.dot-pulse span:nth-child(2) { animation-delay: .2s; }
.dot-pulse span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Report ── */
.report-section {
  margin-bottom: 20px; padding: 0 4px; line-height: 2;
}
.report-section .section-title {
  font-size: .88rem; font-weight: 600; color: var(--text-accent);
  margin-bottom: 10px; letter-spacing: .5px;
}
.report-section .section-body { font-size: .94rem; line-height: 2.1; }

.report-section.imagery {
  border-left: 3px solid var(--btn-primary); padding-left: 16px;
  background: rgba(200, 150, 80, 0.03); border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.report-section.contradiction {
  background: rgba(200, 150, 80, 0.05); border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 28px 0;
  border: 1px solid rgba(200, 150, 80, 0.1);
}
.report-section.contradiction .section-title { color: var(--text-accent); }
.report-section.desire {
  border-left: 3px solid var(--safe-green); padding-left: 16px;
}

/* ── CTA Box ── */
.cta-box {
  background: linear-gradient(135deg, rgba(200, 150, 80, 0.06), rgba(200, 150, 80, 0.02));
  border-radius: var(--radius-card); padding: 24px; text-align: center;
  margin-top: 20px; border: 1px solid rgba(200, 150, 80, 0.1);
  box-shadow: var(--shadow-sm);
}
.cta-box h3 { font-size: .92rem; color: var(--text); margin-bottom: 14px; font-weight: 600; }

/* ── Paywall Card ── */
.paywall-card { text-align: center; padding: 32px 24px; }
.paywall-card .wechat-id {
  font-size: 1.1rem; color: var(--text-accent); font-weight: 600;
  margin: 20px 0; letter-spacing: .5px;
}

/* ── Crisis Page ── */
.crisis-page { text-align: center; padding: 40px 20px; }
.crisis-page .crisis-message {
  font-size: .92rem; color: var(--text); line-height: 2.1; margin-bottom: 24px;
}

/* ── Entry Grid (首页功能入口 2×2) ── */
.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4px;
}
.entry-tile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 26px 14px 22px;
  cursor: pointer;
  transition: all .25s ease;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.entry-tile:active {
  background: var(--bg-warm);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.entry-tile .entry-icon {
  font-size: 2.2rem;
  width: 60px; height: 60px; display: flex; align-items: center; justify-content: center;
  border-radius: 18px;
  background: var(--card-bg-alt);
  border: 1px solid var(--card-border);
  margin-bottom: 14px;
}
.entry-tile .entry-name {
  font-size: .95rem; font-weight: 600; color: var(--text);
  margin-bottom: 4px; line-height: 1.3;
}
.entry-tile .entry-desc {
  font-size: .78rem; color: var(--text-secondary); line-height: 1.4;
}
.entry-tile .entry-meta {
  font-size: .68rem; color: rgba(140, 128, 112, 0.45); margin-top: 6px;
}
.entry-tile .entry-arrow {
  position: absolute; top: 12px; right: 14px;
  font-size: .9rem; color: rgba(140, 128, 112, 0.3);
  transition: transform .25s;
}
.entry-tile:active .entry-arrow { transform: translate(2px, -2px); }

.entry-tile.disabled {
  opacity: .4; pointer-events: none;
}
.entry-tile.disabled .entry-icon {
  opacity: .55;
}
.entry-tile.disabled .entry-arrow {
  display: none;
}

/* ── Home Intro ── */
.home-intro {
  text-align: center; margin: 28px 0 36px;
  font-size: 1.05rem; color: var(--text-secondary);
  line-height: 2.3; letter-spacing: .3px;
}

/* ── Home Footer ── */
.home-footer {
  text-align: center; padding: 28px 16px 8px;
}
.home-footer p {
  font-size: .68rem; color: rgba(140, 128, 112, 0.4);
}

/* ── Staggered reveal for entry tiles ── */
.entry-grid .entry-tile { animation: cardReveal .5s ease-out both; }
.entry-grid .entry-tile:nth-child(1) { animation-delay: .06s; }
.entry-grid .entry-tile:nth-child(2) { animation-delay: .14s; }
.entry-grid .entry-tile:nth-child(3) { animation-delay: .22s; }
.entry-grid .entry-tile:nth-child(4) { animation-delay: .30s; }

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ── Section Label (保留以备后用) ── */
.section-label {
  text-align: center; padding: 40px 16px 8px;
}
.section-label p {
  font-size: .95rem; color: var(--text-accent); font-weight: 500;
}

/* ── Dream Report Sections ── */
.report-section.boundary {
  background: rgba(180,150,110,.06);
  border-left: 2px solid rgba(180,150,110,.2);
  padding: 14px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .84rem;
  color: var(--text-secondary);
  line-height: 1.9;
}
.report-section.dream-second-episode {
  background: linear-gradient(135deg, rgba(200,160,120,.06) 0%, rgba(220,200,170,.04) 100%);
  border: 1px dashed rgba(190,150,100,.2);
  border-radius: var(--radius-sm);
  padding: 20px 18px;
  font-style: italic;
  line-height: 2;
}
.report-section.body-residue {
  border-left: 2px solid rgba(160,130,100,.15);
  padding-left: 14px;
}
.report-section.association {
  border-left: 2px solid rgba(140,160,180,.15);
  padding-left: 14px;
}
.report-section.summary {
  background: rgba(180,150,110,.04);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.report-section.module-transfer {
  border-top: 1px solid var(--card-border);
  padding-top: 18px;
  margin-top: 12px;
  font-size: .82rem;
  color: var(--text-secondary);
}
.report-section.module-transfer .transfer-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(180,150,110,.05);
  border-radius: var(--radius-xs);
  margin-top: 8px;
  font-size: .8rem;
  color: var(--text-accent);
  cursor: pointer;
  transition: background .2s;
}
.report-section.module-transfer .transfer-hint:active {
  background: rgba(180,150,110,.12);
}

/* ── Crisis Page ── */
.crisis-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.crisis-actions .btn {
  width: 100%;
  padding: 14px 20px;
  font-size: .88rem;
}
.crisis-page {
  text-align: center;
  padding-top: 40px;
}
.crisis-page .card {
  display: inline-block;
  text-align: left;
  padding: 28px 22px;
}
.crisis-message {
  font-size: .92rem;
  color: var(--text);
  line-height: 2;
}

/* ── Safety Banner ── */
.safety-banner {
  background: rgba(200,120,100,.06);
  border: 1px solid rgba(200,120,100,.15);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: .78rem;
  color: #8c6a5a;
  line-height: 1.8;
}

/* ── WeChat / Mobile fixes ── */
input, textarea { font-size: 16px; }
* { -webkit-touch-callout: none; }
