/* ===== よるナビ - Modern Night Review Theme ===== */
:root {
  --bg: #0c0c14;
  --bg-surface: #12121c;
  --card-bg: #181824;
  --card-hover: #1e1e2e;
  --sidebar-bg: #151520;
  --accent: #f43f5e;
  --accent-soft: rgba(244, 63, 94, 0.1);
  --accent-hover: #fb7185;
  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, 0.1);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.1);
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.1);
  --text: #f0f0f4;
  --text-secondary: #a8a8c0;
  --text-muted: #6b6b84;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans JP', -apple-system, 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

/* ---- Header ---- */
.site-header {
  background: rgba(17, 17, 24, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-logo {
  font-size: 1.2rem;
  font-weight: 800;
}
.site-logo a { color: var(--text); }
.site-logo a:hover { color: var(--text); }
.site-logo span { color: var(--accent); }
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.header-nav a {
  color: var(--text-secondary);
  font-size: 0.84rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.header-nav a:hover { background: var(--accent-soft); color: var(--accent); }
.header-nav a.active { background: var(--accent-soft); color: var(--accent); }

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translateY(7px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translateY(-7px); }

/* ---- Hero Section ---- */
.hero {
  background: linear-gradient(135deg, #0c0c14 0%, #1a0a1e 40%, #0f0a1e 70%, #0c0c14 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(244, 63, 94, 0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(56, 189, 248, 0.04) 0%, transparent 60%);
  animation: hero-glow 12s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes hero-glow {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-5%, 3%, 0); }
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.hero-title span { color: var(--accent); }
.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}
.hero-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- Main Layout ---- */
.main-wrap {
  max-width: 1440px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 250px 1fr 350px;
  gap: 1.2rem;
}

/* ---- Section Title ---- */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 1.2em;
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
}

/* ---- Random Pickup ---- */
.random-pickup { margin-bottom: 2rem; }
.pickup-scroll {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}
.pickup-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.pickup-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.pickup-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  position: relative;
}
.pickup-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.pickup-card:hover .pickup-thumb img { transform: scale(1.06); }
.pickup-thumb-ph {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e1030, #181828);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.pickup-body {
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.pickup-cat {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
}
.pickup-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Terms (Tags/Categories list) ---- */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}
.terms-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1rem 0.6rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-align: center;
}
.terms-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}
.terms-count {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}
.terms-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}
.terms-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}
/* Tier colors */
.terms-card.tier-gold .terms-count { color: var(--gold); }
.terms-card.tier-gold { border-color: rgba(251,191,36,0.25); background: rgba(251,191,36,0.04); }
.terms-card.tier-gold:hover { border-color: var(--gold); }
.terms-card.tier-red .terms-count { color: var(--accent); }
.terms-card.tier-red { border-color: rgba(244,63,94,0.2); background: rgba(244,63,94,0.04); }
.terms-card.tier-red:hover { border-color: var(--accent); }
.terms-card.tier-green .terms-count { color: var(--green); }
.terms-card.tier-green { border-color: rgba(74,222,128,0.2); background: rgba(74,222,128,0.04); }
.terms-card.tier-green:hover { border-color: var(--green); }
.terms-card.tier-default .terms-count { color: var(--text-secondary); }

/* Terms page controls */
.terms-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.terms-controls-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.terms-search {
  flex: 1;
  min-width: 160px;
  padding: 0.5rem 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}
