:root {
  --primary-color: #1a2a36;
  --secondary-color: #992d22;
  --accent-gold: #c5a059;
  --accent-gold-hover: #b38b45;
  --bg-page: #f9f8f4;
  --bg-card: #ffffff;
  --text-main: #24292f;
  --text-muted: #57606a;
  --text-light: #8c959f;
  --border-light: #e5e0d8;
  --border-card: #ece6dc;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --reader-font-size: 19px;
  --reader-line-height: 2.0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Nav */
.header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 50px;
  height: 40px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1a2a36, #2d4558);
  color: #e5c07b;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 1px;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid var(--accent-gold);
}

.brand-text h1 {
  font-size: 1.25rem;
  color: var(--primary-color);
  font-weight: 700;
  font-family: var(--font-serif);
  letter-spacing: 0.5px;
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--secondary-color);
  background: rgba(153, 45, 34, 0.05);
}

.btn-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.4rem 0.9rem;
  background-color: #f1f5f9;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted) !important;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.btn-admin-link:hover {
  background-color: #e2e8f0;
  color: var(--primary-color) !important;
}

/* Banner */
.hero-banner {
  background: linear-gradient(135deg, #17242e 0%, #203444 60%, #152028 100%);
  color: #ffffff;
  padding: 3.5rem 1.5rem;
  text-align: center;
  border-bottom: 4px solid var(--accent-gold);
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, rgba(197, 160, 89, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(197, 160, 89, 0.2);
  border: 1px solid var(--accent-gold);
  color: #f1d596;
  border-radius: 20px;
  font-size: 0.85rem;
  letter-spacing: 2px;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 1.5px;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.hero-notice {
  font-size: 0.9rem;
  color: #94a3b8;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.2rem;
  max-width: 680px;
  margin: 0 auto;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  flex: 1;
}

/* Section Header */
.section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 22px;
  background: var(--secondary-color);
  border-radius: 2px;
}

/* Book Grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

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

.book-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 10px;
  background: #fdf3e7;
  color: #a05e03;
  border: 1px solid #fed7aa;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
}

.book-card-main {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.book-card-cover {
  width: 110px;
  height: 154px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.08);
}

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

.book-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.3rem;
  text-decoration: none;
  line-height: 1.4;
}

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

.book-card-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.book-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.55;
}

.book-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-read {
  background: linear-gradient(135deg, var(--secondary-color), #b83a2e);
  color: #ffffff !important;
  text-decoration: none;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(153, 45, 34, 0.25);
  transition: all 0.2s ease;
}

.btn-read:hover {
  background: linear-gradient(135deg, #b83a2e, var(--secondary-color));
  box-shadow: 0 4px 8px rgba(153, 45, 34, 0.35);
  transform: translateY(-1px);
}

.btn-catalog {
  background: #f1f5f9;
  color: var(--text-main) !important;
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.btn-catalog:hover {
  background: #e2e8f0;
}

/* Feature quotes */
.quote-box {
  background: #ffffff;
  border-left: 4px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.quote-box p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: #334155;
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

.quote-box .quote-source {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-light);
  font-family: var(--font-sans);
}

/* Footer */
.footer {
  background: #1a242c;
  color: #94a3b8;
  padding: 2.5rem 1.5rem 2rem;
  margin-top: auto;
  border-top: 1px solid #2d3b48;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-motto {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #e2e8f0;
  margin-bottom: 0.8rem;
  letter-spacing: 2px;
}

.footer-text {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.85rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
}

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

/* Mobile nav toggle (hamburger) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--primary-color);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.7rem;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    padding: 0.5rem 1rem 1rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links li {
    margin: 0;
  }
  .nav-links a {
    display: block;
    padding: 0.85rem 0.6rem;
    font-size: 1rem;
    border-bottom: 1px dashed var(--border-light);
  }
  .nav-links li:last-child a {
    border-bottom: none;
  }
  .header {
    position: -webkit-sticky;
    position: sticky;
  }
  .header-container {
    padding: 0.75rem 1rem;
  }
  .book-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .hero-banner {
    padding: 2.25rem 1.25rem;
  }
  .hero-content .hero-notice {
    font-size: 0.85rem;
  }
  .container {
    padding: 1.75rem 1rem;
  }
  .book-card {
    padding: 1.15rem;
  }
  .book-card-main {
    gap: 0.9rem;
  }
  .book-card-cover {
    width: 88px;
    height: 123px;
  }
  .book-card-title {
    font-size: 1.1rem;
  }
  .book-card-desc {
    font-size: 0.83rem;
  }
  .book-card-footer {
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .book-card-footer > div {
    width: 100%;
    justify-content: flex-end;
  }
  .btn-read, .btn-catalog {
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
  }
  .quote-box {
    padding: 1.15rem;
    margin: 1.5rem 0;
  }
  .quote-box p {
    font-size: 0.95rem;
  }
  .footer {
    padding: 1.75rem 1rem 1.5rem;
  }
  .footer-motto {
    font-size: 1rem;
    letter-spacing: 1px;
  }
  .footer-links {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .section-title {
    font-size: 1.25rem;
  }
}
