/* 缘分测试页面样式 v2 — 金色中式主题 */
@import "variables.css";

body {
  background: linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-warm-end) 100%);
}

/* 免责声明提示 */
.disclaimer-tip {
  background: rgba(255, 193, 7, 0.95);
  padding: 8px 15px calc(env(safe-area-inset-bottom) + 8px) 15px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  border-radius: 0;
  cursor: pointer;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1100;
}
.disclaimer-icon { font-size: 18px; margin-right: 10px; }
.disclaimer-text { flex: 1; font-size: 13px; color: var(--text-primary); }
.disclaimer-arrow { font-size: 18px; color: var(--text-secondary); }

/* 缘分类型选择 */
.fate-type-section { margin: 20px 0; }
.section-title { font-size: 16px; font-weight: bold; color: var(--text-primary); margin-bottom: 15px; }
.fate-types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.fate-type-item {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 20px 15px;
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}
.fate-type-item:active { transform: scale(0.97); }
.fate-type-item.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 4px 16px rgba(212,175,55,0.25);
}
.type-icon { font-size: 36px; margin-bottom: 8px; }
.type-name { font-size: 16px; font-weight: bold; color: var(--text-primary); margin-bottom: 5px; }
.type-desc { font-size: 12px; color: var(--text-muted); }

