/* ==========================================================================
   Base / Reset
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #2b3a3f;
  background-color: #f5f7f8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: #17a2b8;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #138496;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: #2b3a3f;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

.site-main {
  flex: 1 0 auto;
}

/* ==========================================================================
   Layout / Shell
   ========================================================================== */

.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e2f0f1;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2b3a3f;
}

.brand-slogan {
  font-size: 0.8125rem;
  color: #6c7a80;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: block;
  padding: 8px 16px;
  font-size: 0.9375rem;
  color: #4a5a60;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background-color: #e2f0f1;
  color: #17a2b8;
}

.nav-link.is-current {
  background-color: #17a2b8;
  color: #ffffff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #2b3a3f;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  width: 100%;
}

.site-footer {
  background-color: #ffffff;
  border-top: 1px solid #e2f0f1;
  margin-top: auto;
  flex-shrink: 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 24px;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 40px;
}

.footer-brand-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: #2b3a3f;
  margin-bottom: 8px;
}

.footer-brand-desc {
  font-size: 0.875rem;
  color: #6c7a80;
  line-height: 1.6;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.footer-link-group h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #2b3a3f;
  margin-bottom: 12px;
}

.footer-link-group ul li {
  margin-bottom: 8px;
}

.footer-link-group a {
  font-size: 0.875rem;
  color: #6c7a80;
}

.footer-link-group a:hover {
  color: #17a2b8;
}

.footer-bottom {
  border-top: 1px solid #e2f0f1;
  padding: 16px 20px;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8125rem;
  color: #8a9a9f;
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Section heading */
.section-heading {
  margin-bottom: 24px;
}

.section-heading h2,
.section-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: #2b3a3f;
  margin-bottom: 8px;
}

.section-heading p,
.section-intro,
.section-desc {
  font-size: 0.9375rem;
  color: #6c7a80;
  line-height: 1.6;
  max-width: 720px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 10px 24px;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 6px;
  text-align: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background-color: #17a2b8;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #138496;
  color: #ffffff;
}

.btn-secondary {
  background-color: #ffffff;
  color: #17a2b8;
  border: 1px solid #17a2b8;
}

.btn-secondary:hover {
  background-color: #e2f0f1;
  color: #138496;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #8a9a9f;
  margin-bottom: 24px;
}

.breadcrumb a {
  color: #17a2b8;
}

.breadcrumb-sep {
  color: #b0c0c5;
}

.breadcrumb-current {
  color: #4a5a60;
}

/* Page header */
.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2b3a3f;
  margin-bottom: 12px;
}

.page-description {
  font-size: 1rem;
  color: #6c7a80;
  line-height: 1.6;
  max-width: 720px;
}

/* Card hover */
.comic-card,
.genre-card,
.work-card,
.guide-card,
.topic-card,
.popular-item,
.update-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comic-card:hover,
.genre-card:hover,
.work-card:hover,
.guide-card:hover,
.topic-card:hover,
.popular-item:hover,
.update-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(43, 58, 63, 0.08);
}

/* ==========================================================================
   Home Page
   ========================================================================== */

.home-main {
  padding-top: 0;
}

/* Hero */
.hero-section {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 48px 0 40px;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
}

