/* =========================================================
   数量経済分析 図解ポータル ― 共有スタイル
   Quantitative Indigo パレット（農業経営学=Satoyama Green、
   農政学=Setouchi Blue と区別する計量経済学固有の配色）
   ========================================================= */

:root {
  /* --- Quantitative Indigo --- */
  --ink:          #1E1B4B;   /* 最深 indigo-950 */
  --indigo-900:   #312E81;
  --indigo-800:   #3730A3;
  --indigo-700:   #4338CA;
  --indigo-600:   #4F46E5;   /* primary */
  --indigo-500:   #6366F1;
  --indigo-400:   #818CF8;
  --indigo-300:   #A5B4FC;
  --indigo-200:   #C7D2FE;
  --indigo-100:   #E0E7FF;
  --indigo-50:    #EEF2FF;

  /* セマンティック別名（農業経営学テンプレ互換） */
  --sprout:        #A5B4FC;
  --field:         #6366F1;
  --forest:        #4F46E5;
  --canopy:        #3730A3;
  --midnight-soil: #1E1B4B;

  --surface:       #FFFFFF;
  --bg-meadow:     #F6F7FE;
  --body:          #1E1B33;
  --muted:         #64748B;
  --muted-strong:  #475569;

  /* データ・結果アクセント（シアン） */
  --accent-cyan:   #0891B2;
  --accent-cyan-bg:#ECFEFF;
  --accent-cyan-bord:#A5F3FC;

  /* 強調ゴールド（Professor Note 用、姉妹ポータルと共通） */
  --accent-gold:   #C9A84C;
  --professor-bg:  #FFFBEB;
  --professor-bg-2:#FEF3C7;
  --professor-bord:#F4D88E;
  --professor-text:#78350F;
  --professor-accent: #C9A84C;

  /* 落とし穴・バイアス（レッド） */
  --risk-red:      #DC2626;
  --risk-red-bg:   #FEF2F2;
  --risk-red-bord: #FECACA;

  /* 結果・成立（グリーン） */
  --solution:      #047857;
  --solution-bg-1: #ECFDF5;

  --grad-header:   linear-gradient(135deg, #1E1B4B 0%, #3730A3 45%, #6366F1 100%);
  --grad-brand:    linear-gradient(90deg, #312E81, #4F46E5, #818CF8);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  color: var(--body);
  background: var(--bg-meadow);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.wrap  { max-width: 960px; margin: 0 auto; padding: 0 24px 96px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding: 0 24px 96px; }

/* 図解⇄和訳の切替を「ゆっくりスクロール」ではなく一瞬のフェードインで知らせる。
   head 内 CSS なので初回ペイント前に opacity:0 から始まり、fill:both で 1 に留まる＝フラッシュ無し。 */
.wrap, .wrap-wide { animation: ys-page-in .18s ease-out both; }
@keyframes ys-page-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wrap, .wrap-wide { animation: none; } }
.prose { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ===== スクロール進捗バー ===== */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--indigo-500); z-index: 100; transition: width 0.05s linear;
}

/* ===== ヒーロー ===== */
.hero {
  background: var(--grad-header); color: #FFFFFF;
  padding: 28px 0 32px; position: relative; overflow: hidden;
}
.hero.tall { padding: 56px 0 64px; }
.hero::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 55%; height: 100%;
  background: radial-gradient(circle at 80% 15%, rgba(165,180,252,0.28), transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; left: -40px; bottom: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.25), transparent 70%);
  pointer-events: none;
}
.hero-inner { max-width: 960px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.hero-inner.wide { max-width: 1080px; }

.breadcrumb {
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.72); font-size: 13px;
  text-decoration: none; margin-bottom: 14px; transition: color 0.15s;
}
.breadcrumb:hover { color: rgba(255,255,255,0.96); }
.breadcrumb i { width: 14px; height: 14px; }

