/* ============================================================
   PHTI 摄影人格测试 — 样式
   Mobile-First / 最小 14px / 按钮 44px
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1e1e1e;
  --text: #f0f0f0;
  --text-secondary: #999;
  --border: #2a2a2a;
  --result-primary: #2D5F8A;
  --result-secondary: #E8F1F8;
  --result-accent: #F5A623;
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* --- Pages --- */
.page {
  display: none;
  min-height: 100dvh;
  padding: 0 20px;
}
.page.active { display: flex; flex-direction: column; }

/* --- 首页 --- */
#page-home {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
}

.home-icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.home-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.home-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  letter-spacing: 6px;
  margin-bottom: 24px;
}

.home-slogan {
  font-size: 1.125rem;
  color: var(--result-accent);
  margin-bottom: 32px;
  font-weight: 500;
}

.home-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.8;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 200px;
  padding: 14px 40px;
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 26px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 2px;
}
.btn-primary:active { transform: scale(0.96); }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4); }
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.home-footer {
  margin-top: 32px;
  font-size: 0.75rem;
  color: #555;
}

.home-credits {
  margin-top: 16px;
  font-size: 0.7rem;
  color: #444;
  line-height: 1.8;
}

/* 首页连点彩蛋 */
.home-icon { cursor: pointer; user-select: none; }
.home-egg {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  animation: egg-fade 2s ease forwards;
}
@keyframes egg-fade {
  0% { opacity: 0; transform: translateY(6px); }
  15% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

/* --- 答题页（滑动长页面） --- */
#page-quiz {
  padding-top: 0;
}

.quiz-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 16px 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 50px;
  text-align: right;
}

/* 题目滚动区 */
.quiz-scroll {
  flex: 1;
  padding-bottom: 20px;
}

.quiz-question {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.quiz-question:last-child {
  border-bottom: none;
}

.quiz-question.answered {
  opacity: 1;
}

.quiz-question.unanswered-highlight {
  border-left: 3px solid #ef4444;
  padding-left: 12px;
  margin-left: -15px;
}

.question-text {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.7;
}

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

.option-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.option-btn:active { transform: scale(0.98); }
.option-btn:hover { border-color: #6366f1; }
.option-btn.selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}
.option-hint {
  font-size: 0.7rem;
  color: #888;
  font-style: italic;
  margin: -4px 0 6px 4px;
}

/* Q25 换选彩蛋 */
.option-switch-egg {
  font-size: 0.75rem;
  color: #F58220;
  font-style: italic;
  margin-top: 4px;
  animation: egg-fade 1.5s ease forwards;
}

/* 答题底部区域 */
.quiz-footer {
  padding: 24px 0 40px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.quiz-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.quiz-missing {
  font-size: 0.85rem;
  color: #ef4444;
  margin-bottom: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-submit {
  margin-top: 8px;
}

.quiz-footer-hint {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* --- 加载页 --- */
#page-loading {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--surface-2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1rem;
  color: var(--text-secondary);
  transition: opacity 0.3s;
}

/* --- 结果页 --- */
#page-result {
  padding-bottom: 100px;
}

.result-section {
  margin-bottom: 24px;
}

/* 品牌阵营卡片 */
.brand-card {
  text-align: center;
  padding: 28px 20px 20px;
  margin-top: 20px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 700;
}

.brand-emoji { font-size: 1.3rem; }

/* 索尼金色闪光 */
.brand-badge.sony-flash {
  position: relative;
  overflow: hidden;
}
.brand-badge.sony-flash::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,210,80,0.4) 50%, transparent 60%);
  animation: sony-shine 1.2s ease-out 0.3s;
  opacity: 0;
}
@keyframes sony-shine {
  0% { left: -60%; opacity: 1; }
  100% { left: 120%; opacity: 0; }
}

.brand-short {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.faith-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  font-size: 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
}

/* 人格代表图占位 */
.personality-avatar-wrap {
  text-align: center;
  padding: 12px 0 0;
}

.personality-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 3px solid rgba(255,255,255,0.15);
}

/* 人格大标题 */
.personality-header {
  text-align: center;
  padding: 12px 0;
}

