* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; background: #f5f5f5; color: #333; line-height: 1.6; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.header { background: #2c3e50; color: #fff; padding: 15px 0; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.logo { font-size: 1.5em; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: -0.5px; }
.logo:hover { opacity: 0.9; }
.nav { display: flex; gap: 20px; }
.nav-link { color: #bdc3c7; text-decoration: none; font-size: 0.95em; padding: 3px 0; }
.nav-link:hover, .nav-link.active { color: #fff; border-bottom: 2px solid #3498db; }
.search-box { display: flex; gap: 5px; margin-left: auto; }
.search-box input { padding: 8px 12px; border: none; border-radius: 4px; width: 220px; font-size: 0.9em; }
.search-box button { padding: 8px 16px; background: #3498db; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.search-box button:hover { background: #2980b9; }

.hero { text-align: center; padding: 50px 20px 30px; }
.hero h1 { font-size: 2.5em; color: #2c3e50; margin-bottom: 10px; }
.hero p { color: #666; max-width: 700px; margin: 10px auto; font-size: 1.1em; }

.section { margin-bottom: 40px; }
.section h2 { font-size: 1.4em; color: #2c3e50; margin-bottom: 20px; padding-bottom: 8px; border-bottom: 2px solid #3498db; }

.book-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.book-card { width: 160px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.book-card-cover { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #ecf0f1; display: block; }
.book-card-info { padding: 12px; }
.book-card-title { font-size: 0.9em; font-weight: 600; color: #2c3e50; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-card-author { font-size: 0.8em; color: #7f8c8d; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card-source { font-size: 0.7em; color: #95a5a6; margin-top: 4px; }

.book-list { display: flex; flex-direction: column; gap: 10px; }
.book-list-item { background: #fff; border-radius: 6px; padding: 14px 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); cursor: pointer; transition: background 0.15s; }
.book-list-item:hover { background: #f8f9fa; }
.book-list-item h3 { font-size: 1em; color: #2c3e50; margin-bottom: 2px; }
.book-list-item .author { font-size: 0.85em; color: #7f8c8d; margin-bottom: 4px; }
.book-list-item .meta { font-size: 0.75em; color: #95a5a6; }
.book-list-item .desc { font-size: 0.85em; color: #666; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.release-list { display: flex; flex-direction: column; gap: 10px; }
.release-item { background: #fff; border-radius: 6px; padding: 16px 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); cursor: pointer; transition: background 0.15s; }
.release-item:hover { background: #f8f9fa; }
.release-item h3 { font-size: 1em; color: #2c3e50; margin-bottom: 4px; }
.release-item .source-tag { display: inline-block; background: #3498db10; color: #3498db; font-size: 0.75em; padding: 2px 8px; border-radius: 10px; margin-bottom: 4px; }
.release-item .meta { font-size: 0.8em; color: #95a5a6; margin-bottom: 4px; }
.release-item .desc { font-size: 0.85em; color: #666; }

.filters { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filters select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; background: #fff; font-size: 0.9em; }

.pagination { display: flex; justify-content: center; gap: 8px; margin: 30px 0; flex-wrap: wrap; }
.pagination button { padding: 8px 16px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; }
.pagination button:hover { background: #f0f0f0; }
.pagination button.active { background: #3498db; color: #fff; border-color: #3498db; }

.subject-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.subject-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer; transition: transform 0.15s; }
.subject-card:hover { transform: translateY(-2px); }
.subject-card h3 { color: #2c3e50; font-size: 1.1em; margin-bottom: 6px; }
.subject-card .count { color: #95a5a6; font-size: 0.85em; }

.back-link { display: inline-block; margin: 20px 0; color: #3498db; text-decoration: none; font-size: 0.95em; }
.back-link:hover { text-decoration: underline; }

#bookDetail { background: #fff; border-radius: 8px; padding: 30px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; gap: 30px; flex-wrap: wrap; }
#bookDetail .cover { flex: 0 0 200px; }
#bookDetail .cover img { width: 100%; border-radius: 4px; }
#bookDetail .info { flex: 1; min-width: 250px; }
#bookDetail .info h1 { font-size: 1.8em; color: #2c3e50; margin-bottom: 8px; }
#bookDetail .info .author { font-size: 1.1em; color: #7f8c8d; margin-bottom: 5px; }
#bookDetail .info .source { font-size: 0.85em; color: #95a5a6; margin-bottom: 15px; }
#bookDetail .info .desc { font-size: 0.95em; color: #555; line-height: 1.7; margin-bottom: 20px; }
#bookDetail .info .subjects { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
#bookDetail .info .subjects span { background: #3498db10; color: #3498db; font-size: 0.8em; padding: 4px 10px; border-radius: 12px; }
#bookDetail .info .downloads { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 25px; }
#bookDetail .info .download-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; color: #fff; border: none; border-radius: 8px; font-size: 1em; font-weight: 600; min-width: 140px; justify-content: center; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; font-family: inherit; }
#bookDetail .info .download-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
#bookDetail .info .download-btn .format-label { font-size: 0.75em; opacity: 0.8; font-weight: 400; }
#bookDetail .info .download-btn.epub { background: linear-gradient(135deg, #3498db, #2980b9); }
#bookDetail .info .download-btn.epub:hover { background: linear-gradient(135deg, #2980b9, #1a6da5); }
#bookDetail .info .download-btn.mobi { background: linear-gradient(135deg, #e67e22, #d35400); }
#bookDetail .info .download-btn.mobi:hover { background: linear-gradient(135deg, #d35400, #b84400); }
#bookDetail .info .download-btn.kobo { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
#bookDetail .info .download-btn.kobo:hover { background: linear-gradient(135deg, #8e44ad, #7d3c98); }
#bookDetail .info .download-btn.pdf { background: linear-gradient(135deg, #e74c3c, #c0392b); }
#bookDetail .info .download-btn.pdf:hover { background: linear-gradient(135deg, #c0392b, #a93226); }
#bookDetail .info .download-btn.html { background: linear-gradient(135deg, #27ae60, #1e8449); }
#bookDetail .info .download-btn.html:hover { background: linear-gradient(135deg, #1e8449, #186a3b); }
#bookDetail .info .download-btn.text { background: linear-gradient(135deg, #7f8c8d, #636e72); }
#bookDetail .info .download-btn.text:hover { background: linear-gradient(135deg, #636e72, #535b5e); }

.footer { background: #2c3e50; color: #bdc3c7; text-align: center; padding: 25px 0; margin-top: 50px; font-size: 0.9em; }

@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 15px; }
  .search-box { margin-left: 0; width: 100%; }
  .search-box input { width: 100%; }
  .book-grid { gap: 15px; }
  .book-card { width: 130px; }
  .hero h1 { font-size: 1.8em; }
  #bookDetail { flex-direction: column; }
  #bookDetail .cover { flex: 0 0 auto; max-width: 150px; }
}