.hero-meta {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.82); font-size: 13px;
  letter-spacing: 0.10em; margin-bottom: 12px;
}
.hero-meta.upper { text-transform: uppercase; letter-spacing: 0.12em; }
.hero h1 {
  font-size: clamp(28px, 3.8vw, 40px); font-weight: 700;
  line-height: 1.22; letter-spacing: -0.02em; margin-bottom: 12px;
}
.hero.tall h1 { font-size: clamp(34px, 5vw, 54px); }
.hero-sub {
  font-size: clamp(15px, 1.7vw, 18px); font-weight: 500;
  color: rgba(255,255,255,0.92); line-height: 1.65; max-width: 740px;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-tag {
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px; padding: 5px 13px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.05em;
  color: rgba(255,255,255,0.94); backdrop-filter: blur(6px);
}

/* ===== メタストリップ ===== */
.meta-strip { background: var(--surface); border-bottom: 1px solid var(--indigo-100); }
.meta-strip-inner {
  max-width: 960px; margin: 0 auto; padding: 12px 24px;
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 13px; color: var(--muted-strong); letter-spacing: 0.04em;
}
.meta-strip-inner.wide { max-width: 1080px; }
.meta-strip-inner span { display: inline-flex; align-items: center; gap: 6px; }

/* ===== 目次 ===== */
.toc {
  background: var(--surface); border: 1px solid var(--indigo-100); border-radius: 12px;
  padding: 16px 20px; margin: 24px 0 32px; font-size: 14px;
}
.toc-title {
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--forest); letter-spacing: 0.14em; margin-bottom: 8px; text-transform: uppercase;
}
.toc ol { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.toc a {
  color: var(--body); text-decoration: none; display: block;
  padding: 4px 0 4px 10px; border-left: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.toc a:hover { color: var(--canopy); border-left-color: var(--forest); }

/* =========================================================
   2ペイン・レイアウト（左：目次レール / 右：本文）
   .wrap が直下に .toc を持つときだけ発火する（:has）。
   1024px 未満では従来どおり単一カラム（.toc は本文上のブロック）。
   ========================================================= */
@media (min-width: 1024px) {
  .wrap:has(> .toc) {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    column-gap: 54px;
    max-width: 1200px;
    align-items: start;
  }
  /* 目次以外の直下要素はすべて右カラムへ */
  .wrap:has(> .toc) > * { grid-column: 2; min-width: 0; }

  /* 左レール：全行にまたがらせて sticky で追従させる */
  .wrap:has(> .toc) > .toc {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: start;
    position: sticky;
    top: 18px;
    margin: 24px 0;
    padding: 18px 18px 20px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--indigo-200) transparent;
  }
  .wrap:has(> .toc) > .toc::-webkit-scrollbar { width: 8px; }
  .wrap:has(> .toc) > .toc::-webkit-scrollbar-thumb { background: var(--indigo-200); border-radius: 8px; }

  /* レール内リストは1カラム＋スクロールスパイ（目次リンクのみ。トグルは別扱い） */
  .wrap:has(> .toc) > .toc ol { grid-template-columns: 1fr; gap: 1px; }
  .wrap:has(> .toc) > .toc ol a {
    padding: 7px 12px;
    border-left: 2px solid transparent;
    border-radius: 0 7px 7px 0;
    font-size: 13px; line-height: 1.5;
    color: var(--muted-strong);
    transition: background .14s, color .14s, border-color .14s;
  }
  .wrap:has(> .toc) > .toc ol a:hover {
    background: var(--indigo-50); color: var(--canopy); border-left-color: var(--indigo-300);
  }
  .wrap:has(> .toc) > .toc ol a.active {
    background: var(--indigo-50); color: var(--canopy);
    font-weight: 700; border-left-color: var(--forest);
  }
}

/* =========================================================
   図解⇄和訳トグル：左レール（目次）内のボタン群として表示
   yaku-switch.js が .yaku-switch を .toc の先頭へ移動する。
   本文カラムでの sticky 浮き（見出しと重なる問題）を廃する。
   ========================================================= */
/* 「ポータルに戻る」ボタン（yaku-switch.js がレール先頭へ挿入。sticky で常時表示） */
.toc .rail-back {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 8px 12px;
  border: 1px solid var(--indigo-100); border-radius: 9px;
  background: var(--indigo-50); color: var(--canopy);
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: background .14s, border-color .14s;
}
.toc .rail-back:hover { background: var(--indigo-100); border-color: var(--forest); }
.toc .rail-back i, .toc .rail-back svg { width: 15px; height: 15px; flex-shrink: 0; }

/* 図解／原文和訳トグル：横並びの2分割ボタン */
.toc .yaku-switch {
  position: static;
  display: flex; flex-direction: row; gap: 6px;
  margin: 0 0 14px; padding: 0 0 14px;
  background: none; border: none; box-shadow: none; border-radius: 0;
  border-bottom: 1px solid var(--indigo-100);
}
.toc .yaku-switch .ys-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  flex: 1 1 0; min-width: 0; white-space: nowrap;
  padding: 8px 6px;
  border: 1px solid var(--indigo-100); border-radius: 9px;
  font-size: 13px; line-height: 1.3;
}
.toc .yaku-switch .ys-opt.active {
  background: var(--forest); color: #FFFFFF; border-color: var(--forest);
}
.toc .yaku-switch a.ys-opt { background: transparent; color: var(--muted-strong); }
.toc .yaku-switch a.ys-opt:hover {
  background: var(--indigo-50); color: var(--canopy); border-color: var(--forest);
}

