:root {
  --bg-page: #ffffff;
  --bg-subtle: #f7f6f3;
  --bg-card: #ffffff;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --border-hairline: #e4e4e0;
  --border-strong: #d4d4ce;
  --brand-orange: #ea580c;
  --brand-orange-hover: #c2410c;
  --brand-red: #c81e1e;
  --brand-tint: #fff7ed;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --container-max: 1180px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 2px;
}

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header - 3-zone single row contract */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 64px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.main-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--brand-orange);
  border-bottom-color: var(--brand-orange);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--brand-orange);
  border: 1px solid var(--brand-orange);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--brand-orange-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-page);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-page);
  padding: 12px 20px 20px;
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-drawer a {
  display: block;
  padding: 12px 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-hairline);
}

.mobile-drawer a:last-child {
  border-bottom: none;
}

/* Breadcrumb */
.breadcrumb {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-hairline);
  background-color: var(--bg-subtle);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--brand-orange);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--text-primary);
  font-weight: 500;
}

/* Hero Section */
.hero-section {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border-hairline);
  background: linear-gradient(180deg, #ffffff 0%, #faf9f6 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.hero-kicker {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-red);
  margin: 0 0 10px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.875rem, 3.2vw, 2.75rem);
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-primary);
  text-wrap: balance;
}

.hero-lead {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0 0 24px;
  max-width: 60ch;
}

.hero-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-subtle);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Search Box */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  max-width: 560px;
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.search-input:focus {
  border-color: var(--brand-orange);
}

.search-results {
  margin-top: 12px;
  max-width: 560px;
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.search-results[hidden] {
  display: none;
}

.search-results-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.search-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.search-result-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: 0.9375rem;
}

.search-result-list a:hover {
  background: var(--brand-tint);
  color: var(--brand-orange);
}

.search-result-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.quick-links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.quick-links-inline a {
  color: var(--brand-orange);
  font-weight: 500;
}

.quick-links-inline a:hover {
  text-decoration: underline;
}

/* Sections */
.section {
  padding: 48px 0;
}

.section-subtle {
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 28px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.section-desc {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.section-more {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-orange);
  white-space: nowrap;
}

.section-more:hover {
  text-decoration: underline;
}

/* Grids & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--brand-orange);
}

.card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  color: var(--text-primary);
}

.card-title a:hover {
  color: var(--brand-orange);
}

.card-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.65;
}

.card-link {
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-orange);
}

.card-link:hover {
  text-decoration: underline;
}

.novel-card {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 18px;
  align-items: start;
}

.novel-cover {
  width: 108px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background: linear-gradient(145deg, #fff7ed 0%, #f4f4f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.novel-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.novel-cover-text {
  padding: 10px;
  text-align: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-primary);
}

/* Ranking List & Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-hairline);
}

.data-table th {
  background-color: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table a {
  color: var(--brand-orange);
  font-weight: 600;
}

.data-table a:hover {
  text-decoration: underline;
}

.rank-num {
  font-weight: 700;
  color: var(--brand-red);
  font-variant-numeric: tabular-nums;
}

/* Article / Subpage Layout */
.page-banner {
  padding: 36px 0 32px;
  border-bottom: 1px solid var(--border-hairline);
  background-color: #ffffff;
}

.page-kicker {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-orange);
  margin: 0 0 8px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.375rem);
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text-primary);
  text-wrap: balance;
}

.page-summary {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 72ch;
  margin: 0;
  line-height: 1.75;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  padding: 40px 0 64px;
  align-items: start;
}

.prose {
  max-width: 74ch;
}

.prose h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-primary);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

.prose p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--text-secondary);
}

.prose li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.prose a {
  color: var(--brand-orange);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--brand-red);
}

.info-dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  padding: 20px;
  margin: 0 0 28px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}

.info-dl-item dt {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.info-dl-item dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-stack {
  display: grid;
  gap: 24px;
}

.sidebar-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 20px;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text-primary);
}

.sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.sidebar-links a {
  display: block;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  padding: 4px 0;
}

.sidebar-links a:hover {
  color: var(--brand-orange);
  text-decoration: underline;
}

.notice-box {
  background-color: var(--brand-tint);
  border: 1px solid #fed7aa;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 24px 0;
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.7;
}

/* FAQ Accordion */
.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.faq-item {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  padding: 16px 20px;
}

.faq-item summary {
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.125rem;
  color: var(--brand-orange);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.75;
}

/* Filter Tabs */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-btn[aria-pressed="true"],
.filter-btn:hover {
  background-color: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #ffffff;
}

/* Footer */
.site-footer {
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-hairline);
  padding: 48px 0 32px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-links a:hover {
  color: var(--brand-orange);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .article-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .main-nav,
  .header-actions .btn-primary {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .hero-grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .info-dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .grid-4,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .novel-card {
    grid-template-columns: 88px 1fr;
    gap: 14px;
  }
  .novel-cover {
    width: 88px;
  }
  .search-box {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
