:root {
  --ink: #18211d;
  --muted: #6b746e;
  --paper: #f5f3ed;
  --cream: #eeeadf;
  --line: #dcd8cb;
  --moss: #32523f;
  --lime: #d6ed90;
  --orange: #e4743d;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-header, main > section, footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header { height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: Georgia, "Noto Serif SC", serif; font-size: 20px; font-weight: 700; letter-spacing: -.04em; }
.brand-mark { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px 8px 8px 2px; background: var(--moss); color: var(--lime); font-size: 17px; }
nav { display: flex; gap: 28px; color: var(--muted); font-size: 14px; }
nav a { position: relative; padding: 8px 0; }
nav a.active { color: var(--ink); font-weight: 700; }
nav a.active::after { position: absolute; right: 0; bottom: 1px; left: 0; height: 2px; background: var(--orange); content: ""; }
.account-button, .view-all, .text-button { border: 0; background: transparent; cursor: pointer; }
.account-button { border: 1px solid var(--ink); border-radius: 999px; padding: 10px 16px; font-size: 13px; font-weight: 650; }

.hero { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 524px; overflow: hidden; border-radius: 4px; background: #ddebd0; }
.hero-copy { padding: clamp(42px, 6vw, 82px); }
.eyebrow { margin: 0 0 16px; color: var(--moss); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, "Noto Serif SC", serif; }
h1 { margin-bottom: 22px; font-size: clamp(45px, 5.5vw, 75px); line-height: .98; letter-spacing: -.075em; }
h1 em { color: var(--moss); font-weight: 400; }
.hero-description { max-width: 430px; color: #536057; font-size: 16px; line-height: 1.85; }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 30px; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 24px; border: 1px solid var(--moss); border-radius: 999px; padding: 13px 19px; background: var(--moss); color: white; cursor: pointer; font-size: 14px; font-weight: 700; }
.primary-button:hover { background: #223b2d; }
.primary-button span { color: var(--lime); font-size: 18px; line-height: 1; }
.text-button { color: var(--moss); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.hero-stats { display: flex; gap: clamp(22px, 4vw, 46px); margin: 72px 0 0; }
.hero-stats div { min-width: 75px; }
.hero-stats dt { font-family: Georgia, serif; font-size: 27px; font-weight: 700; letter-spacing: -.04em; }
.hero-stats dd { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.hero-art { position: relative; min-height: 424px; overflow: hidden; background: #295846; }
.sun { position: absolute; top: 44px; right: 20%; width: 250px; height: 250px; border-radius: 50%; background: #f7d98c; }
.book-object { position: absolute; transform: rotate(-11deg); box-shadow: 18px 24px 30px rgb(5 28 19 / 30%); }
.book-object-back { top: 102px; right: 18%; width: 180px; height: 264px; background: #e4743d; }
.book-object-front { top: 71px; right: 26%; display: flex; width: 205px; height: 302px; flex-direction: column; justify-content: space-between; padding: 25px; background: #f4efe2; color: #203a2f; font-family: Georgia, serif; font-size: 30px; font-weight: 400; line-height: .94; letter-spacing: -.07em; }
.book-object-front b { font-size: 43px; }
.book-object-front small { font-family: Inter, sans-serif; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.hero-caption { position: absolute; right: 34px; bottom: 31px; color: #dce7cc; text-align: right; }
.hero-caption span { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: .1em; }
.hero-caption strong { font-family: Georgia, serif; font-size: 20px; }

.search-section { padding: 28px 0 70px; text-align: center; }
.search-box { display: flex; width: min(720px, 100%); align-items: center; gap: 13px; margin-inline: auto; border-bottom: 1px solid #a6ada5; padding: 15px 4px; }
.search-box > span { font-size: 28px; line-height: 1; transform: rotate(-20deg); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 19px; }
.search-box input::placeholder { color: #929990; }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; color: var(--muted); font-size: 11px; }
.search-section p { margin: 13px 0 0; color: var(--muted); font-size: 13px; }

.categories, .shelf, .how-it-works { padding: 45px 0 85px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.section-heading.compact { align-items: center; }
.section-heading h2, .how-it-works > h2 { margin: 0; font-size: clamp(30px, 3.5vw, 44px); letter-spacing: -.06em; }
.section-heading .eyebrow { margin-bottom: 8px; }
.view-all { color: var(--moss); font-size: 14px; font-weight: 700; }
.view-all span { margin-left: 6px; font-size: 18px; }
.category-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; }
.category-card { display: flex; min-height: 90px; flex-direction: column; align-items: start; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 3px; background: #faf9f5; color: var(--ink); cursor: pointer; padding: 16px; text-align: left; transition: .2s ease; }
.category-card span { color: var(--orange); font-size: 20px; }
.category-card:hover, .category-card.selected { border-color: var(--moss); background: var(--moss); color: white; transform: translateY(-2px); }
.category-card.selected span { color: var(--lime); }

.shelf { border-top: 1px solid var(--line); }
.shelf-note { margin: 0; color: var(--muted); font-size: 13px; }
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.book-card { min-width: 0; }
.cover { position: relative; display: flex; min-height: 270px; align-items: center; justify-content: center; overflow: hidden; padding: 25px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 6%); transition: transform .25s ease, box-shadow .25s ease; }
.book-card:hover .cover { transform: translateY(-6px); box-shadow: 0 16px 25px rgb(31 43 34 / 13%); }
.cover::after { position: absolute; inset: 8px; border: 1px solid rgb(255 255 255 / 45%); content: ""; }
.cover-title { position: relative; z-index: 1; max-width: 150px; color: inherit; font-family: Georgia, "Noto Serif SC", serif; font-size: 29px; font-weight: 700; line-height: 1.05; letter-spacing: -.07em; text-align: center; }
.cover-author { position: absolute; z-index: 1; bottom: 26px; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.book-meta { padding: 16px 3px 0; }
.book-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.book-meta h3 { margin: 0; overflow: hidden; font-size: 20px; letter-spacing: -.045em; text-overflow: ellipsis; white-space: nowrap; }
.rating { color: var(--orange); font-size: 12px; font-weight: 800; white-space: nowrap; }
.book-meta p { margin: 6px 0 14px; color: var(--muted); font-size: 12px; }
.borrow-button { display: block; width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px; background: transparent; color: var(--moss); cursor: pointer; font-size: 13px; font-weight: 750; text-align: center; }
.borrow-button:hover { border-color: var(--moss); background: var(--moss); color: white; }
.empty-state { grid-column: 1 / -1; padding: 70px 20px; color: var(--muted); text-align: center; }

.membership { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin-bottom: 86px; padding: clamp(38px, 5vw, 70px); background: var(--orange); color: #fff9ed; }
.membership .eyebrow { color: #f9e2a3; }
.membership h2 { margin: 0; font-size: clamp(35px, 4vw, 54px); line-height: 1.06; letter-spacing: -.07em; }
.membership-copy { display: flex; align-items: start; justify-content: center; flex-direction: column; }
.membership-copy p { max-width: 400px; color: #ffead0; line-height: 1.85; }
.primary-button.light { margin-top: 14px; border-color: #fff6e8; background: #fff6e8; color: #9e3e23; }
.primary-button.light span { color: var(--orange); }

.how-it-works { border-top: 1px solid var(--line); }
.how-it-works > .eyebrow { margin-bottom: 8px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 45px; border-top: 1px solid var(--line); }
.steps article { min-height: 170px; border-right: 1px solid var(--line); padding: 28px 28px 0 0; }
.steps article + article { padding-left: 28px; }
.steps article:last-child { border-right: 0; }
.steps span { color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.steps h3 { margin: 28px 0 8px; font-size: 23px; letter-spacing: -.05em; }
.steps p { max-width: 250px; color: var(--muted); font-size: 14px; line-height: 1.7; }
footer { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 25px; border-top: 1px solid var(--line); padding: 30px 0 43px; color: var(--muted); }
footer p, footer small { margin: 0; font-size: 12px; }
footer small { letter-spacing: .08em; }

dialog { width: min(420px, calc(100% - 32px)); border: 0; border-radius: 10px; padding: 35px; background: #fbfaf6; box-shadow: 0 24px 70px rgb(0 0 0 / 28%); color: var(--ink); }
dialog::backdrop { background: rgb(25 38 30 / 55%); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 13px; font-size: 34px; letter-spacing: -.06em; }
dialog p:not(.eyebrow) { color: var(--muted); line-height: 1.75; }
.dialog-close { position: absolute; top: 11px; right: 14px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 28px; }

.inner-page { width: min(1180px, calc(100% - 48px)); margin: 44px auto 100px; }
.inner-page > h1 { max-width: 740px; font-size: clamp(48px, 6vw, 78px); }
.page-intro { max-width: 560px; color: var(--muted); font-size: 16px; line-height: 1.85; }
.catalog-tools { display: grid; gap: 22px; margin: 55px 0 20px; }
.catalog-tools .search-box { width: 100%; margin: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-row button { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.filter-row button.selected, .filter-row button:hover { border-color: var(--moss); background: var(--moss); color: #fff; }
.result-count { color: var(--muted); font-size: 13px; }
.catalog-grid { padding-top: 8px; }
.back-link { display: inline-block; margin-bottom: 36px; color: var(--moss); font-size: 14px; font-weight: 700; }
.book-detail { display: grid; grid-template-columns: minmax(250px, .65fr) 1fr; gap: clamp(42px, 8vw, 110px); align-items: center; }
.detail-cover { min-height: 475px; padding: 50px; }
.detail-cover .cover-title { font-size: 48px; }
.detail-copy h1 { margin: 0 0 12px; font-size: clamp(45px, 5vw, 70px); }
.detail-author { color: var(--muted); font-size: 16px; }
.detail-author span { margin-left: 12px; color: var(--orange); font-weight: 800; }
.detail-summary { max-width: 520px; margin: 32px 0; color: #505b54; font-size: 17px; line-height: 1.9; }
.availability { display: flex; gap: 16px; align-items: center; margin: 0 0 28px; border-left: 3px solid var(--orange); padding: 3px 0 3px 13px; }
.availability strong { color: var(--moss); }
.availability span { color: var(--muted); font-size: 13px; }
.related-section { margin-top: 105px; border-top: 1px solid var(--line); padding-top: 55px; }
.reader-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 45px 0 70px; }
.reader-summary article { min-height: 180px; padding: 24px; background: var(--cream); }
.reader-summary span { color: var(--muted); font-size: 13px; }
.reader-summary strong { display: block; margin: 17px 0 10px; font-family: Georgia, serif; font-size: 48px; }
.reader-summary p { color: var(--muted); font-size: 13px; }
.current-loan { border-top: 1px solid var(--line); padding-top: 38px; }
.current-loan h2 { margin: 0; font-size: 38px; letter-spacing: -.06em; }
.loan-card { display: grid; grid-template-columns: 90px 1fr auto; gap: 21px; align-items: center; margin-top: 28px; padding: 22px; background: #fffdf8; }
.mini-cover { display: grid; min-height: 120px; place-items: center; background: var(--moss); color: #f8f0da; font-family: Georgia, serif; font-size: 18px; text-align: center; }
.loan-card h3 { margin: 0 0 8px; font-size: 24px; }
.loan-card p { color: var(--muted); font-size: 13px; }
.loan-status { border-radius: 999px; padding: 6px 10px; background: #e5efcf; color: var(--moss); font-size: 12px; font-weight: 700; }
.rule-list { margin: 55px 0; border-top: 1px solid var(--line); }
.rule-list article { display: grid; grid-template-columns: 76px 1fr; gap: 20px; border-bottom: 1px solid var(--line); padding: 29px 0; }
.rule-list article > span { color: var(--orange); font-size: 13px; font-weight: 800; }
.rule-list h2 { margin: 0 0 10px; font-size: 28px; letter-spacing: -.05em; }
.rule-list p { max-width: 600px; margin: 0; color: var(--muted); line-height: 1.8; }

@media (max-width: 760px) {
  .site-header, main > section, footer { width: min(100% - 32px, 1180px); }
  .site-header { height: 70px; }
  nav { display: none; }
  .account-button { padding: 8px 11px; font-size: 12px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 47px 29px 42px; }
  .hero-stats { margin-top: 42px; }
  .hero-art { min-height: 315px; }
  .sun { top: 20px; width: 210px; height: 210px; }
  .book-object-back { top: 65px; right: 20%; }
  .book-object-front { top: 41px; right: 27%; transform: rotate(-8deg) scale(.84); transform-origin: center; }
  .category-list { grid-template-columns: repeat(2, 1fr); }
  .category-card:last-child { grid-column: span 2; }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; }
  .cover { min-height: 215px; padding: 13px; }
  .cover-title { font-size: 23px; }
  .membership, .steps { grid-template-columns: 1fr; }
  .membership { gap: 26px; margin-bottom: 52px; }
  .steps article, .steps article + article { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 0; }
  .steps article:last-child { border-bottom: 0; }
  .steps h3 { margin-top: 15px; }
  footer { grid-template-columns: 1fr; gap: 11px; }
  .inner-page { width: min(100% - 32px, 1180px); margin-top: 32px; }
  .book-detail { grid-template-columns: 1fr; gap: 35px; }
  .detail-cover { min-height: 340px; }
  .detail-cover .cover-title { font-size: 40px; }
  .reader-summary { grid-template-columns: 1fr; }
  .loan-card { grid-template-columns: 75px 1fr; }
  .loan-status { grid-column: 2; justify-self: start; }
  .rule-list article { grid-template-columns: 48px 1fr; }
}
