:root {
  --accent-blue: #4C78A8;
  --accent-red: #E45756;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --bg-surface: #fafbfc;
  --border-light: #e8ecf1;
  --font-serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Source Code Pro", monospace;
  --font-ja: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

body {
  font-family: var(--font-serif);
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 1.05rem;
}

html[lang="ja"] body {
  font-family: var(--font-ja), var(--font-serif);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] h4,
html[lang="ja"] h5,
html[lang="ja"] h6 {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

h1.title {
  font-size: 2rem;
  border-bottom: 3px solid var(--accent-blue);
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
}

p.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.25rem;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-light);
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.8rem;
  color: var(--text-secondary);
}

#TOC {
  border-left: 3px solid var(--accent-blue);
  padding-left: 1rem;
}

#TOC a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

#TOC a:hover,
#TOC a.active {
  color: var(--accent-blue);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1.5rem 0;
}

thead th {
  background-color: var(--bg-surface);
  border-bottom: 2px solid var(--text-primary);
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

tbody td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border-light);
}

tbody tr:hover {
  background-color: var(--bg-surface);
}

div.callout {
  border-radius: 4px;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

div.callout-note {
  border-left: 4px solid var(--accent-blue);
}

div.callout-tip {
  border-left: 4px solid #54A24B;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background-color: var(--bg-surface);
  padding: 0.15em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--border-light);
}

pre code {
  border: none;
  padding: 0;
}

div.sourceCode {
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background-color: var(--bg-surface);
}

.navbar {
  font-family: var(--font-sans);
  border-bottom: 1px solid var(--border-light);
}

hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 2.5rem 0;
}

@media (max-width: 768px) {
  h1.title {
    font-size: 1.5rem;
  }

  p.subtitle {
    font-size: 0.95rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  body {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  table {
    font-size: 0.82rem;
  }

  thead th,
  tbody td {
    padding: 0.4rem 0.5rem;
  }
}

@media (max-width: 480px) {
  h1.title {
    font-size: 1.3rem;
  }

  table {
    font-size: 0.78rem;
  }

  thead th,
  tbody td {
    padding: 0.3rem 0.4rem;
  }
}
