/* ============================================
   オレ的同人まとめ - 共通CSS
   ダーク系 / サイドバー+メイン / カード型
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: #0a0a0f;
  color: #e7e9ea;
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: #a78bfa;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #c4b5fd;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(167, 139, 250, 0.15);
  padding: 12px 20px;
}

.site-header .header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .site-title {
  font-size: 18px;
  font-weight: 700;
  color: #a78bfa;
  letter-spacing: 0.5px;
}

.site-header .nav-links {
  display: flex;
  gap: 8px;
}

.site-header .nav-link {
  font-size: 13px;
  color: #9ca3af;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.site-header .nav-link:hover {
  color: #e7e9ea;
  background: rgba(255, 255, 255, 0.05);
}

.site-header .nav-link.active {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
}

/* --- サイドバー + メイン レイアウト --- */
.page-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  gap: 24px;
}

.page-main {
  flex: 1;
  min-width: 0;
}

.page-sidebar {
  width: 220px;
  flex-shrink: 0;
}

.sidebar-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.sidebar-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #9ca3af;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-tag-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #9ca3af;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.sidebar-tag:hover {
  color: #e7e9ea;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-tag.active {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.25);
}

.sidebar-tag .tag-count {
  font-size: 11px;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-tag.active .tag-count {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.15);
}

/* --- アクティブフィルター表示 --- */
.active-filter-display {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.active-filter-display .filter-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.active-filter-display .filter-tag.format {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.active-filter-display .filter-tag::after {
  content: '\00d7';
  margin-left: 6px;
  font-size: 14px;
}

.active-filter-display .filter-tag:hover {
  opacity: 0.7;
}

.active-filter-display .clear-all {
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  margin-left: 4px;
}

.active-filter-display .clear-all:hover {
  color: #e7e9ea;
}

/* --- カード型レイアウト --- */
.works-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px;
  margin-top: 16px;
}

.work-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.work-card:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.3);
}

.work-card .card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.work-card .card-body {
  padding: 12px;
}

.work-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: #e7e9ea;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.work-card .card-circle {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 8px;
}

.work-card .card-dates {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 6px;
}

.work-card .card-version {
  color: #10b981;
  font-weight: 600;
}

.work-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.work-card .card-tag {
  font-size: 11px;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.work-card .card-tag:hover {
  background: rgba(167, 139, 250, 0.25);
}

.work-card .card-format {
  font-size: 11px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.work-card .card-format:hover {
  background: rgba(16, 185, 129, 0.25);
}

/* --- 個別作品ページ --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

.work-detail {
  max-width: 800px;
  margin: 0 auto;
}

.work-detail .work-hero {
  text-align: center;
  margin-bottom: 24px;
}

.work-detail .work-hero img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.work-detail .work-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.work-detail .work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.work-detail .work-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.work-detail .work-description {
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 32px;
}

/* --- 画像ギャラリー（詳細ページ） --- */
.work-gallery {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.work-gallery .gallery-main {
  flex: 1;
  min-width: 0;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.work-gallery .gallery-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.work-gallery .gallery-side {
  width: 80px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 500px;
}

.gallery-scroll-btn {
  width: 80px;
  height: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #9ca3af;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.gallery-scroll-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #e7e9ea;
}

.work-gallery .gallery-thumbs {
  flex: 1;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 0;
}

.work-gallery .gallery-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s;
  display: block;
  flex-shrink: 0;
}

.work-gallery .gallery-thumb:hover {
  opacity: 0.85;
}

.work-gallery .gallery-thumb.active {
  border-color: #a78bfa;
  opacity: 1;
}

.work-gallery .gallery-thumb-wrap {
  position: relative;
  flex-shrink: 0;
}

.work-gallery .gallery-thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding-left: 2px;
}

/* --- バージョン履歴 --- */
.version-history-toggle {
  font-size: 13px;
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.version-history-toggle:hover {
  color: #e7e9ea;
}

.version-history-toggle .arrow {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 10px;
}

.version-history-toggle.open .arrow {
  transform: rotate(90deg);
}

.version-history {
  display: none;
  margin-bottom: 24px;
}

.version-history.open {
  display: block;
}

.version-entry {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.version-entry .ver-date {
  color: #6b7280;
  flex-shrink: 0;
  width: 90px;
}

.version-entry .ver-label {
  color: #10b981;
  font-weight: 600;
  flex-shrink: 0;
  width: 70px;
}

.version-entry .ver-note {
  color: #9ca3af;
  flex: 1;
}

/* --- CTAボタン --- */
.cta-button {
  display: inline-block;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 40px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.cta-button:hover {
  opacity: 0.9;
  color: #fff;
}

.cta-button:active {
  transform: scale(0.98);
}

.cta-area {
  text-align: center;
  margin: 32px 0;
}

/* --- 年齢確認ゲート --- */
.age-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 24px;
}

.age-gate h1 {
  font-size: 28px;
  margin-bottom: 16px;
  color: #e7e9ea;
}

.age-gate p {
  font-size: 15px;
  color: #9ca3af;
  margin-bottom: 32px;
  max-width: 400px;
}

.age-gate .btn-group {
  display: flex;
  gap: 16px;
}

.age-gate .btn-yes {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 48px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.age-gate .btn-yes:hover {
  opacity: 0.9;
}

.age-gate .btn-no {
  background: rgba(255, 255, 255, 0.06);
  color: #9ca3af;
  font-size: 16px;
  padding: 14px 48px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s;
}

.age-gate .btn-no:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e7e9ea;
}

/* --- セクション見出し --- */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #e7e9ea;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(167, 139, 250, 0.3);
  margin-bottom: 16px;
}

/* --- ページネーション --- */
#pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

#pagination button {
  font-size: 13px;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

#pagination button:hover {
  color: #e7e9ea;
  background: rgba(255, 255, 255, 0.08);
}

#pagination button.current {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.3);
  font-weight: 700;
}

/* --- フッター --- */
.site-footer {
  text-align: center;
  padding: 40px 16px;
  font-size: 12px;
  color: #6b7280;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 60px;
}

/* --- レスポンシブ --- */
@media (max-width: 768px) {
  .page-layout {
    flex-direction: column;
  }

  .page-sidebar {
    width: 100%;
    order: -1;
  }

  .sidebar-section {
    padding: 12px;
  }

  .sidebar-tag-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .sidebar-tag {
    padding: 4px 10px;
    font-size: 12px;
  }

  .sidebar-tag .tag-count {
    display: none;
  }
}

@media (max-width: 640px) {
  .work-gallery {
    flex-direction: column-reverse;
  }

  .work-gallery .gallery-main {
    height: 300px;
  }

  .work-gallery .gallery-side {
    width: 100%;
    height: auto;
    flex-direction: row;
  }

  .gallery-scroll-btn {
    width: 24px;
    height: 45px;
  }

  .work-gallery .gallery-thumbs {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 6px;
  }

  .work-gallery .gallery-thumb {
    width: 60px;
    height: 45px;
  }
}
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .work-card .card-body {
    padding: 10px;
  }

  .work-card .card-title {
    font-size: 13px;
  }

  .work-detail .work-title {
    font-size: 18px;
  }

  .site-header .header-inner {
    flex-direction: column;
    gap: 8px;
  }

  .age-gate .btn-group {
    flex-direction: column;
  }
}
