/* 同人サイト共通スタイル（スマホ優先） */
:root {
  --bg: #f7f6fa;
  --surface: #ffffff;
  --text: #22201f;
  --muted: #6d6662;
  --line: #e8e1dc;
  --accent: #5e35b1;
  --accent-ink: #ffffff;
  --sale: #d84315;
  --star: #e0a100;
  --radius: 10px;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161414;
    --surface: #211e1e;
    --text: #efe9e6;
    --muted: #a59d99;
    --line: #353030;
    --accent: #b39ddb;
    --accent-ink: #160d26;
    --sale: #ff8a65;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); line-height: 1.7; font-size: 15px; }
html.gated body { overflow: hidden; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* 年齢確認 */
.age-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 8, 8, .92); backdrop-filter: blur(6px); }
.age-gate[hidden] { display: none; }
.age-gate__box { background: var(--surface); border-radius: 16px; padding: 28px 24px; max-width: 380px; text-align: center; }
.age-gate__mark { display: inline-block; margin: 0 0 8px; padding: 2px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.age-gate__box h2 { margin: 0 0 8px; font-size: 20px; }
.age-gate__actions { display: grid; gap: 10px; margin-top: 18px; }

/* ボタン */
.btn { display: inline-block; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); text-align: center;
  font-weight: 700; text-decoration: none; cursor: pointer; font-size: 15px; background: var(--surface); color: var(--text); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; }
.btn--buy { display: block; width: 100%; max-width: 420px; margin: 16px 0; font-size: 16px; }

