:root {
  --bg-page: #f7fafc;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-sub: #475569;
  --text-muted: #64748b;
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --accent: #10b981;
  --accent-dark: #059669;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--text-sub);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--primary-dark);
}

.main-content {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 48px;
}

.screen[hidden],
[hidden] {
  display: none !important;
}

.hero-card,
.diagnose-card,
.gate-card,
.policy-card,
.neutral-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.hero-badge {
  display: inline-block;
  background: #e0f2fe;
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin: 0 0 8px;
}

.hero-title {
  font-size: 2rem;
  margin: 0 0 8px;
  color: var(--text-main);
}

.hero-subtitle {
  color: var(--text-sub);
  margin: 0 0 24px;
}

.mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.mode-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: #fafcff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mode-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.mode-card h2 {
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.mode-card p {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin: 0 0 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-large {
  padding: 13px 24px;
  font-size: 1.05rem;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.btn-accent:hover {
  background: var(--accent-dark);
}

.btn-outline {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border);
}

.btn-outline:hover {
  background: #f1f5f9;
}

.privacy-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.notice-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.notice-box h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.notice-box ul {
  margin: 0;
  padding-left: 20px;
}

.section-header {
  margin-bottom: 20px;
}

.section-header h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.section-header p {
  margin: 0;
  color: var(--text-sub);
}

.sample-note {
  display: inline-block;
  margin-top: 8px !important;
  font-size: 0.78rem;
  color: var(--text-muted) !important;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 999px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.filter-search {
  flex: 1;
  min-width: 180px;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
}

.filter-group select,
.filter-group input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

.celeb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.celeb-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.celeb-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.celeb-name-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  cursor: pointer;
  text-align: left;
}

.celeb-name-btn:hover {
  text-decoration: underline;
}

.celeb-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.celeb-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.model-status-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-loading {
  background: #f59e0b;
}

.status-ready {
  background: #10b981;
}

.status-error {
  background: #ef4444;
}

.first-time-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 10px 0 20px;
}

.upload-area {
  margin: 20px 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.sample-demo-box {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.sample-demo-title {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin: 0 0 10px;
}

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

.loading-box {
  margin-top: 20px;
  padding: 20px;
  text-align: center;
  background: #f0f9ff;
  border-radius: 8px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid #bae6fd;
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: spin 0.8s linear infinite;
}

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

.retry-box {
  margin-top: 20px;
  padding: 16px;
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
  color: #713f12;
}

.retry-box h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.retry-box p {
  margin: 0;
  font-size: 0.9rem;
}

.preview-wrap {
  margin-top: 16px;
  text-align: center;
}

.preview-img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.rank-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.rank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.rank-badge {
  background: #e0f2fe;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 3px 10px;
  border-radius: 999px;
}

.tier-label {
  font-weight: 700;
  color: var(--accent-dark);
  font-size: 0.95rem;
}

.rank-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 4px 0 8px;
}

.rank-praise {
  color: var(--text-sub);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

.share-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.share-box h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.share-box p {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-sub);
}

.share-feedback {
  margin-top: 12px;
}

.share-feedback textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #f8fafc;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.gated-entry-box {
  border-top: 1px dashed var(--border);
  padding-top: 20px;
  text-align: center;
}

.btn-gated-link {
  background: #f1f5f9;
  color: var(--text-sub);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.btn-gated-link:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.gate-card {
  text-align: center;
  max-width: 540px;
  margin: 0 auto;
}

.gate-badge {
  display: inline-block;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.gate-question {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 12px 0 8px;
}

.gate-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.gate-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.pr-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.pr-badge {
  background: #d97706;
  color: #ffffff;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.actresses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.actress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.actress-placeholder {
  width: 100%;
  height: 140px;
  background: #f1f5f9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.actress-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

.actress-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.actress-note {
  font-size: 0.9rem;
  color: var(--accent-dark);
  font-weight: 600;
  margin: 0 0 14px;
}

.works-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.work-title {
  font-weight: 700;
  margin: 0 0 4px;
}

.work-price {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin: 0;
}

.section-footer-actions {
  margin-top: 20px;
}

.fanza-credit {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 16px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-sub);
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 1.6rem;
  }
  .celeb-row,
  .work-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
