/* 两阶段意识形态测试 - 主样式文件 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 300;
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.progress-container {
  background: #f8f9fa;
  height: 8px;
  position: relative;
}

.progress-bar {
  background: linear-gradient(90deg, #667eea, #764ba2);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 0 4px 4px 0;
}

.survey-content {
  padding: 0;
}

.page {
  display: block;
}

.section-header {
  background: #f8f9fa;
  padding: 25px 30px;
  border-bottom: 1px solid #e9ecef;
}

.section-header h2 {
  color: #495057;
  font-size: 1.8rem;
  margin-bottom: 8px;
  font-weight: 500;
}

.section-header p {
  color: #6c757d;
  font-size: 1rem;
}

.question {
  padding: 40px 30px;
}

.question-title {
  font-size: 1.4rem;
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 30px;
  line-height: 1.5;
}

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

.option {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.option:hover {
  background: #e9ecef;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.option input[type="radio"] {
  margin-right: 15px;
  transform: scale(1.2);
  accent-color: #667eea;
}

.option input[type="radio"]:checked + span {
  font-weight: 600;
  color: #667eea;
}

.option:has(input:checked) {
  background: linear-gradient(135deg, #667eea20, #764ba220);
  border-color: #667eea;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.buttons {
  display: flex;
  justify-content: space-between;
  padding: 25px 30px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.btn-prev, .btn-next, .btn-restart {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-prev:hover, .btn-next:hover, .btn-restart:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-prev:disabled, .btn-next:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.page-indicator {
  text-align: center;
  padding: 15px 30px;
  background: #f8f9fa;
  color: #6c757d;
  font-weight: 500;
  border-top: 1px solid #e9ecef;
}

.score-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 20px 30px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.badge {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.thank-you-message {
  text-align: center;
  padding: 60px 30px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.thank-you-message i {
  font-size: 4rem;
  color: #28a745;
  margin-bottom: 20px;
}

.thank-you-message h2 {
  color: #2c3e50;
  font-size: 2.2rem;
  margin-bottom: 15px;
  font-weight: 500;
}

.thank-you-message p {
  color: #6c757d;
  font-size: 1.1rem;
  margin-bottom: 30px;
}

.results {
  background: white;
  border-radius: 15px;
  padding: 30px;
  margin: 20px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* 结果页面样式 */
.main-result-card {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 30px;
  border-radius: 15px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.result-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 500;
}

.match-score {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 1.1rem;
}

.result-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.result-description {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 25px;
  opacity: 0.95;
}

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.score-label {
  min-width: 80px;
  font-weight: 500;
}

.score-value {
  min-width: 30px;
  font-weight: 600;
  font-size: 1.1rem;
}

.score-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.terms-card, .specific-card, .other-matches-card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  margin-bottom: 20px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  border: 1px solid #e9ecef;
}

.terms-card h3, .specific-card h3, .other-matches-card h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.4rem;
  font-weight: 600;
}

.terms-list, .specific-terms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.term-tag, .specific-term-tag {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
  transition: transform 0.2s ease;
}

.term-tag:hover, .specific-term-tag:hover {
  transform: translateY(-2px);
}

.specific-description {
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.other-matches-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.other-match-item {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #667eea;
  transition: transform 0.2s ease;
}

.other-match-item:hover {
  transform: translateX(5px);
}

.other-match-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.other-match-score {
  color: #667eea;
  font-weight: 500;
  margin-bottom: 10px;
}

.other-match-details {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  color: #6c757d;
}

.other-match-details span {
  background: white;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.save-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px 15px;
  border-radius: 25px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.save-indicator i {
  margin-right: 8px;
  color: #28a745;
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    border-radius: 10px;
  }
  
  .header {
    padding: 20px;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .question {
    padding: 30px 20px;
  }
  
  .question-title {
    font-size: 1.2rem;
  }
  
  .buttons {
    padding: 20px;
    flex-direction: column;
    gap: 15px;
  }
  
  .btn-prev, .btn-next, .btn-restart {
    width: 100%;
    justify-content: center;
  }
  
  .section-header {
    padding: 20px;
  }
  
  .section-header h2 {
    font-size: 1.5rem;
  }
  
  .score-badges {
    padding: 15px 20px;
  }
  
  .badge {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.8rem;
  }
  
  .question-title {
    font-size: 1.1rem;
  }
  
  .option {
    padding: 12px 15px;
    font-size: 0.9rem;
  }
  
  .thank-you-message {
    padding: 40px 20px;
  }
  
  .thank-you-message h2 {
    font-size: 1.8rem;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page {
  animation: fadeIn 0.5s ease;
}

.option {
  animation: fadeIn 0.3s ease;
}

/* 加载状态 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: #6c757d;
}

.loading i {
  margin-right: 10px;
  animation: spin 1s linear infinite;
}

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

/* 错误状态 */
.error {
  color: #dc3545;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 15px;
  border-radius: 5px;
  margin: 20px 0;
}

/* 成功状态 */
.success {
  color: #155724;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 15px;
  border-radius: 5px;
  margin: 20px 0;
}

/* 欢迎界面样式 */
.welcome-content {
  padding: 60px 30px;
  text-align: center;
}

.welcome-content h2 {
  color: #2c3e50;
  font-size: 2.2rem;
  margin-bottom: 15px;
  font-weight: 500;
}

.welcome-content > p {
  color: #6c757d;
  font-size: 1.2rem;
  margin-bottom: 40px;
}

.mode-selection {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.mode-card {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 15px;
  padding: 30px;
  width: 300px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.mode-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
  border-color: #667eea;
}

.mode-card h3 {
  color: #2c3e50;
  font-size: 1.6rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.mode-card p {
  color: #6c757d;
  margin-bottom: 10px;
  font-size: 1rem;
}

.mode-description {
  color: #495057 !important;
  font-style: italic;
  margin-bottom: 25px !important;
  font-size: 0.95rem !important;
}

.btn-mode-select {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  width: 100%;
}

.btn-mode-select:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.mode-card:hover .btn-mode-select {
  background: linear-gradient(135deg, #5a6fd8, #6a4190);
}

/* 响应式设计 - 欢迎界面 */
@media (max-width: 768px) {
  .welcome-content {
    padding: 40px 20px;
  }
  
  .welcome-content h2 {
    font-size: 1.8rem;
  }
  
  .mode-selection {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  
  .mode-card {
    width: 100%;
    max-width: 350px;
    padding: 25px;
  }
}

@media (max-width: 480px) {
  .welcome-content h2 {
    font-size: 1.6rem;
  }
  
  .welcome-content > p {
    font-size: 1.1rem;
  }
  
  .mode-card {
    padding: 20px;
  }
  
  .mode-card h3 {
    font-size: 1.4rem;
  }
}

/* 清除缓存按钮样式 */
.clear-cache-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: rgba(108, 117, 125, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-cache-btn:hover {
  background: rgba(220, 53, 69, 0.9);
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.clear-cache-btn:active {
  transform: scale(0.95);
}

/* 响应式设计 - 清除缓存按钮 */
@media (max-width: 768px) {
  .clear-cache-btn {
    width: 35px;
    height: 35px;
    font-size: 0.8rem;
    bottom: 15px;
    left: 15px;
  }
}

@media (max-width: 480px) {
  .clear-cache-btn {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
    bottom: 10px;
    left: 10px;
  }
}
