/* erecty — 配色は暗い／明るいの 2 つ（A-8b）。差し色は橙 1 色 #ff9f43 で、両配色とも同じ値（10/23 大石さんのデザイン判断 ⑦）。
   --accent: ロゴ・大きい文字・グラフの線と点・枠・塗り・フォーカスの輪。--accent-text: 小さい文字の橙（値は --accent と同じ）。
   --accent-ink: 橙の塗りの上の文字。両配色とも白 #FFFFFF（⑧）。
   セールの赤 --sale（#D32F2F・両配色同じ）: 「セール中」の印の背景とセール中の作品の価格。印の上の文字は白（4.98:1）。
   橙の文字・線と、橙の塗りの上の白い文字、--sale と一致する文字は、文字と背景の比（4.5:1／3:1）の基準の対象外（大石さんが決めた）。それ以外の文字（--text・--muted）は 4.5:1 を保つ。
   最初の配色は端末の設定（prefers-color-scheme）。boot.js が描く前に <html data-theme="dark|light"> を付ける。
   JavaScript が動かないときは data-theme が付かず、下の @media が端末の設定に従う（切り替えのボタンは出さない）。
   すべて自前（外部のフォント・CSS は使わない）。色は変数にまとめ、直書きは見本プレーヤーまわり（--media-*）だけ。 */
