/* どうてき（douteki.net）デザイン
   基調は白＋ライトグレー。色は絞る: リンク・操作はインディゴブルー、
   割引・セール系はオレンジ、年齢バッジのみ緑／赤。その他はグレーの濃淡で示す。 */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #182230;
  --muted: #68727f;
  --line: #e3e7ee;
  --brand: #2456c8;
  --brand-dark: #1a3f96;
  --brand-soft: #eef2fb;
  --sale: #e8590c;
  --sale-soft: #fff3e8;
  --coupon: #0b8754;
  --age-all: #1e9e62;
  --age-r15: #d9930d;
  --age-r18: #d64545;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(24, 34, 48, .06), 0 4px 14px rgba(24, 34, 48, .04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.35; margin: 8px 0 12px; }
h2 { font-size: 19px; margin: 28px 0 12px; }
img { max-width: 100%; }
.sp-only { display: none; }

/* ---- ヘッダー ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 20px; height: 56px;
}
.logo {
  font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: .04em;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; color: var(--brand); }
.site-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.site-nav a {
  color: var(--ink); padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: 14px;
}
.site-nav a:hover { background: var(--brand-soft); text-decoration: none; }
.site-nav a.nav-active { color: var(--brand); font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* R18トグル */
.age-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.age-toggle-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.age-toggle input { display: none; }
.age-toggle-ui {
  width: 38px; height: 22px; border-radius: 999px; background: #ccd3dd; position: relative; transition: background .15s;
  flex: none;
}
.age-toggle-ui::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.age-toggle input:checked + .age-toggle-ui { background: var(--age-r18); }
.age-toggle input:checked + .age-toggle-ui::after { left: 19px; }

/* ハンバーガー */
.nav-button {
  display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); cursor: pointer; padding: 9px 10px;
}
.nav-button span { display: block; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 1px; }

/* ---- レイアウト ---- */
.container { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; }
.crumbs { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.meta { color: var(--muted); }
.list-count { color: var(--muted); margin: 0 0 8px; }

/* ---- ヒーロー ---- */
.hero {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 32px 28px; margin-bottom: 8px;
}
.hero-title { font-size: 30px; margin: 0 0 10px; }
.nb { display: inline-block; }
.hero-text { color: var(--muted); max-width: 640px; margin: 0 0 18px; }
.hero-search { display: flex; gap: 8px; max-width: 560px; }
.hero-search input {
  flex: 1; padding: 12px 14px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface);
}
.hero-search button, .button-primary {
  padding: 12px 22px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 700;
}
.hero-search button:hover, .button-primary:hover { background: var(--brand-dark); }
.genre-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.genre-tile {
  display: block; padding: 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); color: var(--ink);
}
.genre-tile:hover { text-decoration: none; border-color: var(--brand); box-shadow: var(--shadow); }
.tile-label { display: block; font-weight: 700; font-size: 16px; }
.tile-count { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---- セクション ---- */
.home-section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; gap: 14px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 13px; }
.section-note { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.home-sale-link { margin-top: 26px; color: var(--muted); }

/* ---- 作品カード ---- */
.work-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px; margin-top: 14px;
}
.work-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 5px;
  color: var(--ink);
}
a.work-card:hover { text-decoration: none; border-color: var(--brand); }
.card-thumb {
  margin: -14px -16px 6px; border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden; background: #eef0f3; aspect-ratio: 4 / 3;
}
.card-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.chobit-player { margin: 8px 0 6px; }
.chobit-player iframe { width: 100%; max-width: 740px; height: 215px; border: 0; display: block; }
.work-thumb { margin: 12px 0 6px; }
.work-thumb img {
  width: 100%; max-width: 480px; height: auto; display: block;
  border: 1px solid var(--line); border-radius: var(--radius); background: #eef0f3;
}
.card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-title { font-size: 15.5px; line-height: 1.45; margin: 2px 0 0; color: var(--ink); }
a.work-card:hover .card-title { color: var(--brand); }
.card-circle { margin: 0; font-size: 13px; color: var(--muted); }
.card-meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.card-rating { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 700; }
.card-price-main { margin-top: auto; padding-top: 8px; }
.card-stores { border-top: 1px dashed var(--line); padding-top: 6px; }
.card-store-row { font-size: 13px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.store-name { color: var(--muted); min-width: 44px; }
.card-sale-end { margin: 4px 0 0; font-size: 12.5px; color: var(--sale); font-weight: 700; }
.card-noprice { color: var(--muted); margin: auto 0 0; padding-top: 8px; font-size: 13px; }
.price-now { font-size: 17px; font-weight: 800; color: var(--ink); }
.card-price-main .price-now { font-size: 19px; }
.price-regular { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.off-badge {
  background: var(--sale); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; vertical-align: 2px;
}
.coupon-price { color: var(--sale); font-weight: 700; font-size: 13px; }
.lowest-badge {
  background: var(--sale-soft); color: var(--sale); border: 1px solid var(--sale);
  font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px;
}
.ending-badge {
  margin-left: auto; background: var(--sale); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 1px 8px; border-radius: 999px;
}

/* チップ・バッジ */
.chip {
  font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark);
}
.chip:hover { text-decoration: none; opacity: .85; }
.badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: #fff; }
.badge-all { background: var(--age-all); }
.badge-r15 { background: var(--age-r15); }
.badge-r18 { background: var(--age-r18); }
.term-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.term-chip {
  display: inline-block; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 11px; font-size: 13px; color: var(--ink);
}
.term-chip:hover { border-color: var(--brand); text-decoration: none; }
.term-count { color: var(--muted); font-size: 12px; }
.chip-section { margin-top: 30px; }
.more-link { font-size: 13px; }

/* ---- 並び替え ---- */
.sort-toolbar {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; margin-top: 10px; font-size: 14px;
}
.sort-toolbar select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; }
.sale-only { cursor: pointer; }

