/* 全局样式定义 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: #f9f9fb;
  color: #333;
  line-height: 1.5;
}

header.app-header {
  background-color: #3a8dde;
  color: white;
  padding: 1rem;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
}

.view {
  display: block;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

.hidden {
  display: none;
}

/* 按钮样式 */
.primary-btn,
.secondary-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-align: center;
}

.primary-btn {
  background-color: #3a8dde;
  color: #fff;
}
.primary-btn:hover:not(:disabled) {
  background-color: #3176c5;
}
.primary-btn:disabled {
  background-color: #a9c8e7;
  cursor: not-allowed;
}

.secondary-btn {
  background-color: #fff;
  color: #3a8dde;
  border: 1px solid #3a8dde;
}
.secondary-btn:hover {
  background-color: #f4faff;
}

/* 首页样式 */
#home-view .home-content {
  text-align: center;
  margin-top: 2rem;
}
#home-view p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* 基本信息表单 */
#info-view .info-form {
  max-width: 480px;
  margin: 0 auto;
}
#info-view label {
  display: block;
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
}
#info-view input[type="number"],
#info-view select {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.skin-tip {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}
.form-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
}

/* 测试界面 */
#quiz-view .quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.progress-text {
  font-size: 1rem;
  color: #555;
}

.question-container {
  margin-top: 1rem;
  background-color: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.question-text {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: #fafafa;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.option:hover {
  background-color: #f2f8ff;
}
.option.selected {
  background-color: #d6eaff;
  border-color: #3a8dde;
}
.option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

/* 确认页面 */
#confirm-view .confirm-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
#confirm-summary {
  margin: 1rem 0;
  white-space: pre-wrap;
  font-size: 1rem;
}

/* 结果页面 */
#result-view .result-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}
.chart-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}
.score-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}
.score-table th,
.score-table td {
  border: 1px solid #e5e5e5;
  padding: 0.5rem;
  font-size: 0.9rem;
}
.score-table th {
  background-color: #f7f7f7;
  font-weight: 600;
}
.score-table td {
  background-color: #fff;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #0d1117;
    color: #c9d1d9;
  }
  header.app-header {
    background-color: #103f72;
  }
  .question-container {
    background-color: #161b22;
    border-color: #30363d;
  }
  .option {
    background-color: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
  }
  .option:hover {
    background-color: #172038;
  }
  .option.selected {
    background-color: #0a4667;
    border-color: #2384c5;
  }
  .primary-btn {
    background-color: #2384c5;
  }
  .primary-btn:hover:not(:disabled) {
    background-color: #1b6da0;
  }
  .secondary-btn {
    background-color: #0d1117;
    border-color: #2384c5;
    color: #2384c5;
  }
  .secondary-btn:hover {
    background-color: #172038;
  }
  .score-table th {
    background-color: #0f1723;
  }
  .score-table td {
    background-color: #0d1117;
  }
}