:root {
  --fg: #1a1a1a;
  --bg: #ffffff;
  --muted: #666;
  --accent: #c1272d; /* ImageMagick 公式の赤系 */
  --border: #e2e2e2;
  --code-bg: #f6f8fa;
  --banner-bg: #fff8e1;
  --banner-border: #f0c36d;
  --max: 1100px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6e6e6; --bg: #16181c; --muted: #9aa0a6; --border: #2c2f36;
    --code-bg: #1f2228; --banner-bg: #2b2410; --banner-border: #6b5a1f;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--fg); background: var(--bg);
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.75; font-size: 16px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header { border-bottom: 1px solid var(--border); }
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: .75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--fg); }
.lang-switch a { margin-left: .75rem; color: var(--muted); font-size: .9rem; }
.lang-switch a.active { color: var(--accent); font-weight: 700; }

.unofficial-banner {
  background: var(--banner-bg); border-bottom: 1px solid var(--banner-border);
  padding: .6rem 1rem; font-size: .85rem; text-align: center;
}

.layout {
  max-width: var(--max); margin: 0 auto; padding: 1.5rem 1rem;
  display: grid; grid-template-columns: 220px 1fr; gap: 2rem;
}
.sidebar nav ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 1rem; }
.sidebar li { margin: .15rem 0; }
.sidebar li a { display: block; padding: .35rem .6rem; border-radius: 6px; color: var(--fg); }
.sidebar li a:hover { background: var(--code-bg); text-decoration: none; }
.sidebar li.current a { background: var(--accent); color: #fff; }

/* スマホ: 本文を先頭に、ページ一覧は本文の下にコンパクトなチップ表示で置く。 */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .content { order: -1; }
  .sidebar { border-top: 1px solid var(--border); padding-top: 1rem; }
  .sidebar nav ul {
    position: static; display: flex; flex-wrap: wrap; gap: .35rem;
  }
  .sidebar li { margin: 0; }
  .sidebar li a {
    padding: .3rem .6rem; border: 1px solid var(--border); border-radius: 999px;
    font-size: .85rem;
  }
}

.content { min-width: 0; }
.content article { overflow-wrap: break-word; }
.content h1 { font-size: 1.9rem; border-bottom: 2px solid var(--border); padding-bottom: .3rem; }
.content h2 { margin-top: 2rem; border-bottom: 1px solid var(--border); padding-bottom: .2rem; }
.content pre {
  background: var(--code-bg); padding: 1rem; border-radius: 8px; overflow-x: auto;
  border: 1px solid var(--border); font-size: .9rem;
}
.content code {
  background: var(--code-bg); padding: .15em .4em; border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace; font-size: .9em;
}
.content pre code { background: none; padding: 0; }
/* 広い表はラッパで横スクロールさせ、本文レイアウトを崩さない（スマホ対応）。 */
.content .table-wrap { overflow-x: auto; margin: 1rem 0; }
.content table { border-collapse: collapse; width: 100%; }
.content th, .content td { border: 1px solid var(--border); padding: .5rem .75rem; vertical-align: top; }
.content th { background: var(--code-bg); text-align: left; }
.content img { max-width: 100%; height: auto; }

/* 定義リスト（原文 <dl>：オプション名/言語名などの用語＋説明） */
.content dl { margin: 1rem 0; }
.content dt { font-weight: 600; margin-top: .8rem; }
.content dd { margin: .2rem 0 .2rem 1.4rem; }

/* CLI オプション索引（原文 <select> を復元）。300 項目を 1 つのドロップダウンに集約。 */
.content .cli-option-jump {
  max-width: 100%; padding: .5rem .7rem; margin: .5rem 0 1.5rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--code-bg);
  color: var(--fg); font-size: .95rem;
}

.source-link { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px dashed var(--border); font-size: .85rem; color: var(--muted); }

.site-footer {
  border-top: 1px solid var(--border); margin-top: 2rem; padding: 1.5rem 1rem;
  font-size: .8rem; color: var(--muted); text-align: center;
}
.site-footer p { max-width: var(--max); margin: .4rem auto; }

/* Cookie 同意バナー（Consent Mode v2 連動）。画面下部固定。 */
.consent-banner[hidden] { display: none; }
.consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: flex; flex-wrap: wrap; gap: .8rem 1.2rem;
  align-items: center; justify-content: center;
  padding: .8rem 1rem;
  background: var(--code-bg); border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,.12);
  font-size: .85rem; color: var(--fg);
}
.consent-banner .consent-actions { display: flex; gap: .6rem; }
.consent-banner button {
  cursor: pointer; padding: .4rem .9rem; border-radius: 6px;
  border: 1px solid var(--border); font-size: .85rem;
}
.consent-banner #consent-accept { background: var(--accent); color: #fff; border-color: var(--accent); }
.consent-banner #consent-reject { background: transparent; color: var(--fg); }
