:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --primary: #0f766e;
  --primary-contrast: #e0f2f1;
  --text: #0f172a;
  --muted: #475569;
  --accent: #f59e0b;
  --danger: #dc2626;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1rem 2rem;
  background: var(--bg);
  color: var(--text);
}

header {
  text-align: center;
  padding: 2rem 0 1rem;
}

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

.subtitle {
  color: var(--muted);
  margin-top: 0.25rem;
}

main {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

select,
button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  background: var(--card);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

button:hover,
select:focus {
  border-color: var(--primary);
}

button {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

button.secondary {
  background: var(--primary-contrast);
  color: var(--text);
  border-color: var(--border);
}

.card {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: #fefefe;
}

.hidden {
  display: none;
}

.pill {
  display: inline-block;
  background: var(--primary-contrast);
  color: var(--primary);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  margin-right: 0.35rem;
  border: 1px solid var(--border);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.prompt {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.75rem 0 1rem;
}

.options {
  display: grid;
  gap: 0.5rem;
}

.option-btn {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  text-align: left;
  width: 100%;
}

.option-btn.correct {
  border-color: var(--primary);
  background: #ecfdf3;
}

.option-btn.incorrect {
  border-color: var(--danger);
  background: #fef2f2;
}

.feedback {
  min-height: 1.5rem;
  margin-top: 0.5rem;
  font-weight: 600;
}

.feedback.correct {
  color: var(--primary);
}

.feedback.incorrect {
  color: var(--danger);
}

.post-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.status {
  color: var(--muted);
  font-size: 0.95rem;
}

.wrong-list-content {
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.95rem;
}

.wrong-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wrong-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wrong-index {
  width: 2rem;
  font-weight: 600;
}

.wrong-en {
  font-weight: 600;
}

.wrong-zh {
  opacity: 0.85;
}

.wrong-level-pill {
  margin-left: auto;
  font-size: 0.75rem;
}

footer {
  text-align: center;
  margin-top: 1rem;
  color: var(--muted);
}

.subtle {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .controls {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  button,
  select {
    width: 100%;
  }

  .post-actions {
    flex-direction: column;
  }
}