/* ===== セクション共通 ===== */
section { margin-top: 32px; margin-bottom: 56px; }
.sec-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.sec-num {
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--forest); letter-spacing: 0.18em;
}
.sec-head h2 {
  font-size: clamp(22px, 2.6vw, 31px); font-weight: 700;
  color: var(--midnight-soil); letter-spacing: -0.01em; line-height: 1.35;
}
.sec-head h2::after {
  content: ''; display: block; width: 40px; height: 2px;
  background: var(--forest); margin-top: 8px;
}
.sec-head .sec-desc {
  font-size: 15px; color: var(--muted-strong);
  line-height: 1.7; margin-top: 6px; max-width: 740px;
}

/* ===== リード文（強調） ===== */
.hero-msg {
  font-size: clamp(16px, 1.8vw, 19px); font-weight: 700;
  line-height: 1.7; color: var(--body); margin-bottom: 24px;
}
.hero-msg .accent {
  color: var(--canopy);
  background: linear-gradient(transparent 60%, rgba(99,102,241,0.30) 60%);
  padding: 0 2px;
}
.hero-msg .accent-cyan {
  color: var(--accent-cyan);
  background: linear-gradient(transparent 60%, rgba(8,145,178,0.18) 60%);
  padding: 0 2px;
}
.hero-msg .accent-red {
  color: var(--risk-red);
  background: linear-gradient(transparent 60%, rgba(220,38,38,0.16) 60%);
  padding: 0 2px;
}

/* ===== 本文 ===== */
.prose p { margin-bottom: 14px; font-size: 16px; line-height: 1.85; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 14px 1.4em; }
.prose li { font-size: 15px; line-height: 1.8; margin-bottom: 4px; }