.hero-text {
  font-size: 1rem;
  color: #4a5a60;
  line-height: 1.7;
  margin-bottom: 12px;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.hero-figure {
  border-radius: 8px;
  overflow: hidden;
  background-color: #e2f0f1;
}

.hero-figure img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.hero-figure figcaption {
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: #6c7a80;
  background-color: #ffffff;
}

/* Category tags */
.category-nav-section {
  padding: 32px 0;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-item {
  display: inline-block;
  padding: 8px 20px;
  background-color: #ffffff;
  border: 1px solid #e2f0f1;
  border-radius: 20px;
  font-size: 0.9375rem;
  color: #2b3a3f;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tag-item:hover {
  background-color: #17a2b8;
  border-color: #17a2b8;
  color: #ffffff;
}

/* Recent updates */
.recent-updates-section {
  padding: 32px 0;
}

.update-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.update-item {
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2f0f1;
}

.update-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.update-info {
  padding: 16px;
}

.update-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.update-meta {
  font-size: 0.8125rem;
  color: #8a9a9f;
  margin-bottom: 6px;
}

.update-status {
  display: inline-block;
  font-size: 0.75rem;
  color: #17a2b8;
  background-color: #e2f0f1;
  padding: 2px 10px;
  border-radius: 10px;
}

/* Popular list */
.popular-section {
  padding: 32px 0;
}

.popular-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.popular-item {
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2f0f1;
  overflow: hidden;
  position: relative;
}

.popular-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.rank-number {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: rgba(43, 58, 63, 0.85);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popular-info {
  padding: 14px 16px 16px;
}

.popular-info h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.popular-info p {
  font-size: 0.8125rem;
  color: #6c7a80;
  line-height: 1.5;
}

/* Guide entry */
.guide-entry-section {
  padding: 32px 0;
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.guide-card {
  display: block;
  background-color: #ffffff;
  border: 1px solid #e2f0f1;
  border-radius: 8px;
  padding: 24px;
}

.guide-card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: #2b3a3f;
}

.guide-card p {
  font-size: 0.9375rem;
  color: #6c7a80;
  line-height: 1.6;
}

/* Featured topics */
.featured-topics-section {
  padding: 32px 0;
}

.topic-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.topic-card {
  display: block;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2f0f1;
  overflow: hidden;
}

.topic-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.topic-card h3 {
  font-size: 1.125rem;
  padding: 16px 16px 4px;
}

.topic-card p {
  font-size: 0.9375rem;
  color: #6c7a80;
  padding: 0 16px 16px;
}

/* ==========================================================================
   Inner Pages Layout
   ========================================================================== */

.layout-shell,
.page-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  width: 100%;
}

.inner-main {
  max-width: none;
  padding: 0;
  min-width: 0;
}

.sidebar,
.guide-aside {
  min-width: 0;
}

.sidebar-card,
.aside-block {
  background-color: #ffffff;
  border: 1px solid #e2f0f1;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-card h2,
.sidebar-card h3,
.sidebar-title,
.aside-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #2b3a3f;
}

.sidebar-links li,
.sidebar-list li,
.aside-list li {
  margin-bottom: 10px;
}

.sidebar-links a,
.sidebar-list a,
.aside-list a {
  font-size: 0.875rem;
  color: #4a5a60;
  line-height: 1.5;
}

.sidebar-links a:hover,
.sidebar-list a:hover,
.aside-list a:hover {
  color: #17a2b8;
}

.sidebar-text {
  font-size: 0.875rem;
  color: #6c7a80;
  line-height: 1.6;
}

/* ==========================================================================
   Categories Page
   ========================================================================== */

.genre-section,
.featured-works-section,
.category-tip-section {
  margin-bottom: 40px;
}

.genre-section h2,
.featured-works-section h2,
.category-tip-section h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.genre-card {
  background-color: #ffffff;
  border: 1px solid #e2f0f1;
  border-radius: 8px;
  overflow: hidden;
}

.genre-figure {
  overflow: hidden;
}

.genre-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.genre-figure figcaption {
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: #6c7a80;
  background-color: #f5f7f8;
}

.genre-body {
  padding: 16px;
}

.genre-body h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.genre-body p {
  font-size: 0.875rem;
  color: #6c7a80;
  line-height: 1.6;
  margin-bottom: 12px;
}

.genre-link {
  font-size: 0.875rem;
  font-weight: 500;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.work-card {
  background-color: #ffffff;
  border: 1px solid #e2f0f1;
  border-radius: 8px;
  overflow: hidden;
}

.work-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.work-info {
  padding: 16px;
}

.work-info h3 {
  font-size: 0.9375rem;
  margin-bottom: 6px;
}

.work-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: #17a2b8;
  background-color: #e2f0f1;
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.work-info p:last-child {
  font-size: 0.8125rem;
  color: #6c7a80;
  line-height: 1.5;
}

.category-tip-section p {
  font-size: 0.9375rem;
  color: #4a5a60;
  line-height: 1.7;
  max-width: 760px;
  margin-bottom: 12px;
}

/* ==========================================================================
   Guide Page
   ========================================================================== */

.guide-section {
  margin-bottom: 40px;
}

.step-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.step-item {
  display: flex;
  gap: 16px;
  background-color: #ffffff;
  border: 1px solid #e2f0f1;
  border-radius: 8px;
  padding: 20px;
}

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background-color: #17a2b8;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-body h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.step-body p {
  font-size: 0.875rem;
  color: #6c7a80;
  line-height: 1.6;
}

.guide-figure {
  margin: 32px 0;
  border-radius: 8px;
  overflow: hidden;
}

.guide-figure img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.guide-figure figcaption {
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: #6c7a80;
  background-color: #ffffff;
}

.related-links {
  margin-bottom: 32px;
}

.related-links h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.related-links > p {
  font-size: 0.9375rem;
  color: #6c7a80;
  margin-bottom: 16px;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.related-list a {
  display: block;
  font-size: 0.875rem;
  color: #17a2b8;
  padding: 8px 0;
}

.related-list a:hover {
  color: #138496;
}

.related-links ul li a {
  display: block;
  font-size: 0.875rem;
  color: #17a2b8;
  padding: 8px 0;
}

/* ==========================================================================
   Romance / Action Pages
   ========================================================================== */

.content-section {
  margin-bottom: 40px;
}

.comic-card {
  display: flex;
  gap: 16px;
  background-color: #ffffff;
  border: 1px solid #e2f0f1;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.comic-cover-wrap {
  flex-shrink: 0;
  width: 140px;
}

.comic-cover {
  width: 140px;
  height: 190px;
  object-fit: cover;
  border-radius: 6px;
}

.comic-info {
  flex: 1;
  min-width: 0;
}

.comic-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.comic-tags {
  font-size: 0.8125rem;
  color: #17a2b8;
  margin-bottom: 8px;
}

.comic-desc {
  font-size: 0.875rem;
  color: #6c7a80;
  line-height: 1.6;
}

/* Action page comic card variant */
.recommend-list .comic-card {
  flex-direction: row;
}

.comic-card-media {
  flex-shrink: 0;
  width: 160px;
}

.comic-card-media img {
  width: 160px;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
}

.comic-card-body {
  flex: 1;
  min-width: 0;
}

.comic-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.comic-card-tags {
  font-size: 0.8125rem;
  color: #17a2b8;
  margin-bottom: 8px;
}

.comic-card-desc {
  font-size: 0.875rem;
  color: #6c7a80;
  line-height: 1.6;
}

/* Compare table */
.table-wrapper,
.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background-color: #ffffff;
}

.compare-table th,
.compare-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2f0f1;
}

.compare-table th {
  background-color: #e2f0f1;
  font-weight: 600;
  color: #2b3a3f;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.advice-note,
.suggestion-note {
  font-size: 0.875rem;
  color: #6c7a80;
  line-height: 1.6;
  margin-top: 12px;
}

.suggestion-note a {
  color: #17a2b8;
}

/* Related section */
.related-section {
  margin-bottom: 40px;
}

.related-section h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.related-links {
  margin-top: 16px;
}

.related-links li {
  margin-bottom: 8px;
}

.related-links a {
  font-size: 0.875rem;
}

/* Action hero */
.action-hero-section {
  margin-bottom: 32px;
}

.hero-media {
  border-radius: 8px;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.hero-media figcaption {
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: #6c7a80;
  background-color: #ffffff;
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.error-main {
  max-width: 720px;
  text-align: center;
  padding-top: 64px;
  padding-bottom: 64px;
}

.error-code {
  font-size: 4rem;
  font-weight: 700;
  color: #17a2b8;
  margin-bottom: 8px;
}

.error-main h1 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.error-desc {
  font-size: 1rem;
  color: #6c7a80;
  line-height: 1.6;
  margin-bottom: 8px;
}

.error-btn {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 24px;
  background-color: #17a2b8;
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.9375rem;
}

.error-btn:hover {
  background-color: #138496;
  color: #ffffff;
}

.error-suggest {
  margin-top: 48px;
  text-align: left;
}

.error-suggest h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.error-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.error-links a {
  font-size: 0.9375rem;
  color: #17a2b8;
  padding: 8px 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .layout-shell,
  .page-layout {
    grid-template-columns: 1fr 280px;
    gap: 24px;
  }

  .update-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .popular-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-inner {
    height: 56px;
    padding: 0 16px;
  }

  .brand-slogan {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-list {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background-color: #ffffff;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    border-bottom: 1px solid #e2f0f1;
    box-shadow: 0 4px 12px rgba(43, 58, 63, 0.08);
    display: none;
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-link {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .hero-section {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 0 24px;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-figure img {
    height: 220px;
  }

  .update-list {
    grid-template-columns: 1fr;
  }

  .popular-list {
    grid-template-columns: 1fr;
  }

  .guide-cards,
  .topic-cards {
    grid-template-columns: 1fr;
  }

  .layout-shell,
  .page-layout {
    grid-template-columns: 1fr;
    padding: 24px 16px 40px;
  }

  .inner-main {
    padding: 0;
  }

  .genre-grid,
  .works-grid {
    grid-template-columns: 1fr;
  }

  .step-list {
    grid-template-columns: 1fr;
  }

  .comic-card {
    flex-direction: column;
  }

  .comic-cover-wrap,
  .comic-cover {
    width: 100%;
    height: 200px;
  }

  .comic-card-media,
  .comic-card-media img {
    width: 100%;
    height: 200px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 16px 24px;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-list,
  .error-links {
    grid-template-columns: 1fr;
  }

  .error-main {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .error-code {
    font-size: 3rem;
  }
}

@media (max-width: 390px) {
  .header-inner {
    padding: 0 12px;
  }

  .brand-name {
    font-size: 1.0625rem;
  }

  .site-main {
    padding: 24px 12px 40px;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .btn-secondary {
    text-align: center;
  }

  .genre-figure img,
  .work-image {
    height: 180px;
  }
}

/* ==========================================================================
   Accessibility / Misc
   ========================================================================== */

:focus-visible {
  outline: 2px solid #17a2b8;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
