:root {
  color-scheme: light;
  --paper-ink: #49372c;
  --paper-text: #4e4438;
  --paper-muted: #958a7a;
  --paper-line: #e5dfd5;
  --paper-brown: #49372c;
  --paper-dark: #352a21;
  --paper-gold: #a78025;
  --paper-cream: #f5f2eb;
  scrollbar-gutter: stable;
}
* { box-sizing: border-box; }
body.papers-page { margin: 0; background: #eeece7; color: var(--paper-text); font: 14px/1.5 Arial,"PingFang SC","Microsoft YaHei",sans-serif; }
.papers-page button,.papers-page input,.papers-page select { font: inherit; }
.papers-page button { cursor: pointer; }
.papers-page button:disabled { opacity: .45; cursor: default; }
.papers-page button:focus-visible,.papers-page a:focus-visible,.papers-page input:focus-visible,.papers-page select:focus-visible { outline: 2px solid #b3934b; outline-offset: 3px; }
.papers-page [hidden] { display: none !important; }
.papers-main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 36px; min-height: calc(100dvh - 150px); min-width: 0; }
.papers-intro { display: flex; align-items: center; justify-content: space-between; min-height: 124px; margin: 0; padding: 21px 24px; gap: 24px; color: #fff; background: var(--paper-dark); border-bottom: 1px solid #5b4939; }
.papers-eyebrow { margin: 0 0 5px; color: #bfa678; font-size: 10px; letter-spacing: 1.5px; }
.papers-intro h1 { margin: 0; color: #fff; font-size: 25px; font-weight: 700; letter-spacing: .5px; line-height: 1.3; }
.papers-description { margin: 6px 0 0; color: #c6bcb0; font-size: 12px; }
.papers-source { margin-left: 10px; color: #b8b8b8; font-size: 12px; font-weight: 400; }
.papers-summary { display: flex; align-items: baseline; gap: 7px; color: #c3b69f; white-space: nowrap; }
.papers-summary strong { color: #debb69; font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; }
.papers-summary span { font-size: 12px; }
.papers-panel { overflow: hidden; background: #fff; border: 1px solid var(--paper-line); border-top: 0; }
.papers-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 18px; min-height: 50px; background: var(--paper-brown); border-bottom: 2px solid #ac8a42; }
#paper-categories { display: flex; align-items: stretch; flex-wrap: nowrap; gap: 5px; height: auto; min-height: 0; z-index: auto; }
#paper-categories button { position: relative; padding: 15px 17px 13px; min-width: 95px; border: 0; background: transparent; color: #d2c9bd; font-size: 14px; font-weight: 600; white-space: nowrap; }
#paper-categories button:hover { background: #ffffff09; color: #f0e7d8; }
#paper-categories button.active { color: #debb69; background: #352a213b; }
#paper-categories button.active::after { content: ""; position: absolute; bottom: -2px; left: 17px; right: 17px; height: 3px; background: #debb69; }
.paper-search { display: flex; align-items: center; gap: 8px; width: 216px; height: 33px; padding: 0 10px; border: 1px solid #d7cfc1; border-radius: 3px; background: #fff; color: #a3947f; }
.paper-search:focus-within { outline: 2px solid #b3934b; outline-offset: 2px; }
.paper-search svg { flex-shrink: 0; }
.paper-search input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #514637; font-size: 12px; }
.paper-search input::placeholder { color: #a3998c; }
#paper-letters { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; height: auto; min-height: 0; padding: 15px 18px; border-bottom: 1px solid var(--paper-line); background: var(--paper-cream); z-index: auto; }
#paper-letters button { min-width: 29px; min-height: 29px; padding: 3px 8px; border: 1px solid #ddd5c8; border-radius: 3px; background: #fff; color: #796b5b; font: 12px/21px Arial,"PingFang SC","Microsoft YaHei",sans-serif; transition: color .15s,background .15s; }
#paper-letters button:hover { border-color: #baa06e; color: #7d601f; }
#paper-letters button.active { background: var(--paper-gold); border-color: var(--paper-gold); color: #fff; font-weight: 600; }
.paper-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; padding: 13px 18px; border-bottom: 1px solid #ebe6dd; background: #faf8f3; }
#paper-list-title { color: #5d4d36; font-size: 13px; font-weight: 700; }
#paper-list-count { color: #9a8b75; font-size: 11px; }
#paper-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 23px 18px; align-items: start; min-height: 320px; padding: 20px 18px 6px; }
.paper-card { position: relative; min-width: 0; background: #fff; }
.paper-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; }
.paper-poster { display: flex; align-items: center; justify-content: center; position: relative; aspect-ratio: 3/4; width: 100%; overflow: hidden; border: 1px solid #ded6c8; background: #f6f3ed; transition: border-color .15s,box-shadow .15s; }
.paper-poster img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; background: #fff; }
.paper-card:hover .paper-poster { border-color: #b2955b; box-shadow: 0 3px 12px #49372c12; }
.paper-poster-placeholder { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; padding: 12px; color: #a49884; font-size: 12px; text-align: center; }
.paper-poster-placeholder svg { opacity: .6; }
.paper-card-copy { display: block; padding: 10px 0 0; }
.paper-card-copy strong { display: block; overflow: hidden; color: #59472e; font-size: 14px; font-weight: 600; line-height: 22px; white-space: nowrap; text-overflow: ellipsis; }
.paper-card-period { display: block; margin-top: 2px; color: #a09585; font-size: 11px; font-variant-numeric: tabular-nums; }
.paper-star { position: absolute; right: 5px; top: 5px; z-index: 1; width: 29px; height: 29px; padding: 0; border: 1px solid #ded6c8; border-radius: 3px; background: #fffffff2; color: #b2a48e; font-size: 19px !important; line-height: 26px; text-align: center; }
.paper-star:hover,.paper-star.saved { color: #a78025; border-color: #b99e66; }
.paper-empty { grid-column: 1/-1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; min-height: 320px; padding: 30px; color: #a09585; font-size: 13px; text-align: center; }
.paper-empty button,.paper-pagination button { padding: 8px 26px; border: 1px solid #d7c6a1; border-radius: 3px; background: #f8f3e8; color: #8b6a2e; font-size: 12px; }
.paper-empty button:hover,.paper-pagination button:hover { border-color: #b89a60; background: #fffaf0; }
.paper-pagination { min-height: 44px; padding: 25px 18px; text-align: center; }
#paper-notice { margin: 0; padding: 10px 18px; border-bottom: 1px solid #e9dbb9; background: #fff8e8; color: #8b682b; font-size: 12px; }
html.paper-modal-open { overflow: hidden; }
.papers-page dialog { padding: 0; max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); border: 1px solid #b8a990; border-radius: 5px; background: #fff; color: var(--paper-text); box-shadow: 0 20px 80px #241b1866; overscroll-behavior: contain; }
.papers-page dialog::backdrop { background: #241b2170; }
#paper-dialog { width: 980px; }
.paper-dialog-heading { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 3; height: 78px; padding: 15px 22px; border-bottom: 1px solid #66513c; background: var(--paper-brown); }
.paper-dialog-heading p { margin: 0 0 4px; color: #c3b69f; font-size: 11px; }
.paper-dialog-heading h2 { margin: 0; color: #f5eee2; font-size: 20px; font-weight: 650; }
.paper-dialog-heading>button,#paper-zoom-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid #8c7860; border-radius: 3px; background: #ffffff08; color: #e4d9c7; font-size: 24px !important; line-height: 1; }
.paper-dialog-heading>button:hover,#paper-zoom-close:hover { background: #ffffff15; }
.paper-detail-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; position: sticky; top: 78px; z-index: 2; min-height: 62px; padding: 13px 22px; border-bottom: 1px solid #dfd4c1; background: #f1ece2; color: #8a795f; font-size: 12px; }
.paper-detail-tools input,.paper-detail-tools select { height: 33px; margin-left: 5px; padding: 0 8px; border: 1px solid #d7cfc1; border-radius: 3px; background: #fff; color: #514637; font-size: 12px; }
.paper-detail-tools input { width: 78px; }
.paper-detail-tools button { height: 33px; padding: 0 12px; border: 1px solid #d7cfc1; border-radius: 3px; background: #fff; color: #796b5b; font-size: 12px; }
.paper-detail-tools button:hover { border-color: #baa06e; color: #7d601f; }
#paper-save { margin-left: auto; }
#paper-save[aria-pressed="true"] { border-color: var(--paper-gold); background: var(--paper-gold); color: #fff; }
.paper-detail-caption { display: flex; justify-content: space-between; gap: 12px; padding: 13px 22px; color: #a09585; font-size: 12px; }
#paper-images { min-height: 360px; padding: 0 22px 22px; background: #eeece7; }
#paper-images figure { margin: 0 0 22px; border: 1px solid #ded6c8; background: #fff; text-align: center; }
#paper-images img { display: block; width: 100%; height: 100%; max-width: 100%; margin: 0 auto; object-fit: contain; object-position: top center; background: #fff; cursor: zoom-in; }
#paper-images figcaption { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid #e5dfd5; color: #a09585; font-size: 12px; }
#paper-images figcaption a { display: inline-flex; align-items: center; gap: 5px; padding: 4px; color: #927038; text-decoration: none; }
.paper-image-button { display: block; aspect-ratio: 3/4; width: 100%; overflow: hidden; padding: 0; border: 0; background: #fff; }
#paper-zoom { width: calc(100vw - 32px); height: calc(100dvh - 32px); max-width: none; overflow: hidden; background: #eeece7; }
.paper-zoom-tools { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 1; height: 58px; padding: 0 18px; border-bottom: 1px solid #66513c; background: var(--paper-brown); }
.paper-zoom-tools>span { overflow: hidden; margin-right: auto; color: #e4d9c7; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.paper-zoom-tools>button:not(#paper-zoom-close) { width: 32px; height: 32px; border: 1px solid #8c7860; border-radius: 3px; background: #ffffff08; color: #debb69; }
.paper-zoom-tools>a { padding: 4px 7px; color: #debb69; font-size: 12px; text-decoration: none; white-space: nowrap; }
.paper-zoom-scroll { display: block; height: calc(100% - 58px); overflow: auto; padding: 24px; overscroll-behavior: contain; text-align: center; }
#paper-zoom-image { display: block; width: 100%; height: auto; max-width: none; margin: auto; transform-origin: top left; }
.paper-load-failed { padding: 20px; color: #8a724f; font-size: 12px; }
html:not(.paper-browse-mode) .papers-intro,html:not(.paper-browse-mode) .papers-panel { display: none; }
html.paper-browse-mode #paper-landing { display: none; }
#paper-landing .paper-star { display: none; }
#paper-landing .paper-card-copy { padding-top: 9px; }
#paper-landing .paper-card-period { margin-top: 2px; }
#paper-landing .paper-empty { grid-column: 1/-1; min-height: 300px; }
#paper-landing-grid { min-height: 300px; }
@media(max-width:1100px) { #paper-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 20px 14px; } }
@media(max-width:850px) {
  #paper-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .papers-toolbar { padding: 0 15px; gap: 16px; }
  .paper-search { width: 185px; }
  #paper-categories button { min-width: 88px; padding-left: 12px; padding-right: 12px; }
}
@media(max-width:640px) {
  .papers-main { padding: 20px 8px 24px; }
  .papers-intro { padding: 20px 15px; gap: 12px; min-height: 123px; }
  .papers-intro h1 { font-size: 23px; }
  .papers-eyebrow { font-size: 9px; letter-spacing: 1px; }
  .papers-description { font-size: 11px; }
  .papers-summary { flex-direction: column; align-items: center; gap: 0; }
  .papers-summary strong { font-size: 22px; }
  .papers-summary span { font-size: 10px; }
  .papers-toolbar { flex-wrap: wrap; gap: 0; padding: 0 12px 12px; }
  .paper-search { width: 100%; height: 34px; margin-top: 8px; }
  #paper-categories { width: 100%; gap: 0; }
  #paper-categories button { flex: 1; min-width: 0; padding: 14px 10px 12px; font-size: 13px; }
  #paper-categories button.active::after { left: 10px; right: 10px; }
  #paper-letters { padding: 12px; gap: 4px; }
  #paper-letters button { min-width: 25px; min-height: 27px; padding: 2px 6px; font-size: 11px; }
  .paper-list-heading { padding: 12px; }
  #paper-list-title { font-size: 12px; }
  #paper-list-count { font-size: 10px; }
  #paper-grid { padding: 15px 12px 6px; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px 10px; }
  .paper-card-copy { padding-top: 8px; }
  .paper-card-copy strong { font-size: 12px; line-height: 19px; }
  .paper-card-period { font-size: 10px; }
  .paper-star { width: 25px; height: 25px; font-size: 17px !important; line-height: 22px; }
  .paper-poster-placeholder { padding: 6px; font-size: 10px; }
  .paper-poster-placeholder svg { width: 25px; }
  #paper-landing-grid>.paper-empty { min-width: 100%; }
  #paper-landing .paper-card-copy strong { font-size: 13px; }
  #paper-landing .paper-card-period { font-size: 10px; }
  .paper-dialog-heading { padding: 14px 15px; height: 74px; }
  .paper-dialog-heading h2 { font-size: 18px; }
  .paper-detail-tools { padding: 10px 12px; gap: 8px; top: 74px; }
  .paper-detail-tools select { max-width: 150px; }
  .paper-detail-caption { padding: 12px; font-size: 11px; }
  .paper-detail-caption>span:last-child { display: none; }
  #paper-images { padding: 0 10px 14px; }
  #paper-images figcaption { font-size: 11px; }
  #paper-save { margin-left: 0; }
  .papers-page dialog { max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  #paper-zoom { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
  .paper-zoom-tools { padding: 0 10px; gap: 7px; }
  .paper-zoom-tools>span { font-size: 11px; }
  .paper-zoom-tools>a { font-size: 11px; padding: 0; }
  .paper-zoom-scroll { padding: 10px; }
}
@media(prefers-reduced-motion:reduce) { .paper-poster,#paper-letters button { transition: none; } }
