/* ==========================================================================
   Claude Code & X記事自動化 導入手順書 スタイルシート
   デザイン要件:
   - 白地 (#ffffff), 濃紺本文 (#0f172a / #1e293b)
   - Skitch風マゼンタ注釈 (#e11d48 / #be185d / #f43f5e)
   - 16px以上のフォント、可読性重視の編集デザイン
   - 左サイドバー（章ナビ）、OS切替（Mac/Windows・DOM保持）
   - コピーボタン、チェックボックス、レスポンシブ、印刷対応
   ========================================================================== */

:root {
  /* カラーパレット */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-code: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;

  /* Skitch マゼンタ */
  --skitch-magenta: #e11d48;
  --skitch-magenta-dark: #be185d;
  --skitch-magenta-light: #ffe4e6;
  --skitch-magenta-glow: rgba(225, 29, 72, 0.15);

  /* アクセント・ステータスカラー */
  --accent-blue: #2563eb;
  --accent-blue-light: #eff6ff;
  --accent-green: #16a34a;
  --accent-green-light: #f0fdf4;
  --accent-amber: #d97706;
  --accent-amber-light: #fffbeb;

  /* タイポグラフィ */
  --font-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-size-base: 16px;
  --line-height-base: 1.75;

  /* レイアウト */
  --sidebar-width: 280px;
  --content-max-width: 960px;
  --header-height: 64px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-skitch: 0 0 0 2px #ffffff, 0 0 0 5px var(--skitch-magenta);
}

/* 基本リセット */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-base);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* リンク */
a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--skitch-magenta);
}

/* ==========================================================================
   ヘッダーとナビゲーション
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 8px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.brand-badge {
  background-color: var(--skitch-magenta);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* OS切り替えスイッチ */
.os-selector-group {
  display: flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.os-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.os-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.os-btn.active {
  background-color: #ffffff;
  color: var(--skitch-magenta);
  box-shadow: var(--shadow-sm);
}

/* モバイルメニュートグル */
.menu-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* 進捗プログレスバー */
.progress-bar-container {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: 4px;
  background: var(--bg-tertiary);
  z-index: 999;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--skitch-magenta), var(--skitch-magenta-dark));
  transition: width 0.3s ease;
}

/* ==========================================================================
   レイアウト構造
   ========================================================================== */
.site-layout {
  display: flex;
  margin-top: calc(var(--header-height) + 4px);
  min-height: calc(100vh - var(--header-height) - 4px);
}

/* 左サイドバー目次 */
.sidebar-nav {
  width: var(--sidebar-width);
  position: sticky;
  top: calc(var(--header-height) + 4px);
  height: calc(100vh - var(--header-height) - 4px);
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  padding: 24px 16px;
  flex-shrink: 0;
}

.sidebar-heading {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 8px;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  line-height: 1.4;
}

.nav-link:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--skitch-magenta-light);
  color: var(--skitch-magenta);
  font-weight: 700;
  border-left: 3px solid var(--skitch-magenta);
}

.nav-badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 10px;
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link.active .nav-badge {
  background-color: #ffffff;
  color: var(--skitch-magenta);
}

/* メインコンテンツエリア */
.main-content {
  flex: 1;
  max-width: var(--content-max-width);
  width: 100%;
  min-width: 0; /* flexアイテムの縮小を許可 */
  margin: 0 auto;
  padding: 40px 32px 120px;
  overflow-wrap: break-word;
}

/* ドキュメント案内ヘッダー */
.doc-intro-banner {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 40px;
}

.doc-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 12px;
}

.doc-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.doc-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   章・セクション・見出しスタイル
   ========================================================================== */
.chapter-section {
  margin-bottom: 64px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
}

.chapter-header {
  margin-bottom: 24px;
}

.chapter-number {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--skitch-magenta);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.chapter-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 24px 0 12px;
}

p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

strong {
  color: var(--text-primary);
  font-weight: 700;
}

ul, ol {
  margin: 0 0 20px 24px;
  color: var(--text-secondary);
}

