
:root { color-scheme: light; }
* { box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6; color: #1f2328; background: #f6f8fa; margin: 0; }
a { color: #0969da; text-decoration: none; }
a:hover { text-decoration: underline; }
header.site { background: #fff; border-bottom: 1px solid #d0d7de; padding: 1rem 1.25rem;
  position: sticky; top: 0; z-index: 10; }
header.site .inner { max-width: 1200px; margin: 0 auto; display: flex; gap: 1rem;
  align-items: center; justify-content: space-between; }
header.site h1 { font-size: 1.25rem; margin: 0; }
header.site input { padding: .45rem .8rem; border: 1px solid #d0d7de; border-radius: 6px; width: 260px; }
.container { max-width: 1200px; margin: 0 auto; padding: 1.25rem; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.25rem; }
.book-card { background: #fff; border: 1px solid #d0d7de; border-radius: 8px; overflow: hidden;
  display: flex; flex-direction: column; cursor: pointer; transition: box-shadow .15s; }
.book-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.book-card .cover { aspect-ratio: 3/4; background: #f0f2f5; display: flex; align-items: center;
  justify-content: center; text-align: center; padding: 1rem; color: #656d76; font-size: .9rem; }
.book-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card .info { padding: .75rem; }
.book-card .title { font-weight: 600; font-size: .95rem; line-height: 1.35; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-card .meta { font-size: .8rem; color: #656d76; margin-top: .25rem; }
.empty { text-align: center; color: #656d76; padding: 3rem 1rem; }

.detail { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; }
.detail .cover { width: 220px; aspect-ratio: 3/4; background: #f0f2f5; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: #656d76; overflow: hidden; }
.detail .cover img { width: 100%; height: 100%; object-fit: cover; }
.detail h2 { margin-top: 0; }
.detail .meta { color: #656d76; margin: .5rem 0; }
.detail .actions { margin: 1rem 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.detail .actions a { display: inline-block; padding: .5rem .9rem; background: #0969da; color: #fff;
  border-radius: 6px; }
.detail .actions a.secondary { background: #fff; color: #0969da; border: 1px solid #d0d7de; }
.detail .toc { margin-top: 1.5rem; }
.detail .toc ul { list-style: none; padding-left: 0; }
.detail .toc li { padding: .35rem 0; border-bottom: 1px solid #eef1f4; }

.reader { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.reader aside { background: #fff; border-right: 1px solid #d0d7de; padding: 1rem; overflow-y: auto;
  position: fixed; top: 56px; bottom: 0; width: 260px; }
.reader aside ul { list-style: none; padding-left: 0; }
.reader aside li { padding: .25rem 0; }
.reader aside a { font-size: .9rem; }
.reader main { margin-left: 260px; }
.reader .toolbar { position: sticky; top: 0; background: #fff; border-bottom: 1px solid #d0d7de;
  padding: .75rem 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.reader .content { max-width: 860px; margin: 0 auto; padding: 2rem 1.5rem; background: #fff; min-height: 100vh; }
.reader .content.loading { color: #656d76; }
#menu-btn { display: none; }
@media (max-width: 768px) {
  .reader { display: block; }
  .reader aside { position: fixed; left: -260px; transition: left .2s; z-index: 20; top: 0; }
  .reader aside.open { left: 0; }
  .reader main { margin-left: 0; margin-top: 48px; }
  #menu-btn { display: inline-block; }
}
