/* ===== RPI 情侣占有欲指数测评 — 全局样式 ===== */

:root {
  --purple-deep: #6c5ce7;
  --purple-light: #a29bfe;
  --pink: #fd79a8;
  --pink-light: #ffeef5;
  --coral: #ff6b6b;
  --teal: #00cec9;
  --bg: #faf0f5;
  --bg-card: #fff;
  --text: #2d3436;
  --text-muted: #636e72;
  --text-light: #b2bec3;
  --border: #eee;
  --shadow: 0 4px 20px rgba(108, 92, 231, 0.1);
  --shadow-hover: 0 8px 30px rgba(108, 92, 231, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-w: 420px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== 容器 ===== */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===== 顶部装饰 ===== */

.decor-top {
  height: 180px;
  background: linear-gradient(135deg, var(--purple-deep), var(--pink));
  border-radius: 0 0 40px 40px;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}

.decor-top::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  top: -80px;
  right: -40px;
}

.decor-top::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  bottom: -30px;
  left: 30px;
}

.decor-top .logo {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 2px;
  white-space: nowrap;
  z-index: 2;
}

.brand-logo {
  display: block;
  height: 28px;
  margin: 0 auto;
}

.decor-top .brand-bar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.decor-top .brand-bar .brand-logo {
  height: 26px;
}

/* 白色版 logo (用在渐变背景上) */
.brand-logo-white {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* 底部品牌栏 */

.brand-footer {
  text-align: center;
  padding: 20px 0 28px;
}

.brand-footer .brand-logo {
  height: 24px;
  opacity: 0.55;
}

.brand-footer .brand-text {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 6px;
}

/* ===== 卡片 ===== */

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  margin-top: -30px;
  position: relative;
  z-index: 1;
}

.card + .card {
  margin-top: 16px;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--purple-deep), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* ===== 表单 ===== */

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition);
  outline: none;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
}

.form-input:focus {
  border-color: var(--purple-deep);
}

.form-input::placeholder {
  letter-spacing: 0;
  color: var(--text-light);
}

/* 选择按钮组 */

.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-btn {
  flex: 1 1 auto;
  min-width: calc(50% - 4px);
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}

.option-btn:hover {
  border-color: var(--purple-light);
}

.option-btn.active {
  border-color: var(--purple-deep);
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(253, 121, 168, 0.08));
  color: var(--purple-deep);
  font-weight: 600;
}

/* ===== 按钮 ===== */

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-deep), var(--pink));
  color: #fff;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(108, 92, 231, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: #fff;
  color: var(--purple-deep);
  border: 2px solid var(--purple-light);
}

.btn-secondary:hover {
  background: rgba(108, 92, 231, 0.05);
}

/* ===== 进度条 ===== */

.progress-container {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 12px 0 8px;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-deep), var(--pink));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== 答题页 ===== */

.quiz-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.question-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  margin-bottom: 16px;
  animation: fadeInUp 0.3s ease;
}

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

.question-number {
  display: inline-block;
  background: linear-gradient(135deg, var(--purple-deep), var(--pink));
  color: #fff;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
}

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

.likert-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.likert-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  gap: 12px;
}

.likert-option:hover {
  border-color: var(--purple-light);
  background: rgba(108, 92, 231, 0.03);
}

.likert-option.selected {
  border-color: var(--purple-deep);
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(253, 121, 168, 0.06));
}

.likert-dot {
  width: 22px;
  height: 22px;
  border: 2px solid var(--text-light);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.likert-option.selected .likert-dot {
  border-color: var(--purple-deep);
  background: var(--purple-deep);
}

.likert-option.selected .likert-dot::after {
  content: "";
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}

.likert-label {
  font-size: 0.95rem;
  color: var(--text);
}

/* 答题导航 */

.quiz-nav {
  display: flex;
  gap: 12px;
  padding: 16px 0 32px;
}

.quiz-nav .btn {
  flex: 1;
}

/* ===== 分析动画 ===== */

.analyzing-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 20px;
}

.analyzing-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-deep), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 24px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.analyzing-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.analyzing-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.analyzing-steps {
  margin-top: 24px;
  text-align: left;
}

.analyzing-step {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0;
  opacity: 0.3;
  transition: opacity 0.5s;
}

.analyzing-step.active {
  opacity: 1;
  color: var(--purple-deep);
  font-weight: 600;
}

.analyzing-step.done {
  opacity: 0.6;
}

/* ===== 结果页 ===== */

.result-hero {
  text-align: center;
  padding: 24px 0 8px;
}

.result-emoji {
  font-size: 3rem;
  margin-bottom: 8px;
}

.result-score {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-deep), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.result-score-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 8px;
}

.result-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 雷达图容器 */

