:root {
  --bg: #faf8f5;
  --card: #ffffff;
  --ink: #2b2b2b;
  --muted: #8a8276;
  --accent: #00c4cc;
  --accent2: #7b61ff;
  --line: #ece7df;
  --shadow: 0 2px 12px rgba(60, 50, 30, 0.06);
  --radius: 16px;
}
[data-theme="r18"] {
  --bg: #18141a;
  --card: #221c28;
  --ink: #f3eef7;
  --muted: #a99bb5;
  --accent: #ff5d8f;
  --accent2: #b14cff;
  --line: #352b3d;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.hero {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  padding: 48px 20px 56px;
  text-align: center;
}
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: .02em; }
.hero p { margin-top: 10px; opacity: .95; font-size: .98rem; }
.hero .count { margin-top: 16px; display: inline-block; background: rgba(255,255,255,.22); padding: 5px 16px; border-radius: 99px; font-size: .85rem; font-weight: 600; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

.toolbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  margin-bottom: 8px;
}
.search {
  width: 100%; padding: 12px 16px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink);
}
.search:focus { outline: 2px solid var(--accent); border-color: transparent; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill {
  padding: 7px 14px; border-radius: 99px; font-size: .85rem; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.pill:hover { color: var(--ink); }
.pill.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.section-title { font-size: 1.15rem; font-weight: 800; margin: 28px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.section-title .n { font-size: .8rem; font-weight: 600; color: var(--muted); }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(60,50,30,.12); }
.card .thumb { aspect-ratio: 1 / 1; background: var(--line); overflow: hidden; }
.card.wide .thumb { aspect-ratio: 16 / 9; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .title { font-size: .82rem; font-weight: 600; line-height: 1.35; color: var(--ink); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .btn {
  display: block; text-align: center; padding: 8px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: .8rem; font-weight: 700;
}
.card .btn:hover { filter: brightness(1.05); }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

.banner {
  margin: 24px 0; padding: 18px 22px; border-radius: var(--radius);
  background: linear-gradient(135deg, #ff5d8f, #b14cff); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.banner .t { font-weight: 800; font-size: 1.05rem; }
.banner .s { font-size: .85rem; opacity: .92; }
.banner a.go { background: rgba(255,255,255,.95); color: #b14cff; padding: 10px 20px; border-radius: 99px; font-weight: 800; white-space: nowrap; }
.banner.normal-link { background: linear-gradient(135deg, #00c4cc, #5b7cff); }
.banner.normal-link a.go { color: #0a7fa8; }

.backlink { display: inline-flex; align-items: center; gap: 6px; margin: 20px 0; font-weight: 600; color: var(--muted); }
.backlink:hover { color: var(--ink); }

footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 40px 16px 60px; }

.r18-badge { display:inline-block; background:#ff5d8f; color:#fff; font-size:.7rem; font-weight:800; padding:3px 10px; border-radius:99px; vertical-align:middle; margin-left:8px; }

/* ---- section nav tabs ---- */
.section-nav { margin-top: 8px; align-items: center; }
.section-nav .nav-label { font-size: .8rem; font-weight: 700; color: var(--muted); margin-right: 2px; }
.pill.nav-pill { background: transparent; border-style: dashed; }
.pill.nav-pill:hover { background: var(--card); border-style: solid; color: var(--ink); }

/* ---- extra sections ---- */
.extra-section { scroll-margin-top: 140px; }
.divider { border: none; border-top: 2px dashed var(--line); margin: 48px 0 8px; }
.section-title.big { font-size: 1.4rem; margin-top: 40px; }
.sub-title { font-size: 1rem; font-weight: 700; margin: 22px 0 10px; color: var(--ink); }
.lead { color: var(--muted); font-size: .92rem; margin-bottom: 14px; line-height: 1.7; }
.inline-link { color: var(--accent); font-weight: 700; }
.inline-link:hover { text-decoration: underline; }

.site-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  margin-bottom: 12px; transition: transform .15s; max-width: 560px;
}
.site-card:hover { transform: translateY(-2px); }
.site-card .site-thumb { aspect-ratio: 16 / 9; background: var(--line); overflow: hidden; }
.site-card .site-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-card .site-body { padding: 16px 20px; }
.site-card .site-t { font-weight: 800; font-size: 1.02rem; color: var(--accent); }
.site-card .site-d { color: var(--muted); font-size: .88rem; margin: 6px 0; line-height: 1.6; }
.site-card .site-u { color: var(--muted); font-size: .78rem; word-break: break-all; }

.acc-wrap { display: flex; flex-direction: column; gap: 8px; }
.acc {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.acc summary {
  cursor: pointer; padding: 14px 18px; font-weight: 700; font-size: .92rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '＋'; color: var(--muted); font-weight: 700; }
.acc[open] summary::after { content: '－'; }
.acc-body { padding: 0 18px 16px; color: var(--muted); font-size: .88rem; line-height: 1.8; }

.notes { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.notes li {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; font-size: .9rem; color: var(--ink); position: relative; padding-left: 38px;
}
.notes li::before { content: '⚠️'; position: absolute; left: 14px; }
