:root {
  --green: #58cc02;
  --green-dark: #46a302;
  --green-light: #e8f9d8;
  --orange: #ff9600;
  --red: #ff4b4b;
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #3c3c3c;
  --text-muted: #8e8e93;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 420px;
  min-height: 100%;
  margin: 0 auto;
  padding: 24px 20px calc(24px + var(--safe-bottom));
}

.screen {
  display: none;
  animation: fadeIn 0.35s ease;
}

.screen.active {
  display: block;
}

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

/* 首页 */
.hero {
  text-align: center;
  padding: 32px 0 24px;
}

.logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 24px rgba(88, 204, 2, 0.35);
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}

.intro-list {
  list-style: none;
}

.intro-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 15px;
  line-height: 1.5;
  border-bottom: 1px solid #f0f0f5;
}

.intro-list li:last-child {
  border-bottom: none;
}

.intro-list .icon {
  font-size: 18px;
  flex-shrink: 0;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--green), var(--green-dark));
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--green-dark), 0 8px 20px rgba(88, 204, 2, 0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--green-dark);
}

.hint {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* 测试页 */
.test-header {
  margin-bottom: 20px;
}

.vocab-estimate-line {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
}

.progress-wrap {
  height: 8px;
  background: #e8e8ed;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), #7ee022);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}

.timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 14px;
  font-weight: 700;
}

.timer.urgent {
  background: #ffe8e8;
  color: var(--red);
  animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
  to {
    transform: scale(1.05);
  }
}

.word-card {
  text-align: center;
  padding: 36px 20px;
  margin-bottom: 20px;
}

.phonetic {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 8px;
  min-height: 22px;
}

.word {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  font-size: 16px;
  line-height: 1.4;
  border: 2px solid #e8e8ed;
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option:active:not(:disabled) {
  border-color: var(--green);
  background: var(--green-light);
}

.option.correct {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green-dark);
}

.option.wrong {
  border-color: var(--red);
  background: #fff0f0;
  color: var(--red);
}

.option:disabled {
  cursor: default;
}

.extra-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn-extra {
  flex: 1;
  padding: 14px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn-no-answer {
  background: #fff8ee;
  color: #c67600;
  border: 2px solid #ffd699;
}

.btn-unknown {
  background: #f5f5f7;
  color: var(--text-muted);
  border: 2px solid #e8e8ed;
}

.btn-extra:active:not(:disabled) {
  opacity: 0.85;
}

.btn-extra.correct {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green-dark);
}

.btn-extra.wrong {
  border-color: var(--red);
  background: #fff0f0;
  color: var(--red);
}

.btn-extra:disabled {
  cursor: default;
}

.btn-finish {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 2px solid var(--green);
  border-radius: 14px;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-finish.hidden {
  display: none;
}

.finish-hint {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}

.finish-hint.hidden {
  display: none;
}

/* 结果页 */
.result-hero {
  text-align: center;
  padding: 28px 0;
}

.result-label {
  font-size: 15px;
  color: var(--text-muted);
}

.result-number {
  font-size: 52px;
  font-weight: 800;
  color: var(--green-dark);
  margin: 8px 0;
  line-height: 1.1;
}

.result-range {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.level-badge {
  display: inline-block;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--orange), #ffb340);
  color: #fff;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
}

.stats-card .stat-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f5;
  font-size: 15px;
}

.stats-card .stat-row:last-child {
  border-bottom: none;
}

.stats-card strong {
  color: var(--green-dark);
}

.result-advice-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.advice-card {
  margin-bottom: 0;
  padding: 16px;
}

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

.advice-card p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
  min-height: 1.65em;
}

#screen-result {
  padding-bottom: 8px;
}

#screen-result .btn-primary {
  margin-top: 8px;
}
