:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1f2a27;
  --muted: #5d6b67;
  --line: #e3e0d8;
  --accent: #2f6f5e;
  --accent-soft: #e4f0eb;
  --ok: #1e7a46;
  --ok-soft: #e3f4ea;
  --ng: #b3412f;
  --ng-soft: #fbe9e5;
  --block1: #e8a33d;
  --block2: #d9604c;
  --block3: #2f6f5e;
  --ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161b1a;
    --surface: #1e2523;
    --text: #e8ece9;
    --muted: #a3b0ac;
    --line: #34403c;
    --accent: #7cc4ad;
    --accent-soft: #23362f;
    --ok: #7fd3a0;
    --ok-soft: #1f3528;
    --ng: #f08f7d;
    --ng-soft: #3d2420;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, var(--ja);
}
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.ja { font-family: var(--ja); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
h1 { font-size: 1.85rem; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 12px; }

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.logo { font-weight: 700; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.blocks { display: inline-flex; gap: 2px; align-items: flex-end; }
.blocks i { display: block; width: 8px; height: 8px; border-radius: 2px; background: var(--block1); }
.blocks i:nth-child(2) { height: 13px; background: var(--block2); }
.blocks i:nth-child(3) { height: 18px; background: var(--block3); }
nav a { margin-left: 14px; text-decoration: none; font-weight: 600; }
nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

main { padding: 28px 16px 40px; }
section { margin-bottom: 36px; }
.hero { padding-top: 8px; }
.lead { font-size: 1.08rem; color: var(--muted); margin: 0; }

.levels { display: grid; gap: 12px; }
.level-card {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); text-decoration: none;
}
.level-card:hover { border-color: var(--accent); }
.level-text { display: flex; flex-direction: column; flex: 1; }
.level-text span { color: var(--muted); font-size: 0.93rem; }
.arrow { color: var(--accent); font-size: 1.3rem; }
.level-badge {
  display: inline-grid; place-items: center; min-width: 52px; height: 52px; border-radius: 10px;
  background: var(--accent); color: var(--surface); font-weight: 800; font-size: 1.15rem;
}
.level-badge.small { min-width: 40px; height: 40px; font-size: 0.95rem; }

.points ul { padding-left: 20px; margin: 0; }
.points li { margin-bottom: 8px; }

.book-list { display: grid; gap: 10px; margin: 12px 0; }
.book { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.book > div { flex: 1; font-size: 0.95rem; }
.disclosure { font-size: 0.9rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; }

.btn {
  display: inline-block; padding: 11px 18px; border-radius: 10px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--surface); font-weight: 700; text-decoration: none; font-size: 1rem; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--accent); white-space: nowrap; }

.crumb { font-size: 0.9rem; color: var(--muted); margin: 0 0 8px; }
.quiz { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 16px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.task { margin: 0 0 10px; font-weight: 600; display: flex; gap: 10px; align-items: baseline; }
.qnum { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 0.9rem; }
.stem { font-size: 1.2rem; line-height: 2.1; margin: 0 0 12px; }
.usage-word { font-weight: 700; }
.target { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
rt { font-size: 0.55em; }
.slot { display: inline-block; width: 3.2em; border-bottom: 2px solid var(--text); margin: 0 3px; text-align: center; line-height: 1.4; }
.slot.star { color: var(--ng); }

.options { display: grid; gap: 8px; }
.options.cols-4 { grid-template-columns: repeat(4, 1fr); }
.options.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) {
  .options.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .options.cols-2 { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .book { flex-wrap: wrap; }
}
.opt {
  display: flex; gap: 10px; align-items: baseline; text-align: left; width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font-size: 1.05rem; line-height: 1.9; cursor: pointer;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt .num { color: var(--muted); font-weight: 700; font-family: system-ui, sans-serif; }
.opt:disabled { cursor: default; }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.correct .num { color: var(--ok); }
.opt.wrong { border-color: var(--ng); background: var(--ng-soft); }
.opt.wrong .num { color: var(--ng); }

.explain { margin-top: 12px; }
.explain summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.explain p { margin: 8px 0 0; }
.answer-line strong { font-size: 1.1rem; }
.translation { font-style: italic; color: var(--muted); }
.full { font-size: 1.1rem; }
.verdict { font-weight: 700; margin-right: 6px; }
.verdict.ok { color: var(--ok); }
.verdict.ng { color: var(--ng); }

.result, .cta { background: var(--accent-soft); border-radius: 12px; padding: 20px; }
.cta { background: var(--surface); border: 2px solid var(--accent); }
.other-levels a { margin-left: 10px; font-weight: 700; }

.prose h2 { margin-top: 28px; }
.prose ul { padding-left: 20px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; padding: 20px 0 32px; }
.site-footer p { margin: 0 0 8px; }
