: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 { 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; }
.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: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; 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; }
.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 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; }

.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; }

@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:first-of-type { display: none; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 28px, 1160px); }
  .nav-wrap { min-height: 66px; gap: 15px; }
  .welcome { display: none; }
  .account-nav { gap: 12px; }
  .hero-grid { display: block; min-height: auto; }
  .hero-copy { padding: 65px 0 45px; }
  .hero h1 { font-size: 48px; }
  .hero-art { min-height: 420px; }
  .sun { right: 0; width: 260px; height: 260px; }
  .arch-back { right: -70px; width: 360px; height: 390px; }
  .arch-front { right: 10px; width: 300px; height: 350px; padding: 100px 25px 0; }
  .shelf { height: 62px; }
  .shelf i { height: 48px; }
  .shelf + .shelf { margin-top: 20px; }
  .floating-note { display: none; }
  .hero-stats { gap: 25px; }
  .section { padding-top: 58px; padding-bottom: 65px; }
  .section-heading h2 { font-size: 30px; }
  .book-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps article { padding: 28px; }
  .filter-panel { grid-template-columns: 1fr; }
  .filter-panel .button { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; gap: 38px; }
  .detail-cover { position: relative; top: auto; width: min(300px, 100%); min-height: 420px; margin: 0 auto; }
  .detail-content h1 { font-size: 38px; }
  .availability-box { align-items: flex-start; flex-wrap: wrap; }
  .borrow-action { width: 100%; margin: 4px 0 0; }
  .borrow-action .button { width: 100%; }
  .member-heading { align-items: flex-start; gap: 25px; }
  .member-heading h1 { font-size: 34px; }
  .quota-card { min-width: 140px; padding: 15px; }
  .loan-row { grid-template-columns: 52px 1fr auto; }
  .loan-row .loan-date { display: none; }
  .loan-row form { grid-column: 2 / -1; }
  .loan-row .button { width: 100%; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { min-height: 330px; padding: 50px 28px; }
  .auth-art h1 { font-size: 42px; }
  .footer-grid { grid-template-columns: 1fr; gap: 25px; }
}

@media (max-width: 480px) {
  .brand small { display: none; }
  .account-nav > a:not(.button) { display: none; }
  .hero h1 { font-size: 40px; }
  .hero-search { border-radius: 15px; }
  .hero-search button { padding-inline: 16px; }
  .hero-stats strong { font-size: 24px; }
  .book-card { grid-template-columns: 110px 1fr; min-height: 195px; padding: 12px; }
  .book-cover { min-height: 170px; padding: 13px; }
  .book-card-body { padding-left: 13px; }
  .book-facts { grid-template-columns: 1fr; }
  .member-heading { display: block; }
  .quota-card { margin-top: 20px; width: fit-content; }
}
