/* RatioKit 解説記事 共通スタイル（ツール本体と同じダークテーマ） */
:root {
  --bg: #0b0b0d;
  --surface: #141417;
  --surface-2: #1b1b1f;
  --border: rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.14);
  --text: #f2f2f5;
  --body: #c4c4cc;
  --muted: #8d8d96;
  --faint: #5c5c64;
  --accent: #0a84ff;
  --accent-soft: rgba(10,132,255,.14);
  --warn: #ff9f0a;
  --radius: 14px;
  --radius-sm: 10px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Noto Sans JP", "Segoe UI", system-ui, sans-serif;
  font-size: 16px; line-height: 1.85; -webkit-font-smoothing: antialiased;
  padding: max(16px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; }

/* ヘッダー */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 16px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.site-head nav { display: flex; gap: 4px; margin-right: -10px; }
.site-head nav a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 8px 10px; border-radius: 8px; }
.site-head nav a:hover { color: var(--text); background: var(--surface-2); }

/* パンくず */
.crumbs { font-size: 12px; color: var(--faint); margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

/* 記事 */
article h1 { color: var(--text); font-size: clamp(24px, 5vw, 32px); line-height: 1.35; letter-spacing: -.01em; margin: 14px 0 10px; font-weight: 700; }
.meta { font-size: 12.5px; color: var(--faint); margin-bottom: 28px; }
article h2 { color: var(--text); font-size: 21px; line-height: 1.45; margin: 52px 0 14px; padding-top: 8px; font-weight: 650; letter-spacing: -.005em; }
article h3 { color: var(--text); font-size: 17px; margin: 32px 0 8px; font-weight: 600; }
article p { margin: 0 0 16px; }
article ul, article ol { margin: 0 0 18px; padding-left: 1.4em; }
article li { margin-bottom: 6px; }
article strong, article b { color: var(--text); font-weight: 600; }
article code { overflow-wrap: anywhere; font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--text); }

/* 結論ボックス */
.summary { background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 28px; }
.summary-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--accent); margin: 0 0 8px; }
.summary ul { margin: 0; padding-left: 1.2em; }
.summary li { margin-bottom: 4px; }

/* 補足・注意 */
.note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.note.warn { border-left: 3px solid var(--warn); }

/* 目次 */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 8px; font-size: 14.5px; }
.toc-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin: 3px 0; }
.toc a { color: var(--body); text-decoration: none; }
.toc a:hover { color: var(--accent); }

/* 表 */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 20px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
td:first-child { color: var(--text); white-space: nowrap; }
@media (max-width: 519px) { th, td { padding: 10px 10px; font-size: 13.5px; } td:first-child { white-space: normal; min-width: 5em; } }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* セーフゾーン図 */
.figure { margin: 8px 0 22px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.figure svg { width: 180px; height: auto; flex: none; }
.figure figcaption { flex: 1 1 220px; font-size: 13.5px; color: var(--muted); }
.figure .legend { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* ツールへの誘導 */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 18px 20px; margin: 28px 0; }
.cta p { margin: 0; color: var(--text); font-size: 15px; }
.cta p small { display: block; color: var(--muted); font-size: 13px; }
.cta a { flex: none; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; padding: 11px 18px; border-radius: 10px; }
.cta a:hover { filter: brightness(1.1); }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 16px; margin-bottom: 8px; }
details summary { cursor: pointer; padding: 14px 0; color: var(--text); font-weight: 500; list-style: none; position: relative; padding-right: 24px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; position: absolute; right: 0; top: 12px; color: var(--muted); font-size: 18px; }
details[open] summary::after { content: "−"; }
details p { margin: 0 0 14px; font-size: 15px; }

.sources { font-size: 13px; color: var(--muted); }
.sources a { word-break: break-all; }

/* 記事一覧 */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.post-list a { display: block; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; transition: border-color .15s, background .15s; }
.post-list a:hover { border-color: var(--border-strong); background: var(--surface-2); }
.post-list b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.post-list span { color: var(--muted); font-size: 13.5px; line-height: 1.6; display: block; }

/* フッター */
.site-footer { margin-top: 64px; padding: 24px 0 8px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 12.5px; color: var(--faint); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -10px; }
.site-footer nav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.site-footer nav a:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 519px) { .site-footer { flex-direction: column-reverse; align-items: flex-start; } }

/* コマンド */
pre.cmd { line-height: 1.6; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
pre.cmd code { background: none; border: none; padding: 0; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
