/* A reading room, in the site's existing paper and sage palette. */
.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; }
.shelf-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; padding: 66px 0 58px; min-height: 420px; }
.shelf-hero .eyebrow { display: flex; align-items: center; gap: 10px; }
.shelf-hero h1 { font-size: clamp(42px,5.4vw,62px); line-height: 1.3; letter-spacing: -2px; margin: 22px 0 20px; }
.shelf-hero h1 > span, .shelf-heading h2 > span { color: #82a44d; }
.shelf-hero-copy > p:not(.eyebrow) { font-size: 14px; color: var(--text-secondary); line-height: 1.95; }
.shelf-art { position: relative; height: 295px; display: grid; place-items: center; }
.shelf-art::before { content: ''; position: absolute; width: 280px; height: 280px; border-radius: 50%; border: 1px dashed #cbd5ba; background: radial-gradient(circle,#dfe9c566,transparent 70%); }
.book-stack { position: relative; width: 315px; height: 205px; display: flex; align-items: end; justify-content: center; gap: 10px; z-index: 1; }
.art-book { display: flex; flex-direction: column; justify-content: space-between; height: 198px; width: 91px; padding: 24px 15px 15px; border-radius: 4px 10px 10px 4px; border-left: 6px solid #0002; box-shadow: 6px 7px 12px #25372d12,inset -4px 0 #fff2; }
.art-book span { font-size: 24px; letter-spacing: 3px; line-height: 1.4; font-weight: 600; }
.art-book i { font: 6px/1.7 monospace; letter-spacing: 1px; }
.art-book-one { background: #cad9ab; color: #4f6540; height: 176px; transform: rotate(-12deg) translateY(-5px); }
.art-book-two { background: #355844; color: #edf3da; height: 210px; transform: rotate(-3deg); }
.art-book-three { background: #e5cda2; color: #6e5940; height: 187px; transform: rotate(10deg) translateY(-5px); }
.art-shelf-line { position: absolute; bottom: 43px; width: 335px; height: 9px; background: #d0d9be; border-radius: 3px; box-shadow: 0 9px 12px #25372d08; }
.shelf-art-note { position: absolute; bottom: 0; font-size: 10px; color: var(--text-secondary); letter-spacing: 1px; }
.continue-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 23px 28px; margin-bottom: 38px; border: 1px solid #d8e2c8; border-radius: 14px; background: #edf1e4; }
.continue-panel > div { min-width: 0; }
.continue-panel h2 { font-size: 18px; line-height: 1.5; margin: 6px 0; overflow-wrap: anywhere; }
.continue-panel > div > p:last-child { color: var(--text-secondary); font-size: 11px; }
.shelf-button { display: inline-flex; align-items: center; justify-content: center; gap: 21px; padding: 11px 19px; font-size: 12px; font-weight: 600; text-decoration: none; border: 1px solid var(--text); color: var(--bg); background: var(--text); border-radius: 7px; white-space: nowrap; flex-shrink: 0; transition: background .2s,transform .2s; }
.shelf-button:hover { background: var(--accent); transform: translateY(-2px); }
.shelf-button.secondary { background: transparent; color: var(--text); border-color: #c9d3bd; }
.shelf-button.secondary:hover { background: #e9efdc; }
#my-books { scroll-margin-top: 108px; }
.shelf-heading { padding: 30px 0 26px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.shelf-heading h2 { font-size: 25px; letter-spacing: -.8px; margin-top: 4px; }
#shelf-count { font-size: 11px; color: var(--text-secondary); padding-bottom: 3px; }
.shelf-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 100px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.search-wrap > span:first-child { font-size: 25px; line-height: 1; color: #7e8c73; }
.search-wrap input { font: inherit; font-size: 12px; border: 0; background: none; color: var(--text); width: 100%; padding: 12px 0; min-width: 0; outline: none; }
.search-wrap:focus-within { outline: 2px solid #9db67b; outline-offset: 2px; }
.filter-wrap { display: block; min-width: 0; }
.filter-wrap select { font: inherit; font-size: 11px; height: 45px; max-width: 160px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 0 26px 0 12px; color: var(--text-secondary); cursor: pointer; }
.refresh-button { border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text-secondary); padding: 0 13px; font-size: 11px; cursor: pointer; flex-shrink: 0; }
.refresh-button > span { font-size: 17px; vertical-align: -1px; margin-right: 3px; }
.refresh-button:hover { color: var(--accent); border-color: #9db67b; }
.refresh-button:disabled { opacity: .5; cursor: wait; }
.shelf-browse-tools { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.reading-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.reading-filters button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 11px; padding: 8px 12px; border: 1px solid transparent; border-radius: 6px; color: var(--text-secondary); background: transparent; cursor: pointer; }
.reading-filters button:hover { background: #edf1e4; }
.reading-filters button[aria-pressed="true"] { color: #355844; border-color: #cbd9b9; background: #e7edda; font-weight: 600; }
.reading-filters button > span { font-variant-numeric: tabular-nums; opacity: .7; }
.sort-wrap { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-secondary); }
.sort-wrap select { font: inherit; color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; background: var(--surface); cursor: pointer; }
.reading-filters button:focus-visible, .sort-wrap select:focus-visible, .filter-wrap select:focus-visible, .refresh-button:focus-visible, .book-card:focus-visible { outline: 2px solid #7e9d5f; outline-offset: 4px; }
.shelf-status { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; min-height: 20px; }
.shelf-status:empty { min-height: 0; margin: 0; }
.shelf-warning { font-size: 12px; line-height: 1.8; border: 1px solid #e2d7b4; border-radius: 8px; padding: 12px 16px; color: #776137; background: #f6f0df; margin-bottom: 20px; }
.book-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 28px 24px; }
.book-card { text-decoration: none; min-width: 0; display: flex; flex-direction: column; }
.book-visual { position: relative; aspect-ratio: 3 / 4; border-radius: 4px 11px 11px 4px; overflow: hidden; background: var(--cover-bg); color: var(--cover-ink); border-left: 7px solid #00000016; box-shadow: 4px 5px 0 #c8cbb955,5px 9px 18px #25372d0b; transition: transform .35s var(--ease),box-shadow .35s; isolation: isolate; }
.book-visual::after { content: ''; position: absolute; inset: 0; border-right: 4px solid #ffffff1a; pointer-events: none; border-radius: inherit; }
.book-card:hover .book-visual { transform: translateY(-6px) rotate(-1deg); box-shadow: 5px 6px 0 #c8cbb955,6px 15px 24px #25372d16; }
.book-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.cover-content { display: flex; flex-direction: column; height: 100%; padding: 23px 18px 18px; position: relative; }
.cover-number { font: 8px/1.5 monospace; letter-spacing: 1.5px; opacity: .7; }
.cover-title { font-family: 'Noto Serif SC','Songti SC',SimSun,serif; font-size: clamp(20px,2.1vw,27px); font-weight: 600; line-height: 1.55; margin-top: 18px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cover-rule { width: 26px; height: 1px; background: currentColor; opacity: .4; margin-top: 19px; }
.cover-author { font-size: 10px; opacity: .8; margin-top: auto; padding-top: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-format { position: absolute; bottom: 13px; right: 13px; z-index: 3; border-radius: 4px; padding: 2px 6px; font: 8px/1.7 monospace; letter-spacing: 1px; background: #fffdf0e6; color: #43543a; }
.book-copy { padding: 17px 0 0; }
.book-copy h3 { font-size: 14px; font-weight: 600; line-height: 1.65; overflow-wrap: anywhere; }
.book-author { font-size: 11px; color: var(--text-secondary); margin-top: 3px; overflow-wrap: anywhere; }
.book-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; color: #7a856e; margin-top: 10px; }
.book-bottom > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-bottom > span:last-child { flex-shrink: 0; }
.book-reading-state.is-finished { color: #355844; font-weight: 600; }
.book-meter { margin-top: 10px; height: 3px; background: #e2e8d8; border-radius: 5px; overflow: hidden; }
.book-meter > span { display: block; height: 100%; background: #91ab6a; }
.empty-shelf { text-align: center; padding: 55px 24px 60px; background: #f0f3e8; border: 1px dashed #cdd7bd; border-radius: 14px; }
.empty-symbol { font-size: 40px; color: #8b9e73; }
.empty-shelf h3 { font-size: 18px; margin: 12px 0 9px; }
.empty-shelf p { font-size: 12px; color: var(--text-secondary); margin-bottom: 24px; }
.import-guide { margin-top: 50px; padding: 0 23px; border: 1px solid var(--border); border-radius: 12px; }
.import-guide summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 18px 0; list-style: none; }
.import-guide summary::-webkit-details-marker { display: none; }
.import-guide summary > span:first-child > span { color: #7d9861; margin-right: 8px; font-size: 17px; }
.guide-chevron { transition: transform .2s; }
.import-guide[open] .guide-chevron { transform: rotate(180deg); }
.import-content { border-top: 1px solid var(--border); padding: 18px 0 22px; }
.import-content p { font-size: 12px; color: var(--text-secondary); line-height: 1.95; margin-bottom: 12px; }
.import-content code { font-size: 11px; background: #e9eddf; color: var(--text); padding: 2px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.import-link { display: inline-flex; gap: 20px; font-size: 12px; text-underline-offset: 4px; margin: 3px 0 16px; }
.import-content .guide-footnote { font-size: 10px; margin: 0; }
@media (max-width:800px) { .book-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 25px 20px; } .shelf-hero { gap: 10px; } .book-stack { transform: scale(.85); } .art-shelf-line { width: 285px; bottom: 51px; } .shelf-art::before { width: 250px; height: 250px; } }
@media (max-width:600px) {
  .shelf-hero { grid-template-columns: minmax(0,1fr); padding: 40px 0 30px; gap: 8px; }
  .shelf-hero h1 { font-size: 46px; margin: 20px 0 16px; }
  .shelf-hero-copy > p:not(.eyebrow) { font-size: 13px; }
  .shelf-art { height: 240px; width: 100%; min-width: 0; max-width: 350px; justify-self: center; }
  .shelf-art::before { width: 220px; height: 220px; }
  .book-stack { transform: scale(.8); }
  .art-shelf-line { bottom: 30px; width: 280px; }
  .shelf-art-note { bottom: -8px; font-size: 9px; }
  .continue-panel { padding: 20px; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
  .continue-panel .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .continue-panel h2 { font-size: 16px; }
  .continue-panel .shelf-button { padding: 9px 14px; font-size: 11px; }
  .shelf-heading { padding: 25px 0 22px; }
  .shelf-heading h2 { font-size: 23px; }
  .shelf-toolbar { flex-wrap: wrap; gap: 8px; }
  .shelf-browse-tools { gap: 10px; }
  .reading-filters { flex: 1 1 100%; gap: 4px; }
  .reading-filters button { flex: 1; padding: 9px 5px; justify-content: center; }
  .sort-wrap { margin-left: auto; }
  .search-wrap { flex-basis: 100%; }
  .filter-wrap { flex: 1; }
  .filter-wrap select { width: 100%; max-width: none; height: 40px; }
  .refresh-button { height: 40px; }
  .book-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 27px 19px; }
  .book-visual { border-left-width: 5px; }
  .cover-content { padding: 18px 13px 16px; }
  .cover-title { font-size: 23px; margin-top: 15px; -webkit-line-clamp: 3; }
  .cover-rule { margin-top: 12px; }
  .cover-number { font-size: 7px; letter-spacing: 1px; }
  .cover-author { font-size: 9px; }
  .book-copy h3 { font-size: 13px; }
  .book-author { font-size: 10px; }
  .book-bottom { font-size: 9px; }
  .import-guide { margin-top: 34px; padding: 0 17px; }
  .empty-shelf { padding: 40px 16px; }
}
@media (max-width:390px) { .cover-title { font-size: 20px; } }
@media (prefers-reduced-motion:reduce) { .book-visual, .shelf-button, .guide-chevron { transition: none; } .book-card:hover .book-visual, .shelf-button:hover { transform: none; } }
