/* =========================================================================
   AIの基礎サイト スタイル（ライトモード・コーポレート調）
   上部グローバルヘッダー ＋ 左ナビ ＋ 右コンテンツ ＋ フッター
   ========================================================================= */

:root {
  --navy: #16335c;          /* ブランド・見出し */
  --navy-deep: #0f2747;
  --accent: #2257c9;        /* リンク・強調 */
  --accent-weak: #eef3fc;
  --accent-line: #d4e0f4;
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --bg-sidebar: #fbfcfe;
  --line: #e4e8f0;
  --line-soft: #eef1f6;
  --text: #1b2433;
  --text-soft: #46505f;
  --muted: #6b7585;
  --code-bg: #0f1e34;
  --code-fg: #e7edf7;
  --header-h: 66px;
  --sidebar-w: 300px;
  --wrap: 1320px;
  --content-max: 820px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 38, 70, .06);
  --shadow-md: 0 10px 30px rgba(20, 38, 70, .10);
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI",
    "Yu Gothic", "Meiryo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 14px; z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- グローバルヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: #fff;
  border-top: 3px solid var(--navy);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.site-header-inner {
  max-width: var(--wrap); margin: 0 auto;
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(135deg, var(--navy), var(--accent));
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .03em;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { color: var(--navy); font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.brand-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.header-nav { margin-left: auto; display: flex; gap: 6px; }
.header-nav a {
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 8px 14px; border-radius: 8px;
}
.header-nav a:hover { background: var(--bg-alt); color: var(--navy); }

/* ---------- レイアウト ---------- */
.layout { display: flex; max-width: var(--wrap); margin: 0 auto; align-items: flex-start; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  padding: 14px 0 56px;
  scrollbar-width: thin;
}
.content {
  flex: 1 1 auto; min-width: 0;
  padding: 38px 56px 40px;
}
.article { max-width: var(--content-max); margin: 0 auto; }

/* ---------- サイドバー・ナビ ---------- */
.global-nav { padding: 6px 14px; font-size: 14px; }
.nav-home, .nav-extra {
  display: block; color: var(--text); text-decoration: none;
  padding: 9px 14px; border-radius: 8px; font-weight: 700; margin: 2px 0;
}
.nav-home:hover, .nav-extra:hover { background: var(--accent-weak); color: var(--navy); }
.nav-home.active, .nav-extra.active {
  background: var(--accent-weak); color: var(--navy);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-extra { margin-top: 16px; padding-top: 18px; border-top: 1px solid var(--line); border-radius: 0 8px 8px 0; }

.nav-part { margin-top: 16px; }
.nav-part-title {
  font-size: 11px; font-weight: 800; letter-spacing: .07em;
  color: var(--muted); margin: 6px 14px 6px;
}
.nav-part ul { list-style: none; margin: 0; padding: 0; }
.nav-chapter {
  display: flex; gap: 10px; align-items: baseline;
  color: var(--text-soft); text-decoration: none;
  padding: 7px 14px; border-radius: 8px; line-height: 1.5;
}
.nav-chapter:hover { background: var(--accent-weak); color: var(--navy); }
.nav-chapter.active {
  background: var(--accent-weak); color: var(--navy); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}
.ch-num {
  flex: 0 0 auto; min-width: 1.5em; text-align: right;
  font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted);
}
.nav-chapter.active .ch-num { color: var(--accent); }
.ch-title { flex: 1 1 auto; }

/* ---------- パンくず ---------- */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted); margin-bottom: 22px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb span[aria-current] { color: var(--text-soft); }
.bc-sep { color: var(--line); }

/* ---------- 記事見出し ---------- */
.article-head { margin-bottom: 6px; }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .04em; margin: 0 0 12px; }
.article-num { display: block; font-size: 14px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.article-title {
  font-size: 32px; line-height: 1.45; font-weight: 800; color: var(--navy);
  margin: 0 0 6px; letter-spacing: .01em;
  padding-bottom: 22px; border-bottom: 1px solid var(--line);
}

/* ---------- 章内目次 ---------- */
.page-toc {
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 24px; margin: 28px 0 44px;
}
.page-toc-title { margin: 0 0 10px; font-weight: 800; font-size: 12.5px; color: var(--navy); letter-spacing: .03em; }
.page-toc ol { margin: 0; padding-left: 1.5em; }
.page-toc li { margin: 4px 0; }
.page-toc a { text-decoration: none; color: var(--text-soft); }
.page-toc a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 本文 ---------- */
.article h2 {
  font-size: 24px; font-weight: 800; line-height: 1.5; color: var(--navy);
  margin: 60px 0 18px; padding-left: 16px; position: relative;
}
.article h2::before {
  content: ""; position: absolute; left: 0; top: .2em; bottom: .2em;
  width: 5px; border-radius: 3px;
  background: linear-gradient(var(--accent), var(--navy));
}
.article h2 .sec-num { color: var(--accent); margin-right: .5em; font-variant-numeric: tabular-nums; }
.article h3 { font-size: 18px; font-weight: 700; color: var(--text); margin: 36px 0 12px; }
.article p { margin: 0 0 18px; }
.article strong { font-weight: 700; color: var(--navy); }
.lead { font-size: 17px; color: var(--text-soft); line-height: 1.95; }
.article ul, .article ol { margin: 0 0 20px; padding-left: 1.5em; }
.article li { margin: 6px 0; }

/* 結論囲み */
.takeaway {
  background: var(--accent-weak); border: 1px solid var(--accent-line);
  border-left: 5px solid var(--accent);
  border-radius: 10px; padding: 16px 22px; margin: 0 0 28px;
}
.takeaway p { margin: 0; font-weight: 600; color: var(--navy); }

/* 補足ノート */
.note { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px; margin: 24px 0; }
.note .note-title { font-weight: 800; font-size: 12.5px; color: var(--navy); margin: 0 0 6px; letter-spacing: .03em; }
.note p:last-child { margin-bottom: 0; }

/* たとえ */
.analogy { border: 1px solid var(--line); border-left: 5px solid #c8b46a; border-radius: 10px; padding: 16px 22px; margin: 24px 0; background: #fdfbf4; }
.analogy .analogy-title { font-weight: 800; font-size: 12.5px; color: #8a7320; margin: 0 0 6px; letter-spacing: .03em; }

/* 実務メモ */
.practice { border: 1px solid #bfe6d4; border-left: 5px solid #1f9d6b; background: #f0faf5; border-radius: 10px; padding: 16px 22px; margin: 24px 0; }
.practice .practice-title { font-weight: 800; font-size: 12.5px; color: #147a51; margin: 0 0 6px; letter-spacing: .03em; }
.practice p:last-child { margin-bottom: 0; }
.practice ul { margin: 6px 0 0; }

/* 具体例 */
.example { border: 1px solid var(--line); border-radius: 10px; margin: 28px 0; overflow: hidden; box-shadow: var(--shadow-sm); }
.example .example-title { background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; padding: 9px 20px; margin: 0; letter-spacing: .03em; }
.example .example-body { padding: 18px 22px; }
.example .example-body > *:last-child { margin-bottom: 0; }
.example .ex-step { color: var(--accent); font-weight: 800; margin-right: .4em; }
.example .ex-calc { font-family: var(--font-mono); font-size: .95em; background: var(--bg-alt); border: 1px solid var(--line-soft); border-radius: 6px; padding: 2px 8px; }

/* 深掘りコラム（任意で読み飛ばせる） */
.deepdive { border: 1px solid #d8d3f0; border-left: 5px solid #6b5bd6; background: #f7f6fd; border-radius: 10px; padding: 16px 22px; margin: 24px 0; }
.deepdive .deepdive-title { font-weight: 800; font-size: 12.5px; color: #4a3fb0; margin: 0 0 6px; letter-spacing: .03em; }
.deepdive p:last-child { margin-bottom: 0; }

/* 要点整理 */
.summary { background: linear-gradient(180deg, #fafcff, #fff); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 20px 24px 10px; margin: 40px 0 8px; box-shadow: var(--shadow-sm); }
.summary .summary-title { font-weight: 800; font-size: 14px; color: var(--accent); margin: 0 0 12px; letter-spacing: .03em; }
.summary ul { margin: 0 0 12px; }

/* 図版 */
.figure { margin: 32px 0; text-align: center; }
.figure svg { max-width: 100%; height: auto; }
.figure-frame { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-alt); padding: 26px; box-shadow: var(--shadow-sm); }
.figure figcaption { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* コード */
.code-block { margin: 24px 0; }
.code-block .code-label {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--text-soft);
  background: var(--bg-alt); border: 1px solid var(--line); border-bottom: none;
  border-radius: 8px 8px 0 0; padding: 6px 14px;
}
pre {
  margin: 0; background: var(--code-bg); color: var(--code-fg);
  border-radius: 0 10px 10px 10px; padding: 16px 18px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7;
}
code { font-family: var(--font-mono); font-size: .92em; background: var(--bg-alt); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 5px; }
pre code { background: none; border: none; padding: 0; }

/* テーブル */
.article table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; box-shadow: var(--shadow-sm); border-radius: 10px; overflow: hidden; }
.article th, .article td { border: 1px solid var(--line); padding: 12px 16px; text-align: left; vertical-align: top; }
.article th { background: var(--navy); color: #fff; font-weight: 700; border-color: var(--navy); }
.article tbody tr:nth-child(even) { background: var(--bg-alt); }

/* 準備中 */
.status-note { background: var(--bg-alt); border: 1px dashed #c4ccdb; border-radius: var(--radius); padding: 16px 22px; color: var(--text-soft); }
.planned-sections { color: var(--text-soft); }

/* ---------- 前後ナビ ---------- */
.pager { display: flex; gap: 16px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager-link {
  flex: 1 1 0; display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pager-link:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pager-next { text-align: right; }
.pager-dir { font-size: 12px; color: var(--accent); font-weight: 700; }
.pager-label { font-weight: 700; color: var(--navy); }

/* ---------- フッター ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); margin-top: 80px; }
.site-footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 44px 24px; display: flex; gap: 48px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; min-width: 220px; }
.footer-brand-text .footer-title { margin: 0; font-weight: 800; color: var(--navy); }
.footer-brand-text .footer-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.footer-nav { flex: 1 1 480px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 28px; }
.footer-part { text-decoration: none; color: var(--text); padding: 7px 0; display: flex; gap: 8px; align-items: baseline; }
.footer-part-tag { color: var(--accent); font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.footer-part-name { font-size: 13.5px; }
.footer-part:hover .footer-part-name { color: var(--accent); text-decoration: underline; }
.site-footer-bar {
  max-width: var(--wrap); margin: 0 auto; padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.footer-copy { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.footer-links { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 12.5px; }
.footer-links a:hover { color: var(--accent); }

/* ---------- ランディング ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center;
  padding: 12px 0 44px; margin-bottom: 48px; border-bottom: 1px solid var(--line);
}
.hero-eyebrow { color: var(--accent); font-weight: 800; font-size: 13px; letter-spacing: .08em; margin: 0 0 16px; }
.hero h1 { font-size: 37px; line-height: 1.45; font-weight: 800; color: var(--navy); margin: 0 0 18px; letter-spacing: .01em; }
.hero-lead { font-size: 16px; color: var(--text-soft); line-height: 1.95; margin: 0 0 26px; }
.hero-visual { display: block; }
.hero-visual svg { width: 100%; height: auto; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; text-decoration: none; font-weight: 700; padding: 12px 26px; border-radius: 9px; font-size: 15px; transition: background .15s, box-shadow .15s, transform .15s; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #1c49ab; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line); color: var(--navy); background: #fff; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* 特長の3カラム */
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 8px 0 48px; }
.feature-card { border: 1px solid var(--line); border-radius: 12px; padding: 22px 22px; background: #fff; box-shadow: var(--shadow-sm); }
.feature-card .feature-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-weak); color: var(--accent); display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.feature-card h3 { margin: 0 0 8px; font-size: 16px; color: var(--navy); }
.feature-card p { margin: 0; font-size: 13.5px; color: var(--text-soft); line-height: 1.8; }

.map-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 24px 0; }
.map-card { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; text-decoration: none; color: var(--text); background: #fff; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.map-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.map-card .map-part { font-size: 12px; color: var(--accent); font-weight: 800; letter-spacing: .04em; }
.map-card .map-title { font-weight: 800; margin: 6px 0 6px; font-size: 16px; color: var(--navy); }
.map-card .map-desc { font-size: 13.5px; color: var(--text-soft); line-height: 1.75; margin: 0; }

/* ランディング側の見出し */
.section-head { font-size: 22px; font-weight: 800; color: var(--navy); margin: 48px 0 14px; padding-left: 14px; border-left: 5px solid var(--accent); }

/* ---------- 用語集 ---------- */
.glossary-list { margin: 8px 0; }
.glossary-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.glossary-item dt { font-weight: 800; font-size: 16px; color: var(--navy); }
.glossary-item dt .reading { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 8px; }
.glossary-item dd { margin: 6px 0 0; color: var(--text-soft); }

/* ---------- モバイル用トグル ---------- */
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 42px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; padding: 0 9px; }
.nav-toggle-bar { display: block; height: 2px; background: var(--navy); border-radius: 2px; }
.nav-backdrop { position: fixed; inset: 0; background: rgba(10, 22, 44, .45); z-index: 40; }

@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .header-nav { display: none; }
  .layout { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 70; width: 86%; max-width: 330px;
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-md);
    background: #fff; padding-top: 14px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .content { padding: 28px 20px 30px; }
  .article-title { font-size: 26px; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-visual { order: -1; max-width: 360px; }
  .hero h1 { font-size: 28px; }
  .feature-row { grid-template-columns: 1fr; }
  .map-grid { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: repeat(2, 1fr); }
  .pager { flex-direction: column; }
}