/* 用户卡片 */
.user-card { background: var(--bg-card); border-radius: var(--radius-xl); padding: 20px; margin-bottom: 15px; box-shadow: var(--shadow-md); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.card-label { font-size: 16px; font-weight: bold; color: var(--text-primary); }
.input-row { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.input-row:last-child { border-bottom: none; }
.input-label { width: 80px; font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.input-field { flex: 1; font-size: 14px; color: var(--text-primary); border: none; outline: none; background: transparent; }
.input-field::placeholder { color: var(--text-muted); }
.gender-options { display: flex; gap: 12px; }
.gender-option { padding: 8px 24px; background: var(--bg-page); border-radius: 20px; font-size: 14px; color: var(--text-secondary); cursor: pointer; transition: all 0.3s ease; }
.gender-option.active { background: linear-gradient(135deg, var(--primary) 0%, #f0d060 100%); color: #fff; }

/* 连接线 */
.connection-line { display: flex; justify-content: center; align-items: center; height: 40px; position: relative; margin: 10px 0; }
.connection-line::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--primary), #f0d060); }
.heart-icon { font-size: 28px; background: var(--bg-page); padding: 5px; position: relative; z-index: 1; animation: heartbeat 1.5s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }

/* 开始测算按钮 */
.calculate-btn {
  width: 100%; height: 50px;
  background: linear-gradient(135deg, #d4af37 0%, #c49b2a 50%, #f0d060 100%);
  color: #fff; font-size: 16px; font-weight: bold;
  border-radius: 25px; border: none; margin-top: 20px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(212,175,55,0.35);
  letter-spacing: 2px;
}
.calculate-btn:active { transform: scale(0.98); }

/* ========== 结果展示 ========== */
.result-section { margin-top: 30px; animation: fadeIn 0.6s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.result-card {
  background: linear-gradient(180deg, #fffdf5 0%, var(--bg-card) 30%);
  border-radius: var(--radius-xl);
  padding: 30px 20px;
  margin-bottom: 15px;
  border: 1px solid rgba(212,175,55,0.12);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
/* 顶部装饰线 */
.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d4af37, #f0d060, #d4af37);
}

/* 结果类型标签 */
.result-type-tag { text-align: center; margin-bottom: 20px; }
.result-type-tag span {
  background: linear-gradient(135deg, #d4af37 0%, #c49b2a 100%);
  padding: 8px 24px; border-radius: 20px;
  font-size: 14px; color: #fff; font-weight: 500;
  box-shadow: 0 2px 8px rgba(212,175,55,0.3);
}

/* 分数圆圈 */
.score-circle {
  width: 160px; height: 160px; border-radius: 50%;
  background: linear-gradient(135deg, #d4af37 0%, #c49b2a 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 0 8px rgba(212,175,55,0.1), 0 8px 32px rgba(212,175,55,0.3);
  position: relative;
}
.score-circle::after {
  content: '';
  position: absolute; inset: -12px;
  border-radius: 50%;
  border: 2px dashed rgba(212,175,55,0.25);
  animation: spin 20s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.score-circle.level-perfect {
  background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
  box-shadow: 0 0 0 8px rgba(255,107,157,0.1), 0 8px 32px rgba(255,107,157,0.3);
}
.score-circle.level-great {
  background: linear-gradient(135deg, #d4af37 0%, #b8941e 100%);
}
.score-circle.level-good {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  box-shadow: 0 0 0 8px rgba(17,153,142,0.1), 0 8px 32px rgba(17,153,142,0.3);
}
.score-circle.level-normal {
  background: linear-gradient(135deg, #a0a0a0 0%, #888 100%);
  box-shadow: 0 0 0 8px rgba(160,160,160,0.1), 0 8px 32px rgba(160,160,160,0.2);
}
.score-circle.level-low {
  background: linear-gradient(135deg, #999 0%, #777 100%);
  box-shadow: 0 0 0 8px rgba(150,150,150,0.1), 0 8px 32px rgba(150,150,150,0.2);
}

.score-number { font-size: 52px; font-weight: bold; color: #fff; line-height: 1; text-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.score-label { font-size: 14px; color: rgba(255,255,255,0.9); margin-top: 5px; }

/* 缘分等级 */
.fate-level {
  text-align: center; font-size: 22px; font-weight: bold;
  padding: 10px 30px; border-radius: 25px;
  display: block; width: fit-content; margin: 0 auto 24px;
  color: #fff; letter-spacing: 2px;
}
.fate-level.level-perfect { background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%); }
.fate-level.level-great { background: linear-gradient(135deg, #d4af37 0%, #b8941e 100%); }
.fate-level.level-good { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.fate-level.level-normal { background: linear-gradient(135deg, #a0a0a0 0%, #888 100%); }
.fate-level.level-low { background: linear-gradient(135deg, #999 0%, #777 100%); }

/* 详细分析区域 */
.ai-analysis {
  background: linear-gradient(135deg, #fefcf3 0%, #f8f4e8 100%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(212,175,55,0.1);
}
.analysis-title {
  font-size: 17px; font-weight: bold; color: #8B6914;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid rgba(212,175,55,0.15);
}
.analysis-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
  animation: slideUp 0.4s ease-out both;
}
.analysis-section:nth-child(2) { animation-delay: 0.05s; }
.analysis-section:nth-child(3) { animation-delay: 0.1s; }
.analysis-section:nth-child(4) { animation-delay: 0.15s; }
.analysis-section:nth-child(5) { animation-delay: 0.2s; }
.analysis-section:nth-child(6) { animation-delay: 0.25s; }
.analysis-section:nth-child(7) { animation-delay: 0.3s; }
.analysis-section:nth-child(8) { animation-delay: 0.35s; }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.analysis-section:last-child { margin-bottom: 0; }
.section-label {
  font-size: 14px; font-weight: 600; color: #8B6914;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(212,175,55,0.1);
  display: flex; align-items: center; gap: 4px;
}
.section-content {
  font-size: 14px; color: #555; line-height: 1.9;
  white-space: pre-wrap; word-wrap: break-word;
}

/* 命理发现标签 */
.findings-section { margin-top: 16px; }
.findings-title { font-size: 15px; font-weight: 600; color: #333; margin-bottom: 10px; }
.findings-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.finding-tag { font-size: 13px; padding: 6px 12px; border-radius: 8px; line-height: 1.4; }
.finding-positive { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.finding-negative { background: rgba(239,68,68,0.08); color: #dc2626; border: 1px solid rgba(239,68,68,0.15); }

/* 纳音信息 */
.nayin-info { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; font-size: 14px; color: #666; flex-wrap: wrap; }
.nayin-label { color: #999; }
.nayin-value { background: linear-gradient(135deg, #d4af37 0%, #f0d060 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 600; }
.nayin-vs { color: #ccc; font-size: 12px; }

/* 开运元素 */
.lucky-elements { margin-top: 20px; margin-bottom: 20px; }
.lucky-elements-title { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 12px; }
.lucky-elements-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lucky-el-card {
  background: linear-gradient(135deg, #fffdf5 0%, #fef8e0 100%);
  border: 1px solid rgba(212,175,55,0.18);
  border-radius: 12px; padding: 14px 10px; text-align: center;
  box-shadow: 0 2px 8px rgba(212,175,55,0.06);
  transition: transform 0.2s;
}
.lucky-el-card:active { transform: scale(0.97); }
.lucky-el-icon { font-size: 24px; margin-bottom: 6px; }
.lucky-el-label { font-size: 12px; color: #999; margin-bottom: 3px; }
.lucky-el-value { font-size: 15px; font-weight: 600; color: #8B6914; }

/* 开运小贴士 */
.lucky-tip {
  margin-top: 16px; padding: 16px 18px;
  background: linear-gradient(135deg, rgba(212,175,55,0.08) 0%, rgba(240,208,96,0.14) 100%);
  border-radius: 14px; font-size: 15px; color: #8B6914;
  text-align: center; border: 1px solid rgba(212,175,55,0.15);
  font-weight: 500; letter-spacing: 1px;
}

/* 建议标签 */
.suggestions, .cautions {
  margin-bottom: 20px; padding: 20px;
  background: var(--bg-card); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.suggestions-title, .cautions-title {
  font-size: 16px; font-weight: bold; color: var(--text-primary);
  margin-bottom: 15px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.suggestion-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  background: linear-gradient(135deg, rgba(212,175,55,0.12) 0%, rgba(240,208,96,0.18) 100%);
  color: #8B6914; font-size: 13px; padding: 8px 16px; border-radius: 20px;
  border: 1px solid rgba(212,175,55,0.15);
}
.caution-list { font-size: 14px; color: var(--text-secondary); }
.caution-item {
  padding: 10px 0 10px 24px; position: relative; line-height: 1.7; margin-bottom: 8px;
  background: rgba(245,166,35,0.04); border-radius: 8px; padding-right: 12px;
}
.caution-item:last-child { margin-bottom: 0; }
.caution-item::before { content: '⚠'; position: absolute; left: 4px; top: 10px; font-size: 14px; }

/* 重新测算按钮 */
/* 子类型选择 */
.sub-type-section { margin: -4px 0 16px; animation: fadeIn 0.3s ease-out; }
.sub-type-options { display: flex; flex-wrap: wrap; gap: 10px; }
.sub-type-item {
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
}
.sub-type-item:active { transform: scale(0.96); }
.sub-type-item.active {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: var(--primary);
  color: #8B6914;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(212,175,55,0.18);
}

.recalculate-btn {
  width: 100%; height: 50px;
  background: #fff; color: #d4af37;
  font-size: 16px; font-weight: bold;
  border-radius: 25px; border: 2px solid #d4af37;
  cursor: pointer; letter-spacing: 2px;
  transition: all 0.2s;
}
.recalculate-btn:active { background: #fffdf5; transform: scale(0.98); }

/* 免责声明弹窗 */
.disclaimer-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.disclaimer-mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); }
.disclaimer-content { position: relative; background: var(--bg-card); border-radius: var(--radius-xl); padding: 24px; margin: 20px; max-width: 400px; max-height: 80vh; overflow-y: auto; z-index: 1; }
.disclaimer-title { font-size: 18px; font-weight: bold; color: var(--text-primary); margin-bottom: 15px; text-align: center; }
.disclaimer-body { margin-bottom: 20px; }
.disclaimer-body .disclaimer-text { font-size: 14px; line-height: 1.8; color: var(--text-secondary); text-align: justify; }
.disclaimer-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.disclaimer-btn { padding: 12px; border-radius: var(--radius-md); font-size: 16px; cursor: pointer; border: none; }
.disclaimer-btn.cancel { background: var(--bg-page); color: var(--text-secondary); }
.disclaimer-btn.confirm { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; }


/* 响应式 */
@media screen and (min-width: 768px) {
  .main-content {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
  }
}
