:root { --accent: #0b5cad; --muted: #666; }
body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.5; color: #222; background: #fafafa; }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }
a { color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.card-title { font-weight: 600; }
.card-author { color: var(--muted); font-size: .9em; }
.cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; background: #ddd; }
.cover-empty { display: flex; align-items: center; justify-content: center; font-size: 3em; color: #fff; background: #556; }
.sort a, .sort strong { margin: 0 .4em; }
.book { display: grid; grid-template-columns: minmax(120px, 240px) 1fr; gap: 24px; }
.button { display: inline-block; padding: 10px 24px; background: var(--accent); color: #fff; border-radius: 4px; text-decoration: none; }
@media (max-width: 600px) { .book { grid-template-columns: 1fr; } }

.reader-page main { max-width: 760px; padding-top: 0; }
.reader-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #ddd; font-size: .9em; }
.reader-title { flex: 1; text-align: center; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#reader-content { padding: 16px 0; font-family: Georgia, serif; font-size: 1.15em; line-height: 1.7; outline: none; }
#reader-content img { max-width: 100%; height: auto; }
#reader-content table { border-collapse: collapse; max-width: 100%; }
#reader-content td, #reader-content th { border: 1px solid #ccc; padding: 4px 8px; }
.reader-nav { display: flex; justify-content: space-between; padding: 16px 0 32px; }
.reader-nav button { padding: 10px 24px; font-size: 1em; border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 4px; cursor: pointer; }
.reader-nav button:disabled { opacity: .4; cursor: default; }

.badge { display: inline-block; padding: 6px 16px; border: 1px solid var(--accent); border-radius: 999px; background: #fff; color: var(--accent); font-size: .9em; text-decoration: none; }
.badge:hover { background: var(--accent); color: #fff; }

.home { max-width: 760px; margin: 0 auto; }
.home h1 { font-size: 2em; margin: 1.2em 0 .4em; }
.home h2 { margin: 1.8em 0 .5em; }
.home .lead { font-size: 1.2em; }
.home-hero { padding: 24px 0; border-bottom: 1px solid #ddd; }
.steps, .uses, .features { padding-left: 1.2em; }
.steps li, .uses li, .features li { margin: .5em 0; }
.home-footer { margin-top: 3em; padding-top: 16px; border-top: 1px solid #ddd; color: var(--muted); font-size: .9em; }
#reader-toc { padding: 8px 0; border-bottom: 1px solid #ddd; max-height: 60vh; overflow-y: auto; }
#reader-toc ul { list-style: none; margin: 0; padding: 0; }
#reader-toc li { padding: 6px 0; }
#reader-toc .toc-l1 { padding-left: 20px; }
#reader-toc .toc-l2 { padding-left: 40px; }
#reader-toc .toc-l3 { padding-left: 60px; }
