/* 公式クイズ用のスタイル（style.css の続き） */

header {
  flex-wrap: wrap;
  gap: 4px 12px;
}

h1 { white-space: nowrap; }

.page-nav {
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.page-nav a,
.quiz-link {
  color: var(--accent);
}

.link-button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  text-decoration: none;
}

select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

h3 {
  font-size: 0.95rem;
  margin: 16px 0 6px;
}

/* 出題モード */
.mode-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}

.mode-option input {
  display: inline-block;
  width: auto;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.mode-option small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

/* 出題画面 */
.q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.badge {
  background: #e8f0ed;
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
}

.q-text {
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 14px 0;
}

.q-options {
  display: grid;
  gap: 8px;
}

.option-button {
  text-align: left;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 1rem;
  line-height: 1.5;
}

.option-button:hover:not(:disabled) {
  background: #f1f5f3;
  border-color: var(--accent);
}

.option-button:disabled {
  cursor: default;
}

.option-button.correct {
  background: #e3f1ea;
  border-color: #3e8a62;
  color: #1f5a3b;
  font-weight: 600;
}

.option-button.wrong {
  background: #f8e6e6;
  border-color: #b23b3b;
  color: #8a2a2a;
}

.q-feedback {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.95rem;
  line-height: 1.6;
}

.q-feedback p { margin: 0; }
.q-feedback p + p { margin-top: 6px; }

.q-verdict { font-weight: 700; }
.q-verdict.ok { color: #2f7a52; }
.q-verdict.ng { color: #b23b3b; }

.q-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.text-button {
  background: none;
  color: var(--muted);
  padding: 0;
  font-size: 0.85rem;
  text-decoration: underline;
}

.text-button:hover { background: none; color: var(--text); }

.secondary-button {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.secondary-button:hover { background: #f1f5f3; }

/* 結果 */
.result-score {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 4px 0 12px;
}

.wrong-item {
  border-top: 1px solid var(--border);
  padding: 8px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.wrong-item .answer { color: #2f7a52; font-weight: 600; }

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.save-message {
  font-size: 0.85rem;
  color: var(--accent-dark);
}

/* 成績 */
.stats-summary {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.weak-list {
  margin: 0;
  padding-left: 1.4em;
  font-size: 0.9rem;
  line-height: 1.6;
}

.weak-list .rate {
  color: #b23b3b;
  font-weight: 600;
  margin-left: 6px;
  white-space: nowrap;
}

.weak-list .empty { list-style: none; margin-left: -1.4em; color: var(--muted); }
