/* FANZAサクラチェッカー */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f1a;
  color: #eee;
  min-height: 100vh;
}

/* Global header */
.global-header {
  background: #0a0a12;
  border-bottom: 1px solid #1a1a2e;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.site-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

a.site-logo,
.site-logo {
  font-size: 20px;
  font-weight: bold;
  text-decoration: none;
  background: linear-gradient(135deg, #ff6b9d, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

a.site-logo:hover,
.site-logo:hover {
  opacity: 0.8;
}

.site-tagline {
  font-size: 12px;
  color: #666;
}

/* Global footer */
.global-footer {
  text-align: center;
  padding: 32px 20px;
  color: #555;
  font-size: 12px;
  border-top: 1px solid #1a1a2e;
  margin-top: 48px;
}

.global-footer .affiliate-notice {
  margin-bottom: 12px;
  color: #666;
}

.global-footer .footer-links {
  margin-bottom: 12px;
}

.global-footer .footer-links a {
  color: #666;
  text-decoration: none;
  margin: 0 8px;
}

.global-footer .footer-links a:hover {
  color: #888;
}

.global-footer .copyright {
  color: #444;
}

/* Last updated */
.last-updated {
  color: #aaa;
  font-size: 14px;
  margin: 0;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.page-title {
  text-align: center;
  margin-bottom: 24px;
}

.page-title h1 {
  color: #ff6b9d;
  font-size: 28px;
  margin-bottom: 4px;
}

.subtitle {
  color: #888;
  font-size: 14px;
}

.controls {
  background: #16213e;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group label {
  color: #aaa;
  font-size: 14px;
}

.year-buttons,
.sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.year-btn,
.sort-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: #0f3460;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}

.year-btn:hover,
.sort-btn:hover {
  background: #e91e63;
}

.year-btn.active,
.sort-btn.active {
  background: #ff6b9d;
}

.year-btn.deleted.active {
  background: #dc2626;
}

.stats {
  color: #888;
  font-size: 14px;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-card {
  display: flex;
  background: #16213e;
  border-radius: 8px;
  padding: 12px;
  gap: 12px;
  transition: transform 0.2s;
}

.video-card:hover {
  transform: translateX(4px);
}

.rank {
  font-size: 20px;
  font-weight: bold;
  color: #ff6b9d;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbnail-link {
  flex-shrink: 0;
}

.thumbnail {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
  transition: opacity 0.2s;
}

.thumbnail-link:hover .thumbnail {
  opacity: 0.8;
}

.info {
  flex: 1;
  min-width: 0;
}

.title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
  line-height: 1.4;
}

.title a {
  color: #4cc9f0;
  text-decoration: none;
}

.title a:hover {
  text-decoration: underline;
}

.year-tag {
  display: inline-block;
  background: #333;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  margin-left: 8px;
  font-weight: normal;
}

.actress {
  color: #f72585;
  font-size: 13px;
  margin-bottom: 6px;
}

.actress a {
  color: #4cc9f0;
  text-decoration: none;
}

.actress a:hover {
  color: #7dd3fc;
}

.meta-info {
  color: #888;
  font-size: 12px;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-info .maker,
.meta-info .director {
  color: #888;
}

.meta-info a {
  color: #4cc9f0;
  text-decoration: none;
}

.meta-info a:hover {
  color: #7dd3fc;
}

.release-date {
  color: #888;
  font-size: 12px;
  margin-bottom: 6px;
}

.meta {
  color: #aaa;
  font-size: 13px;
}

/* Video card stats */
.video-card .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.video-card .stat-item {
  background: #0f3460;
  padding: 6px 10px;
  border-radius: 4px;
  text-align: center;
  min-width: 70px;
}

.video-card .stat-item.highlight {
  background: #1a4d1a;
}

.video-card .stat-item.warning {
  background: #4d1a1a;
  position: relative;
  cursor: help;
}

.video-card .stat-item.warning::after {
  content: "コメント/評価比率が高い場合、サクラやステマの可能性があります";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
  margin-bottom: 8px;
  pointer-events: none;
}

.video-card .stat-item.warning:hover::after {
  opacity: 1;
  visibility: visible;
}

.video-card .stat-item.warning .stat-value {
  color: #ef4444;
}

.video-card .stat-label {
  display: block;
  color: #888;
  font-size: 10px;
  margin-bottom: 2px;
}

.video-card .stat-value {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

.video-card .stat-item.highlight .stat-value {
  color: #4ade80;
}

.video-card .analysis {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #0a0a12;
  border-radius: 4px;
  width: fit-content;
}

.video-card .analysis-label {
  color: #888;
  font-size: 12px;
}

.video-card .analysis-value {
  color: #f59e0b;
  font-family: monospace;
  font-size: 13px;
  font-weight: bold;
}

.video-card .rankings {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.video-card .ranking-item {
  color: #4ade80;
  font-size: 12px;
}

.highlight {
  color: #4ade80;
  font-weight: bold;
}

.debug-ratio {
  color: #f59e0b;
  font-family: monospace;
}

.debug-warning {
  color: #ef4444;
  font-weight: bold;
}

.load-more {
  display: none;
  text-align: center;
  padding: 20px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 40px;
  color: #888;
  min-height: 100px;
}

.loading .spinner,
.loading span {
  display: none;
}

.loading.show .spinner,
.loading.show span {
  display: block;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #333;
  border-top-color: #ff6b9d;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Header navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: #aaa;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-link:hover {
  color: #fff;
  background: #16213e;
}

/* Search page */
.search-box {
  background: #16213e;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.search-form {
  display: flex;
  gap: 12px;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #0f3460;
  border-radius: 6px;
  background: #0a0a12;
  color: #fff;
  font-size: 16px;
}

.search-input:focus {
  outline: none;
  border-color: #ff6b9d;
}

.search-input::placeholder {
  color: #666;
}

.search-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  background: #ff6b9d;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background 0.2s;
  white-space: nowrap;
}

.search-btn:hover {
  background: #e91e63;
}

.search-hint {
  margin-top: 12px;
  color: #666;
  font-size: 13px;
}

.search-initial {
  text-align: center;
  padding: 48px;
  color: #666;
}

/* Result card */
.result-card {
  background: #16213e;
  border-radius: 8px;
  padding: 24px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #0f3460;
}

.result-header h2 {
  color: #ff6b9d;
  font-size: 20px;
  margin: 0;
}

.result-count {
  background: #0f3460;
  color: #4cc9f0;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
}

.actress-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.back-to-ranking {
  margin-left: auto;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: #0f3460;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}

.back-to-ranking:hover {
  background: #ff6b9d;
}

.deleted-badge {
  background: #dc2626;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.result-content {
  display: flex;
  gap: 24px;
}

.result-thumbnail img {
  width: 180px;
  height: 240px;
  object-fit: cover;
  border-radius: 6px;
}

.result-info {
  flex: 1;
}

.result-title {
  font-size: 18px;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.result-title a {
  color: #4cc9f0;
  text-decoration: none;
}

.result-title a:hover {
  text-decoration: underline;
}

.result-actress {
  color: #f72585;
  font-size: 14px;
  margin-bottom: 16px;
}

.result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.stat-item {
  background: #0f3460;
  padding: 12px 16px;
  border-radius: 6px;
  text-align: center;
  min-width: 100px;
}

.stat-label {
  display: block;
  color: #888;
  font-size: 12px;
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
}

.result-analysis {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background: #0a0a12;
  border-radius: 6px;
}

.analysis-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-label {
  color: #888;
  font-size: 13px;
}

.analysis-value {
  color: #f59e0b;
  font-family: monospace;
  font-size: 14px;
  font-weight: bold;
}

.analysis-item.warning .analysis-value {
  color: #ef4444;
}

.result-rank {
  color: #4ade80;
  font-size: 14px;
  margin-bottom: 8px;
}

.result-id {
  color: #666;
  font-size: 12px;
  font-family: monospace;
}

/* Not found */
.not-found {
  text-align: center;
  padding: 32px;
}

.not-found-title {
  color: #ef4444;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
}

.not-found-id {
  color: #888;
  font-size: 14px;
  font-family: monospace;
  margin-bottom: 12px;
}

.not-found-hint {
  color: #666;
  font-size: 14px;
}

/* Error */
.error-card {
  border: 2px solid #ef4444;
}

.error-message {
  color: #ef4444;
  text-align: center;
  padding: 24px;
  font-size: 16px;
}

/* Search filters */
.search-filters {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #0f3460;
}

.search-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.search-filter-row:last-child {
  margin-bottom: 0;
}

.filter-label {
  color: #aaa;
  font-size: 14px;
  min-width: 50px;
}

.search-year-buttons,
.search-sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.no-results {
  text-align: center;
  padding: 32px;
  color: #888;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .video-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .rank {
    font-size: 16px;
    min-width: auto;
  }

  .thumbnail {
    width: 100px;
    height: 133px;
  }

  .title {
    font-size: 13px;
  }

  .video-card .stats {
    justify-content: center;
  }

  .video-card .stat-item {
    min-width: 60px;
    padding: 4px 8px;
  }

  .video-card .stat-value {
    font-size: 12px;
  }

  /* Search page mobile */
  .search-form {
    flex-direction: column;
  }

  .search-btn {
    width: 100%;
  }

  .result-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .result-thumbnail img {
    width: 140px;
    height: 186px;
  }

  .result-stats {
    justify-content: center;
  }

  .stat-item {
    min-width: 80px;
    padding: 8px 12px;
  }

  .stat-value {
    font-size: 16px;
  }

  .result-analysis {
    flex-direction: column;
    align-items: center;
  }

  /* Search filters mobile */
  .search-filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .filter-label {
    min-width: auto;
  }

  .search-year-buttons,
  .search-sort-buttons {
    justify-content: flex-start;
  }
}