:root {
  color-scheme: dark;
  --bg: #101116;
  --panel: #181a21;
  --panel2: #1f222b;
  --line: #2c303b;
  --text: #e9eaee;
  --muted: #9a9da8;
  --accent: #ff9f43;
  --accent-text: #ff9f43;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 159, 67, 0.16);
  --sale: #D32F2F;
  --sale-ink: #ffffff;
  --radius: 10px;
  --maxw: 780px;
  /* 見本プレーヤーの枠と動画の上の重ねは、どちらの配色でも黒のまま */
  --media-bg: #000;
  --media-shade: rgba(0, 0, 0, 0.28);
  --media-shade-hover: rgba(0, 0, 0, 0.12);
  --media-label-bg: rgba(0, 0, 0, 0.6);
  --media-note-bg: rgba(16, 17, 22, 0.88);
  --media-text: #fff;
  --media-muted: #9a9da8;
  --media-accent: #ff9f43;
}
:root[data-theme="dark"] { color-scheme: dark; }
/* 明るい配色（参考サイトの白地＋グレーの面。補助の文字だけ比を満たすよう調整・差し色は暗い配色と同じ橙） */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f5f5f7;
  --panel2: #ebebef;
  --line: #d2d2d7;
  --text: #1d1d1f;
  --muted: #6a6a6f;
  --accent: #ff9f43;
  --accent-text: #ff9f43;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 159, 67, 0.16);
  --sale: #D32F2F;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #ffffff;
    --panel: #f5f5f7;
    --panel2: #ebebef;
    --line: #d2d2d7;
    --text: #1d1d1f;
    --muted: #6a6a6f;
    --accent: #ff9f43;
    --accent-text: #ff9f43;
    --accent-ink: #ffffff;
    --accent-soft: rgba(255, 159, 67, 0.16);
  --sale: #D32F2F;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.65; font-size: 16px; overflow-wrap: anywhere;
}
a { color: var(--text); text-decoration-color: var(--muted); text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
img, svg { max-width: 100%; }
h1 { font-size: 1.45rem; line-height: 1.35; margin: 0.4em 0 0.6em; }
h2 { font-size: 1.15rem; line-height: 1.4; margin: 1.4em 0 0.6em; }
button, input, textarea { font: inherit; color: inherit; }
::placeholder { color: var(--muted); opacity: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.lead { color: var(--muted); margin: 0 0 1em; }
.empty { color: var(--muted); padding: 32px 0; text-align: center; }

/* 最上部の PR の 1 行 */
.pr-line { background: var(--panel2); color: var(--muted); font-size: 0.78rem; text-align: center; padding: 5px 12px; border-bottom: 1px solid var(--line); }

/* ヘッダー */
.site-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: var(--maxw); margin: 0 auto; padding: 10px 16px;
}
.logo { font-size: 1.7rem; font-weight: 800; letter-spacing: 0.02em; color: var(--accent); text-decoration: none; line-height: 1; padding: 4px 2px; }
.logo:hover { color: var(--accent); }
.header-search { flex: 1 1 200px; display: flex; gap: 6px; min-width: 0; }
.header-search input, .search-form input {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--text);
}
.header-search button, .search-form button {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap;
}
.menu-btn, .theme-btn {
  display: inline-flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 44px;
}
/* 配色のボタン: 半月のマーク（自前の SVG）。44px 四方以上。JavaScript が動くときだけ出す。明るい配色では向きを反対にして、今の配色が分かるようにする */
.theme-btn { display: none; justify-content: center; width: 44px; min-width: 44px; padding: 0; color: var(--text); }
.js .theme-btn { display: inline-flex; }
.theme-icon { display: block; width: 22px; height: 22px; max-width: none; }
html[data-theme="light"] .theme-icon { transform: scaleX(-1); }
@media (prefers-color-scheme: light) { html:not([data-theme]) .theme-icon { transform: scaleX(-1); } }
.menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 18px; height: 2px; background: var(--text); content: ""; position: relative; }
.menu-bars::before { position: absolute; top: -6px; }
.menu-bars::after { position: absolute; top: 6px; }
.menu-btn[aria-expanded="true"] { border-color: var(--accent); }
.menu { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.menu ul { list-style: none; margin: 0 0 8px; padding: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.menu a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; }
.menu a:hover { background: var(--panel2); }
.js .menu { display: none; }
.js .menu.open { display: block; }

/* 本文 */
.main { max-width: var(--maxw); margin: 0 auto; padding: 8px 16px 40px; min-height: 60vh; }

/* タグの帯・並び替え */
.tagbar ul, .sortbar ul, .spanbar, .orderbar ul, .row-nav ul, .inline-links, .tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.tagbar { margin: 6px 0 12px; }
.tag {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.82rem; text-decoration: none;
  background: var(--panel2); border: 1px solid var(--line);
}
.tag:hover { border-color: var(--accent); color: var(--accent-text); }
.tag-price-down, .tag-lowest, .tag-rating-up, .tag-sale-often { border-color: var(--accent); }
.sortbar { margin: 4px 0 14px; }
.sortbar ul { gap: 6px; }
.sortbar a, .orderbar a, .row-nav a {
  display: inline-block; padding: 6px 14px; border-radius: 8px; text-decoration: none; background: var(--panel); border: 1px solid var(--line);
}
/* 並び替えの段と「週間・月間」の段の間に余白（C-15・10/23 追加） */
.sortbar .spanbar { margin-top: 18px; }
.spanbar a { padding: 3px 12px; font-size: 0.88rem; }
/* アイコン（C-16）: 自前のインライン SVG。線の色は文字色（currentColor）・文字の大きさに合わせる。いいね・あとで見るは押す前は線だけ、押したら（.is-on）塗りつぶし */
.ico { display: inline-block; flex: none; width: 1.1em; height: 1.1em; max-width: none; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tag-with-ico { display: inline-flex; align-items: center; gap: 5px; }
.react .ico { width: 1.15em; height: 1.15em; vertical-align: middle; }
.react.is-on .ico { fill: currentColor; }
/* 選ばれている状態（C-15）: タグ・ジャンル・並び替え・期間・並び順・メニューの今いる項目。塗り＋太字（色だけに頼らない）。hover でも読める色のまま */
a[aria-current="page"], a[aria-current="page"]:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }

/* カード */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 18px; overflow: hidden; }
.media { position: relative; background: var(--media-bg); aspect-ratio: 800 / 538; }
.media .cover { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-empty { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: var(--panel2); color: var(--muted); }
.play {
  position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer; background: var(--media-shade); color: var(--media-text);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.play:hover { background: var(--media-shade-hover); }
.play-mark { width: 0; height: 0; border-style: solid; border-width: 18px 0 18px 30px; border-color: transparent transparent transparent var(--media-accent); }
.noplay { display: none; position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 6px 12px; font-size: 0.82rem; color: var(--media-muted); background: var(--media-note-bg); }
@media (min-width: 769px) {
  .media[data-pc="0"] .play { display: none; }
  .media[data-pc="0"] .noplay { display: block; }
}
@media (max-width: 768px) {
  .media[data-sp="0"] .play { display: none; }
  .media[data-sp="0"] .noplay { display: block; }
}
.media.is-playing { aspect-ratio: auto; background: var(--media-bg); }
.media.is-playing .cover, .media.is-playing .play, .media.is-playing .noplay { display: none; }
.player { display: flex; justify-content: center; background: var(--media-bg); }
.player[hidden] { display: none; }
.player iframe { display: block; width: 720px; max-width: 100%; height: auto; aspect-ratio: 720 / 480; border: 0; background: var(--media-bg); }
.player[data-size="sp"] iframe { width: 476px; aspect-ratio: 476 / 306; }
.card-body { padding: 12px 14px 14px; }
.card-title { font-size: 1.05rem; line-height: 1.45; margin: 0 0 6px; }
.card-title a { text-decoration: none; }
.card-meta { margin: 0 0 8px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.price { font-weight: 700; font-size: 1.1rem; color: var(--accent-text); }
.price-none { font-weight: 400; font-size: 0.95rem; color: var(--muted); }
.price-date, .sale-end { font-size: 0.8rem; color: var(--muted); }
.price-sale { color: var(--sale); }
.badge-sale { display: inline-flex; align-items: center; gap: 4px; background: var(--sale); color: var(--sale-ink); font-size: 0.78rem; font-weight: 700; padding: 1px 9px; border-radius: 6px; }
.sale-name { font-weight: 700; }
.card .tags { margin: 0 0 10px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.react, .fanza, .share {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; min-height: 40px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; text-decoration: none; font-size: 0.92rem;
}
.react:hover, .fanza:hover, .share:hover { border-color: var(--accent); }
.react.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.react.is-on .ico { color: var(--accent-text); }
.react-n { font-variant-numeric: tabular-nums; }
.more { text-align: center; margin: 8px 0 24px; }
.more a { display: inline-block; padding: 8px 20px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); }

/* 記事 */
.article h1 { margin-top: 0.2em; }
.article .media { border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.price-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.price-box p { margin: 4px 0; }
.price-now .price { font-size: 1.6rem; }
.sale-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lowest-line { font-size: 0.92rem; }
.article-actions { margin: 10px 0 18px; }
/* 記事ページ末尾: パッケージ画像のリンク（加工しない・本文の幅いっぱい）とその下の FANZA のボタン（C-20） */
.pkg-link { margin: 24px 0 8px; }
.pkg-link .fanza-pkg { display: block; padding: 0; min-height: 0; border: 0; border-radius: var(--radius); overflow: hidden; background: var(--media-bg); }
.pkg-img { display: block; width: 100%; height: auto; }
.pkg-btn { margin: 10px 0 0; }
.chart-block figure { margin: 0 0 14px; }
.chart { display: block; width: 100%; height: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.legend-sale::before { content: ""; display: inline-block; width: 14px; height: 10px; background: var(--accent); opacity: 0.35; margin-right: 4px; vertical-align: baseline; }
.g-line { stroke: var(--accent); stroke-width: 2; fill: none; }
.g-line-sub { stroke: var(--text); }
.g-sale { fill: var(--accent); opacity: 0.22; }
.g-grid { stroke: var(--line); stroke-width: 1; }
.g-axis { stroke: var(--muted); stroke-width: 1; }
.g-text { fill: var(--muted); font-size: 12px; font-family: system-ui, sans-serif; }
.g-dot { fill: var(--accent); }
.sale-history { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.sale-history th, .sale-history td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sale-history th { color: var(--muted); font-weight: 400; }
.info { display: grid; grid-template-columns: 7em 1fr; gap: 6px 10px; margin: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.inline-links { gap: 4px 12px; }

/* 出演者 */
.actress-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.actress-img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); background: var(--panel2); flex: none; }
.actress-head h1 { margin: 0; }
.ruby, .summary { margin: 2px 0; color: var(--muted); }
.scope-note { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 0.9rem; }
.orderbar { margin: 12px 0; }
.year-group h2 { border-bottom: 1px solid var(--line); padding-bottom: 4px; color: var(--accent-text); }
.timeline-list { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tl-cover { width: 120px; height: 80px; object-fit: cover; border-radius: 6px; background: var(--panel2); display: block; }
.tl-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tl-date { font-size: 0.8rem; color: var(--muted); }
.tl-title { font-weight: 700; text-decoration: none; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tl-item .tags { margin-top: 2px; }
.search-form { display: flex; gap: 6px; margin: 0 0 12px; }

/* 50 音の索引 */
.row-nav { margin: 8px 0 16px; }
.row-group h2 { color: var(--accent-text); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.index-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.count { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

/* ランキング */
.rank-list, .arank-list { list-style: none; margin: 0 0 12px; padding: 0; }
.rank-item { position: relative; }
.rank-no { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2em; height: 2.2em; background: var(--accent); color: var(--accent-ink); font-weight: 800; border-radius: 8px; padding: 0 6px; }
.rank-item > .rank-no { position: absolute; left: 8px; top: 8px; z-index: 2; }
.rank-count { margin: -10px 0 18px; color: var(--muted); font-size: 0.88rem; text-align: right; }
.fill-note { background: var(--panel); border: 1px dashed var(--muted); border-radius: 8px; padding: 8px 12px; color: var(--muted); font-size: 0.9rem; }
.arank-item { display: grid; grid-template-columns: 2.6em 64px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.arank-img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--panel2); display: block; }
.arank-empty { background: var(--panel); border: 1px dashed var(--line); }
.arank-name { font-weight: 700; text-decoration: none; min-width: 0; }
.arank-item .rank-count { margin: 0; white-space: nowrap; }

/* 固定ページ・問い合わせ */
.doc { max-width: 680px; }
.doc p, .doc li { color: var(--text); }
.contact-form { max-width: 640px; }
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: 6px; padding: 0; }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text);
}
.field textarea { resize: vertical; min-height: 9em; }
.radio { display: block; font-weight: 400 !important; padding: 8px 0; }
.req, .opt { font-size: 0.78rem; font-weight: 400; }
.req { color: var(--accent-text); }
.opt { color: var(--muted); }
.field-error, .form-error { color: var(--accent-text); margin: 6px 0 0; font-weight: 700; }
.submit { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 12px 28px; font-weight: 800; cursor: pointer; min-height: 44px; }
.privacy-note { color: var(--muted); font-size: 0.88rem; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* フッター */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); padding: 20px 16px 32px; text-align: center; color: var(--muted); font-size: 0.88rem; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--text); }
.age { color: var(--text); font-weight: 700; }
.foot-links { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }

/* 記録の要約・表・横のリンク・パンくず（Sprint 6b-1）。色は変数だけ（文字は --text・--muted で 4.5:1 を保つ） */
.record-summary { margin: 10px 0 14px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.95rem; line-height: 1.7; }
.home-summary { margin: 0 0 12px; }
.home-summary .record-summary { margin-bottom: 8px; }
.price-changes, .year-counts { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 8px 0 14px; }
.price-changes caption, .year-counts caption { text-align: left; color: var(--muted); font-size: 0.85rem; padding: 4px 0; }
.price-changes th, .price-changes td, .year-counts th, .year-counts td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.price-changes th, .year-counts th { color: var(--muted); font-weight: 400; }
.year-counts { max-width: 20em; }
.breadcrumb { margin: 0 0 8px; font-size: 0.85rem; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; }
.breadcrumb li { color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.related h2 { margin-top: 1.2em; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-item { display: grid; grid-template-columns: 96px 1fr; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
.mini-link { display: contents; text-decoration: none; }
.mini-cover { grid-row: 1 / span 2; width: 96px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--panel2); display: block; }
.mini-title { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.mini-meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 0.9rem; }

/* 手元の確認用の見本プレーヤー（iframe の中身） */
.ph-player { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; text-align: center; background: #15171d; color: #9a9da8; margin: 0; }
.ph-player p { margin: 0.3em 1em; }

@media (max-width: 520px) {
  .site-header { padding: 8px 12px; }
  .header-search { order: 3; flex-basis: 100%; }
  .main { padding: 6px 12px 32px; }
  .tl-item { grid-template-columns: 96px 1fr; }
  .tl-cover { width: 96px; height: 64px; }
  .info { grid-template-columns: 1fr; gap: 0; }
  .info dt { margin-top: 8px; }
  .arank-item { grid-template-columns: 2.4em 52px 1fr; }
  .arank-item .rank-count { grid-column: 3; }
  .arank-img { width: 52px; height: 52px; }
  .actress-img { width: 88px; height: 88px; }
}
