:root {
  --max: 1200px;
  --radius: 14px;

  --pageBg: #f8fafc;
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --focus: rgba(59, 130, 246, 0.35);

  --hotBg: #fff1f2;
  --hotLine: #fecaca;

  --amazon: #f59e0b;
  --amazonInk: #111827;
  --dmm: #111a2e;
  --dmmInk: #ffffff;
  --dlsite: #2464ec;
  --dlsiteInk: #ffffff;
  --fanza: #d40414;
  --fanzaInk: #ffffff;

  --barBg: #0b1220;
  --barInk: #ffffff;
  --barLink: rgba(255, 255, 255, 0.88);
  --barLinkHover: #ffffff;
  --subBarBg: #ffffff;
  --subBarText: #334155;
  --subBarBorder: #d6dbe3;

  --markBg: #0a0a0a;
  --markInk: #ffffff;
  --markRing: rgba(255, 255, 255, 0.8);
  --markRingW: 3px;

  --danger: #d10b1e;

  --titleFs: 21px;
  --titleFsPc: 23px;
  --titleLh: 1.38;
  --infoFs: 16px;
  --priceFs: 17px;
  --nowFs: 22px;
}

html[data-mode="dark"] {
  --pageBg: #070b12;
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.52);
  --focus: rgba(59, 130, 246, 0.45);
  --hotBg: rgba(251, 113, 133, 0.12);
  --hotLine: rgba(251, 113, 133, 0.35);
  --subBarBg: #0b1220;
  --subBarText: #cbd5e1;
  --subBarBorder: rgba(148, 163, 184, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--pageBg);
  color: var(--text);
}

a {
  color: inherit;
}

.bar {
  width: 100%;
  background: var(--barBg);
  color: var(--barInk);
}

.barInner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 14px;
}

.siteHeader .barInner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--markBg);
  color: var(--markInk);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 1000;
  border: var(--markRingW) solid var(--markRing);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

.brandText {
  font-size: 16px;
  line-height: 1.2;
}

.headerNav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.headLink {
  color: var(--barLink);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.headLink:hover {
  color: var(--barLinkHover);
  border-color: rgba(255, 255, 255, 0.3);
}

.headLink.is-active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
}

.siteFooter .barInner {
  padding: 10px 14px;
}

.subBar {
  background: var(--subBarBg);
  border-top: 1px solid var(--subBarBorder);
  border-bottom: 1px solid var(--subBarBorder);
  box-shadow: 0 1px 0 rgba(2, 6, 23, 0.03);
}

.subBarInner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 6px 14px 7px;
}

.headerNotice,
.footerNotice {
  margin: 0;
  color: var(--subBarText);
  font-size: 11.5px;
  line-height: 1.45;
}

.noticeStrong {
  font-weight: 1000;
  color: var(--text);
}

@media (min-width: 980px) {
  .headerNotice,
  .footerNotice {
    font-size: 12px;
  }
}

.footNav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  line-height: 1.2;
}

.footNav a {
  color: var(--barLink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
}

.footNav a:hover {
  color: var(--barLinkHover);
  border-bottom-color: rgba(255, 255, 255, 0.45);
}

.footSep {
  opacity: 0.55;
}

.copy {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.85;
}

.copy .footSep {
  display: inline-block;
  margin-inline: 0.45em;
}

.footerNotices {
  display: grid;
  gap: 4px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px;
}

.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.modePanel {
  margin-bottom: 12px;
}

/* トップページ以外（各カテゴリ／情報ページ）ではブラックモード切り替えを非表示 */
body[data-page-type] .modePanel {
  display: none;
}

/* 新着セールのお知らせ（トップページ） */
.saleNotice {
  margin-bottom: 12px;
}
.saleNoticeHead {
  font-weight: 1000;
  font-size: 13px;
  margin-bottom: 8px;
}
.saleNoticeList {
  max-height: 104px; /* 固定の高さ。件数が多いと縦スクロール */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.saleNoticeItem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}
.saleNoticeItem:hover {
  border-color: var(--muted);
}
.saleNoticePlats {
  display: inline-flex;
  gap: 4px;
  flex: 0 0 auto;
}
.saleNoticeTitle {
  font-weight: 700;
  font-size: 12px;
}
.saleNoticeItem.is-clicked {
  background: rgba(127, 127, 127, 0.12);
}
.saleNoticeItem.is-clicked .saleNoticeTitle {
  color: var(--muted);
}

.tabsRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabBtn {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.tabBtn[aria-selected="true"] {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px var(--focus);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.titleRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}

.pageTitle {
  margin: 0;
  font-size: 22px;
}

.pageLead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.catalogLayout {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 980px) {
  .catalogLayout {
    grid-template-columns: 320px 1fr;
    align-items: start;
  }
}

.pcTitle {
  display: none;
}

@media (min-width: 980px) {
  .pcTitle {
    display: block;
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 1000;
  }
}

.filter-details summary {
  font-size: 14px;
  font-weight: 1000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
  color: var(--text);
}

.filter-details summary::-webkit-details-marker {
  display: none;
}

.filter-details summary::after {
  content: "▼";
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s;
}

.filter-details[open] summary::after {
  transform: rotate(180deg);
}

.filter-content {
  margin-top: 10px;
}

@media (min-width: 980px) {
  .filter-details summary {
    display: none;
  }

  .filter-content {
    margin-top: 0;
  }
}

.sec {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

.sec:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 1000;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.chip:hover {
  border-color: #93c5fd;
}

.chip.is-active {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px var(--focus);
}

.row {
  display: flex;
  gap: 8px;
}

#sortLimitRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 140px);
  align-items: center;
}

.select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
}

#sortLimitRow .select {
  min-width: 0;
}

