:root {
  --bg: #fafaf8;
  --bg-card: #ffffff;
  --bg-hero: #1a1a2e;
  --text: #1a1a2e;
  --text-secondary: #5a5a6e;
  --text-muted: #8e8e9e;
  --accent: #c0392b;
  --accent-light: #e74c3c;
  --accent-bg: #fdf0ef;
  --gold: #d4a843;
  --gold-bg: #faf6eb;
  --border: #e8e8ec;
  --border-hover: #d0d0d8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --font: 'Inter', -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --max-w: 1200px;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 0;
}

.header .container {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.5px;
}

.logo-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
}

.logo-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-link:hover { background: #f0f0f4; color: var(--text); }
.nav-link.active { background: var(--accent-bg); color: var(--accent); }

.search-box {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f4f4f6;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 14px;
  height: 40px;
  transition: all 0.2s;
  color: var(--text-muted);
  min-width: 240px;
}

.search-box:focus-within {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  width: 100%;
}

.search-box input::placeholder { color: var(--text-muted); }

.hero {
  background: var(--bg-hero);
  color: #fff;
  padding: 80px 0 72px;
  text-align: center;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(192,57,43,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(212,168,67,0.1) 0%, transparent 50%);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 17px;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.hero-stat {
  text-align: center;
}

.hero-stat-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
}

.hero-stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text);
}

.categories {
  padding: 64px 0;
}

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

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.cat-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.cat-card-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
}

.cat-card-count {
  font-size: 13px;
  color: var(--text-muted);
}

.books-section {
  padding: 0 0 80px;
}

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

.filter-bar {
  display: flex;
  gap: 12px;
}

.filter-bar select {
  font-family: var(--font);
  font-size: 14px;
  padding: 8px 32px 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e9e' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

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

.book-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f0f0f4;
  overflow: hidden;
}

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

.book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8ddd3 0%, #d4c5b5 100%);
  padding: 20px;
  text-align: center;
}

.book-cover-placeholder .placeholder-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.4;
}

.book-cover-placeholder .placeholder-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(0,0,0,0.4);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.book-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.book-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

.book-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
}

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

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

.btn-outline {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--border-hover);
  background: #f8f8fa;
}

.load-more {
  text-align: center;
  margin-top: 32px;
}

.footer {
  background: var(--bg-hero);
  color: rgba(255,255,255,0.6);
  padding: 40px 0;
  text-align: center;
  font-size: 14px;
}

.footer-sub {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

@media (max-width: 768px) {
  .header .container { gap: 12px; }
  .logo-sub { display: none; }
  .nav { display: none; }
  .search-box { min-width: 0; flex: 1; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 28px; }
  .hero-desc { font-size: 15px; }
  .hero-stats { gap: 24px; }
  .hero-stat-num { font-size: 24px; }
  .section-title { font-size: 22px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .filter-bar { flex-wrap: wrap; }
}
