/* ===== Deyn English Self-Test — Enid Color Palette ===== */
:root {
  --green: #5E7361;
  --green-light: #8BA08E;
  --pink: #E6B8AF;
  --pink-dark: #C4958C;
  --beige: #F5E4D0;
  --cream: #FCFAF3;
  --primary: #F07167;
  --primary-dark: #D65A50;
  --text: #2D2D2D;
  --text-light: #5A5A5A;
  --text-muted: #8A8A8A;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 18px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.03);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.03);
}

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

body {
  font-family: 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Header ===== */
header {
  background: var(--green);
  color: var(--cream);
  text-align: center;
  padding: 32px 20px 28px;
}
header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  font-family: 'Noto Serif SC', serif;
}
header p {
  font-size: 0.95rem;
  opacity: 0.85;
}

/* ===== Start Screen ===== */
#start-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 40px 20px;
}
.welcome-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.welcome-card h2 {
  font-size: 1.4rem;
  color: var(--green);
  margin-bottom: 12px;
  font-family: 'Noto Serif SC', serif;
}
.welcome-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 24px;
  line-height: 1.7;
}
.student-info {
  text-align: left;
  margin-bottom: 24px;
}
.student-info label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.student-info input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 16px;
}
.student-info input:focus {
  border-color: var(--green);
}

/* ===== Buttons ===== */
button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
  transition: all 0.25s;
}
#startBtn {
  background: var(--primary);
  color: #fff;
  padding: 14px 40px;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(240, 113, 103, 0.3);
}
#startBtn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(240, 113, 103, 0.35);
}

/* ===== Test Container ===== */
#test-container {
  display: none;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.timer {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.timer span {
  color: var(--primary);
  font-weight: 700;
}
.progress-section {
  flex: 1;
  min-width: 120px;
}
.progress-section p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.progress-bar {
  height: 6px;
  background: #e8e8e8;
  border-radius: 3px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Section Header */
.section-header {
  margin-bottom: 16px;
}
#section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--green);
  background: rgba(94, 115, 97, 0.1);
  display: inline-block;
  padding: 6px 18px;
  border-radius: 9999px;
  font-family: 'Noto Sans SC', sans-serif;
}

/* ===== 模块标签 ===== */
.module-badge {
  display: inline-block;
  background: #5E7361;
  color: #fff;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
}

/* Reading Area */
.reading-area {
  display: none;
  margin-bottom: 20px;
}
.reading-box {
  background: #fff;
  border: 1.5px solid var(--beige);
  border-radius: var(--radius);
  padding: 20px;
}
.reading-box h3 {
  font-size: 0.85rem;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.reading-box p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
}

/* Audio Area */
.audio-area {
  display: none;
  margin-bottom: 20px;
}
.audio-box {
  background: #f0f0f0;
  border-left: 4px solid #5E7361;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 0.95rem;
  line-height: 1.7;
}
.audio-box h3 {
  margin: 0 0 10px 0;
  font-size: 1rem;
  color: #5E7361;
}

/* Questions */
#questions-container {
  margin-bottom: 20px;
}
.question-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.question-card h3 {
  font-size: 0.85rem;
  color: var(--pink-dark);
  margin-bottom: 8px;
  font-family: 'Noto Sans SC', sans-serif;
}
.question-card > p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.7;
  white-space: pre-line;
}
.answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.answers label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid #e8e8e8;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  color: var(--text);
}
.answers label:hover {
  border-color: var(--green-light);
  background: rgba(139, 160, 142, 0.05);
}
.answers input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}
.answers input[type="radio"]:checked {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 4px #fff;
}

/* ===== 选项样式 ===== */
.answer-option {
  display: block;
  padding: 12px 16px;
  margin: 8px 0;
  border: 2px solid #e0d8cc;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}
.answer-option:hover {
  border-color: #8BA08E;
  background: #f5f0e8;
}
.answer-option.selected {
  border-color: #5E7361;
  background: #e8f0e6;
}
.answer-option input[type="radio"] {
  margin-right: 10px;
}

/* ===== 特性列表 ===== */
.feature-list {
  text-align: left;
  margin: 16px auto;
  max-width: 360px;
  line-height: 2;
  list-style: none;
  padding: 0;
}

/* Navigation */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
#previousBtn {
  background: #fff;
  color: var(--text);
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1.5px solid #e0e0e0;
}
#previousBtn:hover:not(:disabled) {
  border-color: var(--green-light);
  background: rgba(139, 160, 142, 0.05);
}
#previousBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#nextBtn {
  background: var(--green);
  color: #fff;
  padding: 12px 32px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(94, 115, 97, 0.25);
}
#nextBtn:hover {
  background: var(--green-light);
  transform: translateY(-1px);
}

/* ===== 结果页 ===== */
#results-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 60vh;
  padding: 40px 20px;
}
.results-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.result-header h2 {
  color: #5E7361;
  margin: 0 0 4px 0;
  font-size: 1.5rem;
}
.result-date {
  color: #999;
  font-size: 0.85rem;
  margin: 0 0 20px 0;
}
.result-modules h3,
.result-overall h3,
.result-analysis h3,
.result-recommendation h3 {
  color: #5E7361;
  font-size: 1.1rem;
  margin: 20px 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 2px solid #f0ebe3;
}
.module-result {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  margin: 6px 0;
  background: #fcfaf3;
  border-radius: 10px;
  gap: 10px;
}
.module-result.weakest {
  background: #fff0ed;
  border: 1px solid #f0c0b8;
}
.module-icon { font-size: 1.2rem; }
.module-name { flex: 1; font-weight: 500; }
.module-score { font-weight: 700; color: #5E7361; min-width: 40px; }
.module-rating { min-width: 80px; }
.weak-badge {
  color: #d65a50;
  font-size: 0.8rem;
  font-weight: 600;
}
.total-score {
  font-size: 1.8rem;
  font-weight: 700;
  color: #5E7361;
  margin: 8px 0;
}
.level-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0;
}
.level-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #F07167;
}
.level-cefr {
  font-size: 1rem;
  color: #666;
}
.level-desc {
  color: #555;
  font-size: 0.95rem;
  margin: 8px 0;
  line-height: 1.6;
}
.result-analysis p {
  line-height: 1.6;
  color: #444;
}
.result-recommendation {
  background: #f5f9f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 16px;
}
.rec-course {
  font-size: 1.1rem;
  font-weight: 700;
  color: #5E7361;
  margin: 8px 0;
}
.rec-pitch {
  color: #666;
  margin: 4px 0;
}
.rec-reason {
  color: #888;
  font-size: 0.9rem;
  margin: 8px 0;
}
.rec-button {
  display: inline-block;
  background: #F07167;
  color: #fff;
  padding: 12px 32px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 12px;
  transition: background 0.2s;
}
.rec-button:hover {
  background: #d65a50;
}
.restart-button {
  display: block;
  margin: 24px auto 0;
  background: #8BA08E;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.restart-button:hover {
  background: #5E7361;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
footer a {
  color: var(--green);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  header h1 { font-size: 1.3rem; }
  .welcome-card, .results-card { padding: 28px 20px; }
  .question-card { padding: 18px; }
  .top-bar { flex-direction: column; align-items: stretch; }
  .timer { text-align: center; }
  .navigation-buttons { flex-direction: column; }
  #previousBtn, #nextBtn { width: 100%; justify-content: center; text-align: center; }
}
