/* ===== CSS变量定义 ===== */
:root {
  --primary-color: #4a6fa5;
  --secondary-color: #6c63ff;
  --accent-color: #ff6584;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --gray-light: #e9ecef;
  --gray-medium: #adb5bd;
  --gradient-blue: linear-gradient(135deg, #4a6fa5 0%, #6c63ff 100%);
  --gradient-green: linear-gradient(135deg, #28a745 0%, #7bed9f 100%);
  --gradient-orange: linear-gradient(135deg, #ff9a3c 0%, #ff6b6b 100%);
  --gradient-purple: linear-gradient(135deg, #6c63ff 0%, #b063ff 100%);
  --gradient-light: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.12);
  --shadow-light: 0 3px 10px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
}

/* ===== 全局重置与基础样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gradient-light);
  color: var(--dark-color);
  line-height: 1.6;
  padding: 20px 15px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.container {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.8s ease-out;
}

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

/* ===== 头部样式 ===== */
header {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--gradient-blue);
  color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
  transform: rotate(30deg);
  z-index: 0;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

h1 i {
  color: #ffd166;
  font-size: 2.3rem;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto;
  font-weight: 300;
  position: relative;
  z-index: 1;
}

/* ===== 信息框样式 ===== */
.info-box {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  border-left: 6px solid var(--primary-color);
  transition: var(--transition);
}

.info-box:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.info-box h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-box h2 i {
  color: var(--secondary-color);
  font-size: 1.5rem;
}

.info-box p {
  margin-bottom: 1rem;
  color: #555;
  font-size: 1.05rem;
  line-height: 1.7;
}

.info-box strong {
  color: var(--primary-color);
  font-weight: 600;
}

.auto-next-hint {
  background: linear-gradient(135deg, rgba(74, 111, 165, 0.08) 0%, rgba(108, 99, 255, 0.08) 100%);
  padding: 1.2rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1a6db3;
  border-left: 4px solid var(--primary-color);
  margin-top: 1.5rem;
  font-weight: 500;
}

.auto-next-hint i {
  font-size: 1.5rem;
  color: var(--warning-color);
  animation: pulse 2s infinite;
}

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

/* ===== 进度条样式 ===== */
.progress-container {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 15px;
  z-index: 100;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.1rem;
}

#progressText {
  background: var(--gradient-blue);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-weight: 700;
  box-shadow: var(--shadow-light);
}

.progress-bar-bg {
  height: 12px;
  background: var(--gray-light);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-blue);
  width: 0;
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== 问题卡片样式 ===== */
.question-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.question-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

.question-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--gradient-blue);
  border-radius: 6px 0 0 6px;
}

.question-number {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(74, 111, 165, 0.08);
  z-index: 0;
}

.question-title {
  font-size: 1.3rem;
  color: var(--dark-color);
  margin-bottom: 2rem;
  font-weight: 600;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* ===== 选项容器样式 ===== */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.option {
  padding: 1.2rem 1.5rem;
  border: 2px solid var(--gray-light);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  background: white;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.option:hover {
  border-color: var(--primary-color);
  background: rgba(74, 111, 165, 0.03);
  transform: translateY(-2px);
}

.option.selected {
  border-color: var(--secondary-color);
  background: rgba(108, 99, 255, 0.05);
  box-shadow: 0 5px 15px rgba(108, 99, 255, 0.15);
  transform: translateY(-3px);
}

.option.selected::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--secondary-color);
  border-radius: 0 6px 6px 0;
}

.option-value {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: var(--gray-light);
  border-radius: 50%;
  margin-right: 15px;
  font-weight: 700;
  color: #555;
  flex-shrink: 0;
  font-size: 1.1rem;
  transition: var(--transition);
}

.option.selected .option-value {
  background: var(--gradient-blue);
  color: white;
  box-shadow: 0 4px 10px rgba(108, 99, 255, 0.3);
}

.option-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: #444;
}

/* ===== 按钮组样式 ===== */
.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

button {
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.1rem;
  font-family: inherit;
  flex: 1;
  min-height: 56px;
}

.btn-primary {
  background: var(--gradient-blue);
  color: white;
  box-shadow: 0 5px 15px rgba(74, 111, 165, 0.3);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(74, 111, 165, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--gray-light);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(74, 111, 165, 0.2);
}