.select:focus {
  box-shadow: 0 0 0 4px var(--focus);
  border-color: #93c5fd;
  outline: none;
}

.results {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.booksDailyTabsWrap {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.booksDateTabs {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.booksDateTab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
}

.booksDateTab:hover {
  color: var(--text);
  text-decoration: underline;
}

.booksDateTab.is-active {
  color: var(--text);
  font-weight: 1000;
  text-decoration: underline;
  text-decoration-color: #93c5fd;
  text-underline-offset: 4px;
}

.booksTabsDivider {
  color: var(--muted);
  padding: 0 10px;
  user-select: none;
}

.rTop {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.productList {
  display: flex;
  flex-direction: column;
}

.paginationWrap {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.paginationWrap:empty {
  display: none;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.pageBtn {
  min-width: 42px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.pageBtn:hover {
  border-color: #93c5fd;
}

.pageBtn.is-active {
  background: var(--barBg);
  color: var(--barInk);
  border-color: transparent;
}

.pageBtn:disabled {
  opacity: 0.45;
  cursor: default;
}

.pageDots {
  color: var(--muted);
  font-weight: 900;
}

.productCard {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  grid-template-columns: 1fr;
  grid-template-areas:
    "cover"
    "main"
    "buy";
  align-items: start;
}

@media (min-width: 980px) {
  .productCard {
    grid-template-columns: 160px minmax(0, 1fr) auto;
    grid-template-areas: "cover main buy";
  }
}

.bookCover {
  grid-area: cover;
}

.bookMain {
  grid-area: main;
  min-width: 0;
}

.bookBuy {
  grid-area: buy;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
}

.bookBuy .storeBtn {
  width: 100%;
  min-width: 0;
}

@media (min-width: 980px) {
  .bookBuy {
    justify-self: end;
    align-items: flex-end;
  }

  .bookBuy .storeBtn {
    width: auto;
    min-width: 220px;
  }
}

.coverLink {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.1);
  background: linear-gradient(135deg, rgba(75, 10, 20, 0.18), rgba(2, 6, 23, 0.06));
}

@media (max-width: 979px) {
  .coverLink {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
  }
}

html[data-mode="dark"] .coverLink {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}

.coverImg,
.coverPlaceholder {
  width: 100%;
  height: 100%;
}

.coverImg {
  display: block;
  object-fit: contain;
  background: var(--pageBg);
}

.coverPlaceholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.contextSlot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.contextPill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.titleLink {
  display: -webkit-box;
  margin: 0;
  font-size: var(--titleFs);
  font-weight: 1000;
  line-height: var(--titleLh);
  color: var(--text);
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.titleLink:hover {
  text-decoration: underline;
}

@media (min-width: 980px) {
  .titleLink {
    font-size: var(--titleFsPc);
  }
}

.line2stats {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--infoFs);
  line-height: 1.45;
  color: var(--muted);
}

.rating {
  color: var(--text);
  font-weight: 900;
}

.rating .star {
  color: #facc15;
}

.sales {
  color: var(--muted);
  font-weight: 400;
}

.salesNumber {
  color: var(--text);
  font-weight: 900;
}

.line3creator {
  margin-top: 8px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--infoFs);
  line-height: 1.45;
  color: var(--muted);
}

.metaLabel {
  color: var(--muted);
  font-weight: 400;
}

.line4price {
  margin-top: 8px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: var(--priceFs);
  line-height: 1.4;
}

.priceNow {
  font-weight: 1000;
  font-size: var(--nowFs);
  color: var(--text);
}

.priceOld {
  color: var(--muted);
  text-decoration: line-through;
}

.discount {
  color: var(--danger);
  font-weight: 1000;
}

.priceStatic,
.priceFallback {
  color: var(--muted);
  font-size: 13px;
}

.priceFallback {
  font-weight: 900;
}

.line5sale {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.salePill {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(100, 116, 139, 0.06);
  color: var(--text);
  font-size: 14px;
  line-height: 1.05;
  font-weight: 900;
  white-space: nowrap;
}

/* 締切バッジは割引の赤(--danger)と区別するため、専用の濃いローズ系を使う */
.salePill--urgent {
  background: #9f1239;
  border-color: transparent;
  color: #ffffff;
}

.salePill--soon {
  background: var(--hotBg);
  border-color: #fda4af;
  color: #9f1239;
}

html[data-mode="dark"] .salePill--soon {
  border-color: rgba(253, 164, 175, 0.45);
  color: #fda4af;
}

.salePill--unknown {
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.25);
  color: var(--muted);
}

.line6meta {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  opacity: 0.9;
}

.variantList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

@media (min-width: 980px) {
  .variantList {
    width: 220px;
  }
}

.variantItem {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(148, 163, 184, 0.04);
}

.variantMeta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.variantTitle {
  color: var(--text);
  font-weight: 800;
}

.variantPrice {
  text-align: right;
}

.storeBtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-width: 220px;
  padding: 0 46px 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 1000;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.14);
  user-select: none;
  color: inherit;
}

.storeBtn:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), 0 10px 26px rgba(2, 6, 23, 0.14);
}