li {
  margin-bottom: 8px;
}

/* ==========================================================================
   Skitch風 注釈・バッジ・枠線・矢印
   ========================================================================== */
/* Skitch注釈バッジ（番号丸） */
.skitch-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--skitch-magenta);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9375rem;
  box-shadow: 0 2px 4px rgba(225, 29, 72, 0.3);
  flex-shrink: 0;
}

.skitch-badge-large {
  width: 36px;
  height: 36px;
  font-size: 1.125rem;
}

/* Skitch枠線強調ボックス */
.skitch-box {
  position: relative;
  border: 3px solid var(--skitch-magenta);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0;
  background-color: #ffffff;
  box-shadow: 0 4px 12px var(--skitch-magenta-glow);
}

.skitch-box-label {
  position: absolute;
  top: -14px;
  left: 16px;
  background-color: var(--skitch-magenta);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Skitch矢印ポインター */
.skitch-pointer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--skitch-magenta);
  font-weight: 700;
  margin: 8px 0;
}

/* Skitch丸番号ピン（画像上に配置する①②） */
.skitch-number-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--skitch-magenta);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 10;
  cursor: default;
}

/* Skitch四角枠（画像上のハイライト枠） */
.skitch-rect-highlight {
  position: absolute;
  border: 3px solid var(--skitch-magenta);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 9;
}

/* 画像下のSkitch注釈説明リスト（レジェンド） */
.screenshot-legend {
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-primary);
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--skitch-magenta);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* 折りたたみ（details/summary） */
details.tree-details {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: 16px 0;
  background-color: var(--bg-secondary);
  overflow: hidden;
}

details.tree-details summary {
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  background-color: var(--bg-tertiary);
  user-select: none;
  outline: none;
  transition: background-color 0.2s;
}

details.tree-details summary:hover {
  background-color: #e2e8f0;
}

details.tree-details .details-content {
  padding: 16px;
  background-color: #ffffff;
}

.skitch-pointer svg {
  width: 20px;
  height: 20px;
  fill: var(--skitch-magenta);
  transform: rotate(0deg);
}

/* ==========================================================================
   各手順の4要素カード構造
   「どこを開く」「何をする」「成功の確認」「困ったら」
   ========================================================================== */
.step-container {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.step-container:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-md);
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.step-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ステップ完了チェックボックス */
.step-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.step-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.step-checkbox:checked {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
}

.step-checkbox:checked::after {
  content: "✔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.step-container.completed {
  border-color: rgba(22, 163, 74, 0.4);
  background-color: rgba(240, 253, 244, 0.3);
}

.step-body {
  padding: 24px 20px;
}