.personality-code {
  font-size: 1rem;
  letter-spacing: 6px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.code-breakdown {
  font-size: 0.75rem;
  color: #666;
  line-height: 1.6;
  margin-top: 2px;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.code-letters {
  letter-spacing: 3px;
}

.personality-name {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--result-primary);
  margin-bottom: 4px;
}

.personality-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* 缩写注释 */
.abbr-note {
  display: block;
  font-size: 0.7rem;
  color: #666;
  margin-top: 6px;
  font-style: italic;
  text-align: center;
}

/* 题材DNA */
.genre-tag {
  text-align: center;
  padding: 8px 0;
}

.genre-tag span {
  display: inline-block;
  padding: 6px 18px;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.genre-emoji { margin-right: 4px; }

/* 一句话 */
.oneliner {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: 0 10px;
  line-height: 1.7;
}

/* 副人格 */
.sub-personality {
  text-align: center;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.sub-label { color: var(--text-secondary); }
.sub-code { color: var(--result-accent); font-weight: 700; }

/* Section 标题 */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon { font-size: 1.2rem; }

/* 体检报告 */
.report-code {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  white-space: pre;
  color: #a5b4fc;
}

/* 理想 vs 现实 */
.vs-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vs-item {
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}

.vs-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.vs-text {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* 语录样式 */
.quote-box {
  padding: 16px 20px;
  background: var(--surface);
  border-left: 3px solid var(--result-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  line-height: 1.7;
  font-style: italic;
}

/* 一句治愈 */
.healing-box {
  padding: 20px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}

.healing-icon { font-size: 1.5rem; margin-bottom: 8px; }

.healing-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
}

/* 四维度指示条 */
.dim-row {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dim-code {
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}
.dim-left { color: var(--result-primary); }
.dim-right { color: var(--result-accent); }

.dim-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  position: relative;
}

.dim-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: var(--result-primary);
  border: 2px solid var(--result-accent);
  border-radius: 50%;
}

.dim-score {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: -4px;
}

.match-score-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 8px 0;
}

.border-tip {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

/* 展开按钮 */
.expand-section {
  text-align: center;
  padding: 8px 0;
}

.btn-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 28px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-expand:hover { border-color: #6366f1; }
.btn-expand:active { background: var(--surface-2); }

/* 可展开详情 */
.result-details.collapsed {
  display: none;
}

/* 人格图鉴 */
.gallery-section {
  text-align: center;
  padding: 8px 0;
}

.gallery-list.collapsed {
  display: none;
}

.gallery-list {
  margin-top: 16px;
  text-align: left;
}

.gallery-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.gallery-item.gallery-me {
  border-color: var(--result-primary);
  box-shadow: 0 0 0 1px var(--result-primary);
}

.gallery-header {
  padding: 14px 16px;
  cursor: pointer;
}

.gallery-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-code {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--result-accent);
  letter-spacing: 2px;
}

.gallery-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.gallery-me-tag {
  font-size: 0.7rem;
  color: var(--result-primary);
  font-weight: 700;
}

.gallery-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.gallery-breakdown {
  font-size: 0.7rem;
  color: #666;
  margin-top: 2px;
}

.gallery-oneliner {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
  font-style: italic;
}

.gallery-detail.collapsed {
  display: none;
}

.gallery-detail-inner {
  padding: 0 16px 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.gallery-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 4px;
}
.gallery-section-label:first-child {
  margin-top: 0;
}

.gallery-quote {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
  padding-left: 8px;
  border-left: 2px solid var(--border);
}

.gallery-vs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.gallery-profile-row {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.gallery-profile-label {
  color: var(--result-accent);
  font-weight: 700;
  margin-right: 4px;
}

/* 基础画像 */
.profile-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.profile-item:last-child { border-bottom: none; }

.profile-label {
  display: block;
  font-size: 0.75rem;
  color: var(--result-accent);
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-value {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* 含量雷达 */
.radar-item {
  display: grid;
  grid-template-columns: 70px 1fr 50px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.radar-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.radar-bar-bg {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.radar-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--result-primary), var(--result-accent));
  border-radius: 4px;
  transition: width 0.8s ease;
}

.radar-value {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: right;
}

/* 搭子 & 天敌 */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.match-item {
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.match-label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.match-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--result-accent);
  margin-bottom: 4px;
}

.match-reason {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 成长建议 */
.growth-box {
  padding: 16px 20px;
  background: var(--surface);
  border-left: 3px solid #4FC3F7;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.growth-label {
  font-size: 0.8rem;
  color: #4FC3F7;
  font-weight: 700;
  margin-bottom: 4px;
}

.growth-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* 底部按钮 */
.result-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  z-index: 20;
}

.btn-action {
  flex: 1;
  min-height: 48px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
}
.btn-action:active { transform: scale(0.96); }

.btn-share {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.btn-restart-2 {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

/* --- 分享弹窗 --- */
.share-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.share-modal.active { display: flex; }

.share-modal-inner {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 400px;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  text-align: center;
}

.share-close {
  display: block;
  margin-left: auto;
  width: 36px;
  height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  margin-bottom: 12px;
}

#share-card-content {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

#share-image {
  display: none;
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.share-tip {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* --- 响应式 --- */
@media (min-width: 600px) {
  .page { max-width: 560px; margin: 0 auto; }
  .result-actions { max-width: 560px; margin: 0 auto; left: 0; right: 0; }
}