.radar-container {
  width: 100%;
  height: 340px;
  margin: 0 -8px;
  width: calc(100% + 16px);
}

/* 维度详情 */

.dim-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dim-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dim-name {
  font-size: 0.85rem;
  font-weight: 600;
  width: 72px;
  flex-shrink: 0;
  text-align: right;
}

.dim-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.dim-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

.dim-value {
  font-size: 0.8rem;
  font-weight: 700;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* 描述卡片 */

.result-desc {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.8;
}

.advice-list {
  list-style: none;
  padding: 0;
}

.advice-list li {
  position: relative;
  padding: 8px 0 8px 24px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.advice-list li::before {
  content: "💡";
  position: absolute;
  left: 0;
  top: 8px;
}

/* MBTI 关联 (now inside report-section) */

.mbti-match {
  font-weight: 700;
  color: var(--purple-deep);
  margin-bottom: 8px;
}

.mbti-insight {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}

/* 底部 CTA */

.result-footer {
  text-align: center;
  padding: 24px 0 40px;
}

.result-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ===== 知情同意 ===== */

.consent-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-height: 200px;
  overflow-y: auto;
  padding: 12px;
  background: #f8f8fa;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.consent-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  cursor: pointer;
}

.consent-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple-deep);
}

.consent-check label {
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

/* ===== 错误提示 ===== */

.error-msg {
  color: var(--coral);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 8px;
  min-height: 1.2em;
}

/* ===== 屏幕切换 ===== */

.screen {
  display: none;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ===== Loading ===== */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

/* ===== 响应式 ===== */

@media (max-width: 360px) {
  .card { padding: 20px 16px; }
  .question-text { font-size: 0.95rem; }
  .result-score { font-size: 3rem; }
}

/* ===== 视角切换 ===== */

.perspective-tabs {
  display: flex;
  background: #f0eef5;
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 20px;
}

.perspective-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition);
}

.perspective-tab.active {
  background: #fff;
  color: var(--purple-deep);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ===== 安全区域 ===== */

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* ===== 报告页增强样式 ===== */

/* 大渐变 Hero 卡片 */
.result-hero-card {
  background: linear-gradient(135deg, #6c5ce7 0%, #8b5cf6 40%, #a78bfa 70%, #c084fc 100%);
  border-radius: var(--radius);
  padding: 32px 24px;
  margin-top: 0;
  position: relative;
  z-index: 1;
  color: #fff;
  text-align: center;
}

.score-ring {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  position: relative;
}

.score-ring-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.score-ring-label {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.7);
}

.hero-level {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.hero-subtitle-text {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 16px;
}

.hero-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hero-tag {
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  font-size: 0.8rem;
  color: #fff;
  font-weight: 500;
}

.hero-quote {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.9);
  font-style: italic;
  line-height: 1.6;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.2);
}

/* 报告区块 — 白色卡片包裹标题+内容 */
.report-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 16px;
}

/* 区块标题 - 竖线风格 (在卡片内部) */
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--purple-deep);
}

.section-heading-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

/* 核心特质卡片 */
.trait-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 10px;
  border-left: 3px solid var(--purple-deep);
}

.trait-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--purple-deep);
  margin-bottom: 6px;
}

.trait-desc {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.7;
}

/* 恋爱建议 - 编号列表 */
.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
}

.tip-number {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--purple-deep), var(--purple-light));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tip-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
}

/* 情侣匹配 */
.match-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
}

.match-label {
  font-size: 0.8rem;
  color: var(--purple-deep);
  font-weight: 600;
  margin-bottom: 6px;
}

.match-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  width: 120px;
  flex-shrink: 0;
}

.match-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.match-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-deep), var(--purple-light));
  border-radius: 4px;
  transition: width 1s ease;
}

.match-score {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple-deep);
  width: 36px;
  text-align: right;
}

/* MBTI 职业标签 */
.career-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.career-tag {
  padding: 6px 14px;
  border: 1.5px solid var(--purple-light);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text);
}

/* 底部渐变结语卡片 */
.ending-card {
  background: linear-gradient(135deg, #6c5ce7 0%, #8b5cf6 50%, #a78bfa 100%);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  color: #fff;
  margin-top: 8px;
}

.ending-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.ending-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 16px;
}

.ending-divider {
  width: 60px;
  height: 1px;
  background: rgba(255,255,255,0.3);
  margin: 0 auto 16px;
}

.ending-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.95);
}

/* 维度分析 2列 */
.dim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dim-grid-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.dim-grid-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.dim-grid-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.dim-grid-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.dim-grid-score {
  text-align: right;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Score ring SVG in hero */
.score-ring svg {
  width: 100%;
  height: 100%;
}