html[data-mode="dark"] .storeBtn {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
}

.storeBtn .label {
  margin: 0;
  font-size: 14px;
  font-weight: 1000;
}

.storeBtn .pr {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 1000;
  opacity: 0.85;
  background: transparent;
  padding: 0;
  border: none;
}

.storeBtnSmall {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0 34px 0 12px;
}

.storeBtnSmall .label {
  font-size: 12px;
}

.storeBtnSmall .pr {
  right: 8px;
  font-size: 10px;
}

.bAmazon {
  background: var(--amazon);
  color: var(--amazonInk);
  border-color: rgba(17, 24, 39, 0.14);
}

.bDMM {
  background: var(--dmm);
  color: var(--dmmInk);
}

.bDLsite {
  background: var(--dlsite);
  color: var(--dlsiteInk);
}

.bFANZA {
  background: var(--fanza);
  color: var(--fanzaInk);
}

.emptyState {
  margin: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.hero {
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(36, 100, 236, 0.12), rgba(17, 26, 46, 0.1));
}

.hero .pageTitle {
  margin-bottom: 6px;
}

.categoryGrid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 720px) {
  .categoryGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .categoryGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.categoryCard {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.categoryCard h3 {
  margin: 0;
}

.categoryCard p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tagRow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.staticContent,
.card,
.footCard,
.contentCard {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  line-height: 1.8;
}

.staticContent h2,
.staticContent h3,
.card h2,
.card h3,
.footCard h2,
.footCard h3,
.contentCard h2,
.contentCard h3 {
  margin-top: 0;
}

.staticContent .title,
.card .title,
.footCard .title {
  margin-top: 0;
  margin-bottom: 12px;
}

.staticContent .lead,
.card .lead,
.footCard .lead,
.contentCard .lead,
.staticContent .p,
.card .p,
.footCard .p,
.contentCard .p,
.footCard .bodyText,
.card .bodyText,
.contentCard .warnText {
  margin: 0;
}

.staticContent .secTitle,
.card .secTitle,
.footCard .secTitle {
  margin-top: 16px;
  margin-bottom: 8px;
}

.contentCard .sec {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.contentCard .sec h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.staticContent .list,
.card .list,
.footCard .list,
.contentCard .list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.staticContent .sep,
.card .sep,
.footCard .sep,
.contentCard .sep {
  border: none;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.subTitle {
  margin: 18px 0 8px;
  font-size: 16px;
}

.refLink,
.extLink {
  color: var(--dlsite);
  text-decoration: underline;
  word-break: break-all;
}

.warn {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--hotLine);
  border-radius: 12px;
  background: var(--hotBg);
}

.warnTitle {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 1000;
}

.warnText {
  line-height: 1.7;
}

.meta {
  margin-top: 18px;
  display: flex;
  gap: 8px 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.linkBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
}

.linkBtn:hover {
  border-color: #93c5fd;
}

.toTop {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}

html[data-mode="dark"] .toTop {
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.52);
}

.toTop.is-show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toTop:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), 0 12px 30px rgba(0, 0, 0, 0.18);
}

@supports (padding: max(0px)) {
  .toTop {
    bottom: calc(14px + env(safe-area-inset-bottom));
    right: calc(14px + env(safe-area-inset-right));
  }
}

/* ============================================================
   site-additions.css
   既存の site.css に追記する差分。
   色・影・角丸などは既存トークンのみを参照します。
   新しい CSS 変数は一切追加していません。
   ============================================================ */