.terms-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.terms-search::placeholder { color: var(--text-muted); }
.terms-sort-group, .terms-filter-group {
  display: flex;
  gap: 0.3rem;
}
.terms-sort-btn, .terms-filter-btn {
  padding: 0.35rem 0.7rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.terms-sort-btn:hover, .terms-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.terms-sort-btn.active, .terms-filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.terms-filter-btn.tier-gold.active { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.terms-filter-btn.tier-red.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.terms-filter-btn.tier-green.active { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.terms-result-count {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Sidebar tag filter */
.sidebar-tag-filter {
  width: 100%;
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 0.76rem;
  outline: none;
  transition: var(--transition);
}
.sidebar-tag-filter:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.sidebar-tag-filter::placeholder { color: var(--text-muted); }

/* ---- Pagefind Search (dark theme override) ---- */
#search-container {
  --pagefind-ui-primary: var(--accent);
  --pagefind-ui-text: var(--text);
  --pagefind-ui-background: var(--card-bg);
  --pagefind-ui-border: var(--border);
  --pagefind-ui-tag: var(--accent-soft);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: var(--radius-sm);
  --pagefind-ui-font: "Noto Sans JP", sans-serif;
}

/* ---- Article List (Top page) ---- */
.article-list { display: flex; flex-direction: column; gap: 1rem; }

.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  overflow: hidden;
  transition: var(--transition);
}
.article-card:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

/* Card thumbnail */
.card-thumb {
  width: 240px;
  flex-shrink: 0;
  position: relative;
  min-height: 180px;
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e1030 0%, #181828 50%, #101020 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}
.thumb-score {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}
.thumb-score.score-high { color: var(--gold); text-shadow: 0 0 24px rgba(251, 191, 36, 0.3); }
.thumb-score.score-mid { color: var(--green); text-shadow: 0 0 24px rgba(74, 222, 128, 0.2); }
.thumb-score.score-low { color: var(--text-muted); }
.thumb-score-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Score badge on card */
.card-score {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}
.score-high { color: var(--gold); border: 1px solid rgba(251, 191, 36, 0.3); }
.score-mid { color: var(--green); border: 1px solid rgba(74, 222, 128, 0.3); }
.score-low { color: var(--text-secondary); border: 1px solid var(--border); }

/* Card body */
.card-body {
  flex: 1;
  padding: 1.1rem 1.3rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.card-category {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
}
.card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-excerpt {
  font-size: 0.84rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.6rem;
  flex: 1;
}

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  transition: var(--transition);
  white-space: nowrap;
}
a.tag { color: var(--text-muted); }
a.tag:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tag-more { font-style: italic; }
.card-readmore {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(244, 63, 94, 0.2);
  transition: var(--transition);
}
.card-readmore:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Single Article ---- */
.article-single { margin: 0; }
.article-header { margin-bottom: 1.5rem; }
.article-single h1 {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.5;
  margin: 0.5rem 0 0.6rem;
}
.article-single .article-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.article-single .article-meta time {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.article-single .article-meta .category {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
}
.score-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
}

/* Affiliate bar (top of article) */
.affiliate-bar {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.08), rgba(56, 189, 248, 0.06));
  border: 1px solid rgba(244, 63, 94, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  margin-bottom: 1.2rem;
  text-align: center;
}
.af-bar-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}
.af-bar-link:hover { color: var(--accent-hover); }

/* Article content */
.article-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
  margin-bottom: 1.5rem;
}
.article-content h2 {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  border-left: 4px solid var(--accent);
  padding: 0.4rem 0 0.4rem 0.8rem;
  margin: 2.2rem 0 1rem;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-content h2:first-child { margin-top: 0; }
.article-content h3 {
  color: var(--accent-hover);
  font-size: 1.05rem;
  margin: 1.5rem 0 0.6rem;
  padding-left: 0.6rem;
  border-left: 2px solid rgba(244, 63, 94, 0.3);
}
.article-content p {
  margin-bottom: 1rem;
  color: var(--text);
}
.article-content ul, .article-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
  color: var(--text-secondary);
}
.article-content li { margin-bottom: 0.3rem; }
.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.8rem 1.2rem;
  margin: 1rem 0;
  background: var(--accent-soft);
  color: var(--text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}
.article-content strong { color: var(--accent-hover); font-weight: 700; }

/* Article thumbnail (hero image) */
.article-thumbnail {
  margin-bottom: 1.2rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.article-thumbnail img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

/* Article content images */
.article-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  border: 1px solid var(--border);
  display: block;
}

/* ---- Affiliate Box ---- */
.affiliate-box {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.06), rgba(56, 189, 248, 0.06));
  border: 1px solid rgba(244, 63, 94, 0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.affiliate-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.af-icon { font-size: 1.2rem; }
.affiliate-box h3 {
  font-size: 1rem;
  font-weight: 700;
}
.affiliate-box-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.af-link-btn {
  flex: 1;
  min-width: 200px;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.86rem;
  color: white;
  transition: var(--transition);
}
.af-link-btn:first-child {
  background: linear-gradient(135deg, var(--accent), #e11d48);
}
.af-link-btn:first-child:hover {
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.35);
  color: white;
  transform: translateY(-2px);
}
.af-link-btn:nth-child(2) {
  background: linear-gradient(135deg, var(--blue), #0284c7);
}
.af-link-btn:nth-child(2):hover {
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.35);
  color: white;
  transform: translateY(-2px);
}
.af-link-btn:nth-child(3) {
  background: linear-gradient(135deg, #4ade80, #22c55e);
}
.af-link-btn:nth-child(3):hover {
  box-shadow: 0 6px 20px rgba(74, 222, 128, 0.35);
  color: white;
  transform: translateY(-2px);
}

/* ---- Related Articles ---- */
.related-articles {
  margin: 2rem 0 1rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
}
.related-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
  display: block;
  color: var(--text);
}
.related-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.related-thumb {
  height: 100px;
  background: linear-gradient(135deg, #1e1030, #181828);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.related-score {
  font-size: 0.85rem;
  font-weight: 800;
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.related-info {
  padding: 0.6rem;
}
.related-title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: block;
}

/* ---- Post Navigation ---- */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.post-nav-link {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--text);
}
.post-nav-link:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  color: var(--text);
}
.post-nav-link.next { text-align: right; }
.post-nav-dir {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}
.post-nav-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }

.sidebar-box {
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sidebar-header {
  padding: 0.7rem 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-header .dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-body { padding: 0.8rem 1rem; }

/* Tag Cloud (collapsible) */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.tag-cloud.expanded {
  max-height: 2000px;
}
.tag-toggle {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.tag-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.tag-cloud a {
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.tag-cloud a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
/* Tag tiers: gold(50+), red(20-49), green(5-19), blue(2-4) */
.tag-cloud a.tag-gold {
  border-color: rgba(245, 180, 50, 0.4);
  color: #f5b432;
  background: rgba(245, 180, 50, 0.1);
  font-weight: 600;
}
.tag-cloud a.tag-red {
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--accent);
  background: var(--accent-soft);
}
.tag-cloud a.tag-green {
  border-color: rgba(52, 211, 153, 0.3);
  color: #34d399;
  background: rgba(52, 211, 153, 0.08);
}
.tag-cloud a.tag-blue {
  border-color: rgba(96, 165, 250, 0.3);
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.08);
}
.tag-count {
  font-size: 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0 0.3rem;
  border-radius: 3px;
  color: var(--text-muted);
}

/* Ranking */
.ranking-list { list-style: none; }
.ranking-item {
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.ranking-item:last-child { border-bottom: none; }
.rank-num {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1a1a1a; }
.rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #1a1a1a; }
.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.ranking-info {
  flex: 1;
  min-width: 0;
}
.ranking-info a {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: block;
}
.ranking-info a:hover { color: var(--accent); }
.ranking-score {
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 600;
}

/* Affiliate Sidebar CTA */
.sidebar-cta {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.04), rgba(56, 189, 248, 0.04));
}
.af-cta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.af-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
}
.af-btn-name { font-size: 0.9rem; }
.af-btn.fanza {
  background: linear-gradient(135deg, var(--accent), #e11d48);
  color: white;
}
.af-btn.fanza:hover { box-shadow: 0 4px 16px rgba(244, 63, 94, 0.35); color: white; transform: translateY(-2px); }
.af-btn.dlsite {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: white;
}
.af-btn.dlsite:hover { box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35); color: white; transform: translateY(-2px); }
.af-btn.pcolle {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: white;
}
.af-btn.pcolle:hover { box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35); color: white; transform: translateY(-2px); }
.af-btn small { font-weight: 400; font-size: 0.7rem; opacity: 0.85; }
.af-btn.monthly {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}
.af-btn.monthly:hover { box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35); color: white; transform: translateY(-2px); }
.af-btn.vr {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
}
.af-btn.vr:hover { box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35); color: white; transform: translateY(-2px); }

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.stat-item { text-align: center; flex: 1; }
.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 2rem 0 1rem;
  list-style: none;
}
.pagination li { list-style: none; }
.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: var(--transition);
}
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.pagination .active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  background: var(--bg-surface);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.footer-brand {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}
.footer-brand span { color: var(--accent); }
.footer-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}
.footer-links a {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .main-wrap { grid-template-columns: 1fr 350px; }
  .ad-sidebar-left { display: none; }
}
@media (max-width: 860px) {
  .main-wrap {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .mobile-menu-btn { display: flex; }
  .header-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(12, 12, 20, 0.95);
    backdrop-filter: blur(20px);
    padding: 1rem;
    flex-direction: column;
    border-bottom: 1px solid var(--border);
  }
  .header-nav.open { display: flex; }
  .header-nav a { padding: 0.6rem 1rem; width: 100%; }
  .article-card { flex-direction: column; }
  .card-thumb { width: 100%; height: 140px; min-height: 140px; }
  .hero-title { font-size: 1.8rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-stat-num { font-size: 1.4rem; }
  .hero-inner { padding: 2rem 1.5rem; }
  .article-single h1 { font-size: 1.3rem; }
  .article-content { padding: 1.2rem; }
  .post-nav { grid-template-columns: 1fr; }
  .affiliate-box-links { flex-direction: column; }
  .af-link-btn { min-width: auto; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .pickup-scroll { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .pickup-scroll { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { flex-direction: row; gap: 1rem; }
  .hero-stat-num { font-size: 1.2rem; }
  .card-body { padding: 0.8rem 1rem; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}
/* ===== 404 エラーページ ===== */
.error-page {
  text-align: center;
  padding: 3rem 1.5rem;
}
.error-code {
  font-size: 6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.error-title {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.error-desc {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}
.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.error-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: opacity 0.2s;
}
.error-btn:hover { opacity: 0.85; }
.error-btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.error-btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.error-suggest {
  margin-top: 2rem;
}
.error-suggest h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* ===== パンくずリスト ===== */
.breadcrumb {
  padding: 0.6rem 0;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s;
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb .sep {
  margin: 0 0.4rem;
  opacity: 0.5;
}

/* ===== アクセシビリティ ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== スキップリンク ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10000;
  font-size: 0.9rem;
}
.skip-link:focus {
  top: 0;
}

/* ===== 18歳確認ゲートウェイ ===== */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
}
.age-gate-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  max-width: 420px;
  width: 90%;
}
.age-gate-logo {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text);
}
.age-gate-logo span {
  color: var(--accent);
}
.age-gate-box h2 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: var(--text);
}
.age-gate-box p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.age-gate-btns {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}
.age-btn-yes {
  padding: 0.75rem 2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.age-btn-yes:hover { opacity: 0.85; }
.age-btn-no {
  padding: 0.75rem 2rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.age-btn-no:hover {
  border-color: var(--text-secondary);
  color: var(--text);
}

/* ===== 記事中間CTA ===== */
.article-cta {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.1), rgba(251, 191, 36, 0.06));
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}
.article-cta .cta-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.article-cta .cta-button {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #e11d48);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.8rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.article-cta .cta-button:hover {
  color: white;
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.4);
  transform: translateY(-2px);
}

/* ===== SNSシェアボタン ===== */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0;
  padding: 0.8rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.share-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: var(--transition);
}
.share-x {
  background: #1a1a2e;
  color: var(--text);
  border: 1px solid var(--border);
}
.share-x:hover {
  background: #000;
  color: #fff;
  border-color: #333;
  transform: translateY(-2px);
}

/* ===== トップへ戻るボタン ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, box-shadow 0.3s;
  z-index: 90;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.3);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.5);
  transform: translateY(-2px);
}

/* 記事内のクリッカブル画像 */
.article-content a > img {
  transition: var(--transition);
  cursor: pointer;
}
.article-content a > img:hover {
  opacity: 0.85;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.2);
}