.btn-accent {
  background: var(--gradient-orange);
  color: white;
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.btn-accent:hover {
  opacity: 0.9;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== 结果卡片样式 ===== */
.result-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
  text-align: center;
  display: none;
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.result-card h2 {
  color: var(--primary-color);
  margin-bottom: 2rem;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.result-card h2 i {
  color: var(--secondary-color);
  font-size: 2rem;
}

/* ===== 总分样式 ===== */
.total-score {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-color);
  margin: 1.5rem 0 2.5rem;
  padding: 1.5rem;
  background: rgba(74, 111, 165, 0.05);
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  border: 2px solid rgba(74, 111, 165, 0.1);
  position: relative;
  overflow: hidden;
}

.total-score::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-blue);
}

/* ===== 结果容器样式 - 所有屏幕双排显示 ===== */
.result-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

/* ===== 结果项样式 ===== */
.result-item {
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.result-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.result-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
}

.result-label {
  font-weight: 700;
  color: var(--dark-color);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-label::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--secondary-color);
  display: inline-block;
}

.result-value {
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--primary-color);
  background: rgba(74, 111, 165, 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
}

.result-bar-container {
  height: 12px;
  background: var(--gray-light);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-top: auto;
}

.result-bar {
  height: 100%;
  background: var(--gradient-blue);
  width: 0%;
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.result-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

/* ===== 结果说明样式 ===== */
.interpretation {
  background: linear-gradient(135deg, rgba(74, 111, 165, 0.05) 0%, rgba(108, 99, 255, 0.05) 100%);
  border-radius: 12px;
  padding: 1.8rem;
  margin: 2.5rem 0;
  text-align: left;
  border-left: 5px solid var(--primary-color);
  position: relative;
  overflow: hidden;
}

.interpretation::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100px;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: rotate(30deg);
}

.interpretation h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.interpretation p {
  color: #555;
  font-size: 1.05rem;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.interpretation h3 i {
  color: var(--secondary-color);
}

/* ===== 页脚样式 ===== */
footer {
  text-align: center;
  margin-top: 2.5rem;
  padding: 1.5rem;
  color: var(--gray-medium);
  font-size: 0.9rem;
  line-height: 1.6;
  border-top: 1px solid rgba(0,0,0,0.05);
}

/* ================= 统一的小屏幕手机适配 ================= */
@media (max-width: 768px) {
  body {
    padding: 15px 10px;
  }
  
  .container {
    padding: 0;
  }
  
  header {
    padding: 1.5rem 1rem;
    margin-bottom: 1.2rem;
    border-radius: 10px;
  }
  
  h1 {
    font-size: 1.6rem;
    gap: 12px;
  }
  
  h1 i {
    font-size: 1.8rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .info-box {
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.2rem;
  }
  
  .info-box h2 {
    font-size: 1.3rem;
  }
  
  .progress-container {
    padding: 1.2rem;
    border-radius: 10px;
    margin-bottom: 1.2rem;
  }
  
  .question-card {
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.2rem;
  }
  
  .question-title {
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
  }
  
  .question-number {
    font-size: 2rem;
    top: 0.8rem;
    right: 1.2rem;
  }
  
  .options-container {
    gap: 0.8rem;
    margin-bottom: 1.8rem;
  }
  
  .option {
    padding: 1rem 1.2rem;
    border-radius: 8px;
  }
  
  .option-value {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    margin-right: 12px;
  }
  
  .option-text {
    font-size: 1rem;
  }
  
  .button-group {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  button {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    min-height: 50px;
    border-radius: 8px;
  }
  
  /* ===== 移动端结果卡片样式 ===== */
  .result-card {
    padding: 1.8rem 1.2rem;
    border-radius: 10px;
  }
  
  .result-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .total-score {
    font-size: 1.8rem;
    padding: 1.2rem;
    margin: 1.2rem 0 2rem;
    border-radius: 12px;
  }
  
  /* ===== 移动端双排显示结果 ===== */
  .result-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin: 1.5rem 0;
  }
  
  .result-item {
    padding: 1.2rem;
    border-radius: 10px;
  }
  
  .result-item-header {
    margin-bottom: 1rem;
  }
  
  .result-label {
    font-size: 1rem;
  }
  
  .result-value {
    font-size: 1.1rem;
    padding: 0.3rem 0.6rem;
  }
  
  .result-bar-container {
    height: 10px;
    border-radius: 8px;
  }
  
  .interpretation {
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1.8rem 0;
  }
  
  .interpretation h3 {
    font-size: 1.2rem;
  }
  
  footer {
    margin-top: 2rem;
    padding: 1.2rem;
    font-size: 0.85rem;
  }
}