/* ==========================================================================
   书香阁 (Shuxiang Pavilion) - High-Performance SEO Novel Portal Stylesheet
   Pure CSS3, zero dependencies, responsive, dark/light theme, accessible
   ========================================================================== */

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-accent: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --primary: #b91c1c; /* Traditional Chinese crimson / vermilion */
  --primary-hover: #991b1b;
  --primary-light: #fef2f2;
  --primary-border: #fecaca;
  --secondary: #0f766e;
  --secondary-light: #f0fdfa;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --container-max: 1200px;
  --font-serif: "Songti SC", "SimSun", "STSong", "Noto Serif SC", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}

[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-accent: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --primary: #ef4444;
  --primary-hover: #dc2626;
  --primary-light: #2c1214;
  --primary-border: #7f1d1d;
  --secondary: #14b8a6;
  --secondary-light: #042f2e;
  --border: #1e293b;
  --border-light: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--primary);
}

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

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Navigation */
.site-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.top-bar {
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.375rem 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-main {
  padding: 0.875rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-symbol {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #7f1d1d 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(185, 28, 28, 0.3);
}

.logo-text h1, .logo-text .site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.logo-text .site-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.header-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  position: relative;
}

.search-form {
  display: flex;
  width: 100%;
}

.search-input {
  flex: 1;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background-color: var(--bg-tertiary);
  color: var(--text-main);
  font-size: 0.9375rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  background-color: var(--bg-secondary);
}

.search-btn {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: background-color 0.15s ease;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

/* Navigation Bar */
.site-nav {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.25rem 0;
}

.nav-link {
  display: inline-block;
  padding: 0.625rem 0.875rem;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 0.875rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  gap: 0.5rem;
}

.breadcrumb-item::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--text-light);
}

.breadcrumb-item:last-child::after {
  display: none;
}

.breadcrumb-item.current {
  color: var(--text-main);
  font-weight: 500;
}

/* Main Content Layout */
.main-wrapper {
  flex: 1;
  padding: 2rem 0 3rem;
}

/* SEO Intro & Heading Cards */
.hero-seo-card {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.hero-seo-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.hero-seo-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 960px;
}

.seo-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.seo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 9999px;
}

/* Section Common Styling */
.content-section {
  margin-bottom: 2.75rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  position: relative;
}

.section-header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: var(--primary);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-more-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.section-more-link:hover {
  color: var(--primary);
}

/* Book Grid & Cards */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.book-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.book-cover {
  width: 90px;
  height: 125px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.625rem 0.5rem;
  color: #ffffff;
  position: relative;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.2), inset 4px 0 6px -2px rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.book-cover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 1px 0 2px rgba(255, 255, 255, 0.2);
}

.book-cover-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  word-break: break-all;
}

.book-cover-author {
  font-size: 0.65rem;
  opacity: 0.9;
  text-align: right;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.book-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.book-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-title a {
  color: var(--text-main);
}

.book-card-title a:hover {
  color: var(--primary);
}

.book-card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-author {
  color: var(--text-main);
  font-weight: 500;
}

.status-badge {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.status-badge.complete {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

.status-badge.ongoing {
  background-color: var(--primary-light);
  color: var(--primary);
}

.book-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: auto;
}

.book-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.mini-tag {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.category-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.category-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cat-icon-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cat-icon {
  font-size: 1.5rem;
}

.cat-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.cat-badge {
  font-size: 0.6875rem;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
}

.cat-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}

.cat-kw-item {
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-tertiary);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
}

/* Rankings Widget Grid */
.rankings-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.rank-board {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.rank-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.rank-board-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rank-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
}

.rank-num {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-num {
  background-color: #ef4444;
  color: #ffffff;
}

.rank-item:nth-child(2) .rank-num {
  background-color: #f97316;
  color: #ffffff;
}

.rank-item:nth-child(3) .rank-num {
  background-color: #eab308;
  color: #ffffff;
}

.rank-book-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.rank-book-cat {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Tag Cloud Section */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.tag-cloud-item {
  padding: 0.45rem 0.875rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-main);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tag-cloud-item:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
  transform: translateY(-1px);
}

/* Book Detail Page Styles */
.book-detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.book-detail-cover-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
}

.book-detail-cover {
  width: 170px;
  height: 235px;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  color: #ffffff;
  position: relative;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25), inset 6px 0 8px -2px rgba(255, 255, 255, 0.2);
}

.book-detail-cover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 8px;
  background: rgba(0, 0, 0, 0.35);
}

.book-detail-cover .title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.book-detail-cover .author {
  font-size: 0.85rem;
  text-align: right;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.book-quick-facts {
  width: 100%;
  margin-top: 1rem;
  text-align: left;
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.fact-row {
  display: flex;
  justify-content: space-between;
}

.fact-label {
  color: var(--text-muted);
}

.fact-val {
  font-weight: 500;
  color: var(--text-main);
}

.book-detail-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.book-main-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.book-sub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.detail-section {
  margin-bottom: 2rem;
}

.detail-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.feature-item::before {
  content: "✔";
  color: var(--secondary);
  font-weight: 700;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.character-card {
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1rem;
  border-left: 3px solid var(--primary);
}

.character-name-role {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.char-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.char-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.char-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.legal-box {
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.legal-box-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-box p {
  font-size: 0.875rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* Ranking Table Styles */
.rank-table-wrap {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.rank-table th {
  background-color: var(--bg-tertiary);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.rank-table td {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
  vertical-align: middle;
}

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

.rank-table tr:hover td {
  background-color: var(--bg-tertiary);
}

.table-rank-num {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.table-rank-num.top-1 { color: #ef4444; }
.table-rank-num.top-2 { color: #f97316; }
.table-rank-num.top-3 { color: #eab308; }

/* Search Tool Form & Interactive Area */
.search-filter-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

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

.filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 60px;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-chip {
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  background-color: var(--bg-tertiary);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.filter-chip:hover, .filter-chip.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
  font-weight: 500;
}

/* Site Footer */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col-brand h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.footer-col-brand p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-col h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 40;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 992px) {
  .book-detail-layout {
    grid-template-columns: 1fr;
  }

  .book-detail-cover-box {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .header-main {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .header-search {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-seo-card h1 {
    font-size: 1.4rem;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }
}
