/**
 * 合盘分析页面样式
 */

/* 页面容器 */
.compatibility-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #2D1B69 0%, #11082A 100%);
  padding: 20px 15px;
  box-sizing: border-box;
}

/* 页面头部 */
.compatibility-header {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  padding: 0 80px; /* 给左右留出空间，避免标题遮挡按钮 */
}

.back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100; /* 提高z-index确保在最上层 */
  pointer-events: auto; /* 确保可以点击 */
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.back-btn:active {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(0.95);
}

.page-title {
  font-size: 28px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1; /* 确保标题在按钮下方 */
}

.header-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 300;
  position: relative;
  z-index: 1; /* 确保副标题在按钮下方 */
}

/* AI生成标记样式 */
.ai-badge {
  display: inline-block;
  background: linear-gradient(135deg, #4CAF50, #2196F3);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 8px;
  font-weight: normal;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* 结果展示区 */
.results-section {
  margin-bottom: 20px;
}

/* 头像对比区 */
.avatars-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 0 20px;
}

.avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.user-avatar {
  background: linear-gradient(135deg, #FF6B8A, #FF8E8E);
}

.partner-avatar {
  background: linear-gradient(135deg, #4ECDC4, #44A08D);
}

.avatar-text {
  font-size: 24px;
  font-weight: bold;
  color: white;
}

.avatar-name {
  font-size: 16px;
  color: white;
  font-weight: 500;
}

.vs-divider {
  font-size: 20px;
  font-weight: bold;
  color: white;
  opacity: 0.8;
  padding: 0 20px;
}

/* 综合评分区 */
.overall-score-section {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.score-title {
  font-size: 18px;
  color: #333;
  margin-bottom: 10px;
  font-weight: 600;
}

.score-value {
  font-size: 48px;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 5px;
}

.score-subtitle {
  font-size: 14px;
  color: #666;
}

/* 三种合盘结果 */
.compatibility-results {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.compatibility-result-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 20px;
  border-left: 4px solid;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.compatibility-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.result-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  gap: 12px;
}

.result-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.result-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
}

.result-score {
  font-size: 24px;
  font-weight: bold;
}

.result-content {
  margin-left: 52px;
}

/* 已移除result-level样式，level字段已被删除 */

.dynamics-title {
  font-size: 16px;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 5px;
}

.dynamics-description {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.result-advice {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.advice-title {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 5px;
}

.advice-content {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  background: rgba(102, 126, 234, 0.05);
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

/* 输入表单区 */
.input-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.form-title {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin-bottom: 25px;
}

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

.form-label {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 10px;
}

/* 性别选择器 */
.gender-selector {
  display: flex;
  gap: 15px;
}

.gender-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.gender-option.active {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  font-weight: 600;
}

.gender-icon {
  font-size: 20px;
}

/* 日历类型选择器 */
.calendar-type-selector {
  display: flex;
  gap: 15px;
}

.calendar-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.calendar-option.active {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  font-weight: 600;
}

.calendar-icon {
  font-size: 18px;
}

/* 日期输入 */
.date-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #E0E0E0;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  transition: border-color 0.3s ease;
  min-width: 80px;
}

.date-input:focus {
  outline: none;
  border-color: #667eea;
}

.date-separator {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.year-input {
  min-width: 100px;
}

/* 日期选择器（下拉框） */
.date-selectors {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-selector {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #E0E0E0;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  transition: border-color 0.3s ease;
  min-width: 80px;
  background-color: white;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 35px;
}

.date-selector:focus {
  outline: none;
  border-color: #667eea;
}

.date-selector:hover {
  border-color: #9ca3af;
}

.year-selector {
  min-width: 100px;
}

/* 时辰选择器 */
.hour-selector {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #E0E0E0;
  border-radius: 8px;
  font-size: 16px;
  background: white;
  transition: border-color 0.3s ease;
}

.hour-selector:focus {
  outline: none;
  border-color: #667eea;
}

/* 分析按钮 */
.analyze-button-container {
  text-align: center;
  margin-top: 30px;
}

.analyze-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 15px 40px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  min-width: 180px;
}

.analyze-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.analyze-btn:active:not(:disabled) {
  transform: translateY(0);
}

.analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .compatibility-page {
    padding: 15px 10px;
  }
  
  .avatars-section {
    padding: 0 10px;
  }
  
  .avatar {
    width: 70px;
    height: 70px;
  }
  
  .avatar-text {
    font-size: 20px;
  }
  
  .score-value {
    font-size: 40px;
  }
  
  .date-inputs {
    flex-direction: column;
    align-items: stretch;
  }
  
  .date-input {
    min-width: auto;
  }
  
  .gender-selector,
  .calendar-type-selector {
    flex-direction: column;
  }
}

/* AI建议Loading样式 */
.advice-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: #667eea;
  font-weight: 500;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 8px;
  border-left: 4px solid #667eea;
  animation: pulse 2s infinite;
}

.advice-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid #667eea;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

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

/* AI生成标记样式优化 */
.ai-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 8px;
  animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 金句Highlight样式 */
highlight {
  background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 600;
  color: #2d3436;
  display: inline-block;
  margin: 0 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: highlightGlow 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

highlight:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  background: linear-gradient(120deg, #74b9ff 0%, #fd79a8 100%);
}

highlight.clicked {
  animation: highlightPulse 0.4s ease-out;
}

highlight:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.6s ease;
}

highlight:hover:before {
  left: 100%;
}

@keyframes highlightGlow {
  0% { 
    transform: scale(1); 
    opacity: 0.7; 
    background: linear-gradient(120deg, #ddd 0%, #eee 100%);
  }
  50% { 
    transform: scale(1.05); 
    opacity: 1; 
  }
  100% { 
    transform: scale(1); 
    opacity: 1; 
    background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
  }
}

@keyframes highlightPulse {
  0% { transform: scale(1); }
  25% { transform: scale(1.1); background: linear-gradient(120deg, #ffd89b 0%, #19547b 100%); }
  50% { transform: scale(1.15); background: linear-gradient(120deg, #667eea 0%, #764ba2 100%); }
  75% { transform: scale(1.1); background: linear-gradient(120deg, #ffd89b 0%, #19547b 100%); }
  100% { transform: scale(1); background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%); }
}

/* 移动端优化 */
@media (max-width: 480px) {
  highlight {
    padding: 2px 6px;
    font-size: 14px;
    border-radius: 6px;
  }

  highlight:hover {
    transform: scale(1.03);
  }
}

/* 相处建议标签样式 */
.advice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.advice-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  font-size: 13px;
  font-weight: 500;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(240, 147, 251, 0.3);
  transition: all 0.3s ease;
  animation: tagFadeIn 0.5s ease-out;
}

.advice-tag:nth-child(2n) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.advice-tag:nth-child(3n) {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  box-shadow: 0 2px 8px rgba(17, 153, 142, 0.3);
}

.advice-tag:nth-child(5n) {
  background: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
  box-shadow: 0 2px 8px rgba(252, 74, 26, 0.3);
}

.advice-tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes tagFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 标签动画延迟 */
.advice-tag:nth-child(1) { animation-delay: 0.1s; }
.advice-tag:nth-child(2) { animation-delay: 0.2s; }
.advice-tag:nth-child(3) { animation-delay: 0.3s; }
.advice-tag:nth-child(4) { animation-delay: 0.4s; }
.advice-tag:nth-child(5) { animation-delay: 0.5s; }

/* 移动端标签优化 */
@media (max-width: 480px) {
  .advice-tags {
    gap: 6px;
  }

  .advice-tag {
    padding: 5px 12px;
    font-size: 12px;
  }
}