/* ヘッダー・フッター */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; padding-bottom: 8px; }
.logo { font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: .02em; }
.site-nav { display: flex; gap: 4px; overflow-x: auto; }
.site-nav a { padding: 6px 10px; border-radius: 999px; text-decoration: none; font-size: 14px; white-space: nowrap; }
.site-nav a:hover { background: var(--bg); }
.pr-note { margin: 0; padding-bottom: 8px; font-size: 12px; color: var(--muted); }
.site-footer { margin-top: 48px; padding: 32px 0; background: var(--surface); border-top: 1px solid var(--line); font-size: 14px; }
.footer-cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-cols h2 { font-size: 14px; margin: 0 0 6px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.credit { margin-top: 24px; }
.small, .note { font-size: 12px; color: var(--muted); }

/* トップ */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(22px, 5vw, 32px); line-height: 1.35; margin: 0 0 8px; }
.hero p { color: var(--muted); max-width: 640px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 14px; }
.section { margin-top: 32px; }
.section h2 { font-size: 19px; margin: 0 0 12px; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section__head a { font-size: 14px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.hub-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.hub-list li { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.hub-list a { text-decoration: none; font-weight: 600; }
.hub-list span { color: var(--muted); white-space: nowrap; }

/* 作品カード */
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.card__img { position: relative; aspect-ratio: 4 / 3; background: var(--line); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__rank { position: absolute; top: 6px; left: 6px; min-width: 28px; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.75); color: #fff; font-weight: 800; font-size: 13px; text-align: center; }
.card__off, .card__lowest { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--sale); color: #fff; font-weight: 700; font-size: 11px; line-height: 1.6; vertical-align: 1px; }
.card__lowest { background: #2e7d32; }
.card__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.card__body { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; flex: 1; }
.card__fmt { font-size: 11px; color: var(--accent); font-weight: 700; }
.card__title { font-size: 13px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__circle { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__meta { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; font-size: 13px; padding-top: 4px; }
.card__price { font-weight: 700; }
.card__price s { color: var(--muted); font-weight: 400; font-size: 11px; }
.card__review { color: var(--star); font-weight: 700; }
.card__review small { color: var(--muted); font-weight: 400; }

/* ハブ */
.crumbs { margin-top: 16px; font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.page-title { font-size: clamp(21px, 4.5vw, 28px); line-height: 1.4; margin: 12px 0 8px; }
.lead { max-width: 760px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 16px 0; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font-weight: 800; font-size: 17px; }
.stats small { font-weight: 400; font-size: 12px; color: var(--sale); }

/* 作品ページ */
.work { display: grid; gap: 20px; margin-top: 12px; }
@media (min-width: 840px) { .work { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.work__visual img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.work__fmt { margin: 0; color: var(--accent); font-weight: 700; font-size: 13px; }
.work__title { font-size: clamp(19px, 4vw, 24px); line-height: 1.45; margin: 4px 0; }
.work__circle { margin: 0; color: var(--muted); }
.work__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.work__price s { color: var(--muted); }
.work__price strong { font-size: 26px; }
.badge { padding: 2px 10px; border-radius: 6px; background: var(--sale); color: #fff; font-weight: 700; font-size: 13px; }
.spec { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec th, .spec td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { width: 6.5em; color: var(--muted); font-weight: 600; }
.samples { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, 120px); }
/* サンプル画像は120×90と小さいので、引き伸ばしすぎない */
.samples img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
/* サンプル画像の拡大表示 */
.viewer { position: fixed; inset: 0; width: auto; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0;
  padding: 48px 8px; border: 0; background: rgba(0, 0, 0, .94); color: #fff; overscroll-behavior: contain; touch-action: manipulation; }
.viewer[open] { display: flex; align-items: center; justify-content: center; }
.viewer::backdrop { background: rgba(0, 0, 0, .6); }
.viewer__img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer__img.is-loading { visibility: hidden; }
.viewer__status { position: absolute; top: 50%; left: 0; right: 0; margin: 0; text-align: center; font-size: 14px; transform: translateY(-50%); pointer-events: none; }
.viewer--single .viewer__prev, .viewer--single .viewer__next, .viewer--single .viewer__count { display: none; }
html:has(.viewer[open]) { overflow: hidden; }
.viewer__count { position: absolute; top: 12px; left: 0; right: 0; margin: 0; text-align: center; font-size: 14px; pointer-events: none; }
.viewer__btn { position: absolute; width: 44px; height: 44px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .16);
  color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.viewer__close { top: 6px; right: 8px; }
.viewer__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.viewer__next { right: 8px; top: 50%; transform: translateY(-50%); }
.viewer__btn[aria-disabled="true"] { opacity: .25; cursor: default; }
.viewer, .viewer__img { cursor: pointer; }
/* タップ時の青いハイライトと、ドラッグでの文字・画像の選択を出さない */
.viewer, .viewer * { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.viewer__img { -webkit-user-drag: none; }
.viewer:focus { outline: none; }
.viewer__btn:focus:not(:focus-visible) { outline: none; }
.prose { max-width: 760px; }

/* 並べ替え */
.sortbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 10px; font-size: 13px; color: var(--muted); }
.sortbar button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.sortbar button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* 順位の変動 */
.card__change, .rank-change { padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.card__change { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.7); color: #fff; }
.card__change--up, .rank-change--up { color: #81c784; }
.card__change--down, .rank-change--down { color: #ef9a9a; }
.card__change--new { background: var(--accent); color: var(--accent-ink); }
.rank-change { background: var(--bg); }
.rank-change--up { color: #2e7d32; }
.rank-change--down { color: #c62828; }
.rank-change--new { background: var(--accent); color: var(--accent-ink); }


/* よくある質問 */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; }

/* サイト内検索 */
.search-form { display: flex; gap: 8px; margin: 16px 0; max-width: 560px; }
.search-form input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.search-form .btn { padding: 10px 18px; }
.search-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.search-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.search-list a { display: flex; gap: 12px; align-items: center; padding: 8px 12px; text-decoration: none; color: inherit; }
.search-list img { flex: none; width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--line); }
.search-list__body { display: flex; flex-direction: column; min-width: 0; }
.search-list b { font-weight: 600; }
.search-list__body span { font-size: 12px; color: var(--muted); }
.search-guide { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.search-guide a { padding: 8px 14px; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; }
.search-more { display: block; margin: 16px auto 0; }
.search-more[hidden] { display: none; }

/* ジャンル別まとめの選び方 */
.hub-guide { margin: 20px 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.hub-guide h2, .hub-guide h3 { font-size: 16px; margin: 0 0 8px; }
.hub-guide ul:not(.chips) { margin: 0; padding-left: 1.2em; }
.hub-guide li + li { margin-top: 4px; }
.hub-guide .chips { margin: 8px 0 0; }
.chip--plain { font-weight: 600; color: var(--muted); }

/* サークル一覧 */
.circle-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.circle-list li { display: flex; flex-direction: column; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.circle-list a { font-weight: 700; text-decoration: none; }
.circle-list span { font-size: 12px; color: var(--muted); }
.circle-list em { color: var(--sale); font-style: normal; }
.work__circle a { color: var(--accent); }

.badge--lowest { background: transparent; color: var(--sale); border: 1px solid var(--sale); }
.tags a { display: inline-block; margin: 0 2px 6px 0; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; text-decoration: none; }
.badge--small { font-size: 11px; padding: 1px 6px; }
.prose h2 { font-size: 17px; margin-top: 24px; }
.points { margin: 0 0 6px; padding-left: 1.2em; }
.points li { margin: 2px 0; }
