:root {
  --ink: #192f2a;
  --muted: #65736f;
  --paper: #f7f3e9;
  --cream: #fffdf7;
  --green: #1f5b49;
  --green-dark: #123f34;
  --green-soft: #dce9df;
  --gold: #d99a3e;
  --rust: #b55d3f;
  --line: #d9ded6;
  --shadow: 0 18px 50px rgba(25, 47, 42, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--cream); font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(217, 154, 62, .68); outline-offset: 3px; }
.container { width: min(1160px, calc(100% - 40px)); margin: 0 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; }

.site-header { position: sticky; z-index: 20; top: 0; background: rgba(255, 253, 247, .94); border-bottom: 1px solid rgba(25, 47, 42, .09); backdrop-filter: blur(16px); }
.nav-wrap { min-height: 76px; display: flex; align-items: center; gap: 36px; }
.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 46px; color: #fff; background: var(--green); border-radius: 4px 13px 4px 4px; font-family: Georgia, serif; font-size: 20px; box-shadow: inset -5px 0 rgba(255, 255, 255, .1); }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong { font-family: Georgia, "Songti SC", serif; font-size: 21px; letter-spacing: .2em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .22em; }
.main-nav, .account-nav { display: flex; align-items: center; gap: 25px; font-size: 14px; }
.main-nav a, .account-nav > a, .link-button { position: relative; color: #344a44; }
.main-nav a::after { position: absolute; right: 0; bottom: -9px; left: 0; height: 2px; content: ""; background: var(--gold); transform: scaleX(0); transition: transform .2s ease; }
.main-nav a:hover::after { transform: scaleX(1); }
.main-nav a:hover, .account-nav a:hover, .link-button:hover { color: var(--green); }
.account-nav > .button { color: #fff; }
.account-nav > .button:hover { color: #fff; }
.account-nav form { margin: 0; }
.link-button { padding: 0; background: none; border: 0; }
.welcome { color: var(--muted); font-size: 13px; }

.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 10px 24px; color: #fff; background: var(--green); border: 1px solid var(--green); border-radius: 999px; font-weight: 700; line-height: 1.2; text-align: center; box-shadow: 0 9px 22px rgba(31, 91, 73, .17); transition: transform .2s, background .2s; }
.button:hover { color: #fff; background: var(--green-dark); transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button-small { min-height: 36px; padding: 6px 17px; font-size: 13px; }
.button-secondary { color: var(--green); background: transparent; box-shadow: none; }
.button-secondary:hover { color: #fff; }
.button-full { width: 100%; }
.text-link, .back-link { color: var(--green); font-weight: 700; }
.back-link { display: inline-block; margin-bottom: 25px; font-size: 14px; }

.message-stack { position: relative; z-index: 30; }
.message { margin-top: 14px; padding: 12px 18px; border-radius: 10px; font-size: 14px; }
.message-success { color: #17533f; background: #e0f1e8; border: 1px solid #b8dac8; }
.message-error { color: #8c362b; background: #fae7e2; border: 1px solid #ebc5bc; }
.message-info { background: #e7eef4; border: 1px solid #cad7e3; }

.hero { overflow: hidden; background: var(--paper); border-bottom: 1px solid #e8e0d2; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; min-height: 650px; }
.hero-copy { position: relative; z-index: 2; padding: 70px 0; }
.eyebrow { display: inline-block; margin-bottom: 11px; color: var(--rust); font-size: 11px; font-weight: 800; letter-spacing: .24em; }
.hero h1, .page-banner h1, .detail-content h1, .auth-art h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-weight: 600; line-height: 1.18; }
.hero h1 { max-width: 650px; font-size: clamp(48px, 6vw, 76px); letter-spacing: -.04em; }
.hero h1 em { color: var(--green); font-style: normal; }
.hero-copy > p { max-width: 590px; margin: 25px 0 30px; color: var(--muted); font-size: 17px; }
.hero-search { display: flex; max-width: 590px; padding: 7px; background: #fff; border: 1px solid #e0dccf; border-radius: 999px; box-shadow: var(--shadow); }
.hero-search input { min-width: 0; flex: 1; padding: 12px 19px; background: transparent; border: 0; outline: 0; }
.hero-search button { padding: 11px 24px; color: #fff; background: var(--green); border: 0; border-radius: 999px; font-weight: 700; }
.hero-stats { display: flex; gap: 42px; margin-top: 36px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-family: Georgia, serif; font-size: 28px; }
.hero-stats span { color: var(--muted); font-size: 12px; }
.hero-art { position: relative; align-self: stretch; min-height: 600px; }
.sun { position: absolute; top: 82px; right: 28px; width: 330px; height: 330px; background: #e7ad55; border-radius: 50%; opacity: .92; }
.arch { position: absolute; bottom: 0; border-radius: 230px 230px 0 0; }
.arch-back { right: -75px; width: 470px; height: 525px; background: #c1d3c8; }
.arch-front { right: 18px; width: 385px; height: 465px; padding: 150px 35px 0; background: var(--green); box-shadow: 24px 0 0 #174a3c; }
.shelf { display: flex; align-items: flex-end; height: 82px; padding: 0 9px 9px; border-bottom: 8px solid #a86b3f; }
.shelf + .shelf { margin-top: 30px; }
.shelf i { display: block; width: 36px; height: 62px; margin-right: 8px; background: #e4c477; border-radius: 2px 5px 1px 1px; box-shadow: inset -6px 0 rgba(0, 0, 0, .08); transform: rotate(-2deg); }
.shelf i:nth-child(2n) { height: 54px; background: #d87955; transform: rotate(3deg); }
.shelf i:nth-child(3n) { height: 69px; background: #f0e9d7; transform: none; }
.shelf-two { margin-left: 35px; }
.plant { position: absolute; right: 22px; bottom: 24px; color: #d7e4dc; font-family: Georgia, serif; font-size: 72px; transform: rotate(-12deg); }
.floating-note { position: absolute; top: 145px; right: 342px; padding: 8px 13px; color: var(--green-dark); background: #fff6d7; font: 700 11px Georgia, serif; letter-spacing: .2em; transform: rotate(-8deg); box-shadow: 0 6px 12px rgba(0, 0, 0, .1); }

.section { padding-top: 80px; padding-bottom: 90px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 34px; }
.section-heading h2 { margin: 0; font: 600 36px/1.2 Georgia, "Songti SC", serif; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading.centered { justify-content: center; text-align: center; }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.book-card { display: grid; grid-template-columns: 138px minmax(0, 1fr); min-height: 218px; padding: 16px; background: #fff; border: 1px solid #e8e6df; border-radius: var(--radius); box-shadow: 0 11px 32px rgba(25, 47, 42, .06); transition: transform .25s, box-shadow .25s; }
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.book-cover { position: relative; overflow: hidden; display: flex; min-height: 185px; flex-direction: column; justify-content: center; padding: 18px; color: #f8f4e8; background: linear-gradient(145deg, #295f4f, #173e35); border-radius: 9px 15px 15px 9px; box-shadow: inset -9px 0 rgba(255, 255, 255, .06), 5px 7px 12px rgba(25, 47, 42, .16); }
.book-card:nth-child(3n+2) .book-cover { background: linear-gradient(145deg, #b15f42, #713725); }
.book-card:nth-child(3n+3) .book-cover { background: linear-gradient(145deg, #315b72, #1d3543); }
.book-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book-cover strong { position: relative; z-index: 1; font-family: Georgia, "Songti SC", serif; font-size: 17px; line-height: 1.35; }
.book-cover small { position: relative; z-index: 1; margin-top: 10px; opacity: .8; }
.book-cover i { position: absolute; right: 15px; bottom: 14px; width: 28px; height: 28px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%; }
.cover-category { position: absolute; top: 16px; left: 18px; font-size: 9px; letter-spacing: .14em; opacity: .8; }
.book-card-body { display: flex; min-width: 0; flex-direction: column; padding: 5px 4px 3px 18px; }
.book-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; width: fit-content; padding: 3px 9px; color: var(--green); background: var(--green-soft); border-radius: 999px; font-size: 11px; font-weight: 700; }
.book-card h3 { margin: 14px 0 5px; font: 600 18px/1.35 Georgia, "Songti SC", serif; }
.book-card h3 a:hover { color: var(--green); }
.book-card-body > p { margin: 0; color: var(--muted); font-size: 13px; }
.book-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.book-meta > a { display: grid; place-items: center; width: 29px; height: 29px; color: var(--green); border: 1px solid var(--line); border-radius: 50%; }
.stock { font-size: 11px; font-weight: 700; }
.available { color: #317157; }
.unavailable { color: var(--rust); }
.empty-state { padding: 48px 25px; text-align: center; background: var(--paper); border: 1px dashed #ccc5b9; border-radius: var(--radius); }
.empty-state.wide { grid-column: 1 / -1; }
.empty-state > span { font-size: 38px; }
.empty-state h3 { margin: 10px 0 4px; font-family: Georgia, "Songti SC", serif; }
.empty-state p { margin: 0 0 9px; color: var(--muted); }

.how-it-works { padding: 85px 0 95px; background: var(--green-dark); color: #fff; }
.how-it-works .eyebrow { color: #e9b65e; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 42px; background: rgba(255, 255, 255, .14); }
.steps article { padding: 36px; background: var(--green-dark); }
.steps b { color: #e9b65e; font: 400 34px Georgia, serif; }
.steps h3 { margin: 15px 0 8px; font: 600 22px Georgia, "Songti SC", serif; }
.steps p { margin: 0; color: #b9cbc5; font-size: 14px; }

.page-banner { padding: 65px 0 55px; color: #fff; background: var(--green-dark); }
.page-banner .eyebrow { color: #efbd69; }
.page-banner h1 { font-size: 48px; }
.page-banner p { margin: 10px 0 0; color: #bdcec8; }
.filter-panel { display: grid; grid-template-columns: 2fr 1fr auto; align-items: end; gap: 18px; padding: 22px; background: var(--paper); border: 1px solid #e4ddd1; border-radius: var(--radius); }
.filter-panel label, .field label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.filter-panel input[type="text"], .filter-panel input:not([type]), .filter-panel select, .field input { width: 100%; min-height: 46px; padding: 10px 13px; color: var(--ink); background: #fff; border: 1px solid #d6d8d2; border-radius: 9px; outline: 0; }
.filter-panel input:focus, .filter-panel select:focus, .field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 91, 73, .1); }
.checkbox-row { display: flex !important; min-height: 46px; align-items: center; gap: 7px; margin: 0 !important; white-space: nowrap; }
.result-summary { margin: 31px 0 20px; color: var(--muted); font-size: 14px; }
.result-summary strong { color: var(--ink); font: 600 23px Georgia, serif; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 42px; }
.pagination a { color: var(--green); font-weight: 700; }
.pagination span { color: var(--muted); font-size: 13px; }

.detail-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 75px; align-items: start; }
.detail-cover { width: 100%; min-height: 470px; padding: 40px; position: sticky; top: 105px; }
.detail-cover strong { font-size: 30px; }
.detail-content { padding-top: 12px; }
.detail-content h1 { margin-top: 15px; font-size: 48px; }
.detail-author { margin: 10px 0 30px; color: var(--muted); font-size: 17px; }
.book-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid var(--line); }
.book-facts div { padding: 17px 0; border-bottom: 1px solid var(--line); }
.book-facts dt { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.book-facts dd { margin: 4px 0 0; font-size: 14px; }
.availability-box { display: flex; align-items: center; gap: 33px; margin-top: 28px; padding: 20px 24px; background: var(--paper); border-radius: 14px; }
.availability-box > div:not(.borrow-action) { display: flex; min-width: 70px; flex-direction: column; }
.availability-box strong { font: 600 28px Georgia, serif; }
.availability-box span { color: var(--muted); font-size: 11px; }
.borrow-action { margin-left: auto; }
.borrow-action form { margin: 0; }
.description { margin-top: 34px; }
.description h2 { margin: 0 0 12px; font: 600 24px Georgia, "Songti SC", serif; }
.description p { color: #52625e; }

.member-banner { padding: 52px 0; }
.member-heading { display: flex; align-items: center; justify-content: space-between; }
.member-heading h1 { font-size: 42px; }
.quota-card { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 0 10px; min-width: 175px; padding: 20px 24px; color: var(--ink); background: #f2d28b; border-radius: 13px; }
.quota-card strong { grid-row: 1 / 3; font: 600 37px Georgia, serif; }
.quota-card span { font-size: 12px; font-weight: 700; }
.quota-card small { color: #5f5a42; }
.dashboard-section { padding-top: 55px; }
.loan-list { display: grid; gap: 13px; }
.return-guide { display: flex; gap: 12px; margin: -15px 0 20px; padding: 12px 16px; color: #4e625c; background: var(--paper); border-left: 3px solid var(--gold); border-radius: 8px; font-size: 12px; }
.return-guide strong { color: var(--ink); white-space: nowrap; }
.loan-row { display: grid; grid-template-columns: 62px minmax(180px, 1.7fr) minmax(105px, .7fr) minmax(105px, .7fr) auto; align-items: center; gap: 18px; padding: 16px 20px; background: #fff; border: 1px solid #e4e5df; border-radius: 13px; }
.loan-overdue { border-left: 4px solid var(--rust); }
.loan-return-pending { border-left: 4px solid var(--gold); background: #fffdf7; }
.mini-cover { display: grid; place-items: center; width: 48px; height: 62px; color: #fff; background: var(--green); border-radius: 4px 8px 8px 4px; font: 600 20px Georgia, serif; }
.loan-title > span, .loan-date span { color: var(--muted); font-size: 10px; }
.loan-title h3 { margin: 1px 0; font: 600 17px Georgia, "Songti SC", serif; }
.loan-title p { margin: 0; color: var(--muted); font-size: 12px; }
.loan-date { display: flex; flex-direction: column; }
.loan-date strong { font-size: 13px; }
.loan-date em { color: var(--rust); font-size: 10px; font-style: normal; font-weight: 700; }
.return-pending { display: flex; min-width: 128px; flex-direction: column; color: #8a6123; text-align: right; }
.return-pending strong { font-size: 12px; }
.return-pending small { color: var(--muted); font-size: 10px; }
.history-heading { margin-top: 65px; }
.history-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.history-table { width: 100%; border-collapse: collapse; background: #fff; }
.history-table th, .history-table td { padding: 15px 20px; text-align: left; border-bottom: 1px solid #ecece7; font-size: 13px; }
.history-table th { color: var(--muted); background: var(--paper); font-size: 11px; letter-spacing: .08em; }
.history-table td:first-child a { display: block; font-weight: 700; }
.history-table td:first-child small { color: var(--muted); }
.history-table tr:last-child td { border-bottom: 0; }
.table-empty { padding: 32px !important; color: var(--muted); text-align: center !important; }
.account-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }

.wallet-banner { background: radial-gradient(circle at 82% 25%, rgba(240, 185, 91, .25), transparent 23%), var(--green-dark); }
.wallet-heading { display: flex; align-items: center; justify-content: space-between; gap: 35px; }
.wallet-balance { display: grid; min-width: 210px; padding: 23px 27px; color: var(--ink); background: #f2d28b; border-radius: 16px; box-shadow: 0 18px 42px rgba(0, 0, 0, .13); }
.wallet-balance strong { font: 600 46px/1 Georgia, serif; }
.wallet-balance span { margin-top: 6px; font-size: 12px; font-weight: 800; }
.wallet-balance small { margin-top: 2px; color: #635b40; }
.wallet-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); align-items: start; gap: 28px; padding-top: 55px; }
.wallet-main, .wallet-side { display: grid; gap: 22px; }
.wallet-card { padding: 28px; background: #fff; border: 1px solid #e4e5df; border-radius: 16px; box-shadow: 0 12px 35px rgba(25, 47, 42, .055); }
.wallet-card h2, .wallet-card h3 { margin: 5px 0 12px; font-family: Georgia, "Songti SC", serif; }
.wallet-card h2 { font-size: 28px; }
.wallet-card h3 { font-size: 20px; }
.muted, .wallet-tip, .rules-card p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.purchase-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: end; gap: 12px; margin-top: 24px; }
.purchase-form label { grid-column: 1 / -1; font-size: 12px; font-weight: 800; }
.purchase-form select { min-height: 46px; padding: 10px 13px; color: var(--ink); background: #fff; border: 1px solid #d6d8d2; border-radius: 9px; }
.wallet-tip { margin: 12px 0 0; }
.setup-notice { margin-top: 20px; padding: 17px 18px; color: #755320; background: #fff7dd; border: 1px solid #ead49d; border-radius: 11px; }
.setup-notice p { margin: 5px 0 0; font-size: 13px; line-height: 1.65; }
.payment-result { display: grid; gap: 3px; padding: 16px 18px; color: #305f50; background: #e8f4ee; border-radius: 11px; }
.payment-result span { font-size: 12px; }
.payment-failed { color: #853a2f; background: #fae9e5; }
.compact-heading { margin-bottom: 18px; }
.transaction-list { display: grid; }
.transaction-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid #ecece7; }
.transaction-row:last-child { border-bottom: 0; }
.transaction-row > div { display: grid; gap: 3px; }
.transaction-row span, .order-row span { color: var(--muted); font-size: 12px; }
.transaction-row em { font: 700 18px Georgia, serif; font-style: normal; }
.points-plus { color: var(--green); }
.points-minus { color: var(--rust); }
.empty-line { padding: 18px 0; color: var(--muted); text-align: center; }
.rules-card ol { display: grid; gap: 13px; margin: 20px 0; padding: 0; list-style: none; }
.rules-card li { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 10px; }
.rules-card li strong { color: var(--green); font: 700 21px Georgia, serif; }
.rules-card li span { font-size: 13px; }
.order-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ecece7; }
.order-row:last-child { border-bottom: 0; }
.order-row strong { font-size: 12px; }

.ebook-tag { color: #1d654e; background: #e2f2eb; }
.ebook-license { margin-top: 24px; padding: 18px 20px; color: #53645e; background: #f1f6f3; border-left: 3px solid #5f8d7b; border-radius: 0 10px 10px 0; font-size: 13px; line-height: 1.7; }
.ebook-license strong { display: block; color: var(--ink); }
.ebook-license p { margin: 5px 0 0; }
.ebook-license a, .reader-source a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.loan-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.loan-actions form { margin: 0; }

.reader-shell { min-height: calc(100vh - 76px); padding: 48px 0 70px; background: #edf2ef; }
.reader-header { display: flex; align-items: flex-start; gap: 34px; }
.reader-header h1 { margin: 3px 0 8px; font: 600 clamp(34px, 4vw, 52px) Georgia, "Songti SC", serif; }
.reader-header p { margin: 0; color: var(--muted); }
.reader-paper { margin-top: 30px; padding: clamp(34px, 6vw, 76px); background: #fffdf8; border: 1px solid #e2ded3; border-radius: 8px; box-shadow: 0 20px 70px rgba(31, 47, 40, .08); }
.reader-content { color: #282d2a; font: 18px/2 Georgia, "Songti SC", "SimSun", serif; white-space: normal; overflow-wrap: anywhere; }
.reader-pagination { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 55px; padding-top: 28px; border-top: 1px solid #e4e0d7; color: var(--muted); font-size: 13px; }
.button.disabled { opacity: .42; pointer-events: none; }
.reader-source { display: flex; justify-content: space-between; gap: 30px; margin-top: 22px; color: var(--muted); font-size: 12px; }

.auth-page { display: grid; grid-template-columns: .85fr 1.15fr; min-height: calc(100vh - 76px); }
.auth-art { display: flex; align-items: flex-end; padding: 70px max(50px, 7vw); color: #fff; background: linear-gradient(rgba(13, 52, 42, .2), rgba(13, 52, 42, .82)), radial-gradient(circle at 70% 20%, #d7a554 0 12%, transparent 12.3%), linear-gradient(145deg, #437866, #163e34); }
.auth-art > div { max-width: 470px; }
.auth-art .eyebrow { color: #f1c472; }
.auth-art h1 { font-size: clamp(42px, 5vw, 64px); }
.auth-art p { color: #cedbd7; }
.auth-panel { display: grid; place-items: center; padding: 55px 30px; }
.auth-card { width: min(440px, 100%); }
.register-card { width: min(560px, 100%); }
.auth-card h2 { margin: 0; font: 600 38px Georgia, "Songti SC", serif; }
.auth-intro { margin: 5px 0 25px; color: var(--muted); }
.stacked-form { display: grid; gap: 16px; }
.field input { min-height: 48px; }
.help-text { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.help-text ul { margin: 5px 0 0; padding-left: 18px; }
.field-error { display: block; margin-top: 4px; color: var(--rust); font-size: 12px; }
.field-invalid input { border-color: var(--rust); }
.form-error { margin-bottom: 18px; padding: 10px 13px; color: #8c362b; background: #fae7e2; border-radius: 8px; font-size: 13px; }
.auth-switch { margin-top: 22px; color: var(--muted); text-align: center; font-size: 13px; }
.auth-switch a { color: var(--green); font-weight: 700; }
.register-page .auth-panel { align-items: start; }

.site-footer { padding: 42px 0; color: #c1d0cb; background: #102f28; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 45px; }
.footer-grid strong { color: #fff; font-family: Georgia, "Songti SC", serif; font-size: 20px; }
.footer-grid span { color: #e1b466; font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.footer-grid p { margin: 5px 0 0; font-size: 12px; }
.mobile-nav { display: none; }

@media (max-width: 1050px) {
  .main-nav { display: none; }
  .hero-grid { grid-template-columns: 1fr .75fr; }
  .book-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .loan-row { grid-template-columns: 55px minmax(180px, 1fr) 105px auto; }
  .loan-row .loan-date-borrowed { display: none; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.reader-page { padding-bottom: 0; }
  .container { width: min(100% - 28px, 1160px); }
  .site-header { padding-top: env(safe-area-inset-top); }
  .nav-wrap { min-height: 62px; justify-content: center; gap: 15px; }
  .brand { margin: 0; }
  .brand-mark { width: 34px; height: 40px; font-size: 18px; }
  .brand strong { font-size: 19px; }
  .account-nav { display: none; }
  .hero-grid { display: block; min-height: auto; }
  .hero-copy { padding: 46px 0 34px; }
  .hero h1 { font-size: clamp(39px, 12vw, 52px); }
  .hero-copy > p { margin: 18px 0 24px; font-size: 15px; }
  .hero-search { width: 100%; padding: 5px; }
  .hero-search input { padding: 10px 13px; }
  .hero-search button { min-height: 44px; padding: 9px 18px; }
  .hero-art { min-height: 220px; }
  .sun { top: 12px; right: 24px; width: 175px; height: 175px; }
  .arch-back { right: -48px; width: 285px; height: 210px; }
  .arch-front { right: 14px; width: 230px; height: 185px; padding: 48px 18px 0; box-shadow: 14px 0 0 #174a3c; }
  .shelf { height: 44px; padding: 0 5px 5px; border-bottom-width: 5px; }
  .shelf i { width: 24px; height: 34px; margin-right: 5px; }
  .shelf i:nth-child(2n) { height: 30px; }
  .shelf i:nth-child(3n) { height: 39px; }
  .shelf + .shelf { margin-top: 10px; }
  .shelf-two { margin-left: 18px; }
  .plant { right: 14px; bottom: 10px; font-size: 38px; }
  .floating-note { display: none; }
  .hero-stats { gap: 28px; margin-top: 27px; }
  .hero-stats strong { font-size: 25px; }
  .section { padding-top: 48px; padding-bottom: 54px; }
  .section-heading { align-items: flex-start; margin-bottom: 25px; }
  .section-heading h2 { font-size: 30px; }
  .book-grid { grid-template-columns: 1fr; }
  .book-card { min-height: 205px; }
  .steps { grid-template-columns: 1fr; }
  .steps article { padding: 28px; }
  .how-it-works { padding: 58px 0 68px; }
  .page-banner { padding: 42px 0 36px; }
  .page-banner h1 { font-size: 37px; }
  .page-banner p { font-size: 14px; }
  .filter-panel { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .filter-panel .button { width: 100%; }
  .checkbox-row { min-height: 36px; }
  .result-summary { margin-top: 24px; }
  .detail-grid { grid-template-columns: 1fr; gap: 38px; }
  .detail-cover { position: relative; top: auto; width: min(245px, 78vw); min-height: 345px; margin: 0 auto; padding: 28px; }
  .detail-cover strong { font-size: 24px; }
  .detail-content h1 { font-size: 35px; }
  .detail-author { margin-bottom: 22px; }
  .availability-box { align-items: center; flex-wrap: wrap; gap: 18px 28px; padding: 18px; }
  .borrow-action { width: 100%; margin: 4px 0 0; }
  .borrow-action .button { width: 100%; }
  .member-banner { padding: 38px 0; }
  .member-heading { align-items: flex-start; gap: 18px; }
  .member-heading h1 { font-size: 34px; }
  .quota-card { min-width: 140px; padding: 15px; }
  .dashboard-section { padding-top: 42px; }
  .return-guide { margin-top: -8px; }
  .loan-row { grid-template-columns: 52px minmax(0, 1fr); align-items: start; gap: 10px 14px; padding: 16px; }
  .mini-cover { grid-row: 1 / span 2; }
  .loan-row .loan-date { display: flex; grid-column: 2; flex-direction: row; align-items: center; gap: 8px; }
  .loan-row .loan-date-borrowed { display: none; }
  .loan-row .loan-date span::after { content: "："; }
  .loan-row form { grid-column: auto; }
  .loan-row .button { width: 100%; }
  .loan-actions { grid-column: 2 / -1; width: 100%; }
  .return-pending { min-width: 0; text-align: left; }
  .history-heading { margin-top: 48px; }
  .history-table { min-width: 590px; }
  .reader-header { display: block; }
  .reader-header .back-link { display: inline-block; margin-bottom: 25px; }
  .reader-shell { min-height: 100vh; padding: 34px 0 50px; }
  .reader-paper { width: 100%; margin-top: 22px; padding: 30px 22px; }
  .reader-content { font-size: 17px; line-height: 1.95; }
  .reader-pagination { flex-wrap: wrap; gap: 12px; }
  .reader-pagination span { order: -1; width: 100%; text-align: center; }
  .reader-source { display: block; }
  .reader-source span { display: block; margin-top: 7px; }
  .auth-page { grid-template-columns: 1fr; min-height: auto; }
  .auth-art { min-height: 205px; padding: 38px 28px; }
  .auth-art h1 { font-size: 36px; }
  .auth-art p { margin-bottom: 0; font-size: 13px; }
  .auth-panel { padding: 38px 20px 54px; }
  .auth-card h2 { font-size: 32px; }
  .stacked-form { gap: 14px; }
  .field input { min-height: 48px; font-size: 16px; }
  .site-footer { padding: 34px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 25px; }
  .mobile-nav { position: fixed; z-index: 100; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); min-height: calc(64px + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom); background: rgba(255, 253, 247, .96); border-top: 1px solid rgba(25, 47, 42, .13); box-shadow: 0 -8px 26px rgba(25, 47, 42, .09); backdrop-filter: blur(16px); }
  .mobile-nav a, .mobile-nav form, .mobile-nav button { min-width: 0; height: 100%; margin: 0; }
  .mobile-nav a, .mobile-nav button { display: flex; min-height: 52px; align-items: center; justify-content: center; flex-direction: column; gap: 1px; padding: 3px 2px; color: #75817d; background: transparent; border: 0; border-radius: 12px; line-height: 1; }
  .mobile-nav a.active { color: var(--green); background: #edf4f0; }
  .mobile-nav-icon { height: 25px; font-size: 23px; line-height: 25px; }
  .mobile-nav small { font-size: 10px; font-weight: 700; }
  .reader-page .mobile-nav { display: none; }
  .wallet-heading { align-items: flex-start; }
  .wallet-balance { min-width: 155px; padding: 18px; }
  .wallet-balance strong { font-size: 37px; }
  .wallet-layout { grid-template-columns: 1fr; padding-top: 38px; }
}

@media (max-width: 480px) {
  .brand small { display: none; }
  .hero h1 { font-size: 40px; }
  .hero-search { border-radius: 15px; }
  .hero-search button { padding-inline: 15px; }
  .hero-stats strong { font-size: 24px; }
  .section-heading > .button, .section-heading > .text-link { font-size: 12px; white-space: nowrap; }
  .book-card { grid-template-columns: 104px 1fr; min-height: 188px; padding: 11px; }
  .book-cover { min-height: 166px; padding: 13px; }
  .book-card-body { padding-left: 13px; }
  .book-card h3 { margin-top: 10px; font-size: 17px; }
  .book-tags .tag { padding-inline: 7px; font-size: 10px; }
  .book-meta { gap: 4px; }
  .book-facts { grid-template-columns: 1fr; }
  .member-heading { display: block; }
  .quota-card { margin-top: 20px; width: fit-content; }
  .return-guide { display: block; }
  .return-guide strong { display: block; margin-bottom: 4px; }
  .reader-pagination .button { min-width: 118px; }
  .wallet-heading { display: block; }
  .wallet-balance { width: fit-content; margin-top: 20px; }
  .wallet-card { padding: 21px; }
  .purchase-form { grid-template-columns: 1fr; }
  .purchase-form .button { width: 100%; }
  .account-actions { align-items: flex-start; flex-direction: column; }
}