/* ===== 左広告サイドバー ===== */
.ad-sidebar-left {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
@media (max-width: 1200px) {
  .ad-sidebar-left { display: none; }
}
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ad-banner {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.ad-banner:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}
.ad-banner img {
  width: 100%;
  height: auto;
  display: block;
}
.ad-placeholder {
  width: 160px;
  height: 600px;
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.sidebar-body .ad-placeholder {
  width: 100%;
  height: 250px;
}
.ad-zone {
  padding: 0.5rem;
}

/* ===== SNSシェアボタン拡張 (LINE, はてブ) ===== */
.share-line {
  background: #06c755;
  color: #fff;
}
.share-line:hover {
  background: #05b34c;
  color: #fff;
}
.share-hatena {
  background: #00a4de;
  color: #fff;
}
.share-hatena:hover {
  background: #0093c7;
  color: #fff;
}

/* ===== 読了時間 ===== */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ===== 読書プログレスバー ===== */
.reading-progress {
  position: fixed;
  top: 56px;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a855f7, var(--blue));
  z-index: 99;
  transition: width 0.1s linear;
}

/* ===== 目次 (TOC) ===== */
.article-toc {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
}
.article-toc summary {
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.article-toc summary::before {
  content: '';
  width: 4px;
  height: 1em;
  background: var(--accent);
  border-radius: 2px;
}
.article-toc summary::after {
  content: '▼';
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
  transition: transform 0.2s;
}
.article-toc[open] summary::after {
  transform: rotate(180deg);
}
.article-toc nav {
  padding: 0 1rem 0.8rem;
}
.article-toc nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.article-toc nav li {
  margin: 0;
  padding: 0;
}
.article-toc nav a {
  display: block;
  padding: 0.3rem 0;
  padding-left: 0.8rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--border);
  transition: var(--transition);
}
.article-toc nav a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
}
.article-toc nav ul ul a {
  padding-left: 1.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===== インライン関連記事 ===== */
.inline-related {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.04), rgba(244, 63, 94, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}
.inline-related h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.inline-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.inline-related li {
  margin: 0;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.inline-related li:last-child { border-bottom: none; }
.inline-related a {
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.inline-related a:hover { color: var(--accent); }
.inline-related a::before {
  content: '→ ';
  color: var(--accent);
}

/* ===== Hover保護 (タッチデバイス) ===== */
@media (hover: none) {
  .pickup-card:hover,
  .terms-card:hover,
  .article-card:hover,
  .related-card:hover,
  .af-link-btn:hover,
  .af-btn:hover,
  .share-btn:hover,
  .back-to-top:hover {
    transform: none;
  }
}

/* ===== Age Gate CSS最適化 ===== */
.age-ok .age-gate { display: none; }

/* ===== アニメーション無効化 (prefers-reduced-motion) ===== */
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  .reading-progress { transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Category Filter ── */
.category-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.category-filter a {
  padding: 0.4rem 0.9rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.category-filter a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.category-filter a.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
