/* === 日语学习课程 — 共享样式表 === */

:root {
  --bg: #fffff8;
  --fg: #111;
  --muted: #666;
  --accent: #9b2226;
  --accent-light: #e9d8d8;
  --border: #ddd;
  --sans: "Georgia", "Times New Roman", serif;
  --mono: "Courier New", monospace;
  --ja: "Hiragino Mincho Pro", "YuMincho", "MS Mincho", serif;
}

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

html {
  font-size: 18px;
  line-height: 1.6;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

h1 {
  font-size: 2.2rem;
  font-weight: normal;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.4rem;
  font-weight: normal;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

h3 {
  font-size: 1.1rem;
  font-weight: normal;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-light);
}

a:hover {
  border-bottom-color: var(--accent);
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1.2rem;
  border-left: 3px solid var(--accent);
  background: #fafaf5;
  font-style: italic;
  color: var(--muted);
}

/* === Kana Display === */
.kana-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 80px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 4px;
  background: white;
  cursor: default;
  transition: box-shadow 0.15s;
}

.kana-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kana-card .ja {
  font-family: var(--ja);
  font-size: 1.6rem;
  line-height: 1;
}

.kana-card .romaji {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 4px;
}

/* === Gojuon Table === */
.gojuon-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.gojuon-table th,
.gojuon-table td {
  border: 1px solid var(--border);
  padding: 5px 4px;
  text-align: center;
  vertical-align: middle;
}

.gojuon-table th {
  background: #f8f8f0;
  font-weight: normal;
  color: var(--muted);
  font-size: 0.75rem;
}

.gojuon-table .hiragana {
  font-family: var(--ja);
  font-size: 1.1rem;
}

.gojuon-table .romaji {
  font-size: 0.65rem;
  color: var(--muted);
  display: block;
}

.gojuon-table .header-col {
  text-align: right;
  padding-right: 8px;
  color: var(--accent);
  font-size: 0.75rem;
}

/* === Quiz === */
.quiz-block {
  margin: 2rem 0;
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fdfdf5;
}

.quiz-block .question {
  font-weight: bold;
  margin-bottom: 0.8rem;
}

.quiz-block .options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.quiz-block .options button {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: var(--sans);
  border: 1px solid var(--border);
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
  min-width: 80px;
}

.quiz-block .options button:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.quiz-block .options button.correct {
  background: #d4edda;
  border-color: #28a745;
}

.quiz-block .options button.wrong {
  background: #f8d7da;
  border-color: #dc3545;
}

.quiz-block .feedback {
  font-size: 0.9rem;
  min-height: 1.5em;
}

.quiz-block .feedback.correct { color: #155724; }
.quiz-block .feedback.wrong   { color: #721c24; }

/* === Utilities === */
.sidenote {
  float: right;
  clear: right;
  width: 180px;
  margin-right: -210px;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 960px) {
  .sidenote {
    float: none;
    width: auto;
    margin: 0.5rem 0;
  }
}

.nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.meta span {
  margin-right: 1.5rem;
}

.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.3rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
  border-radius: 0 4px 4px 0;
}

.callout strong {
  display: block;
  margin-bottom: 0.25rem;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: #f0f0e8;
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.4rem;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: #f4f4ee;
  padding: 0.1em 0.3em;
  border-radius: 2px;
}