/* ============================================================
   1. トップページ：カテゴリ別の人気セクション
   ============================================================ */

.catSection {
  margin-top: 22px;
}

.catSectionHead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.catSectionLeft {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.catSectionTitle {
  margin: 0;
  font-size: 17px;
  font-weight: 1000;
}

.catSectionDesc {
  color: var(--muted);
  font-size: 12px;
}

.catSectionPlats {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.catMore {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.catMore:hover {
  color: var(--text);
}


/* --- カテゴリ見出しの小さなプラットフォームバッジ --- */

.platMini {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.4;
}

.pAmazon  { background: var(--amazon);  color: var(--amazonInk); }
.pDMM     { background: var(--dmm);     color: var(--dmmInk); }
.pDLsite  { background: var(--dlsite);  color: var(--dlsiteInk); }
.pFANZA   { background: var(--fanza);   color: var(--fanzaInk); }


/* --- 人気作品カード（1カテゴリあたり横4枚） --- */

.cardGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 720px) {
  .cardGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.miniCard {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}

.miniCover {
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--pageBg);
}

.miniCover--landscape {
  aspect-ratio: 4 / 3;
}

.miniCover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.miniBadge {
  position: absolute;
  right: 5px;
  top: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.02em;
}

.miniOff {
  position: absolute;
  left: 5px;
  top: 5px;
  background: var(--danger);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 1000;
}

.miniRank {
  position: absolute;
  left: 5px;
  bottom: 5px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.03em;
}

.miniTitle {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.8em;
}

.miniMeta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.miniStar {
  color: #facc15;
  font-weight: 900;
}

.miniStarNum {
  color: var(--text);
  font-weight: 900;
}

.miniCreator {
  font-size: 11px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.miniPrice {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: 2px;
}

.miniNow {
  font-weight: 1000;
  font-size: 15px;
  color: var(--text);
}

.miniOld {
  color: var(--muted);
  font-size: 11px;
  text-decoration: line-through;
}


/* ============================================================
   2. カテゴリページ：パンくず・タイトル行
   ============================================================ */

.crumb {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.crumb a {
  color: var(--muted);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--text);
}

.crumb .sep {
  margin: 0 6px;
  opacity: 0.6;
}

.listTitleRow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.listTitle {
  margin: 0;
  font-size: 22px;
}

.listCount {
  color: var(--muted);
  font-size: 12px;
}

.listCount b {
  color: var(--text);
  font-weight: 1000;
  font-size: 14px;
}


/* ============================================================
   3. カテゴリページ：フィルタバー（.results の直下に入れる）
   ============================================================ */

.filterBar {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(148, 163, 184, 0.04);
}

.filterLabel {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.filterDivider {
  width: 1px;
  height: 20px;
  background: var(--line);
  align-self: center;
}

.filterRight {
  margin-left: auto;
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}


/* --- セグメンテッドボタン --- */

.pillGroup {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}

.pill {
  background: transparent;
  border: 0;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
}

.pill:hover {
  color: var(--text);
}

.pill.is-active {
  background: var(--text);
  color: var(--bg);
  font-weight: 900;
}

/* 在庫0になる店舗×カテゴリの組み合わせは押せない見た目にする（🚫カーソルは出さない） */
.pill:disabled,
.pill.is-disabled {
  opacity: 0.3;
  cursor: default;
}

.pill:disabled:hover,
.pill.is-disabled:hover {
  color: var(--muted);
}


/* --- 小さめセレクト（並び替え・件数用） --- */

.selectSm {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
}

.selectSm:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px var(--focus);
}


/* --- 価格についての注意（カードから開くポップオーバー） --- */

.priceNoteLink {
  appearance: none;
  background: transparent;
  border: none;
  padding: 2px 4px;
  margin: 4px 0 0;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  align-self: center;
  line-height: 1.4;
  border-radius: 6px;
}

.priceNoteLink:hover,
.priceNoteLink:focus-visible {
  color: var(--text);
  text-decoration-style: solid;
}

.priceNoteLink:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

@media (min-width: 980px) {
  .priceNoteLink {
    align-self: flex-end;
  }
}

.pricePolicyPopover {
  position: fixed;
  inset: auto;
  margin: 0;
  max-width: min(320px, calc(100vw - 24px));
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.18);
  font-size: 13px;
  line-height: 1.6;
}

.pricePolicyPopover::backdrop {
  background: transparent;
}

.pricePolicyHeading {
  margin: 0 0 6px;
  padding-right: 22px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.pricePolicyBody {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.pricePolicyClose {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.pricePolicyClose:hover,
.pricePolicyClose:focus-visible {
  color: var(--text);
  background: rgba(148, 163, 184, 0.16);
}

.pricePolicyClose:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

html[data-mode="dark"] .pricePolicyPopover {
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
}