/* ---- ジャンル絞り込み・ページネーション ---- */
.genre-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.genre-chip {
  padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 13.5px; color: inherit;
}
.genre-chip:hover { border-color: var(--brand); text-decoration: none; }
.genre-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 26px 0 6px; }
.page-link, .page-current {
  min-width: 38px; text-align: center; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px;
}
.page-link:hover { border-color: var(--brand); text-decoration: none; }
.page-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.page-gap { color: var(--muted); padding: 0 2px; }

/* ---- 価格表 ---- */
.table-scroll { overflow-x: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.price-table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14px; }
.price-table th, .price-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.price-table th { background: #f0f3f9; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.price-table tr:last-child td { border-bottom: none; }
.price-table .cell-price { white-space: nowrap; }
.price-table .cell-store { font-weight: 700; white-space: nowrap; }
.price-table td:not(.cell-work) { white-space: nowrap; }
.price-table .cell-work { min-width: 220px; }
.price-table tr.row-link { cursor: pointer; }
.price-table tr.row-link:hover td { background: #f4f7fc; }
.row-lowest { background: var(--sale-soft); }
.cell-sub { color: var(--muted); font-size: 12px; }
.table-note { color: var(--muted); font-size: 12.5px; }
.price-list-item { margin-top: 26px; }
.price-item-title { font-size: 17px; margin: 0; }
.genre-links { display: flex; gap: 10px; flex-wrap: wrap; }
.genre-links a {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 13.5px;
}

/* ---- 作品詳細 ---- */
.work-title { font-size: 24px; }
.work-meta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.meta-row { display: flex; gap: 12px; padding: 4px 0; align-items: baseline; }
.meta-label { flex: none; width: 92px; color: var(--muted); font-size: 13px; font-weight: 700; }
.meta-values { display: flex; flex-wrap: wrap; gap: 6px; }
.verdict {
  background: var(--brand-soft); border-left: 4px solid var(--brand);
  padding: 10px 14px; border-radius: 0 8px 8px 0; font-weight: 600;
}
.chart-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 10px; }
.price-chart { width: 100%; height: auto; }
.chart-label { font-size: 11px; fill: var(--muted); }
.chart-legend { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.legend-item { margin-right: 14px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.related-section { margin-top: 34px; }

/* ---- 年齢ゲート ---- */
.age-gate {
  position: fixed; inset: 0; z-index: 100; background: rgba(16, 22, 34, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.age-gate-box {
  background: var(--surface); border-radius: 16px; padding: 28px; max-width: 420px; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.age-gate-title { font-size: 19px; font-weight: 800; margin: 0 0 8px; }
.age-gate-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.button-ghost {
  padding: 12px 20px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface);
}
.button-ghost:hover { text-decoration: none; background: var(--bg); }
.age-hint {
  background: var(--brand-soft); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 8px 14px; font-size: 13.5px;
}

/* ---- 年齢確認モーダル（R18トグル用） ---- */
.age-modal {
  position: fixed; inset: 0; z-index: 100; background: rgba(16, 22, 34, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.age-modal[hidden] { display: none; }
.age-modal-box {
  background: var(--surface); border-radius: 16px; padding: 28px; max-width: 420px; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.age-modal-title { font-size: 19px; font-weight: 800; margin: 0 0 8px; }
.age-modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.sale-hidden { display: none !important; }

/* ---- 検索 ---- */
.search-form { display: flex; gap: 8px; max-width: 560px; margin-top: 8px; }
.search-form input {
  flex: 1; padding: 11px 14px; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.search-form button {
  padding: 11px 22px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 700;
}

/* ---- フッター ---- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 20px; }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 26px 16px 34px; }
.footer-logo { font-weight: 800; font-size: 17px; margin: 0 0 8px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; }
.footer-nav a { color: var(--ink); font-size: 13.5px; }
.footer-note { color: var(--muted); font-size: 12.5px; margin: 4px 0; }

/* ---- モバイル ---- */
@media (max-width: 760px) {
  .sp-only { display: inline; }
  h1 { font-size: 22px; }
  .hero { padding: 22px 16px; }
  .hero-title { font-size: 23px; }
  .genre-tiles { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .nav-button { display: block; }
  .site-nav {
    display: none; position: absolute; top: 56px; right: 0; left: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 10px 16px 16px; gap: 2px;
    box-shadow: 0 12px 24px rgba(24,34,48,.12);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px; font-size: 15px; }
  .meta-label { width: 76px; }
  .work-title { font-size: 20px; }
}

/* サイドバー広告（PCのみ表示） */
.sidebar { display: none; }
@media (min-width: 1180px) {
  .page-wrap { display: flex; gap: 28px; max-width: 1480px; margin: 0 auto; padding: 0 16px; align-items: flex-start; }
  .page-wrap .container { flex: 1 1 auto; min-width: 0; margin: 0; padding-left: 0; padding-right: 0; }
  .sidebar { display: block; flex: 0 0 300px; width: 300px; padding-top: 20px; }
  .sidebar .sidebar-sticky { position: sticky; top: 16px; }
  .sidebar .ad-label { font-size: 11px; color: #888; margin: 0 0 6px; }
  .sidebar iframe { display: block; }
  .sidebar .sidebar-cloud { margin-top: 26px; }
  .sidebar .sidebar-cloud-title { font-size: 13px; font-weight: 700; margin: 0 0 8px; }
  .sidebar .tag-cloud { line-height: 2.05; }
  .sidebar .cloud-tag { color: var(--brand); text-decoration: none; margin-right: 9px; white-space: nowrap; }
  .sidebar .cloud-tag:hover { text-decoration: underline; }
  .sidebar .cloud-tag.lv1 { font-size: 12px; }
  .sidebar .cloud-tag.lv2 { font-size: 13.5px; }
  .sidebar .cloud-tag.lv3 { font-size: 15.5px; }
  .sidebar .cloud-tag.lv4 { font-size: 18px; }
  .sidebar .cloud-tag.lv5 { font-size: 21px; font-weight: 600; }
  .sidebar .cloud-count { font-size: 10px; color: #888; margin-left: 2px; vertical-align: super; }
  .sidebar .sidebar-cloud .more-link { margin-top: 8px; font-size: 12.5px; }
}
.coupon-section { margin-top: 30px; }
