/* 基础变量与重置 */
:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --light-color: #ecf0f1;
  --gradient-blue: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
  --gradient-light-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-green: linear-gradient(135deg, #28a745 0%, #7bed9f 100%);
  --gradient-accent: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  color: #333;
  line-height: 1.5;
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

/* 公共头部样式 */
header {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--gradient-blue);
  color: white;
  border-radius: 12px 12px 0 0;
  box-shadow: var(--card-shadow);
  margin-bottom: 1rem;
  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.1) 0%, rgba(255,255,255,0) 70%);
  transform: rotate(30deg);
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.subtitle {
  font-size: 0.95rem;
  opacity: 0.9;
  max-width: 500px;
  margin: 0 auto;
  font-weight: 300;
}

/* 信息框样式 */
.info-box {
  background: white;
  border-radius: 10px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--primary-color);
}

.info-box h2 {
  color: var(--secondary-color);
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-box p {
  margin-bottom: 0.8rem;
  color: #555;
  font-size: 0.95rem;
}

.auto-next-hint {
  text-align: center;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: #7f8c8d;
  background: #f8f9fa;
  padding: 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* 进度条样式 */
.progress-container {
  position: sticky;
  top: 0;
  background: white;
  padding: 0.8rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 10;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  padding: 0 0.5rem;
  font-size: 0.9rem;
}

.progress-bar-bg {
  height: 8px;
  background: #e0e6ed;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-light-blue);
  width: 0;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* 问题卡片样式 */
.question-card {
  background: white;
  border-radius: 10px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.question-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.question-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-color);
}

.question-number {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(52, 152, 219, 0.1);
}

.question-title {
  font-size: 1.1rem;
  color: var(--secondary-color);
  margin-bottom: 1.2rem;
  font-weight: 500;
  line-height: 1.4;
}

/* 选项容器 */
.options-container {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 0.6rem;
}

.option {
  padding: 0.9rem;
  border: 1px solid #e0e6ed;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  background: white;
  display: flex;
  align-items: center;
  position: relative;
  font-size: 0.92rem;
}

.option:hover {
  border-color: var(--primary-color);
  background: #f0f8ff;
}

.option.selected {
  border-color: var(--primary-color);
  background: #e1f0fa;
  transform: translateX(3px);
}

.option.selected::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-color);
  border-radius: 3px 0 0 3px;
}

.option-value {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  background: #e0e6ed;
  border-radius: 50%;
  margin-right: 10px;
  font-weight: 600;
  color: #555;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.option.selected .option-value {
  background: var(--primary-color);
  color: white;
}

/* 按钮组 */
.button-group {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.2rem;
  justify-content: space-between;
}

button {
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--gradient-blue);
  color: white;
  box-shadow: 0 3px 8px rgba(52, 152, 219, 0.25);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
  background: white;
  color: var(--secondary-color);
  border: 1px solid #d1d8e0;
}

.btn-secondary:hover {
  background: #f8f9fa;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-accent {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 3px 8px rgba(231, 76, 60, 0.3);
}

.btn-accent:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-green {
  background: var(--gradient-green);
  color: white;
  box-shadow: 0 3px 8px rgba(39, 174, 96, 0.3);
}

.btn-green:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 结果卡片 */
.result-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  text-align: center;
  display: none;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card h2 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  font-size: 1.6rem;
}

/* 总分样式 */
.total-score {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 1rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

/* 结果容器 */
.result-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin: 1.2rem 0;
}

.result-item {
  padding: 0.8rem;
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}

.result-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.result-label {
  font-weight: 600;
  color: var(--secondary-color);
  font-size: 0.92rem;
}

.result-value {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--primary-color);
}

.result-bar-container {
  height: 10px;
  background: #e0e6ed;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.result-bar {
  height: 100%;
  background: var(--gradient-light-blue);
  width: 0%;
  border-radius: 5px;
  transition: width 1s ease;
}

/* 结果说明 */
.interpretation {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin: 1.2rem 0;
  text-align: left;
  border-left: 3px solid var(--primary-color);
  font-size: 0.9rem;
}

.interpretation h3 {
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 专业建议 */
.recommendation {
  background: #fff8f7;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.8rem 0;
  text-align: left;
  border-left: 4px solid var(--accent-color);
}

.recommendation h3 {
  color: var(--accent-color);
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 分数圆圈 */
.score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 auto 1.8rem;
  position: relative;
  background: conic-gradient(var(--primary-color) 0% var(--p), #f0f4f8 var(--p) 100%);
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.2);
}

.score-circle::before {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: white;
}

.score-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--secondary-color);
  position: relative;
  z-index: 1;
}

.score-label {
  font-size: 1.1rem;
  color: #7f8c8d;
  position: relative;
  z-index: 1;
  margin-top: -5px;
}

/* 水平指示器 */
.level-indicator {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0;
  position: relative;
}

.level {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 23%;
}

.level-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #bdc3c7;
  margin-bottom: 10px;
}

.level.active .level-dot {
  background: var(--primary-color);
  transform: scale(1.4);
}

.level-label {
  font-size: 0.9rem;
  text-align: center;
  font-weight: 500;
  color: #7f8c8d;
}

.level.active .level-label {
  color: var(--secondary-color);
  font-weight: 600;
}

.level-line {
  position: absolute;
  top: 7px;
  left: 5%;
  width: 90%;
  height: 2px;
  background: #e0e6ed;
  z-index: 0;
}

/* 页脚 */
footer {
  text-align: center;
  margin-top: 1.5rem;
  padding: 1rem;
  color: #7f8c8d;
  font-size: 0.8rem;
}

/* ================= 响应式调整 ================= */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  header {
    padding: 1.2rem 0.8rem;
  }
  
  h1 {
    font-size: 1.6rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
  }
  
  .question-card {
    padding: 1rem;
  }
  
  .question-title {
    font-size: 1.05rem;
    margin-bottom: 1rem;
  }
  
  .option {
    padding: 0.8rem;
    font-size: 0.88rem;
  }
  
  .option-value {
    width: 22px;
    height: 22px;
    font-size: 0.85rem;
  }
  
  .button-group {
    margin-top: 1rem;
    flex-direction: column;
  }
  
  button {
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    width: 100%;
    justify-content: center;
  }
  
  .result-card {
    padding: 1.2rem;
  }
  
  .result-card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
  }
  
  .total-score {
    font-size: 1.6rem;
    padding: 0.8rem;
    margin: 0.8rem 0;
  }
  
  .result-container {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 1rem 0;
  }
  
  .result-item {
    padding: 0.7rem;
  }
  
  .interpretation, .recommendation {
    padding: 0.9rem;
    margin: 1rem 0;
  }
  
  .interpretation h3, .recommendation h3 {
    font-size: 1rem;
  }
  
  footer {
    margin-top: 1.2rem;
    padding: 0.8rem;
  }
  
  .score-circle {
    width: 140px;
    height: 140px;
  }
  
  .score-circle::before {
    width: 120px;
    height: 120px;
  }
  
  .score-value {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  .info-box {
    padding: 1rem;
  }
  
  .question-number {
    font-size: 1.2rem;
  }
  
  .level {
    width: 30%;
  }
  
  .level-label {
    font-size: 0.8rem;
  }
}