@font-face {
  font-family: LXGWBook;
  src: url('assets/LXGWWenKai-Book.woff2') format('woff2');
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #383633;
  --ink-soft: #5a544d;
  --paper: #f7f0e5;
  --paper-light: #fffaf1;
  --line: #ddcdbd;
  --rose: #a97478;
  --library-canvas: #f7f0e5;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--library-canvas); color: var(--ink); font-family: LXGWBook, "Songti SC", "Noto Serif CJK SC", serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--book-accent, var(--rose)); outline-offset: 3px; }
#app { position: relative; min-height: 100vh; isolation: isolate; }
.archive-atmosphere { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 70% 12%, #fffaf1 0, transparent 50%), linear-gradient(135deg, #f9f2e8, #f3e9de 70%, #f7efe4); }
.archive-atmosphere::before { position: absolute; inset: 0; content: ""; opacity: .18; background-image: radial-gradient(circle at center, #8d7e7020 0 .7px, transparent 1px); background-size: 22px 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

.archive-header { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(220px, .8fr) minmax(260px, 1.35fr) minmax(180px, .75fr); align-items: center; gap: clamp(18px, 3vw, 48px); min-height: 94px; padding: 17px clamp(22px, 4vw, 64px); border-bottom: 1px solid #c4aa9a66; background: #fffaf1bd; backdrop-filter: blur(16px); }
.archive-brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid #8f667477; border-radius: 50%; color: #8f6674; font: italic 20px/1 Georgia, serif; }
.archive-brand strong { display: block; font-size: 18px; font-weight: 400; letter-spacing: .22em; }
.archive-brand small { display: block; margin-top: 3px; color: var(--ink-soft); font: 8px/1 Georgia, serif; letter-spacing: .22em; }
.archive-search { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 17px; border: 1px solid #c4aa9a88; border-radius: 999px; background: #fffdf9c9; transition: border-color .2s, box-shadow .2s; }
.archive-search:focus-within { border-color: var(--book-accent, var(--rose)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--book-accent, var(--rose)) 13%, transparent); }
.search-icon { position: relative; flex: 0 0 14px; width: 14px; height: 14px; border: 1.5px solid #7c726a; border-radius: 50%; }
.search-icon::after { position: absolute; right: -5px; bottom: -3px; width: 6px; height: 1.5px; transform: rotate(48deg); transform-origin: left center; background: #7c726a; content: ""; }
.archive-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.archive-search input::placeholder { color: #898076; }
.archive-edition { margin: 0; color: var(--ink-soft); font-size: 11px; letter-spacing: .12em; text-align: right; }

.archive-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); width: min(1600px, 100%); margin: 0 auto; padding: 48px clamp(22px, 4vw, 64px) 28px; }
.archive-sidebar { position: sticky; top: 28px; align-self: start; min-height: calc(100vh - 122px); padding: 3px 23px 20px 0; border-right: 1px solid #c4aa9a55; }
.sidebar-heading { display: flex; align-items: center; gap: 12px; margin: 3px 0 21px; color: var(--ink-soft); font-size: 11px; letter-spacing: .18em; }
.sidebar-rule { flex: 1; height: 1px; background: linear-gradient(90deg, #c4aa9a88, transparent); }
.category-list { display: grid; gap: 7px; }
.category-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 45px; padding: 9px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink-soft); text-align: left; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.category-button:hover { background: #fffaf1a8; color: var(--ink); }
.category-button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--book-accent, var(--rose)) 24%, transparent); background: color-mix(in srgb, var(--book-accent, var(--rose)) 14%, #fffaf1); color: var(--book-accent, #8f6674); }
.category-count { color: #8c8177; font: 12px/1 Georgia, serif; }
.category-button[aria-pressed="true"] .category-count { color: var(--book-accent, #8f6674); }
.sidebar-note { position: absolute; right: 23px; bottom: 4px; left: 0; padding: 19px 14px; border-top: 1px solid #c4aa9a66; color: #70675f; }
.note-orbit { color: var(--book-accent, var(--rose)); font-size: 18px; }
.sidebar-note p { margin: 8px 0 0; font-size: 11px; line-height: 1.9; letter-spacing: .08em; }

.archive-main { min-width: 0; }
.archive-intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 0 0 30px; }
.eyebrow { margin: 0 0 7px; color: var(--book-accent, #8f6674); font: 9px/1 Georgia, serif; letter-spacing: .24em; }
.archive-intro h1 { margin: 0; color: var(--ink); font-size: clamp(30px, 3vw, 42px); font-weight: 400; letter-spacing: .14em; }
.archive-subtitle { margin: 9px 0 0; color: var(--ink-soft); font-size: 13px; letter-spacing: .04em; }
.archive-total { display: flex; align-items: baseline; gap: 8px; padding: 0 0 5px; color: var(--ink-soft); white-space: nowrap; }
.archive-total strong { color: var(--book-accent, #8f6674); font: 30px/1 Georgia, serif; }
.archive-total span { font-size: 11px; letter-spacing: .1em; }
.collection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; margin-bottom: 13px; padding-bottom: 11px; border-bottom: 1px solid #c4aa9a55; }
.result-count { margin: 0; color: #71685f; font-size: 11px; letter-spacing: .07em; }
.sort-control { display: flex; align-items: center; gap: 9px; color: #71685f; font-size: 11px; }
.sort-control select { min-height: 34px; padding: 5px 29px 5px 11px; border: 1px solid #c4aa9a77; border-radius: 999px; appearance: none; background: #fffaf1 url("data:image/svg+xml,%3Csvg width='10' height='7' viewBox='0 0 10 7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%235a544d' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat right 11px center; color: var(--ink); cursor: pointer; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 22px; }
.book-card { min-width: 0; border: 1px solid #ddcdbd8c; border-radius: 18px; background: #fffaf18c; box-shadow: 0 7px 22px #584b3d08; transition: transform .25s, box-shadow .25s, background .25s; }
.book-card:hover { transform: translateY(-4px); background: #fffaf1e6; box-shadow: 0 15px 30px #584b3d16; }
.book-card.is-featured { background: color-mix(in srgb, var(--book-accent) 8%, #fffaf1); }
.book-card-link { display: flex; min-height: 100%; flex-direction: column; padding: 15px 15px 17px; color: inherit; text-decoration: none; }
.book-cover-stage { position: relative; display: grid; min-height: clamp(170px, 20vw, 250px); place-items: center; overflow: hidden; border-radius: 12px; background: radial-gradient(ellipse at 50% 80%, color-mix(in srgb, var(--book-accent) 13%, transparent), transparent 67%), linear-gradient(150deg, #fffaf1c2, #f6eee4a8); }
.book-cover { display: block; width: auto; max-width: 67%; height: clamp(145px, 17vw, 218px); object-fit: contain; border-radius: 5px 10px 10px 5px; filter: drop-shadow(8px 10px 8px #493b3026); transform: perspective(700px) rotateY(-7deg); transition: transform .35s, filter .35s; }
.book-card:hover .book-cover { transform: perspective(700px) rotateY(0) translateY(-3px); filter: drop-shadow(11px 15px 10px #493b3035); }
.book-open-mark { position: absolute; right: 10px; bottom: 10px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--book-accent) 25%, transparent); border-radius: 999px; background: #fffaf1d9; color: var(--book-accent); font-size: 9px; letter-spacing: .1em; opacity: 0; transform: translateY(3px); transition: opacity .2s, transform .2s; }
.book-card:hover .book-open-mark, .book-card-link:focus-visible .book-open-mark { opacity: 1; transform: translateY(0); }
.book-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 13px 0 8px; }
.book-category { max-width: 65%; overflow: hidden; color: var(--book-accent); font-size: 9px; letter-spacing: .08em; text-overflow: ellipsis; white-space: nowrap; }
.book-card-count { color: #71685f; font-size: 9px; white-space: nowrap; }
.book-card-title { overflow: hidden; color: var(--ink); font-size: 18px; font-weight: 400; letter-spacing: .09em; text-overflow: ellipsis; white-space: nowrap; }
.book-card-theme { display: -webkit-box; min-height: 38px; margin-top: 6px; overflow: hidden; color: #6d655c; font-size: 11px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.empty-state { padding: 80px 20px; border: 1px dashed #c4aa9a99; border-radius: 18px; color: var(--ink-soft); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state > span { color: var(--book-accent, var(--rose)); font-size: 42px; }
.empty-state h2 { margin: 12px 0 7px; color: var(--ink); font-size: 20px; font-weight: 400; }
.empty-state p { margin: 0 0 19px; font-size: 12px; }
.empty-state button { padding: 9px 16px; border: 1px solid var(--book-accent, var(--rose)); border-radius: 999px; background: transparent; color: var(--book-accent, var(--rose)); cursor: pointer; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 80px; margin-top: 14px; }
.pagination[hidden] { display: none; }
.page-button { min-width: 36px; height: 36px; padding: 0 11px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 11px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.page-button:hover:not(:disabled) { border-color: #c4aa9a88; background: #fffaf1; }
.page-button:disabled { color: #aaa197; cursor: default; }
.page-button.is-current { border-color: var(--book-accent, var(--rose)); background: var(--book-accent, var(--rose)); color: #fffaf4; }
.page-ellipsis { padding: 0 3px; color: #978c81; }
.archive-footer { display: flex; align-items: center; justify-content: center; gap: 13px; padding: 19px 0 0; border-top: 1px solid #c4aa9a55; color: #82786e; font: 8px/1.4 Georgia, serif; letter-spacing: .18em; }
.archive-footer i { width: 28px; height: 1px; background: var(--book-accent, var(--rose)); }
.archive-footer .footer-count { font-family: LXGWBook, "Songti SC", serif; font-size: 9px; letter-spacing: .06em; }
#loading { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: var(--paper); color: var(--rose); font-size: 17px; letter-spacing: .18em; }

@media (max-width: 1240px) {
  .archive-layout { grid-template-columns: 205px minmax(0, 1fr); gap: 34px; }
  .book-grid { gap: 17px; }
  .book-cover-stage { min-height: 205px; }
  .book-cover { height: 178px; }
}
@media (max-width: 900px) {
  .archive-header { grid-template-columns: auto minmax(220px, 1fr); }
  .archive-edition { display: none; }
  .archive-layout { grid-template-columns: 1fr; gap: 28px; padding-top: 30px; }
  .archive-sidebar { position: static; min-height: 0; padding: 0; border: 0; }
  .sidebar-heading, .sidebar-note { display: none; }
  .category-list { display: flex; gap: 7px; overflow-x: auto; padding: 2px 1px 7px; scrollbar-width: thin; }
  .category-button { flex: 0 0 auto; width: auto; min-height: 38px; padding: 7px 12px; border-color: #ddcdbd88; background: #fffaf17a; font-size: 12px; }
  .book-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
  .book-cover-stage { min-height: clamp(170px, 26vw, 230px); }
  .book-cover { height: clamp(145px, 21vw, 198px); }
}
@media (max-width: 600px) {
  .archive-header { grid-template-columns: 1fr; gap: 15px; padding: 16px 18px; }
  .archive-brand strong { font-size: 17px; }
  .archive-search { height: 43px; }
  .archive-layout { gap: 18px; padding: 20px 16px 22px; }
  .archive-intro { margin-bottom: 19px; }
  .archive-intro h1 { font-size: 29px; }
  .archive-subtitle { max-width: 260px; font-size: 11px; }
  .archive-total strong { font-size: 25px; }
  .collection-toolbar { margin-bottom: 9px; }
  .sort-control { gap: 5px; }
  .sort-control select { max-width: 110px; padding-left: 8px; font-size: 10px; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .book-card { border-radius: 15px; }
  .book-card-link { padding: 9px 9px 12px; }
  .book-cover-stage { min-height: clamp(142px, 49vw, 205px); border-radius: 10px; }
  .book-cover { max-width: 72%; height: clamp(125px, 42vw, 180px); }
  .book-open-mark { display: none; }
  .book-card-meta { align-items: flex-start; flex-direction: column; gap: 3px; margin: 9px 0 6px; }
  .book-category { max-width: 100%; font-size: 8px; }
  .book-card-count { font-size: 8px; }
  .book-card-title { font-size: 15px; }
  .book-card-theme { min-height: 34px; font-size: 10px; line-height: 1.6; }
  .pagination { gap: 2px; min-height: 66px; }
  .page-button { min-width: 31px; height: 34px; padding: 0 7px; font-size: 10px; }
  .page-button:first-child, .page-button:last-child { padding: 0 8px; }
  .archive-footer { flex-wrap: wrap; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
