/* 全局基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 主容器 */
.container {
  width: 100%;
  max-width: 640px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* 顶部标题 */
header {
  background: #5bb85b;
  color: white;
  padding: 20px;
  text-align: center;
}

h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 16px;
  opacity: 0.9;
}

/* 页面切换区块 */
.section {
  display: none;
  padding: 25px;
}

.section.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

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

/* 欢迎介绍 */
.intro {
  margin-bottom: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.6;
}

.instruction {
  background: #eef9ee;
  border-left: 4px solid #5bb85b;
  padding: 15px;
  margin: 20px 0;
  border-radius: 8px;
}

.instruction h3 {
  margin-bottom: 10px;
  color: #5bb85b;
}

.instruction ul {
  margin-left: 20px;
  margin-top: 10px;
}

.instruction li {
  margin-bottom: 6px;
}

/* 测试页 */
.question-container {
  text-align: center;
  margin-bottom: 25px;
}

.question-number {
  color: #5bb85b;
  font-size: 16px;
  margin-bottom: 10px;
}

.question {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 25px;
  line-height: 1.4;
}

.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 30px;
}

.option-label {
  display: flex;
  align-items: center;
  padding: 15px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.option-label:hover {
  border-color: #4a9a4a;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.option-label.selected {
  border-color: #5bb85b;
  background-color: #f0f9f0;
}

.option-value {
  font-size: 18px;
  font-weight: 600;
  color: #5bb85b;
  margin-right: 15px;
  min-width: 40px;
}

.option-text {
  font-size: 16px;
}

/* 进度条 */
.progress-container {
  height: 10px;
  background: #e9ecef;
  border-radius: 5px;
  margin: 25px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #5bb85b;
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 5px;
}

.progress-text {
  text-align: center;
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 5px;
}

.timer {
  text-align: center;
  margin: 15px 0;
  font-size: 14px;
  color: #6c757d;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 14px 28px;
  background: #5bb85b;
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
  text-align: center;
  width: 100%;
  max-width: 280px;
  box-shadow: 0 4px 10px rgba(91, 184, 91, 0.25);
}

.btn:hover {
  background: #4a9a4a;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(91, 184, 91, 0.3);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-center {
  display: block;
  margin: 25px auto;
}

/* 结果页 */
.big-score-box {
  text-align: center;
  margin: 20px 0;
}
.big-score {
  font-size: 48px;
  font-weight: bold;
  color: #5bb85b;
  margin: 10px 0;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}
.result-table th, .result-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
}
.result-table th {
  background: #f8f9fa;
}
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
}
.badge-normal { background: #5bb85b; }
.badge-mild { background: #8bc34a; }
.badge-moderate { background: #ff9800; }
.badge-severe { background: #f44336; }

#factor-explanations {
  margin-top: 25px;
}
.factor-explain {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 10px;
  background: #f8f9fa;
}
.factor-explain h4 {
  margin-bottom: 8px;
}
.factor-explain .badge {
  margin-right: 8px;
}

.result-box {
  margin-top: 30px;
  padding: 20px;
  background: #eef9ee;
  border-radius: 12px;
  border: 1px solid #cde5cd;
}
.result-box h3 {
  margin-bottom: 15px;
  color: #5bb85b;
}

/* 页脚 */
.footer {
  text-align: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
  color: #6c757d;
  font-size: 14px;
}

.alert {
  padding: 12px 14px;
  margin: 12px 0;
  border-radius: 8px;
  background: #fff3cd;
  color: #7a5d00;
  border: 1px solid #ffeeba;
}
.hidden { display: none; }

/* 移动端适配 */
@media (max-width: 480px) {
  h1 { font-size: 20px; }
  .subtitle { font-size: 14px; }
  .question { font-size: 18px; }
  .btn { font-size: 15px; padding: 12px 20px; }
}
