/* 限界の手前で 共通スタイル
   本文タイポグラフィ: 17px / line-height 1.8 / max-width 680px（調査レポート P1 準拠） */
:root {
  --bg: #fdfdfa;
  --text: #2b2b2b;
  --link: #1a5fb4;
  --muted: #6b6b6b;
  --border: #d8d5cc;
  --surface: #f4f2ea;
  --header-bg: #fdfdfa;
  --warn-bg: #fdf3e3;
  --warn-border: #d9a441;
  --btn-bg: #2b2b2b;
  --btn-text: #fdfdfa;
  --accent: #8a4b2a;
}
html[data-theme="dark"] {
  --bg: #1e1e22;
  --text: #e8e8e8;
  --link: #8ab4f8;
  --muted: #a8a8a8;
  --border: #44444c;
  --surface: #28282e;
  --header-bg: #1e1e22;
  --warn-bg: #33302a;
  --warn-border: #d9a441;
  --btn-bg: #e8e8e8;
  --btn-text: #1e1e22;
  --accent: #d9a06a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
a { color: var(--link); }
a:visited { color: var(--link); }

/* ヘッダー */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.site-logo {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "YuMincho", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 8px; flex: 1; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 8px;
  text-decoration: none;
  font-size: 14px;
}
.theme-toggle {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
}

/* レイアウト */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}
@media (min-width: 768px) {
  .container { padding: 24px 24px 64px; }
}
h1 {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "YuMincho", serif;
  font-size: 26px;
  line-height: 1.4;
  margin: 16px 0 8px;
}
h2 {
  font-size: 20px;
  line-height: 1.5;
  margin: 32px 0 12px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--border);
}
h3 { font-size: 17px; margin: 20px 0 8px; }
section { margin-bottom: 8px; }

/* パンくず */
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 4px;
  line-height: 1.6;
}
.breadcrumb a { color: var(--muted); }

/* 本文（小説） */
.story {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "YuMincho", "Hiragino Mincho Pro", serif;
  font-size: 17px;
  line-height: 1.8;
  margin-top: 24px;
}
.story p { margin: 0 0 1em; }
.story p.chapter {
  font-weight: 700;
  margin: 2em 0 1em;
}
.story p.subtitle {
  color: var(--muted);
  margin-bottom: 2em;
}
.story p.warn, p.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}
.preamble {
  background: var(--surface);
  border-radius: 8px;
  padding: 4px 16px 12px;
  margin-top: 16px;
  font-size: 15px;
}
.preamble h2 { border-bottom: none; margin-top: 20px; font-size: 17px; }
.episode-meta, .site-tagline { color: var(--muted); font-size: 14px; }

/* 前後ナビ */
.episode-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.nav-btn {
  flex: 1 1 30%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  text-align: center;
}
a.nav-btn { color: var(--text); }
.nav-disabled { opacity: 0.45; }

/* カード・一覧 */
.chara-card, .episode-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 16px 12px;
  margin: 12px 0;
  background: var(--surface);
}
.episode-card-meta { font-size: 13px; color: var(--muted); margin-top: 12px; }
.tag {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 12px;
  margin-right: 4px;
}
.story-list { padding-left: 1.2em; }
.story-list li { margin-bottom: 14px; line-height: 1.7; }
.updates { padding-left: 1.2em; }
.updates li { margin-bottom: 8px; }
.updates time { font-weight: 700; margin-right: 6px; }

/* 動画枠（アフィリエイト予定地） */
.video-slot {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 4px 16px 12px;
  margin: 32px 0;
  text-align: center;
}
.video-slot h2 { border-bottom: none; }
.video-slot-note { color: var(--muted); }

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
}
.btn-enter { background: var(--btn-bg); color: var(--btn-text); }
.btn-exit { background: var(--surface); color: var(--text); }

/* 年齢確認ゲート */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 20, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.age-gate[hidden] { display: none; }
.age-gate-box {
  background: #fdfdfa;
  color: #2b2b2b;
  max-width: 520px;
  width: 100%;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  line-height: 1.8;
}
.age-gate-title { font-size: 22px; font-weight: 700; margin-top: 0; }
.age-gate-buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
body.gate-locked { overflow: hidden; }

/* フッター */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 24px 16px 40px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.site-footer p { max-width: 680px; margin: 0 auto 10px; }
.footer-note { font-weight: 700; }

/* ペア話リンク（同じ日の、もう一人の話） */
.pair-story {
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 4px 16px 12px;
  margin: 32px 0;
  background: var(--surface);
}
.pair-story h2 { border-bottom: none; }
.pair-story-link { font-size: 17px; font-weight: 700; }

/* セクション見出し下の補足（話数など） */
.section-note { font-size: 13px; color: var(--muted); margin: -6px 0 12px; }

.tag-peak { border-color: #c07f13; color: #c07f13; }
html[data-theme="dark"] .tag-peak { border-color: #e3a93d; color: #e3a93d; }
.episode-position { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* うんち関連の追加プロフィール（アコーディオン） */
.unchi-profile { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 10px 16px 12px; margin: 20px 0; }
.unchi-profile summary { cursor: pointer; font-weight: 700; }
.unchi-profile p { margin: 10px 0 2px; }

/* うんち関連セクション内の話リスト */
.unchi-profile .story-list { margin: 10px 0 2px; }