/* 4要素グリッド/リスト */
.quad-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.quad-item {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.quad-item-where {
  border-left: 4px solid var(--accent-blue);
  background-color: var(--accent-blue-light);
}

.quad-item-what {
  border-left: 4px solid var(--skitch-magenta);
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-left-width: 4px;
}

.quad-item-success {
  border-left: 4px solid var(--accent-green);
  background-color: var(--accent-green-light);
}

.quad-item-trouble {
  border-left: 4px solid var(--accent-amber);
  background-color: var(--accent-amber-light);
}

.quad-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.quad-item-where .quad-label { color: var(--accent-blue); }
.quad-item-what .quad-label { color: var(--skitch-magenta-dark); }
.quad-item-success .quad-label { color: var(--accent-green); }
.quad-item-trouble .quad-label { color: var(--accent-amber); }

.quad-content {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.quad-content ul, .quad-content ol {
  margin: 0 0 8px 20px;
}

/* ==========================================================================
   OS表示制御（Mac / Windows）
   ※ 全手順をDOMに保持し、CSSで表示・非表示を制御
   ========================================================================== */
.os-mac, .os-win {
  transition: opacity 0.2s ease;
}

/* デフォルトはMac表示 */
body[data-active-os="mac"] .os-win {
  display: none !important;
}

body[data-active-os="mac"] .os-mac {
  display: block;
}

body[data-active-os="win"] .os-mac {
  display: none !important;
}

body[data-active-os="win"] .os-win {
  display: block;
}

/* インライン用OS表示 */
span.os-mac, span.os-win {
  display: inline !important;
}

body[data-active-os="mac"] span.os-win {
  display: none !important;
}

body[data-active-os="win"] span.os-mac {
  display: none !important;
}

/* OSバッジ */
.os-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.os-indicator-badge.mac {
  background-color: #e2e8f0;
  color: #1e293b;
}

.os-indicator-badge.win {
  background-color: #dbeafe;
  color: #1d4ed8;
}

/* ==========================================================================
   コードブロック・コマンド・コピーボタン
   ========================================================================== */
.code-wrapper {
  position: relative;
  margin: 16px 0;
  background-color: var(--bg-code);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: #1e293b;
  border-bottom: 1px solid #334155;
  font-size: 0.8125rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #334155;
  color: #f1f5f9;
  border: 1px solid #475569;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background-color: var(--skitch-magenta);
  border-color: var(--skitch-magenta);
}

.copy-btn.copied {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

p code, li code, td code {
  background-color: var(--bg-tertiary);
  color: #b91c1c;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   テーブル
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: left;
}

th, td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 700;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) td {
  background-color: rgba(248, 250, 252, 0.5);
}

/* ==========================================================================
   コールアウト・アラート
   ========================================================================== */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  border-left: 5px solid;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 1rem;
}

.callout-danger {
  background-color: #fff1f2;
  border-color: #e11d48;
  color: #9f1239;
}

.callout-danger .callout-title { color: #be123c; }

.callout-warning {
  background-color: #fffbeb;
  border-color: #d97706;
  color: #92400e;
}

.callout-warning .callout-title { color: #b45309; }

.callout-info {
  background-color: #eff6ff;
  border-color: #2563eb;
  color: #1e40af;
}

.callout-info .callout-title { color: #1d4ed8; }

.callout-success {
  background-color: #f0fdf4;
  border-color: #16a34a;
  color: #166534;
}

.callout-success .callout-title { color: #15803d; }

/* ==========================================================================
   スクリーンショット / Skitch注釈レイヤーコンテナ
   manifest.jsonの読み込みまたは構造プレースホルダー
   ========================================================================== */
.screenshot-container {
  position: relative;
  margin: 24px 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  overflow: hidden;
}

.screenshot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.screenshot-body {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
}

.screenshot-image {
  width: 100%;
  height: auto;
  display: block;
}

/* 注釈レイヤー (SVG/HTML) */
.annotation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.skitch-pin {
  position: absolute;
  pointer-events: auto;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
  animation: skitchBounce 1.5s ease infinite alternate;
}

@keyframes skitchBounce {
  0% { transform: translate(-50%, -100%); }
  100% { transform: translate(-50%, -108%); }
}

.skitch-pin-label {
  background-color: var(--skitch-magenta);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}

.skitch-pin-arrow {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid var(--skitch-magenta);
  margin-top: -1px;
}

.screenshot-caption {
  padding: 8px 16px;
  background-color: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.screenshot-source-link {
  color: var(--accent-blue);
  font-size: 0.75rem;
  text-decoration: none;
}
.screenshot-source-link:hover {
  text-decoration: underline;
}

/* プレースホルダー表示（実画像偽装の防止） */
.screenshot-placeholder {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

.screenshot-placeholder-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--skitch-magenta);
}

/* ==========================================================================
   フッター
   ========================================================================== */
.site-footer {
  margin-top: 80px;
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.footer-content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   レスポンシブ対応
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }
}

@media (max-width: 768px) {
  .menu-toggle-btn {
    display: inline-block;
  }

  .brand-badge {
    display: none; /* スマホ画面では縦書き状になるのを防ぐため非表示 */
  }

  .site-header {
    padding: 0 10px;
  }

  .os-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .os-btn svg {
    width: 14px;
    height: 14px;
  }

  .sidebar-nav {
    position: fixed;
    top: calc(var(--header-height) + 4px);
    left: -100%;
    width: 280px;
    z-index: 1001;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar-nav.open {
    left: 0;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .main-content {
    padding: 20px 12px 60px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .doc-intro-banner {
    padding: 16px;
  }

  .doc-title {
    font-size: 1.35rem;
  }

  .chapter-title {
    font-size: 1.2rem;
  }

  .step-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  pre {
    padding: 12px;
    font-size: 0.8125rem;
  }
}

/* ==========================================================================
   トップ クイックリンク バナー（画像集・AI文書への目立つリンク）
   ========================================================================== */
.top-quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 20px 0 32px;
}

.top-quick-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.top-quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--skitch-magenta);
}

.top-quick-card.card-screenshots {
  border-left: 6px solid var(--skitch-magenta);
}

.top-quick-card.card-ai-guide {
  border-left: 6px solid #4f46e5;
}

.top-quick-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.top-quick-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.top-quick-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-quick-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   スクリーンショット操作バー（拡大・原寸・ダウンロード）
   ========================================================================== */
.screenshot-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 12px;
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
}

.screenshot-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.screenshot-action-btn:hover {
  background-color: #f8fafc;
  color: var(--skitch-magenta);
  border-color: var(--skitch-magenta);
}

/* 5項目解説カード（スクリーンステップ用） */
.step-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--skitch-magenta);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.875rem;
}

.step-detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: baseline;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .step-detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.step-detail-label {
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-detail-value {
  color: var(--text-primary);
}

.step-detail-value code {
  background-color: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: #0f172a;
}

/* 出典バッジ */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.source-badge-provided {
  background-color: #fce7f3;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.source-badge-official {
  background-color: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

/* ==========================================================================
   画像拡大モーダル (Lightbox Modal)
   ========================================================================== */
.image-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.image-modal-overlay.is-active {
  display: flex;
}

.image-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #0f172a;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid #334155;
  overflow: hidden;
}

.image-modal-img {
  max-width: 95vw;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.image-modal-caption {
  width: 100%;
  padding: 12px 20px;
  background-color: #1e293b;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 500;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.image-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background-color: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  border: 1px solid #475569;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 10;
}

.image-modal-close:hover {
  background-color: var(--skitch-magenta);
  border-color: var(--skitch-magenta);
  transform: scale(1.1);
}

/* ==========================================================================
   画像集ページ（screenshots.html）専用スタイル
   ========================================================================== */
.gallery-toc {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 40px;
}

.gallery-toc-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.gallery-toc-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 8px 20px;
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.gallery-intro {
  margin-bottom: 32px;
  padding: 20px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.gallery-item {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.gallery-item:hover {
  box-shadow: var(--shadow-md);
}

.gallery-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.gallery-item-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-item-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background-color: var(--skitch-magenta);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
}

/* ==========================================================================
   印刷対応 (@media print)
   ========================================================================== */
@media print {
  .site-header, .sidebar-nav, .progress-bar-container, .copy-btn, .step-checkbox-label,
  .top-quick-nav, .screenshot-actions, .image-modal-overlay {
    display: none !important;
  }

  .site-layout {
    margin-top: 0;
  }

  .main-content {
    max-width: 100%;
    padding: 0;
  }

  /* 印刷時はMacとWindows両方の手順を展開して表示 */
  body[data-active-os="mac"] .os-win,
  body[data-active-os="win"] .os-mac {
    display: block !important;
    opacity: 0.9;
    border-left: 2px dashed #94a3b8;
    padding-left: 12px;
    margin-top: 12px;
  }

  .os-indicator-badge {
    border: 1px solid #000;
  }

  .chapter-section {
    page-break-inside: avoid;
    border-bottom: 2px solid #000;
  }

  .gallery-item {
    page-break-inside: avoid;
    break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 20px;
  }

  a {
    text-decoration: underline;
    color: #000;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

