:root {
  color-scheme: light;
  --ink: #2e2730;
  --muted: #746d75;
  --paper: #faf8f5;
  --white: #fff;
  --line: #e8e1df;
  --berry: #883951;
  --berry-dark: #66263c;
  --gold: #c99c5e;
  --shadow: 0 16px 45px rgba(48, 30, 41, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--berry); }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.wrap { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.kicker, .eyebrow { color: var(--berry); font-size: .74rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }

.site-header { background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 800; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; color: #fff; background: var(--berry); font-family: Georgia, serif; font-size: 27px; line-height: 1; }
.brand-name { font-size: 1.2rem; letter-spacing: -.03em; }
.brand-name span { color: var(--berry); }
.main-nav { display: flex; gap: 30px; font-size: .95rem; font-weight: 650; }
.main-nav a:hover { color: var(--berry); }

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; line-height: 1.18; }
h1 { font-size: clamp(2.25rem, 4.7vw, 4.35rem); margin: 12px 0 18px; }
h2 { font-size: clamp(1.75rem, 3vw, 2.35rem); margin: 4px 0 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr); min-height: 425px; margin: 36px 0 52px; overflow: hidden; border-radius: 22px; background: #f1e7e5; box-shadow: var(--shadow); }
.hero-copy { align-self: center; padding: clamp(30px, 5vw, 70px); }
.hero-copy h1 { max-width: 730px; }
.hero-copy p { max-width: 580px; color: #665660; font-size: 1.05rem; margin-bottom: 30px; }
.hero-art { display: grid; place-items: center; overflow: hidden; color: #ebc9c9; background: radial-gradient(circle at 45% 46%, #9d5366 0, #7a324d 51%, #4c2339 100%); }
.hero-art span { font-family: Georgia, serif; font-size: clamp(13rem, 25vw, 25rem); line-height: 1; transform: rotate(-10deg); text-shadow: 18px 20px 0 rgba(30,10,23,.12); }
.search-form { display: flex; gap: 8px; width: min(650px, 100%); padding: 6px; border: 1px solid #e9d7d5; border-radius: 12px; background: #fff; box-shadow: 0 8px 26px rgba(82, 44, 55, .06); }
.search-form input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 11px 13px; color: var(--ink); background: transparent; }
.search-form button, .primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 15px; border: 0; border-radius: 8px; padding: 12px 20px; color: #fff; background: var(--berry); font-size: .9rem; font-weight: 700; white-space: nowrap; transition: background .18s, transform .18s; }
.search-form button:hover, .primary-button:hover { color: #fff; background: var(--berry-dark); transform: translateY(-1px); }
.section { margin: 0 0 56px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.text-link { color: var(--berry); font-size: .92rem; font-weight: 700; white-space: nowrap; }
.text-link:hover { color: var(--berry-dark); }
.tag-list, .card-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.tag { display: inline-flex; align-items: center; min-height: 36px; border: 1px solid #eadcdb; border-radius: 100px; padding: 5px 15px; background: #fff; color: #6f394d; font-size: .87rem; font-weight: 600; line-height: 1.25; transition: background .18s, border-color .18s; }
.tag:hover { color: var(--berry-dark); border-color: #bd909d; background: #fff2f3; }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.book-card { display: flex; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 10px 30px rgba(44,29,39,.045); transition: transform .2s, box-shadow .2s; }
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cover { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-width: 118px; width: 38%; min-height: 285px; padding: 20px 14px; color: #fff; background: linear-gradient(145deg, #b86b75, #663547); }
.cover:hover { color: #fff; }
.cover-0 { background: linear-gradient(145deg, #8c4f69, #35253e); }
.cover-1 { background: linear-gradient(145deg, #497b78, #203e4c); }
.cover-2 { background: linear-gradient(145deg, #bd8260, #69443e); }
.cover-3 { background: linear-gradient(145deg, #6b6fa2, #333857); }
.cover-4 { background: linear-gradient(145deg, #a45c67, #552942); }
.cover-5 { background: linear-gradient(145deg, #8a7b60, #454136); }
.cover-6 { background: linear-gradient(145deg, #617c8d, #304b60); }
.cover-7 { background: linear-gradient(145deg, #985f84, #422950); }
.cover-ornament { opacity: .8; font-size: 1.3rem; }
.cover-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; font-family: Georgia, serif; font-size: clamp(1.1rem, 1.45vw, 1.5rem); font-weight: 700; line-height: 1.17; overflow-wrap: anywhere; }
.cover-author { color: rgba(255,255,255,.8); font-size: .7rem; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.card-body { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 21px 18px 17px; }
.card-body h2 { margin: 8px 0 11px; font-size: 1.35rem; overflow-wrap: anywhere; }
.card-body p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; margin: 0 0 17px; color: #655e66; font-size: .9rem; line-height: 1.5; }
.card-tags { gap: 5px; margin-top: auto; }
.card-tags .tag { min-height: 26px; padding: 3px 9px; font-size: .71rem; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 20px; padding-top: 12px; border-top: 1px solid #f0ebeb; font-size: .76rem; }
.card-bottom .text-link { font-size: .8rem; }
.pagination, .reader-nav { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 31px 0; color: var(--muted); font-size: .9rem; }
.pagination a, .reader-nav a { color: var(--berry); font-weight: 700; }
.disabled { opacity: .45; }
.page-heading { padding: 48px 0 27px; }
.page-heading h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); }
.page-heading p { color: var(--muted); }
.page-heading .search-form { margin-top: 28px; }
.result-count { color: var(--muted); margin: 0 0 20px; }
.empty-state { padding: 34px; border: 1px dashed #d8c6cc; border-radius: 12px; background: #fff; color: var(--muted); }
.tag-directory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin: 0 0 65px; }
.tag-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.tag-row span:first-child { font-weight: 650; }
.tag-row span:last-child { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.back-link { display: block; width: fit-content; margin-bottom: 21px; color: var(--berry); font-size: .9rem; font-weight: 700; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; overflow: hidden; margin: 30px 0; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.breadcrumbs span:last-child { overflow: hidden; text-overflow: ellipsis; }
.breadcrumbs a:hover { color: var(--berry); }
.book-detail { margin-bottom: 70px; }
.detail-intro { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(30px, 5vw, 74px); padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.detail-cover { width: 100%; min-height: 360px; border-radius: 8px; padding: 26px; box-shadow: 12px 14px 24px rgba(34,20,33,.16); }
.detail-cover .cover-title { font-size: 2.1rem; }
.detail-main { align-self: center; padding: 12px 20px 12px 0; }
.detail-main h1 { font-size: clamp(2.15rem, 4vw, 3.45rem); }
.detail-author { margin: 0 0 26px; color: var(--muted); }
.annotation { max-width: 730px; margin: 0 0 28px; font-size: 1.1rem; line-height: 1.75; }
.detail-meta { display: flex; gap: 20px; margin-top: 22px; color: var(--muted); font-size: .84rem; }
.detail-section { padding: 45px 0 0; }
.comments { display: grid; gap: 13px; max-width: 860px; }
.comment { padding: 20px 24px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.comment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.comment-head strong { font-size: .95rem; }
.comment time { color: var(--muted); font-size: .79rem; white-space: nowrap; }
.comment p { margin: 10px 0 0; color: #4e4850; }
.reader-shell { width: min(850px, 100%); margin: auto; padding-bottom: 80px; }
.reader-heading { text-align: center; margin: 43px 0 37px; }
.reader-heading h1 { font-size: clamp(2rem, 4vw, 3.3rem); }
.reader-heading p { color: var(--muted); }
.reader-text { padding: clamp(23px, 4vw, 53px); border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.08rem, 1.6vw, 1.3rem); line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.site-footer { margin-top: 55px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .84rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding-block: 26px; }
.footer-inner a { color: var(--berry); }

@media (max-width: 1050px) {
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tag-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .wrap { width: min(100% - 28px, 1200px); }
  .header-inner { min-height: 64px; }
  .brand-mark { width: 36px; height: 36px; font-size: 23px; }
  .brand-name { font-size: 1.05rem; }
  .main-nav { gap: 15px; font-size: .84rem; }
  .hero { display: block; margin: 18px 0 40px; min-height: 0; }
  .hero-copy { padding: 30px 24px; }
  .hero-art { display: none; }
  .hero-copy h1 { font-size: 2.35rem; }
  .search-form { flex-direction: column; }
  .search-form input { min-height: 44px; }
  .book-grid, .tag-directory { grid-template-columns: 1fr; }
  .book-card { min-height: 240px; }
  .cover { min-height: 240px; }
  .section { margin-bottom: 42px; }
  .section-heading { align-items: center; }
  .detail-intro { grid-template-columns: 1fr; gap: 28px; padding: 22px; }
  .detail-cover { width: min(260px, 100%); min-height: 330px; margin: auto; }
  .detail-main { padding: 0; }
  .detail-main h1 { font-size: 2.45rem; }
  .annotation { font-size: 1rem; }
  .comment { padding: 17px; }
  .comment-head { flex-wrap: wrap; gap: 1px 10px; }
  .reader-heading { margin: 30px 0 22px; }
  .reader-text { line-height: 1.78; }
}
