:root {
  --bg: #faf3e0;
  --bg-card: #fffdf5;
  --primary: #5b9fb8;
  --primary-deep: #3a7a92;
  --primary-light: #c8e3ed;
  --accent-yellow: #e3b34a;
  --accent-pink: #ff5e7e;
  --accent-pink-soft: #ffd6df;
  --text: #3d2914;
  --text-soft: #7a6a5a;
  --border: #e8dcc4;
  --correct: #4a8c4a;
  --correct-bg: #e8f3e0;
  --wrong: #c95a5a;
  --wrong-bg: #fde8e8;
}

@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700;800&display=swap');

* { box-sizing: border-box; }

body {
  font-family: 'M PLUS Rounded 1c', -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 18px 80px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  font-weight: 500;
}

a { color: var(--primary-deep); }

/* ヘッダー */
header.site {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 18px;
  border-bottom: 2px dashed var(--border);
  margin-bottom: 28px;
}
header.site .logo-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  flex-shrink: 0;
}
header.site .logo-text {
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  display: block;
  line-height: 1.2;
}
header.site .tagline {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}

/* パンくず */
nav.breadcrumb {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 14px;
}
nav.breadcrumb a {
  color: var(--text-soft);
  text-decoration: none;
}
nav.breadcrumb a:hover { text-decoration: underline; }

/* タイトル：黄色グラデ */
h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.4;
  margin: 8px 0 24px;
  background: linear-gradient(135deg, #f0c662 0%, #c79938 60%, #a87a20 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 0 rgba(0,0,0,0.04);
  padding-bottom: 12px;
  border-bottom: 3px dashed var(--accent-yellow);
}

h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary-deep);
  margin: 44px 0 14px;
  padding: 6px 14px 6px 14px;
  background: var(--primary-light);
  border-radius: 22px 18px 24px 16px / 18px 22px 16px 24px;
  display: inline-block;
}

/* 問題ボックス */
.qbox {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 18px 22px 16px 24px / 20px 18px 22px 16px;
  padding: 22px;
  margin: 16px 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.qstem {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 14px;
  color: var(--text);
}

/* 選択肢：水色枠（アプリ準拠） */
.choices {
  list-style: none;
  padding: 0;
  margin: 0;
}
.choices li {
  background: white;
  border: 2px solid var(--primary-light);
  border-radius: 14px 16px 13px 17px;
  padding: 12px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  font-weight: 500;
}
.choices li:hover {
  background: #f0f8fb;
  transform: translateX(2px);
}
.choices li.correct {
  background: var(--correct-bg);
  border-color: var(--correct);
  color: var(--correct);
  font-weight: 700;
}
.choices li.wrong {
  background: var(--wrong-bg);
  border-color: var(--wrong);
  color: var(--wrong);
}

/* 判定 */
.verdict {
  display: none;
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 14px 18px 14px 18px;
  font-weight: 700;
}
.verdict.show { display: block; }
.verdict.correct { background: var(--correct-bg); color: var(--correct); border: 2px solid var(--correct); }
.verdict.wrong { background: var(--wrong-bg); color: var(--wrong); border: 2px solid var(--wrong); }

/* 会話風吹き出し */
.dialog {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 18px 0;
}
.dialog.right {
  flex-direction: row-reverse;
}
.dialog .avatar {
  flex-shrink: 0;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--primary-light);
  background-size: cover;
  background-position: center;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.dialog .avatar.nyaruki {
  background-image: url('/img/nyaruki.png');
  background-color: #c8e3ed;
}
.dialog .avatar.student {
  background-color: var(--accent-pink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.dialog .bubble {
  background: white;
  border: 2px solid var(--primary-light);
  border-radius: 18px 22px 18px 4px;
  padding: 12px 16px;
  position: relative;
  max-width: 78%;
  font-size: 15px;
  line-height: 1.7;
}
.dialog.right .bubble {
  border-radius: 22px 18px 4px 18px;
  background: #fff8f3;
  border-color: var(--accent-pink-soft);
}
.dialog .name {
  font-size: 12px;
  color: var(--primary-deep);
  font-weight: 700;
  margin-bottom: 2px;
}
.dialog.right .name {
  color: var(--accent-pink);
  text-align: right;
}

/* 選択肢別解説 */
.choice-explain {
  margin: 10px 0;
  padding: 12px 16px;
  background: var(--bg-card);
  border-left: 4px solid var(--primary-light);
  border-radius: 4px 14px 14px 4px;
}
.choice-explain.correct-row {
  border-left-color: var(--wrong);
  background: var(--wrong-bg);
}
.choice-explain .num {
  display: inline-block;
  background: var(--primary);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 26px;
  margin-right: 8px;
  vertical-align: middle;
}
.choice-explain.correct-row .num { background: var(--wrong); }

/* 表 */
table.summary {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--border);
}
table.summary th, table.summary td {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
table.summary tr:last-child th, table.summary tr:last-child td {
  border-bottom: none;
}
table.summary th {
  background: var(--primary-light);
  color: var(--primary-deep);
  font-weight: 700;
  white-space: nowrap;
  border-right: 1px solid var(--border);
}

/* ハイライトマーカー（手描き風） */
.marker {
  background: linear-gradient(transparent 60%, var(--accent-pink-soft) 60%);
  font-weight: 700;
  padding: 0 2px;
}

/* アフィリエイト枠 */
.affiliate-slot {
  margin: 36px 0;
  padding: 16px;
  background: var(--bg-card);
  border: 2px dashed var(--accent-yellow);
  border-radius: 16px 18px 14px 20px;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
}

/* アプリ誘導CTA */
.app-cta {
  margin: 36px 0 12px;
  padding: 18px;
  background: linear-gradient(135deg, var(--accent-pink-soft) 0%, var(--primary-light) 100%);
  border-radius: 18px 22px 18px 22px;
  text-align: center;
}
.app-cta .cta-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.app-cta .cta-button {
  display: inline-block;
  background: var(--accent-pink);
  color: white;
  padding: 10px 24px;
  border-radius: 24px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255,94,126,0.3);
}

/* フッター */
footer {
  margin-top: 60px;
  padding-top: 18px;
  border-top: 2px dashed var(--border);
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
}

/* 問題リスト */
ul.qlist {
  list-style: none;
  padding: 0;
}
ul.qlist li {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px 18px 14px 18px;
  padding: 14px 18px;
  margin-bottom: 12px;
  transition: transform .1s;
}
ul.qlist li:hover {
  transform: translateY(-2px);
}
ul.qlist li a {
  text-decoration: none;
  font-weight: 700;
  color: var(--text);
}
ul.qlist li .meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 4px;
}
