/* ====== 英語長文 共通CSS ====== */
:root {
  --navy: #1E2761;
  --navy-deep: #131840;
  --ice: #CADCFC;
  --gold: #D4A24C;
  --gold-soft: #E8C078;
  --emerald: #2A9D8F;
  --white: #FFFFFF;
  --ink: #2C2C2C;
  --muted: #6B7280;
  --paper: #F8F5EE;
  --paper-2: #FCFAF5;
  --border: #E5E5E5;
  --font-mincho: "Shippori Mincho", "游明朝", "Yu Mincho", serif;
  --font-gothic: "Zen Kaku Gothic New", "游ゴシック", "Yu Gothic", sans-serif;
  --font-en: "Crimson Pro", "Georgia", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: var(--font-gothic);
  color: var(--ink);
  background: #F4F2EC;
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white);
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 60px) clamp(40px, 6vw, 70px);
  position: relative;
}
.page-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 4px;
  background: var(--gold);
}
.crumb {
  font-size: 12px;
  color: var(--ice);
  letter-spacing: 0.3em;
  margin-bottom: 1.5em;
}
.crumb a {
  color: var(--ice);
  text-decoration: none;
}
.crumb a:hover {
  color: var(--gold);
}
.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 0.8em;
}
.chapter-no {
  font-family: var(--font-mincho);
  font-weight: 700;
  color: var(--gold);
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: 0.05em;
}
.chapter-theme {
  display: inline-block;
  font-size: 12px;
  color: var(--ice);
  border: 1px solid rgba(202, 220, 252, 0.4);
  padding: 4px 10px;
  border-radius: 3px;
  letter-spacing: 0.1em;
}
.chapter-title-ja {
  font-family: var(--font-mincho);
  font-weight: 800;
  color: var(--white);
  font-size: clamp(24px, 5vw, 40px);
  line-height: 1.2;
  margin-bottom: 0.3em;
}
.chapter-title-en {
  font-family: var(--font-en);
  font-style: italic;
  color: var(--ice);
  font-size: clamp(14px, 2.2vw, 20px);
  line-height: 1.4;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.tab-btn {
  flex-shrink: 0;
  padding: 16px clamp(14px, 2.5vw, 28px);
  font-family: var(--font-gothic);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--navy);
  background: var(--paper-2);
}
.tab-btn.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
  font-weight: 700;
}

/* ===== Main content ===== */
.content {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 50px) clamp(16px, 4vw, 60px);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Reading panel */
.reading-text {
  font-family: var(--font-en);
  font-size: clamp(16px, 2.2vw, 18px);
  line-height: 1.85;
  color: var(--ink);
  text-align: justify;
}
.reading-text p {
  margin-bottom: 1.2em;
  text-indent: 1.5em;
}
.reading-text p:first-child {
  text-indent: 0;
}

/* Translation panel */
.translation-text {
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.95;
  color: var(--ink);
}
.translation-text p {
  margin-bottom: 1.2em;
}

/* Vocab panel */
.vocab-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.vocab-table th {
  background: var(--navy);
  color: var(--white);
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.vocab-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.vocab-table tr:nth-child(even) td {
  background: var(--paper-2);
}
.vocab-table .vocab-no {
  color: var(--muted);
  font-size: 13px;
  width: 50px;
}
.vocab-table .vocab-word {
  font-family: var(--font-en);
  font-weight: 600;
  color: var(--navy);
  font-size: 16px;
}
.vocab-table .vocab-pos {
  color: var(--emerald);
  font-style: italic;
  font-size: 13px;
  width: 60px;
}
.vocab-table .vocab-meaning {
  color: var(--ink);
}

/* Questions / Answers panel */
.q-section h2 {
  font-family: var(--font-mincho);
  color: var(--navy);
  font-size: 22px;
  margin: 2em 0 0.8em;
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--gold);
}
.q-section h2:first-child {
  margin-top: 0;
}
.q-section h3 {
  font-family: var(--font-mincho);
  color: var(--navy);
  font-size: 17px;
  margin: 1.5em 0 0.6em;
}
.q-section p {
  margin-bottom: 0.8em;
}
.q-section strong {
  color: var(--navy);
}
.q-section .answer-box {
  background: var(--paper);
  border-left: 4px solid var(--gold);
  padding: 14px 18px;
  margin: 0.6em 0 1.4em;
  font-style: italic;
  color: var(--muted);
  font-size: 13px;
}
.q-section blockquote {
  background: var(--paper-2);
  border-left: 3px solid var(--navy);
  padding: 12px 18px;
  margin: 0.8em 0;
  font-family: var(--font-en);
  font-style: italic;
}

/* Answer panel (more emphasized) */
.answers-content {
  background: var(--white);
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  padding: clamp(20px, 3vw, 32px);
}
.answers-content p {
  margin-bottom: 1em;
}
.answers-content strong {
  color: var(--navy);
  display: inline-block;
  min-width: 3em;
}

/* ===== Footer nav ===== */
.chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.nav-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  padding: 16px 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.nav-link:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.nav-link.disabled {
  pointer-events: none;
  opacity: 0.4;
}
.nav-link .nav-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.2em;
  margin-bottom: 4px;
}
.nav-link.next {
  text-align: right;
}
.nav-link .nav-title {
  font-family: var(--font-mincho);
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.4;
}
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.back-link:hover {
  color: var(--navy);
}

@media (max-width: 600px) {
  .chapter-nav {
    grid-template-columns: 1fr;
  }
  .vocab-table .vocab-no {
    display: none;
  }
}
