/* サイト共通スタイル（色・ヘッダー・フッター・基本レイアウト） */
:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #5f6670;
  --border: #dcdfe3;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --grid: #eceef1;
  --axis: #9aa1aa;
  --ground: #b89f74;
  --preview: #8a919b;
  --code-bg: #f0f2f5;
  /* 科目の色 */
  --math: #2563eb;
  --physics: #e4572e;
  --chemistry: #14a06f;
  --biology: #d6457a;
  --earth: #8b5cf6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131519;
    --surface: #1c1f25;
    --text: #e7e9ec;
    --muted: #a0a7b1;
    --border: #323741;
    --accent: #6ea0ff;
    --accent-text: #0d1117;
    --grid: #252930;
    --axis: #5b626d;
    --ground: #8a7550;
    --preview: #7d8590;
    --code-bg: #252930;
    --math: #6ea0ff;
    --physics: #ff8a65;
    --chemistry: #4cc99a;
    --biology: #f07aa5;
    --earth: #ad8cff;
  }
}
:root[data-theme="dark"] {
  --bg: #131519;
  --surface: #1c1f25;
  --text: #e7e9ec;
  --muted: #a0a7b1;
  --border: #323741;
  --accent: #6ea0ff;
  --accent-text: #0d1117;
  --grid: #252930;
  --axis: #5b626d;
  --ground: #8a7550;
  --preview: #7d8590;
  --code-bg: #252930;
  --math: #6ea0ff;
  --physics: #ff8a65;
  --chemistry: #4cc99a;
  --biology: #f07aa5;
  --earth: #ad8cff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.7;
}
a { color: var(--accent); }
header.site, footer.site {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
}
header.site a.brand { color: var(--text); text-decoration: none; font-weight: 700; }
footer.site {
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
footer.site a { color: var(--muted); }
main { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.breadcrumb a { color: var(--muted); }
h1 { font-size: clamp(22px, 4vw, 30px); margin: 8px 0 4px; line-height: 1.3; }
.lead { color: var(--muted); margin: 0 0 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
