:root {
  --primary: #4CAF50;
  --primary-light: #81C784;
  --primary-bg: #E8F5E9;
  --accent: #FFC107;
  --text: #333333;
  --text-secondary: #666666;
  --white: #FFFFFF;
  --error: #F44336;
  --success: #4CAF50;
  --border-radius: 8px;
  --max-width: 480px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background-color: #f5f5f5;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  min-height: 100vh;
  background: var(--white);
}

/* 顶部标题栏 */
.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  width: 110px;
  height: auto;
  flex-shrink: 0;
}

.header-text {
  color: var(--white);
}

.header-text h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.header-text p {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.95;
  margin-top: 2px;
}

/* 首页 */
.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.home-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.home-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 26px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-start:active {
  transform: scale(0.96);
}

/* 装饰元素 */
.decoration {
  position: absolute;
  opacity: 0.08;
  pointer-events: none;
}

.decoration-book {
  top: 10%;
  left: -20px;
  width: 120px;
  height: 120px;
}

.decoration-cap {
  bottom: 15%;
  right: -30px;
  width: 140px;
  height: 140px;
}

/* 答题页 */
.quiz-content {
  padding: 20px 16px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  border: 1px solid var(--primary-light);
  background: var(--white);
  color: var(--primary);
  font-size: 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.question-card {
  background: var(--primary-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
}

.question-type-badge {
  display: inline-block;
  padding: 2px 10px;
  background: var(--primary);
  color: var(--white);
  font-size: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.question-content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  font-weight: 500;
}

.options-list {
  list-style: none;
  margin-bottom: 24px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--white);
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
}

.option-item:active {
  background: var(--primary-bg);
}

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.option-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #e0e0e0;
  color: var(--text);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.option-item.selected .option-label {
  background: var(--primary);
  color: var(--white);
}

.option-text {
  font-size: 15px;
  line-height: 1.5;
  padding-top: 2px;
}

.essay-input {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
}

.essay-input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-submit {
  display: block;
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-submit:active {
  opacity: 0.9;
}

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

.loading-text {
  text-align: center;
  padding: 60px 0;
  color: var(--text-secondary);
  font-size: 16px;
}

/* 结果页 */
.result-content {
  padding: 24px 16px;
  text-align: center;
}

.result-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.result-icon.correct {
  background: var(--primary-bg);
}

.result-icon.wrong {
  background: #FFEBEE;
}

.result-status {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.result-status.correct {
  color: var(--success);
}

.result-status.wrong {
  color: var(--error);
}

.result-card {
  background: #f9f9f9;
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: left;
  margin-bottom: 24px;
}

.result-card h3 {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.result-card p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.result-card + .result-card {
  margin-top: -16px;
  margin-bottom: 24px;
}

.btn-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  margin-top: 8px;
}

.btn-retry:active {
  opacity: 0.9;
}

/* 通用 */
.text-center {
  text-align: center;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

/* SVG装饰样式 */
.deco-svg {
  position: absolute;
  pointer-events: none;
  opacity: 0.06;
}