/* ===== カード ===== */
.inner-card {
  background: var(--surface); border: 1px solid var(--indigo-100);
  border-radius: 12px; padding: 24px;
}
.inner-card h3 {
  font-size: 19px; font-weight: 700; color: var(--canopy);
  letter-spacing: -0.01em; margin-bottom: 14px;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ===== コールアウト ===== */
.callout {
  padding: 12px 16px; border-radius: 8px;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 15px; line-height: 1.7; margin-top: 14px;
}
.callout i { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.callout.info { background: var(--indigo-50); border: 1px solid var(--indigo-100); color: var(--body); }
.callout.good { background: var(--solution-bg-1); border: 1px solid #A7F3D0; color: var(--solution); }
.callout.warn { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.callout.alert{ background: var(--risk-red-bg); border: 1px solid var(--risk-red-bord); color: var(--risk-red); }
.callout.cyan { background: var(--accent-cyan-bg); border: 1px solid var(--accent-cyan-bord); color: #155E75; }
.callout.key {
  background: linear-gradient(135deg, #1E1B4B 0%, #4338CA 100%);
  border: none; color: #ffffff; border-radius: 10px;
}
.callout.key i { color: rgba(255,255,255,0.72); }
.callout strong { color: inherit; }
.callout.info strong, .callout.cyan strong { color: var(--canopy); }

/* ===== 数式ブロック（display equation） ===== */
.eqn {
  background: var(--indigo-50);
  border: 1px solid var(--indigo-100);
  border-left: 4px solid var(--indigo-500);
  border-radius: 0 10px 10px 0;
  padding: 16px 22px; margin: 18px 0;
  display: flex; align-items: center; gap: 16px;
  overflow-x: auto;
}
.eqn .eqn-body { flex: 1; font-size: 17px; }
.eqn .eqn-num {
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--forest); flex-shrink: 0; opacity: 0.8;
}
.eqn.center { justify-content: center; }
.eqn.center .eqn-body { flex: 0 1 auto; }
.eqn-caption {
  font-size: 13px; color: var(--muted-strong); margin-top: -8px; margin-bottom: 18px;
  padding-left: 22px; line-height: 1.6;
}

/* ===== 記法・用語の定義テーブル ===== */
.notation-table {
  width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px;
  background: var(--surface); border-radius: 8px; overflow: hidden;
}
.notation-table th {
  background: var(--canopy); color: #FFFFFF;
  padding: 10px 14px; text-align: left; font-weight: 700;
  font-size: 13px; letter-spacing: 0.04em;
}
.notation-table td {
  padding: 9px 14px; border-bottom: 1px solid var(--indigo-100); vertical-align: top;
  font-size: 14px; line-height: 1.6;
}
.notation-table tr:last-child td { border-bottom: none; }
.notation-table tr:nth-child(even) td { background: var(--indigo-50); }
.notation-table .sym {
  font-weight: 700; color: var(--canopy); white-space: nowrap;
  font-size: 15px;
}

/* ===== 汎用テーブル（measure-table 互換） ===== */
.measure-table {
  width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px;
  background: var(--surface); border-radius: 8px; overflow: hidden;
}
.measure-table th {
  background: var(--canopy); color: #FFFFFF;
  padding: 10px 14px; text-align: left; font-weight: 700;
  font-size: 13px; letter-spacing: 0.04em;
}
.measure-table th.num { text-align: right; }
.measure-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--indigo-100); vertical-align: top;
  font-size: 14px; line-height: 1.6;
}
.measure-table td.num { text-align: right; font-family: 'Inter', sans-serif; font-weight: 600; }
.measure-table tr:last-child td { border-bottom: none; }
.measure-table tr:nth-child(even) td { background: var(--indigo-50); }
.measure-table .label { font-weight: 700; color: var(--canopy); }
.measure-table caption {
  caption-side: top; text-align: left;
  font-size: 12px; font-weight: 700; color: var(--canopy);
  letter-spacing: 0.08em; padding-bottom: 6px; text-transform: uppercase;
}

/* ===== 比較テーブル（2モデル等の対比） ===== */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.compare-col {
  background: var(--surface); border: 1px solid var(--indigo-100);
  border-radius: 12px; padding: 20px; border-top: 4px solid var(--indigo-500);
}
.compare-col.alt { border-top-color: var(--accent-cyan); }
.compare-col h4 {
  font-size: 16px; font-weight: 700; color: var(--canopy); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.compare-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.compare-col li { font-size: 13px; line-height: 1.65; display: flex; gap: 7px; }
.compare-col li::before { content: '▪'; color: var(--indigo-400); flex-shrink: 0; }

/* ===== 概念カード（pillar 互換 / 3〜N列） ===== */
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.pillar-grid.two { grid-template-columns: repeat(2, 1fr); }
.pillar-grid.four { grid-template-columns: repeat(4, 1fr); }
.pillar-card {
  background: var(--surface); border-radius: 14px; padding: 22px 20px;
  border-top: 4px solid var(--canopy);
  border-right: 1px solid var(--indigo-100);
  border-bottom: 1px solid var(--indigo-100);
  border-left: 1px solid var(--indigo-100);
  display: flex; flex-direction: column; gap: 10px;
}
.pillar-card.c1 { border-top-color: var(--indigo-700); }
.pillar-card.c2 { border-top-color: var(--indigo-500); }
.pillar-card.c3 { border-top-color: var(--accent-cyan); }
.pillar-card.c4 { border-top-color: var(--accent-gold); }
.pillar-label {
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--forest);
}
.pillar-card.c3 .pillar-label { color: var(--accent-cyan); }
.pillar-card.c4 .pillar-label { color: var(--accent-gold); }
.pillar-card h3 { font-size: 17px; font-weight: 700; color: var(--midnight-soil); }
.pillar-card h4 { font-size: 15px; font-weight: 700; color: var(--canopy); }
.pillar-card .scope {
  font-size: 12px; padding: 5px 10px; background: var(--indigo-50);
  border: 1px solid var(--indigo-100); border-radius: 6px; color: var(--canopy); font-weight: 600;
  align-self: flex-start;
}
.pillar-card p { font-size: 13px; line-height: 1.7; color: var(--body); }
.pillar-card ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.pillar-card ul li { font-size: 13px; line-height: 1.6; display: flex; gap: 6px; }
.pillar-card ul li::before { content: '◆'; color: var(--field); font-size: 9px; flex-shrink: 0; margin-top: 5px; }

/* ===== 番号付き手順（2SLS 等の段階） ===== */
.steps { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; counter-reset: step; }
.step {
  background: var(--surface); border: 1px solid var(--indigo-100); border-radius: 12px;
  padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start;
}
.step-num {
  font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 700;
  color: #FFFFFF; background: var(--indigo-600); border-radius: 9px;
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.step-body h4 { font-size: 15px; font-weight: 700; color: var(--midnight-soil); margin-bottom: 4px; }
.step-body p { font-size: 14px; color: var(--muted-strong); line-height: 1.7; }

/* ===== 文字バッジ行（A〜E 等のタイプ分類） ===== */
.type-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.type-row {
  background: var(--surface); border: 1px solid var(--indigo-100); border-radius: 10px;
  padding: 14px 16px; display: flex; gap: 14px; align-items: flex-start;
}
.type-badge {
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 700;
  color: #FFFFFF; background: var(--canopy); border-radius: 8px;
  min-width: 38px; height: 38px; padding: 0 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.type-row.t-a .type-badge { background: var(--indigo-900); }
.type-row.t-b .type-badge { background: var(--indigo-700); }
.type-row.t-c .type-badge { background: var(--indigo-500); }
.type-row.t-d .type-badge { background: var(--accent-cyan); }
.type-row.t-e .type-badge { background: var(--accent-gold); }
.type-body h4 { font-size: 15px; font-weight: 700; color: var(--midnight-soil); margin-bottom: 3px; }
.type-body p { font-size: 13px; color: var(--muted-strong); line-height: 1.65; }

/* ===== 課題カード（番号付き・amber） ===== */
.issue-list { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.issue-card {
  background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 12px;
  padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start;
}
.issue-num {
  font-family: 'Inter', sans-serif; font-size: 18px; font-weight: 700;
  color: #FFFFFF; background: var(--accent-gold); border-radius: 8px;
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.issue-body h4 { font-size: 15px; font-weight: 700; color: #92400E; margin-bottom: 4px; }
.issue-body p { font-size: 13px; color: #78350F; line-height: 1.7; }

/* ===== 事例カード ===== */
.case-card {
  background: var(--surface); border: 1px solid var(--indigo-100); border-radius: 14px;
  padding: 22px 24px; margin: 18px 0; border-top: 4px solid var(--indigo-600);
}
.case-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--forest);
  margin-bottom: 6px;
}
.case-card h3 { font-size: 19px; font-weight: 700; color: var(--midnight-soil); margin-bottom: 4px; }
.case-card .case-loc { font-size: 13px; color: var(--muted-strong); margin-bottom: 12px; }
.case-card p { font-size: 14px; line-height: 1.8; color: var(--body); margin-bottom: 10px; }
.case-card p:last-child { margin-bottom: 0; }
.case-card .case-sub {
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--canopy); letter-spacing: 0.06em; margin: 14px 0 6px; text-transform: uppercase;
}
.case-card ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 5px; margin-bottom: 6px; }
.case-card ul li { font-size: 13px; line-height: 1.65; display: flex; gap: 6px; }
.case-card ul li::before { content: '◆'; color: var(--field); font-size: 9px; flex-shrink: 0; margin-top: 5px; }

/* ===== タグ群 ===== */
.tech-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tech-tag {
  background: var(--indigo-50); border: 1px solid var(--indigo-100); border-radius: 8px;
  padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--canopy);
}

/* ===== Professor Note ===== */
.professor-note {
  background: linear-gradient(135deg, var(--professor-bg), var(--professor-bg-2));
  border: 1px solid var(--professor-bord);
  border-left: 4px solid var(--professor-accent);
  border-radius: 10px; padding: 20px 22px; margin: 24px 0;
}
.professor-note-head {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--professor-accent); letter-spacing: 0.14em;
  text-transform: uppercase; margin-bottom: 12px;
}
.professor-note-head i { width: 16px; height: 16px; }
.professor-note p { font-size: 15px; line-height: 1.8; color: var(--professor-text); margin-bottom: 12px; }
.professor-note p:last-child { margin-bottom: 0; }
.professor-note strong { color: var(--professor-accent); font-weight: 700; }
.professor-note .ref {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--professor-bord);
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 14px; color: var(--professor-text); line-height: 1.65;
}
.professor-note .ref i { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; color: var(--professor-accent); }
.professor-note .ref a { color: var(--professor-accent); text-decoration: underline; }

/* ===== 原文引用 ===== */
.raw-quote {
  background: var(--surface); border-left: 4px solid var(--indigo-500);
  border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 18px 0;
  font-size: 15px; line-height: 1.8; color: var(--body);
}
.raw-quote::before {
  content: '原文 '; font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 700; color: var(--forest);
  letter-spacing: 0.12em; display: block; margin-bottom: 6px;
}
.raw-quote[data-label]::before { content: attr(data-label) ' '; }
.raw-quote strong { color: var(--canopy); }
.raw-quote em { color: var(--muted-strong); font-style: italic; }

/* ===== 画像のみページ等の注記 ===== */
.table-image-note {
  background: #F8FAFC; border: 1px dashed #CBD5E1; border-radius: 10px;
  padding: 14px 18px; margin: 14px 0; font-size: 13px; color: var(--muted-strong);
  line-height: 1.7; display: flex; align-items: flex-start; gap: 10px;
}
.table-image-note i { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: #94A3B8; }
.table-image-note strong { color: var(--canopy); }

/* ===== 引用元 ===== */
.ref-block {
  background: #F1F5F9; border-left: 3px solid var(--indigo-200);
  padding: 10px 14px; margin-top: 14px; font-size: 13px;
  color: var(--muted-strong); border-radius: 0 6px 6px 0; line-height: 1.65;
}
.ref-block strong { color: var(--body); }
.ref-block a { color: var(--canopy); }

/* ===== 参考文献リスト ===== */
.refs-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.refs-list li {
  font-size: 13px; line-height: 1.7; color: var(--muted-strong);
  padding-left: 18px; position: relative;
}
.refs-list li::before { content: '§'; position: absolute; left: 0; color: var(--indigo-400); font-weight: 700; }
.refs-list a { color: var(--canopy); }

/* ===== 数値ハイライト ===== */
.stat-box {
  background: linear-gradient(135deg, #1E1B4B, #4338CA);
  color: #FFFFFF; border-radius: 14px; padding: 22px 24px; margin: 18px 0; text-align: center;
}
.stat-label {
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
  color: rgba(165,180,252,0.9); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px;
}
.stat-num {
  font-family: 'Inter', sans-serif; font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 700; color: var(--sprout); letter-spacing: -0.02em; line-height: 1.1;
}
.stat-desc { font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.65; margin-top: 8px; }

/* ===== フッター ===== */
.doc-foot {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--indigo-100);
  font-size: 13px; color: var(--muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.doc-foot .credit { display: inline-flex; align-items: center; gap: 6px; }
.doc-foot strong { color: var(--body); font-weight: 600; }

/* ===== 章ナビ（前後移動） ===== */
.chap-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; flex-wrap: wrap; }
.chap-nav a {
  flex: 1 1 220px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--indigo-100); border-radius: 12px;
  padding: 14px 18px; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.chap-nav a:hover { border-color: var(--forest); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30,27,75,0.10); }
.chap-nav .dir {
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
  color: var(--forest); letter-spacing: 0.12em; text-transform: uppercase; display: flex; align-items: center; gap: 5px;
}
.chap-nav .dir i { width: 13px; height: 13px; }
.chap-nav .nav-title { font-size: 14px; font-weight: 700; color: var(--canopy); margin-top: 4px; }
.chap-nav a.next { text-align: right; }
.chap-nav a.next .dir { justify-content: flex-end; }

/* ===== MathJax 調整 ===== */
mjx-container { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
mjx-container[display="true"] { margin: 0 !important; }

/* ===== レスポンシブ ===== */
@media (max-width: 720px) {
  .grid-2, .grid-3, .pillar-grid, .pillar-grid.two, .pillar-grid.four,
  .compare-grid { grid-template-columns: 1fr; }
  .toc ol { grid-template-columns: 1fr; }
  .measure-table, .notation-table { font-size: 13px; }
  .measure-table th, .measure-table td,
  .notation-table th, .notation-table td { padding: 8px 10px; }
  .hero.tall { padding: 40px 0 48px; }
}

/* ===== ダークモード ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --surface:      #1B1A33;
    --bg-meadow:    #0F0E22;
    --body:         #E5E7FB;
    --muted:        #94A3B8;
    --muted-strong: #C7CBE8;
    --indigo-50:    #1E1D3A;
    --indigo-100:   #312E81;
  }
  .inner-card, .pillar-card, .type-row, .case-card, .compare-col,
  .step, .toc, .eqn { border-color: #353275; }
  .meta-strip { background: #1B1A33; border-bottom-color: #353275; }
  .callout.info { background: #1E1D3A; border-color: #353275; color: #E0E7FF; }
  .callout.good { background: #052E1C; border-color: #14532D; color: #86EFAC; }
  .callout.cyan { background: #08303A; border-color: #155E75; color: #A5F3FC; }
  .measure-table tr:nth-child(even) td,
  .notation-table tr:nth-child(even) td { background: #232150; }
  .measure-table td, .notation-table td { border-bottom-color: #353275; }
  .eqn { background: #1E1D3A; }
  .issue-card { background: #422006; border-color: #713F12; }
  .issue-body h4, .issue-body p { color: #FDE68A; }
  .table-image-note { background: #1E293B; border-color: #334155; color: #C7CBE8; }
  .ref-block { background: #1E293B; border-color: #334155; color: #C7CBE8; }
  .tech-tag, .pillar-card .scope { background: #232150; border-color: #353275; }
  .doc-foot { border-top-color: #353275; }
  .chap-nav a { border-color: #353275; }
  .wrap:has(> .toc) > .toc ol a:hover,
  .wrap:has(> .toc) > .toc ol a.active { background: #232150; color: #C7D2FE; }
  .toc .yaku-switch { border-bottom-color: #353275; }
  .toc .yaku-switch a.ys-opt:hover { background: #232150; color: #C7D2FE; }
  .toc .rail-back { color: #C7D2FE; }
}
