:root {
    --paper: #f8f4eb;
    --paper-light: #fffdf8;
    --paper-deep: #eadcc2;
    --paper-warm: #f1e7d6;
    --cinnabar: #96362f;
    --cinnabar-strong: #7a2925;
    --cinnabar-dark: #55201e;
    --gold: #c39750;
    --gold-light: #e2c792;
    --ink: #2c2722;
    --ink-soft: #655c53;
    --muted: #82786e;
    --border: #dfcfb5;
    --border-strong: #c9ad7b;
    --success: #39745b;
    --warning: #a96827;
    --danger: #a23b34;
    --shadow-sm: 0 4px 16px rgba(73, 48, 28, .08);
    --shadow-md: 0 12px 35px rgba(73, 48, 28, .12);
    --shadow-lg: 0 24px 70px rgba(58, 34, 20, .18);
    --container: 1360px;
    --header-height: 78px;
    --font-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
    --font-sans: "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper) url("/static/assets/portal/paper-texture.svg") repeat; font-family: var(--font-serif); font-size: 16px; line-height: 1.75; text-rendering: optimizeLegibility; }
body.is-nav-open, body.is-modal-open, body.is-filter-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
input, select, textarea { min-height: 44px; border: 1px solid var(--border); border-radius: 7px; background: rgba(255, 255, 255, .82); padding: .65rem .85rem; outline: none; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--cinnabar); box-shadow: 0 0 0 3px rgba(150, 54, 47, .13); background: #fff; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--cinnabar); }
:focus-visible { outline: 3px solid rgba(150, 54, 47, .38); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.3; font-weight: 600; }
address { font-style: normal; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.portal-container { width: min(calc(100% - 48px), var(--container)); margin-inline: auto; }
.portal-main { min-height: 56vh; overflow: hidden; }
.portal-section { padding: 72px 0; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 10000; transform: translateY(-160%); padding: .7rem 1rem; border-radius: 6px; color: #fff; background: var(--cinnabar-dark); }
.skip-link:focus { transform: translateY(0); }
.text-cinnabar { color: var(--cinnabar); font-weight: 700; }

.portal-eyebrow { margin-bottom: .45rem; color: var(--cinnabar); font-family: var(--font-sans); font-size: .76rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.portal-section-heading { margin-bottom: 34px; }
.portal-section-heading > span, .portal-section-heading > div > span { color: var(--gold); font-family: var(--font-sans); font-size: .76rem; font-weight: 700; letter-spacing: .18em; }
.portal-section-heading h2 { margin: .25rem 0 0; font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: .1em; }
.portal-section-heading--center { text-align: center; }
.portal-section-heading--center h2::before, .portal-section-heading--center h2::after { content: ""; display: inline-block; width: clamp(42px, 6vw, 92px); height: 1px; margin: 0 18px .35em; background: linear-gradient(90deg, transparent, var(--gold)); }
.portal-section-heading--center h2::after { background: linear-gradient(90deg, var(--gold), transparent); }
.portal-section-heading--center > p { margin: .75rem 0 0; color: var(--muted); }
.portal-section-heading--row { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.portal-section-heading--row > a { color: var(--cinnabar); font-family: var(--font-sans); font-size: .9rem; }
.portal-section__action { margin: 34px 0 0; text-align: center; }

.portal-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: .5rem; border: 1px solid transparent; border-radius: 7px; padding: .65rem 1.25rem; font-family: var(--font-sans); font-weight: 600; line-height: 1.2; transition: transform .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease, border-color .18s ease; }
.portal-button:hover { transform: translateY(-1px); }
.portal-button:disabled { cursor: wait; transform: none; opacity: .68; }
.portal-button.is-loading svg { animation: search-pulse .8s ease-in-out infinite alternate; }
.portal-button--primary { color: #fffaf0; border-color: var(--cinnabar); background: linear-gradient(135deg, #a64038, #7e2925); box-shadow: 0 6px 16px rgba(126, 41, 37, .2); }
.portal-button--primary:hover { background: linear-gradient(135deg, #b14940, #70231f); box-shadow: 0 9px 22px rgba(126, 41, 37, .28); }
.portal-button--ghost { color: var(--ink); border-color: var(--border); background: rgba(255, 253, 248, .74); }
.portal-button--ghost:hover { color: var(--cinnabar); border-color: var(--cinnabar); background: #fffdf8; }
.portal-button--line { min-height: 38px; padding: .45rem 1.7rem; color: var(--ink-soft); border-color: var(--gold-light); background: transparent; }
.portal-button--line:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
.portal-button--small { min-height: 40px; padding: .5rem 1rem; font-size: .9rem; }
.portal-button--block { width: 100%; }

.portal-header { position: relative; z-index: 100; height: var(--header-height); border-bottom: 1px solid rgba(187, 159, 111, .35); background: rgba(255, 253, 248, .94); backdrop-filter: blur(16px); }
.portal-header__inner { display: flex; height: 100%; align-items: center; gap: clamp(18px, 3vw, 46px); }
.portal-brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 11px; }
.portal-brand__mark { width: 46px; height: 46px; }
.portal-brand__copy { display: grid; line-height: 1.15; }
.portal-brand__copy strong { font-size: 1.35rem; letter-spacing: .12em; white-space: nowrap; }
.portal-header .portal-brand__wordmark { display: block; line-height: 0; }
.portal-header .portal-brand__wordmark img { display: block; width: 142px; height: auto; }
.portal-brand__copy small { margin-top: 4px; color: var(--muted); font-family: Georgia, serif; font-size: .62rem; letter-spacing: .06em; white-space: nowrap; }
.portal-nav { display: flex; flex: 1; align-items: stretch; justify-content: center; align-self: stretch; gap: clamp(14px, 2.1vw, 34px); }
.portal-nav a { position: relative; display: grid; align-items: center; color: #453d36; font-size: .98rem; white-space: nowrap; }
.portal-nav a::after { content: ""; position: absolute; right: 12%; bottom: 0; left: 12%; height: 3px; transform: scaleX(0); background: var(--cinnabar); transition: transform .2s ease; }
.portal-nav a:hover, .page-home .portal-nav [data-nav="home"], .page-search .portal-nav [data-nav="search"], .page-detail .portal-nav [data-nav="search"], .page-about .portal-nav [data-nav="about"] { color: var(--cinnabar); }
.portal-nav a:hover::after, .page-home .portal-nav [data-nav="home"]::after, .page-search .portal-nav [data-nav="search"]::after, .page-detail .portal-nav [data-nav="search"]::after, .page-about .portal-nav [data-nav="about"]::after { transform: scaleX(1); }
.portal-header__actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; font-family: var(--font-sans); }
.portal-user-link { display: inline-flex; min-height: 44px; align-items: center; gap: .45rem; border: 1px solid var(--border); border-radius: 7px; padding: .45rem .8rem; white-space: nowrap; }
.portal-user-link:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
.portal-user-menu { position: relative; }
.portal-user-menu summary { list-style: none; cursor: pointer; }
.portal-user-menu summary::-webkit-details-marker { display: none; }
.portal-user-menu summary img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.portal-user-menu summary svg { width: 14px; transition: transform .18s ease; }
.portal-user-menu[open] summary { color: var(--cinnabar); border-color: var(--cinnabar); background: #fffaf1; }
.portal-user-menu[open] summary svg { transform: rotate(180deg); }
.portal-user-menu__panel { position: absolute; top: calc(100% + 12px); right: 0; z-index: 130; display: grid; width: 230px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fffdf8; box-shadow: var(--shadow-lg); }
.portal-user-menu__panel::before { position: absolute; top: -7px; right: 28px; width: 13px; height: 13px; content: ""; border-top: 1px solid var(--border); border-left: 1px solid var(--border); background: #fffdf8; transform: rotate(45deg); }
.portal-user-menu__panel > div { display: grid; padding: 17px 18px 13px; background: #f4ead9; }
.portal-user-menu__panel > div span { color: var(--muted); font-size: .76rem; }
.portal-user-menu__panel > a, .portal-user-menu__panel form button { display: flex; width: 100%; min-height: 43px; align-items: center; border-top: 1px solid #eee2cf; padding: 0 18px; background: transparent; font-size: .86rem; text-align: left; }
.portal-user-menu__panel > a:hover, .portal-user-menu__panel form button:hover { color: var(--cinnabar); background: #fbf4e8; }
.portal-user-menu__panel form button { color: var(--danger); }
.portal-nav__mobile-account { display: none !important; }
.portal-nav-toggle { display: none; width: 46px; height: 46px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--border); border-radius: 7px; background: var(--paper-light); }
.portal-nav-toggle span { width: 22px; height: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }

.portal-footer { position: relative; overflow: hidden; padding-top: 58px; color: #efe5d3; background: linear-gradient(135deg, #642421, #321c1b); }
.portal-footer::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 170px; background: url("/static/assets/portal/ink-landscape.svg") center bottom / 100% 100% no-repeat; opacity: .18; pointer-events: none; }
.portal-footer__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 58px; padding-bottom: 42px; }
.portal-brand--light .portal-brand__copy small, .portal-footer p, .portal-footer span, .portal-footer a { color: #d8c7b4; }
.portal-footer h2 { margin-bottom: 15px; color: #f2d9a7; font-size: 1rem; letter-spacing: .12em; }
.portal-footer__grid > div:not(:first-child) { display: flex; flex-direction: column; gap: 8px; }
.portal-footer a:hover { color: #fff5d9; }
.portal-footer__brand p { max-width: 380px; margin: 18px 0 0; }
.portal-footer__bottom { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 32px; border-top: 1px solid rgba(231, 198, 139, .25); padding: 20px 0 26px; font-family: var(--font-sans); font-size: .8rem; }

.portal-flash { position: relative; z-index: 90; color: #59431e; background: #f8eaca; border-bottom: 1px solid #e2c58b; font-family: var(--font-sans); }
.portal-flash--success { color: #214f3c; background: #e1efe7; border-color: #add1bc; }
.portal-flash--error { color: #762923; background: #f5dfdc; border-color: #dba7a1; }
.portal-flash__inner { display: flex; min-height: 48px; align-items: center; gap: 10px; }
.portal-flash__inner p { flex: 1; margin: 0; }
.portal-flash__mark { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.portal-flash button { width: 40px; height: 40px; background: transparent; font-size: 1.35rem; }
.portal-toast { position: fixed; right: 24px; bottom: 24px; z-index: 1000; display: flex; width: max-content; max-width: min(520px, calc(100vw - 48px)); transform: translateY(18px); align-items: center; gap: 14px; border: 1px solid #cba66e; border-radius: 8px; padding: 12px 14px 12px 18px; color: #fff8e8; background: rgba(83, 32, 29, .96); box-shadow: var(--shadow-lg); opacity: 0; transition: transform .2s ease, opacity .2s ease; font-family: var(--font-sans); }
.portal-toast.is-visible { transform: translateY(0); opacity: 1; }
.portal-toast__message { min-width: 0; line-height: 1.55; }
.portal-toast__action { flex: 0 0 auto; border: 1px solid rgba(255, 238, 199, .58); border-radius: 6px; padding: 7px 11px; color: #fff4d8; background: rgba(255, 248, 230, .1); font-weight: 700; white-space: nowrap; }
.portal-toast__action:hover, .portal-toast__action:focus-visible { color: #4c241f; background: #fff1ce; }

.portal-breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-family: var(--font-sans); font-size: .86rem; }
.portal-breadcrumb a:hover { color: var(--cinnabar); }
.portal-breadcrumb--spaced { padding: 24px 0; border-bottom: 1px solid rgba(196, 163, 111, .24); }
.portal-page-hero--compact { padding: 18px 0 26px; background: linear-gradient(90deg, rgba(247, 239, 225, .78), rgba(255, 253, 248, .9), rgba(247, 239, 225, .68)), url("/static/assets/portal/generated/search-header.jpg") center / cover no-repeat; }
.portal-empty { display: grid; min-height: 360px; place-items: center; align-content: center; border: 1px dashed var(--border-strong); border-radius: 12px; padding: 40px; text-align: center; background: rgba(255, 253, 248, .56); }
.portal-empty img { margin-bottom: 12px; opacity: .85; }
.portal-empty h2 { margin-bottom: 8px; font-size: 1.35rem; }
.portal-empty p { max-width: 520px; margin-bottom: 20px; color: var(--muted); }
.portal-empty--compact { min-height: 250px; }
.portal-pagination { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 36px; font-family: var(--font-sans); }
.portal-pagination a, .portal-pagination > span { display: grid; min-width: 42px; height: 42px; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: rgba(255, 253, 248, .8); }
.portal-pagination a:hover, .portal-pagination .is-current { color: #fff; border-color: var(--cinnabar); background: var(--cinnabar); }
.portal-pagination .is-disabled { opacity: .45; }
.portal-pagination__ellipsis { border-color: transparent !important; background: transparent !important; }
.portal-pagination__summary { width: auto !important; border-color: transparent !important; padding-inline: 3px; color: var(--muted); background: transparent !important; }

.xssdc{margin-left: 200px}
/* Home */
.home-hero { position: relative; min-height: 600px; overflow: hidden; border-bottom: 1px solid var(--gold-light); background: linear-gradient(90deg, rgba(255, 253, 248, .96) 0%, rgba(255, 253, 248, .8) 38%, rgba(255, 253, 248, .08) 66%), url("/static/assets/portal/generated/home-hero.png") center / cover no-repeat; }
.home-hero::before { display: none; }
.home-hero__inner { position: relative; display: grid; min-height: 600px; grid-template-columns: minmax(470px, .95fr) minmax(520px, 1.05fr); align-items: center; }
.home-hero__copy { position: relative; z-index: 2; padding: 56px 0 74px; }
.home-hero__wordmark { margin: 0 0 12px; line-height: 0; }
.home-hero__wordmark img { display: block; width: clamp(410px, 31vw, 590px); max-width: 100%; height: auto; }
.home-hero__lead { margin-bottom: 22px; color: #493d34; font-size: clamp(1.45rem, 2.2vw, 2.2rem); line-height: 1.55; letter-spacing: .12em; }
.home-hero__description { max-width: 630px; margin-bottom: 28px; color: var(--ink-soft); }
.home-hero__art { display: none; }
.home-search { display: grid; max-width: 720px; grid-template-columns: 140px 1fr 100px; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 12px; background: rgba(255, 253, 248, .9); box-shadow: var(--shadow-md); }
.home-search select, .home-search input { min-height: 58px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.home-search select { border-right: 1px solid var(--border); }
.home-search .portal-button { margin: 6px; }
.home-hot-searches { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 12px; color: var(--muted); font-size: .88rem; }
.home-hot-searches a:hover { color: var(--cinnabar); }
.home-member-desk { display: grid; max-width: 760px; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 18px; margin-top: 22px; border: 1px solid rgba(126, 75, 45, .26); border-radius: 10px; padding: 16px 18px; background: linear-gradient(100deg, rgba(255, 253, 248, .94), rgba(241, 225, 198, .9)); box-shadow: var(--shadow-sm); }
.home-member-desk > div:first-child { display: grid; }
.home-member-desk > div:first-child > span { color: var(--cinnabar); font-family: var(--font-sans); font-size: .72rem; font-weight: 700; letter-spacing: .12em; }
.home-member-desk > div:first-child > strong { font-size: 1.05rem; }
.home-member-desk p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.home-member-desk__stats { display: flex; border-right: 1px solid var(--border); border-left: 1px solid var(--border); }
.home-member-desk__stats a { display: grid; min-width: 62px; justify-items: center; padding: 0 12px; }
.home-member-desk__stats strong { color: var(--cinnabar); font-size: 1.25rem; line-height: 1.2; }
.home-member-desk__stats span { color: var(--muted); font-size: .7rem; }
.home-member-desk__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.home-member-desk .portal-button { min-height: 38px; padding: .45rem .85rem; font-size: .8rem; }
.home-member-desk--guest { grid-template-columns: 1fr auto; }
.home-catalogue { padding-block: 58px; background: #f2e7d5; }
.home-catalogue__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.home-catalogue__grid > a { position: relative; display: grid; min-height: 132px; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px; overflow: hidden; border: 1px solid #d5bd95; border-radius: 8px; padding: 20px; background: rgba(255, 253, 248, .78); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.home-catalogue__grid > a::after { position: absolute; right: -18px; bottom: -26px; width: 90px; height: 90px; content: ""; border: 10px double rgba(150, 54, 47, .06); transform: rotate(45deg); }
.home-catalogue__grid > a:hover { transform: translateY(-2px); border-color: var(--cinnabar); box-shadow: var(--shadow-sm); }
.home-catalogue__seal { display: grid; width: 58px; height: 72px; place-items: center; color: #fff7e8; background: var(--cinnabar-strong); clip-path: polygon(50% 0, 100% 15%, 92% 100%, 8% 100%, 0 15%); letter-spacing: .08em; }
.home-catalogue__grid strong { font-size: 1.08rem; }
.home-catalogue__grid p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.home-catalogue__grid small { align-self: start; color: var(--cinnabar); font-family: var(--font-sans); }
.home-stats { position: relative; z-index: 2; color: #f5ddb0; background: linear-gradient(100deg, #7a2723, #9a3831 52%, #6d2421); box-shadow: 0 -5px 20px rgba(76, 31, 26, .2); }
.home-stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.home-stats__grid > div { display: grid; min-height: 128px; grid-template-columns: 56px 1fr; grid-template-rows: 1fr 1fr; align-items: center; border-right: 1px solid rgba(236, 204, 144, .25); padding: 22px 40px; }
.home-stats__grid > div:last-child { border: 0; }
.home-stats__icon { display: grid; width: 48px; height: 48px; grid-row: 1 / 3; place-items: center; border: 2px solid #d8b66d; border-radius: 50%; font-size: 1rem; }
.home-stats strong { align-self: end; font-size: 2.1rem; font-weight: 500; line-height: 1.1; letter-spacing: .08em; }
.home-stats small { align-self: start; color: #e8c88f; }
.home-functions { background: rgba(255, 253, 248, .54); }
.home-functions__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.home-function-card { position: relative; min-height: 260px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; padding: 34px 28px; text-align: center; background: rgba(255, 253, 248, .85); box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.home-function-card::before, .home-function-card::after { content: ""; position: absolute; width: 30px; height: 30px; border-color: var(--gold-light); opacity: .7; }
.home-function-card::before { top: 9px; left: 9px; border-top: 1px solid; border-left: 1px solid; }
.home-function-card::after { right: 9px; bottom: 9px; border-right: 1px solid; border-bottom: 1px solid; }
.home-function-card:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: var(--shadow-md); }
.home-function-card__seal { display: grid; width: 92px; height: 92px; place-items: center; margin: 0 auto 22px; border: 1px solid var(--gold-light); border-radius: 50%; color: var(--cinnabar); background: radial-gradient(circle, #fff 45%, #f1e4cc 46%, #fff8eb 63%); font-size: 2.5rem; }
.home-function-card h3 { margin-bottom: 10px; font-size: 1.35rem; letter-spacing: .12em; }
.home-function-card p { margin: 0; color: var(--muted); }
.home-featured { padding-top: 54px; }
.document-shelf { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; }
.shelf-card { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 253, 248, .92); box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.shelf-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.shelf-card__cover { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--paper-deep); }
.shelf-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.shelf-card__badge { position: absolute; top: 10px; right: 10px; border-radius: 999px; padding: .2rem .5rem; color: #fff; background: rgba(90, 38, 35, .88); font-family: var(--font-sans); font-size: .68rem; }
.shelf-card__body { padding: 15px; }
.shelf-card h3 { margin-bottom: 5px; font-size: 1.05rem; }
.shelf-card h3 a:hover { color: var(--cinnabar); }
.shelf-card p { margin-bottom: 10px; color: var(--muted); font-size: .86rem; }
.shelf-card__views { color: var(--muted); font-family: var(--font-sans); font-size: .76rem; }
.shelf-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; border-top: 1px solid #eee2cf; padding-top: 8px; color: var(--cinnabar); font-family: var(--font-sans); font-size: .74rem; }
.shelf-card__actions form button { padding: 0; color: var(--cinnabar); background: transparent; }
.home-latest { padding-top: 52px; background: rgba(255, 253, 248, .6); }
.home-latest__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.home-latest__grid article { display: grid; min-width: 0; grid-template-columns: 128px 1fr; gap: 20px; border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: #fffdf8; box-shadow: var(--shadow-sm); }
.home-latest__grid article > a img { width: 118px; height: 150px; border-radius: 4px; object-fit: cover; }
.home-latest__grid article > div { display: grid; min-width: 0; align-content: start; }
.home-latest__grid article > div > span { color: var(--cinnabar); font-family: var(--font-sans); font-size: .72rem; }
.home-latest__grid h3 { margin: 5px 0 6px; font-size: 1.16rem; }
.home-latest__grid p { display: -webkit-box; overflow: hidden; margin-bottom: 10px; color: var(--muted); font-size: .82rem; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-latest__grid article > div > div { display: flex; justify-content: space-between; margin-top: auto; color: var(--muted); font-size: .76rem; }
.home-latest__grid article > div > div a { color: var(--cinnabar); }
.home-value { position: relative; padding: 56px 0 68px; border-top: 1px solid var(--border); background: linear-gradient(rgba(251, 247, 239, .75), rgba(247, 238, 222, .92)), url("/static/assets/portal/ink-landscape.svg") center bottom / 100% 78% no-repeat; }
.home-value__grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 32px; }
.home-value__grid > div { display: grid; gap: 3px; text-align: center; border-right: 1px solid var(--border-strong); }
.home-value__grid > div:last-child { border: 0; }
.home-value strong { font-size: 1.1rem; letter-spacing: .08em; }
.home-value span { color: var(--muted); font-size: .88rem; }

/* About */
.about-hero { position: relative; overflow: hidden; border-bottom: 5px solid var(--cinnabar); background: linear-gradient(90deg, rgba(255, 253, 248, .97) 0%, rgba(255, 253, 248, .8) 42%, rgba(244, 234, 216, .08) 68%), url("/static/assets/portal/generated/about-hero.jpg") center / cover no-repeat; }
.about-hero__inner { display: grid; min-height: 490px; grid-template-columns: minmax(600px, 1.05fr) .95fr; align-items: center; }
.about-hero__copy { position: relative; z-index: 2; padding: 60px 0; }
.about-hero h1 { color: var(--cinnabar-dark); font-size: clamp(2.4rem, 4.4vw, 4.5rem); font-weight: 500; line-height: 1.45; letter-spacing: .07em; }
.about-hero__copy > p:last-child { max-width: 660px; color: var(--ink-soft); font-size: 1.02rem; line-height: 2; }
.about-hero__inner > img { align-self: end; }
.about-intro { background: rgba(255, 253, 248, .55); }
.about-intro__layout { display: grid; grid-template-columns: 330px 1fr; gap: 64px; align-items: center; }
.about-intro__text { border-right: 1px solid var(--border); padding-right: 46px; color: var(--ink-soft); line-height: 2; }
.about-timeline { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.about-timeline::before { content: ""; position: absolute; top: 37px; right: 8%; left: 8%; height: 1px; background: var(--gold); }
.about-timeline li { position: relative; display: grid; justify-items: center; gap: 5px; text-align: center; }
.about-timeline li::before { content: ""; z-index: 1; width: 22px; height: 22px; margin-top: 27px; border: 6px solid var(--paper-light); border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.about-timeline li:first-child::before { background: var(--cinnabar); box-shadow: 0 0 0 2px var(--cinnabar); }
.about-timeline time { position: absolute; top: 0; color: var(--cinnabar); font-weight: 700; }
.about-timeline strong { margin-top: 10px; font-size: 1rem; }
.about-timeline span { color: var(--muted); font-size: .82rem; }
.about-collections { border-top: 1px solid var(--border); background: linear-gradient(rgba(248, 244, 235, .92), rgba(248, 244, 235, .92)), url("/static/assets/portal/ink-landscape.svg") center bottom / 100% 54% no-repeat; }
.about-collections__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.about-collection-card { position: relative; min-height: 310px; overflow: hidden; border: 1px solid var(--border); border-top: 3px solid var(--cinnabar); border-radius: 10px; padding: 28px; background: linear-gradient(#fffdf8 62%, rgba(229, 214, 187, .68)); box-shadow: var(--shadow-sm); }
.about-collection-card:nth-child(even) { border-top-color: var(--gold); }
.about-collection-card::after { content: ""; position: absolute; right: -26px; bottom: -35px; width: 180px; height: 110px; border: 1px solid rgba(170, 136, 85, .25); border-radius: 55% 45% 0 0; transform: rotate(-8deg); }
.about-collection-card__icon { display: grid; width: 62px; height: 62px; place-items: center; float: left; margin: 0 18px 10px 0; border: 3px double var(--gold); border-radius: 50%; color: var(--cinnabar); font-size: 1.5rem; }
.about-collection-card h3 { margin: 5px 0 0; font-size: 1.28rem; }
.about-collection-card strong { color: var(--cinnabar); font-size: 1.65rem; font-weight: 500; }
.about-collection-card strong small { color: var(--ink-soft); font-size: .8rem; }
.about-collection-card p { clear: both; padding-top: 20px; color: var(--ink-soft); }
.about-partners { background: rgba(255, 253, 248, .7); }
.about-partners__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.about-partners__grid > div { display: grid; grid-template-columns: 58px 1fr; grid-template-rows: 1fr 1fr; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 17px 20px; background: #fffdf8; box-shadow: var(--shadow-sm); }
.partner-seal { display: grid; width: 48px; height: 48px; grid-row: 1 / 3; place-items: center; border: 2px solid var(--cinnabar); border-radius: 50%; color: var(--cinnabar); font-weight: 700; }
.about-partners strong { align-self: end; }
.about-partners small { align-self: start; color: var(--muted); font-family: Georgia, serif; font-size: .62rem; }
.about-owner-name { color: var(--cinnabar); font-weight: 600; }
.about-owner-card, .about-partner-card { min-height: 96px; }
.about-owner-card { grid-template-rows: auto auto !important; }
.about-owner-card > div { display: grid; gap: 6px; }
.about-partner-card { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; background: #fffdf8; box-shadow: var(--shadow-sm); color: inherit; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.about-partner-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: var(--shadow-md); }
.about-partner-card__media { display: grid; height: 70px; overflow: hidden; place-items: center; border: 1px solid var(--border); border-radius: 5px; background: #f4eee2; }
.about-partner-card__media img { width: 100%; height: 100%; object-fit: cover; }
.about-partner-card__copy { display: grid; gap: 7px; }
.about-partner-card__copy strong { align-self: auto; color: var(--ink); font-size: 1rem; }
.about-partner-card__copy small { align-self: auto; font-family: var(--font-sans); font-size: .76rem; }
.about-partner-card--empty { display: grid; grid-template-columns: 58px 1fr; align-items: center; }
.about-partner-card--empty > div { display: grid; gap: 6px; }
.about-partners__note { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: .88rem; }
.about-contact { padding-bottom: 80px; border-top: 1px solid var(--border); }
.about-contact__grid { display: grid; grid-template-columns: .9fr 1.35fr .8fr; gap: 26px; align-items: stretch; }
.about-contact address, .about-contact__join { border: 1px solid var(--border); border-radius: 10px; padding: 26px; background: rgba(255, 253, 248, .78); }
.about-contact address p { display: grid; margin-bottom: 15px; }
.about-contact address strong { color: var(--cinnabar); }
.about-contact address span, .about-contact address a { color: var(--ink-soft); }
.about-contact__map-wrap { position: relative; min-height: 300px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.about-contact__map { display: block; width: 100%; height: 100%; min-height: 300px; object-fit: cover; }
.about-contact__map-label { position: absolute; right: 18px; bottom: 18px; left: 18px; display: grid; gap: 5px; padding: 11px 14px; border: 1px solid rgba(210, 185, 138, .85); border-radius: 8px; background: rgba(255, 250, 240, .92); box-shadow: var(--shadow-sm); }
.about-contact__map-label strong { color: var(--cinnabar); font-size: .92rem; }
.about-contact__map-label span { color: var(--ink-soft); font-size: .78rem; line-height: 1.45; }
.about-contact__join { display: flex; flex-direction: column; justify-content: center; }
.about-contact__join h3 { font-size: 1.3rem; }
.about-contact__join p { color: var(--muted); }
.about-contact__join-address { padding-top: 8px; border-top: 1px solid var(--border); font-size: .88rem; line-height: 1.6; }
.portal-footer__address { overflow-wrap: anywhere; }

/* Search */
.search-hero-form { display: grid; grid-template-columns: 150px 1fr 116px 118px; gap: 12px; margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; padding: 20px; background: rgba(255, 253, 248, .88); box-shadow: var(--shadow-sm); }
.search-hero-form input, .search-hero-form select { min-height: 50px; }
.search-advanced { display: grid; grid-column: 1 / -1; gap: 14px; border-top: 1px solid var(--border); padding-top: 17px; }
.search-advanced[hidden] { display: none !important; }
.search-advanced__header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.search-advanced__header > div { display: grid; gap: 2px; }
.search-advanced__header strong { color: var(--cinnabar-dark); font-size: 1rem; }
.search-advanced__header span { color: var(--muted); font-family: var(--font-sans); font-size: .78rem; }
.search-advanced__header a { color: var(--cinnabar); font-family: var(--font-sans); font-size: .8rem; }
.search-advanced__section { margin: 0; border: 1px solid rgba(201, 173, 123, .58); border-radius: 9px; padding: 11px 14px 14px; background: rgba(255, 250, 241, .58); }
.search-advanced__section legend { padding: 0 7px; color: #6d392f; font-family: var(--font-sans); font-size: .82rem; font-weight: 700; }
.search-advanced__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.search-advanced label { display: grid; min-width: 0; gap: 5px; color: var(--ink-soft); font-family: var(--font-sans); font-size: .78rem; }
.search-advanced input, .search-advanced select { width: 100%; min-height: 44px; }
.search-partner-check { display: inline-flex; grid-column: 1 / 3; align-items: center; gap: 8px; color: var(--ink-soft); font-family: var(--font-sans); font-size: .86rem; }
.search-hero-form__hint { grid-column: 3 / -1; align-self: center; justify-self: end; color: var(--muted); font-family: var(--font-sans); font-size: .83rem; }
.search-browse-strip { border-bottom: 1px solid var(--border); padding: 32px 0; background: #efe2cd; }
.search-browse-strip header { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.search-browse-strip h2, .search-partner-intro h2 { margin-bottom: 4px; font-size: 1.6rem; }
.search-browse-strip header > p, .search-partner-intro p:last-child { max-width: 620px; margin: 0; color: var(--muted); }
.search-browse-strip .portal-container > div { display: flex; gap: 10px; margin-top: 18px; overflow-x: auto; padding-bottom: 4px; }
.search-browse-strip a { display: grid; min-width: 155px; grid-template-columns: 1fr auto; align-items: center; border: 1px solid #d0b58c; border-radius: 7px; padding: 10px 13px; background: rgba(255, 253, 248, .72); }
.search-browse-strip a span { color: var(--cinnabar); font-size: .72rem; }
.search-partner-intro { border-bottom: 1px solid var(--border); padding: 30px 0; background: linear-gradient(90deg, #f4e8d5, #fffdf8); }
.search-results-section { padding-top: 36px; }
.search-layout { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 34px; align-items: start; }
.search-filters { position: sticky; top: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 253, 248, .87); box-shadow: var(--shadow-sm); }
.search-filters__heading { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 18px 20px; }
.search-filters__heading h2 { margin: 0; font-size: 1.16rem; }
.search-filters__close { display: none; background: transparent; font-size: 1.5rem; }
body.is-filter-open::after { content: ""; position: fixed; inset: 0; z-index: 250; background: rgba(37, 25, 19, .42); backdrop-filter: blur(2px); }
.search-filters form { padding: 0 20px 22px; }
.filter-group { display: grid; gap: 10px; margin: 0; border: 0; border-bottom: 1px solid var(--border); padding: 19px 0; }
.filter-group legend { margin-bottom: 2px; font-weight: 700; }
.filter-group > label { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-family: var(--font-sans); font-size: .86rem; }
.filter-choice span { flex: 1; }
.filter-choice small { color: var(--muted); }
.filter-group select, .filter-group input[type="text"] { width: 100%; }
.filter-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 20px; }
.search-results__toolbar { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.search-results__toolbar > div { display: flex; align-items: center; gap: 12px; }
.search-results__toolbar p { margin: 0; color: var(--ink-soft); }
.search-results__toolbar p strong { color: var(--cinnabar); font-size: 1.35rem; }
.search-results__toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-family: var(--font-sans); font-size: .82rem; }
.search-results__toolbar select { min-height: 42px; }
.search-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fffaf1; font-family: var(--font-sans); font-size: .78rem; }
.search-active-filters > span { color: var(--muted); }
.search-active-filters em { border-radius: 999px; padding: .24rem .62rem; color: #6e3d23; background: #efe0c9; font-style: normal; }
.search-active-filters a { margin-left: auto; color: var(--cinnabar); }
.view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; background: #fffdf8; }
.view-switch button { min-height: 42px; padding: 0 14px; background: transparent; }
.view-switch button.is-active { color: #fff; background: var(--cinnabar); }
.search-filter-trigger { display: none; }
.search-document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.search-document-card { position: relative; display: grid; min-height: 550px; grid-template-rows: 245px 1fr; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 253, 248, .94); box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.search-document-card::before, .search-document-card::after { content: ""; position: absolute; z-index: 2; width: 30px; height: 30px; pointer-events: none; }
.search-document-card::before { top: 7px; left: 7px; border-top: 1px solid var(--gold-light); border-left: 1px solid var(--gold-light); }
.search-document-card::after { right: 7px; bottom: 7px; border-right: 1px solid var(--gold-light); border-bottom: 1px solid var(--gold-light); }
.search-document-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.search-document-card__cover { display: grid; place-items: center; padding: 24px 24px 0; background: linear-gradient(#faf5eb, #fffdf8); }
.search-document-card__cover img { width: auto; height: 218px; max-width: 74%; object-fit: contain; filter: drop-shadow(0 8px 7px rgba(56, 37, 22, .17)); }
.search-document-card__body { display: flex; flex-direction: column; padding: 19px 24px 24px; }
.search-document-card__labels { display: flex; gap: 6px; margin-bottom: 8px; }
.search-document-card__labels span { border-radius: 999px; padding: .12rem .48rem; color: var(--cinnabar); background: #f3e7d6; font-family: var(--font-sans); font-size: .68rem; }
.search-document-card h2 { margin-bottom: 12px; font-size: 1.22rem; }
.search-document-card h2 a:hover { color: var(--cinnabar); }
.search-document-card dl { display: grid; gap: 3px; margin: 0 0 10px; color: var(--ink-soft); font-size: .84rem; }
.search-document-card dl div { display: flex; gap: 8px; }
.search-document-card dt::after { content: "："; }
.search-document-card dd { margin: 0; }
.search-document-card p { display: -webkit-box; overflow: hidden; margin-bottom: 16px; color: var(--ink-soft); font-size: .88rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.search-document-card .portal-button { align-self: center; margin-top: auto; }
.search-document-card__meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-bottom: 14px; color: var(--muted); font-family: var(--font-sans); font-size: .72rem; }
.search-document-card__ocr-hit { display: grid; gap: 4px; border-left: 3px solid var(--gold); padding: 8px 10px; color: var(--ink-soft); background: #fff8e9; font-family: var(--font-sans); font-size: .78rem; }
.search-document-card__ocr-hit a { color: var(--cinnabar); font-weight: 700; }
.search-document-card__ocr-hit span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.search-document-card__ocr-hit small { color: var(--muted); font-size: .68rem; }
.search-document-card__matches { display: grid; gap: 7px; margin: 0 0 14px; border-left: 3px solid var(--cinnabar); padding: 9px 11px; background: #fbf1df; font-family: var(--font-sans); }
.search-document-card__matches > strong { display: inline-flex; align-items: center; gap: 6px; color: var(--cinnabar-dark); font-size: .78rem; }
.search-document-card__matches > strong svg { width: 15px; }
.search-document-card__matches ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.search-document-card__matches li { display: grid; grid-template-columns: minmax(64px, auto) minmax(0, 1fr); gap: 8px; align-items: start; }
.search-document-card__matches li > span { color: #7b5f42; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.search-document-card__matches li > p { display: -webkit-box; margin: 0; color: var(--ink-soft); font-size: .76rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
mark.search-hit { border-radius: 3px; padding: .02em .12em; color: #4d211d; background: #f2d17f; box-shadow: inset 0 -1px 0 rgba(122, 41, 37, .35); font-weight: 700; }
.search-document-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; }
.search-document-card__actions .portal-button { flex: 1 1 105px; margin: 0; padding-inline: .7rem; }
.search-document-card__actions form { flex: 0 0 auto; }
.search-document-card__actions form button { min-height: 38px; border: 1px solid var(--border); border-radius: 7px; padding: 0 12px; color: var(--cinnabar); background: #fffaf1; font-family: var(--font-sans); }
.search-document-grid.is-list { grid-template-columns: 1fr; }
.search-document-grid.is-list .search-document-card { min-height: 260px; grid-template-columns: 210px 1fr; grid-template-rows: 1fr; }
.search-document-grid.is-list .search-document-card__cover { padding: 22px; }
.search-document-grid.is-list .search-document-card__cover img { height: 210px; max-width: 100%; }
.search-document-grid.is-list .search-document-card__body { padding: 28px; }

/* Detail */
.page-detail .portal-main { background: linear-gradient(rgba(252, 248, 240, .88), rgba(252, 248, 240, .9)), url("/static/assets/portal/generated/detail-bg.jpg") center top / cover fixed no-repeat; }
.detail-main { padding: 12px 0 58px; }
.detail-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 64px; align-items: start; }
.detail-cover-panel { position: sticky; top: 20px; }
.detail-cover-frame { position: relative; display: grid; min-height: 530px; place-items: center; border: 1px solid var(--border); border-radius: 14px; padding: 32px; background: rgba(255, 253, 248, .78); box-shadow: var(--shadow-md); }
.detail-cover-frame::before, .detail-cover-frame::after { content: ""; position: absolute; width: 45px; height: 45px; }
.detail-cover-frame::before { top: 12px; left: 12px; border-top: 2px double var(--gold); border-left: 2px double var(--gold); }
.detail-cover-frame::after { right: 12px; bottom: 12px; border-right: 2px double var(--gold); border-bottom: 2px double var(--gold); }
.detail-cover-frame img { max-height: 480px; filter: drop-shadow(0 14px 10px rgba(54, 34, 20, .22)); }
.detail-cover-panel > .portal-button { margin-top: 22px; min-height: 58px; font-size: 1.15rem; }
.detail-access-card { scroll-margin-top: 24px; margin-top: 14px; border: 1px solid rgba(157, 111, 49, .4); border-radius: 10px; padding: 16px; background: linear-gradient(145deg, rgba(255, 251, 240, .96), rgba(241, 225, 197, .88)); box-shadow: var(--shadow-sm); }
.detail-access-card:target { border-color: var(--cinnabar); box-shadow: 0 0 0 3px rgba(150, 54, 47, .12), var(--shadow-sm); }
.detail-access-card--granted { border-color: rgba(61, 119, 87, .48); background: linear-gradient(145deg, rgba(247, 252, 246, .96), rgba(223, 239, 226, .9)); }
.detail-access-card--unavailable { background: rgba(245, 239, 227, .82); }
.detail-access-card__heading { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.detail-access-card__heading > div { display: grid; gap: 2px; min-width: 0; }
.detail-access-card__heading strong { color: var(--ink); font-size: .96rem; }
.detail-access-card__heading small, .detail-access-card > p { color: var(--muted); font-family: var(--font-sans); }
.detail-access-card__heading small { font-size: .73rem; line-height: 1.45; }
.detail-access-card__icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid rgba(151, 45, 35, .2); border-radius: 50%; color: var(--cinnabar); background: rgba(255, 253, 248, .78); }
.detail-access-card__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.detail-access-card .portal-button { min-height: 46px; }
.detail-access-card__disabled, .detail-download__disabled { cursor: not-allowed; color: #7d7368; background: rgba(239, 233, 222, .82); }
.detail-access-card > p { margin: 9px 2px 0; font-size: .75rem; line-height: 1.55; }
.detail-cover-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.detail-cover-actions form, .detail-cover-actions button { width: 100%; }
.detail-stats { margin: 34px 0 0; border: 1px solid var(--border); border-radius: 10px; padding: 12px 28px; background: rgba(255, 253, 248, .74); }
.detail-stats div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 12px 0; }
.detail-stats div:last-child { border: 0; }
.detail-stats dt { color: var(--muted); }
.detail-stats dd { margin: 0; }
.detail-title { padding: 20px 0 22px; }
.detail-title h1 { margin-bottom: 10px; font-size: clamp(2.2rem, 4vw, 3.7rem); letter-spacing: .09em; }
.detail-title > p:not(.portal-eyebrow) { color: var(--muted); font-size: 1.1rem; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-tags span { border-radius: 6px; padding: .25rem .8rem; color: var(--ink-soft); background: #f0e5d2; font-size: .82rem; }
.detail-tags span:first-child { color: #fff; background: var(--cinnabar); }
.detail-catalog { margin-top: 0; }
.detail-catalog .detail-metadata, .detail-specialized-catalog .detail-metadata { margin-bottom: 0; }
.detail-metadata { overflow: hidden; margin: 0 0 30px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 253, 248, .82); box-shadow: var(--shadow-sm); }
.detail-metadata div { display: grid; grid-template-columns: 150px 1fr; border-bottom: 1px solid var(--border); }
.detail-metadata div:last-child { border: 0; }
.detail-metadata dt, .detail-metadata dd { margin: 0; padding: 13px 20px; }
.detail-metadata dt { background: rgba(235, 223, 202, .52); }
.detail-metadata dd { overflow-wrap: anywhere; }
.detail-metadata--specialized { border-color: rgba(156, 107, 42, .48); background: linear-gradient(90deg, rgba(151, 45, 35, .035), rgba(255, 253, 248, .9) 24%); box-shadow: inset 4px 0 0 rgba(154, 45, 35, .76), var(--shadow-sm); }
.detail-metadata--specialized dt { color: #713027; background: rgba(226, 205, 169, .5); font-weight: 700; }
.detail-section { margin-top: 30px; }
.detail-section h2 { position: relative; padding-left: 22px; font-size: 1.42rem; letter-spacing: .08em; }
.detail-section h2::before { content: "◆"; position: absolute; left: 0; top: .16em; color: var(--cinnabar); font-size: .65rem; }
.detail-section__heading { display: flex; align-items: center; justify-content: space-between; }
.detail-section__heading span { color: var(--muted); font-family: var(--font-sans); font-size: .8rem; letter-spacing: .08em; }
.detail-specialized-catalog .detail-section__heading h2::before { content: "录"; top: .02em; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 3px; color: #fff8e8; background: var(--cinnabar); font-family: var(--font-sans); font-size: .6rem; letter-spacing: 0; }
.detail-specialized-catalog .detail-section__heading > span { border: 1px solid rgba(156, 107, 42, .32); border-radius: 999px; padding: 3px 10px; color: #765d3b; background: rgba(245, 232, 206, .56); }
.detail-paper { border: 1px solid var(--border); border-radius: 10px; padding: 22px 26px; background: rgba(255, 253, 248, .75); box-shadow: var(--shadow-sm); }
.detail-paper p { margin: 0; line-height: 2; }
.detail-provenance__paper { display: grid; gap: 4px; }
.detail-provenance__paper p { margin: 0; }
.detail-provenance__paper a { color: var(--cinnabar); text-decoration: underline; text-underline-offset: 3px; }
.detail-provenance__paper small { color: var(--muted); font-family: var(--font-sans); }
.detail-toc { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; overflow: hidden; margin: 0; border: 1px solid var(--border); border-radius: 10px; padding: 18px 26px; background: rgba(255, 253, 248, .75); box-shadow: var(--shadow-sm); list-style: none; }
.detail-toc li { border-bottom: 1px solid rgba(213, 193, 158, .65); }
.detail-toc li:nth-last-child(-n+2) { border-bottom-color: transparent; }
.detail-toc li:nth-child(n+13) { display: none; }
.detail-toc.is-expanded li { display: block; }
.detail-toc a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.detail-toc a:hover { color: var(--cinnabar); }
.detail-toc__locked { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; color: #776d62; cursor: not-allowed; }
.detail-toc small { color: var(--muted); }
.detail-toc__toggle { display: block; margin: 12px auto 0; padding: 8px 20px; color: var(--cinnabar); background: transparent; }
.detail-protection-note { margin: 10px 2px 0; color: var(--muted); font-family: var(--font-sans); font-size: .78rem; line-height: 1.65; }
.detail-download { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; border: 1px solid var(--gold-light); border-radius: 10px; padding: 20px 24px; background: #f4ead8; }
.detail-download h2, .detail-download p { margin: 0; }
.detail-download p { color: var(--muted); }
.detail-download > .portal-button, .detail-download > .detail-download__disabled { flex: 0 0 auto; }
.detail-related { border-top: 1px solid var(--border); background: rgba(255, 253, 248, .46); }
.related-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
.related-card { overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: #fffdf8; box-shadow: var(--shadow-sm); }
.related-card a { display: block; }
.related-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.related-card h3 { margin: 13px 14px 3px; font-size: 1rem; }
.related-card p { margin: 0 14px 14px; color: var(--muted); font-size: .8rem; }

/* Auth */
.page-auth { background: #fffdf8; }
.page-auth .portal-main { min-height: 100vh; }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: 42% 58%; }
.auth-visual { position: relative; min-height: 100vh; overflow: hidden; color: #fff0ce; background: #3d201c; }
.auth-visual__scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-visual__overlay { position: absolute; inset: 0; background: linear-gradient(120deg, rgba(90, 25, 22, .84), rgba(73, 28, 24, .44) 48%, rgba(39, 19, 17, .72)); }
.auth-visual__brand { position: absolute; top: 12%; left: 10%; display: flex; align-items: center; gap: 24px; }
.auth-visual__brand img { width: 92px; height: 92px; box-shadow: 0 9px 30px rgba(0, 0, 0, .2); }
.auth-visual__brand h1 { margin: 0; font-size: clamp(2.6rem, 4vw, 4.8rem); letter-spacing: .12em; }
.auth-visual__brand p { margin: 0; color: #e3c58a; font-size: 1.1rem; letter-spacing: .35em; }
.auth-visual blockquote { position: absolute; top: 36%; left: 21%; margin: 0; font-size: clamp(1.8rem, 2.7vw, 3.2rem); line-height: 1.7; letter-spacing: .11em; }
.auth-visual__values { position: absolute; right: 8%; bottom: 9%; left: 8%; display: flex; justify-content: center; gap: 0; }
.auth-visual__values span { min-width: 170px; border-right: 1px solid rgba(239, 210, 154, .55); text-align: center; color: #efd69f; font-size: 1.05rem; }
.auth-visual__values span:last-child { border: 0; }
.auth-panel { position: relative; display: grid; min-height: 100vh; place-items: center; padding: 70px 9%; background: linear-gradient(145deg, #fff, #faf5eb); }
.auth-panel::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 35%; background: url("/static/assets/portal/ink-landscape.svg") center bottom / 100% 100% no-repeat; opacity: .14; pointer-events: none; }
.auth-back { position: absolute; top: 28px; right: 36px; z-index: 2; color: var(--muted); font-family: var(--font-sans); }
.auth-back:hover { color: var(--cinnabar); }
.auth-card { position: relative; z-index: 1; width: min(100%, 600px); }
.auth-card > header { margin-bottom: 30px; text-align: center; }
.auth-card > header h2 { margin-bottom: 8px; font-size: clamp(2.2rem, 4vw, 3.4rem); letter-spacing: .1em; }
.auth-card > header > p:last-child { color: var(--muted); font-size: 1.05rem; }
.auth-sso-button { display: flex; min-height: 70px; align-items: center; justify-content: center; gap: 16px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #c32225, #98181d); box-shadow: 0 12px 25px rgba(157, 23, 29, .22); font-family: var(--font-sans); font-size: 1.2rem; font-weight: 700; }
.auth-sso-button__shield { display: grid; width: 38px; height: 43px; place-items: center; clip-path: polygon(50% 0, 95% 15%, 88% 72%, 50% 100%, 12% 72%, 5% 15%); color: #17718b; background: #fff; font-family: var(--font-serif); font-size: 1rem; }
.auth-sso-button--disabled { cursor: not-allowed; opacity: .58; box-shadow: none; }
.auth-sso-note { margin: 7px 0 20px; text-align: center; color: var(--muted); font-family: var(--font-sans); }
.auth-divider { display: flex; align-items: center; gap: 18px; margin: 20px 0; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: #fffdf8; }
.auth-form { display: grid; gap: 18px; }
.auth-field { display: grid; gap: 6px; color: var(--ink-soft); font-family: var(--font-sans); font-size: .86rem; }
.auth-field__control { position: relative; display: flex; align-items: center; }
.auth-field__control > svg { position: absolute; left: 17px; z-index: 1; color: var(--muted); font-size: 1.35rem; }
.auth-field__control > svg + input { padding-left: 52px; }
.auth-field__control input { width: 100%; min-height: 60px; padding-right: 68px; border-radius: 9px; font-size: 1rem; }
.password-toggle { position: absolute; right: 7px; min-width: 52px; height: 44px; color: var(--cinnabar); background: transparent; font-size: .8rem; }
.auth-form__options { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-sans); }
.auth-form__options label { display: flex; align-items: center; gap: 8px; }
.auth-form__options a, .auth-switch a, .auth-legal a, .auth-agreement a { color: var(--cinnabar); }
.auth-submit { min-height: 60px; margin-top: 5px; font-size: 1.18rem; letter-spacing: .18em; }
.auth-switch { margin: 24px 0 0; text-align: center; color: var(--muted); }
.auth-legal { position: absolute; right: 0; bottom: 30px; left: 0; z-index: 1; margin: 0; text-align: center; color: var(--muted); font-family: var(--font-sans); font-size: .82rem; }
.auth-panel--register { align-items: start; overflow-y: auto; }
.auth-panel--register .auth-card { padding-bottom: 30px; }
.auth-form--grid { grid-template-columns: 1fr 1fr; }
.auth-form--grid .auth-agreement, .auth-form--grid .auth-submit { grid-column: 1 / -1; }
.auth-agreement { display: flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-size: .86rem; }

/* Profile */
.profile-page { padding: 38px 0 68px; background: linear-gradient(90deg, rgba(239, 229, 211, .5), transparent 20%, transparent 80%, rgba(239, 229, 211, .42)); }
.profile-layout { display: grid; min-width: 0; grid-template-columns: 282px minmax(0, 1fr); gap: 28px; align-items: stretch; }
.profile-sidebar { position: relative; min-width: 0; min-height: 1020px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 253, 248, .9); box-shadow: var(--shadow-sm); }
.profile-identity { padding: 38px 24px 28px; text-align: center; }
.profile-avatar { position: relative; width: 116px; height: 116px; margin: 0 auto 16px; }
.profile-avatar img { width: 100%; height: 100%; border: 5px solid #f4ead8; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--border); }
.profile-avatar span { position: absolute; right: 0; bottom: 5px; display: grid; width: 33px; height: 33px; place-items: center; border: 3px solid #fffdf8; border-radius: 50%; color: #fff; background: var(--gold); }
.profile-avatar span svg { width: 17px; }
.profile-identity h2 { margin-bottom: 8px; font-size: 1.42rem; }
.profile-role { display: inline-block; border: 1px solid var(--gold-light); border-radius: 999px; padding: .2rem .75rem; color: #8b682f; background: #faf2df; font-family: var(--font-sans); font-size: .75rem; }
.profile-identity p { margin: 10px 0 0; color: var(--muted); font-size: .8rem; }
.profile-nav { position: relative; z-index: 2; display: grid; }
.profile-nav a { display: flex; min-height: 66px; align-items: center; gap: 14px; border-left: 4px solid transparent; padding: 0 30px; font-size: 1.04rem; }
.profile-nav a svg { width: 24px; flex: 0 0 auto; color: var(--ink-soft); }
.profile-nav a:hover, .page-profile-overview [data-profile-nav="overview"], .page-profile-favorites [data-profile-nav="favorites"], .page-profile-bookmarks [data-profile-nav="bookmarks"], .page-profile-history [data-profile-nav="history"], .page-profile-applications [data-profile-nav="applications"], .page-profile-account [data-profile-nav="account"], .page-profile-password [data-profile-nav="password"] { border-left-color: var(--cinnabar); color: var(--cinnabar); background: linear-gradient(90deg, #f3e5d6, rgba(243, 229, 214, .12)); }
.profile-logout { position: relative; z-index: 2; margin: 14px 24px; border-top: 1px solid var(--border); padding-top: 14px; }
.profile-logout button { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; gap: 10px; border: 1px solid #dfb5ac; border-radius: 7px; color: var(--danger); background: rgba(255, 250, 245, .86); }
.profile-logout svg { width: 19px; }
.profile-sidebar__art { position: absolute; right: 0; bottom: 0; left: 0; opacity: .68; pointer-events: none; }
.profile-sidebar__art img { width: 100%; max-height: 430px; object-fit: contain; object-position: center bottom; }
.profile-content { position: relative; min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 36px; background: rgba(255, 253, 248, .92); box-shadow: var(--shadow-sm); }
.profile-content::before { content: ""; position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-top: 2px double var(--gold-light); border-right: 2px double var(--gold-light); }
.profile-content__header { display: flex; min-height: 96px; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.profile-content__header h1 { margin-bottom: 5px; font-size: 2rem; }
.profile-content__header h1 span { display: inline-block; margin-left: 8px; border-radius: 999px; padding: .15rem .65rem; color: #fff; background: var(--cinnabar); font-family: var(--font-sans); font-size: .72rem; vertical-align: middle; }
.profile-content__header p:last-child { margin: 0; color: var(--muted); }
.profile-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.profile-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-tabs a { min-width: 100px; border: 1px solid var(--border); border-radius: 7px; padding: .55rem 1rem; text-align: center; }
.profile-tabs a:hover, .profile-tabs a.is-active { color: #fff; border-color: var(--cinnabar); background: var(--cinnabar); }
.profile-tabs--standalone { margin-bottom: 24px; }
.profile-toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-family: var(--font-sans); }
.profile-toolbar--filters { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto auto; }
.profile-toolbar__search input { width: 100%; }
.favorite-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.favorite-card { overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: #fffdf8; box-shadow: var(--shadow-sm); }
.favorite-card__cover { position: relative; display: block; aspect-ratio: 1.24; overflow: hidden; background: var(--paper-deep); }
.favorite-card__cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .25s ease; }
.favorite-card:hover img { transform: scale(1.035); }
.favorite-card__cover span { position: absolute; top: 0; right: 10px; display: grid; width: 29px; height: 38px; place-items: center; color: #fff; background: var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.favorite-card__body { padding: 13px; }
.favorite-card h2 { overflow: hidden; margin-bottom: 5px; font-size: .96rem; white-space: nowrap; text-overflow: ellipsis; }
.favorite-card p, .favorite-card small, .favorite-card time { display: block; overflow: hidden; margin: 0; color: var(--muted); font-size: .76rem; white-space: nowrap; text-overflow: ellipsis; }
.favorite-card time { margin-top: 9px; border-top: 1px solid var(--border); padding-top: 7px; }
.favorite-card form { margin-top: 6px; }
.favorite-card form button { min-height: 34px; padding: 0; color: var(--cinnabar); background: transparent; font-family: var(--font-sans); font-size: .76rem; }
.favorite-card__actions { display: flex; gap: 12px; margin-top: 8px; color: var(--cinnabar); font-family: var(--font-sans); font-size: .75rem; }
.history-list, .application-list { display: grid; gap: 16px; }
.history-card { display: grid; grid-template-columns: 130px 1fr auto; gap: 22px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 18px; background: #fffdf8; }
.history-card__cover img { width: 110px; height: 138px; border-radius: 4px; object-fit: cover; box-shadow: var(--shadow-sm); }
.history-card h2 { margin-bottom: 5px; font-size: 1.25rem; }
.history-card__body > p:not(.portal-eyebrow), .history-card small, .history-card time { display: block; color: var(--muted); font-size: .82rem; }
.history-card time { margin-top: 5px; }
.history-card__note { margin: 8px 0 0 !important; border-left: 3px solid var(--gold); padding-left: 9px; color: #6f5233 !important; }
.reading-progress { height: 7px; margin: 14px 0 7px; overflow: hidden; border-radius: 999px; background: #eee3d0; }
.reading-progress span { display: block; width: min(var(--reading-progress), 100%); height: 100%; background: linear-gradient(90deg, var(--gold), var(--cinnabar)); }
.history-card__actions { display: grid; justify-items: center; gap: 8px; }
.history-card__actions form button { color: var(--muted); background: transparent; font-family: var(--font-sans); font-size: .78rem; }
.application-card { display: grid; grid-template-columns: 105px 1fr auto; gap: 20px; align-items: start; border: 1px solid var(--border); border-radius: 10px; padding: 20px; background: #fffdf8; }
.application-card > img { width: 86px; height: 112px; border-radius: 4px; object-fit: cover; }
.application-card__heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.application-card h2 { margin-bottom: 10px; font-size: 1.2rem; }
.status-badge { flex: 0 0 auto; border-radius: 999px; padding: .22rem .7rem; color: var(--warning); background: #faead3; font-family: var(--font-sans); font-size: .72rem; }
.status-badge--approved { color: var(--success); background: #e3f0e8; }
.status-badge--rejected, .status-badge--cancelled, .status-badge--canceled { color: var(--danger); background: #f5e1de; }
.application-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 0; color: var(--ink-soft); font-size: .8rem; }
.application-card dl div { display: flex; gap: 6px; }
.application-card dt::after { content: "："; }
.application-card dd { margin: 0; }
.application-card__note { margin: 12px 0 0; border-left: 3px solid var(--gold); padding-left: 12px; color: var(--muted); font-size: .84rem; }
.application-card__actions { align-self: center; }
.application-card__actions form { margin-top: 8px; text-align: center; }
.application-card__actions form button { color: var(--danger); background: transparent; font-family: var(--font-sans); font-size: .78rem; }
.application-card__waiting { color: var(--warning); font-family: var(--font-sans); font-size: .8rem; white-space: nowrap; }
.application-card__reason { margin: 12px 0 0; color: var(--ink-soft); font-size: .82rem; }
.application-card__grant { margin: 12px 0 0; border-radius: 6px; padding: 8px 10px; color: var(--success); background: #e4f0e8; font-size: .8rem; }
.application-timeline { display: grid; grid-template-columns: repeat(4, 1fr); margin: 16px 0 0; padding: 0; list-style: none; }
.application-timeline li { position: relative; display: grid; justify-items: center; gap: 4px; color: var(--muted); font-family: var(--font-sans); font-size: .7rem; text-align: center; }
.application-timeline li::before { width: 12px; height: 12px; z-index: 1; content: ""; border: 2px solid #ccb996; border-radius: 50%; background: #fffdf8; }
.application-timeline li:not(:last-child)::after { position: absolute; top: 5px; left: 50%; width: 100%; height: 2px; content: ""; background: #ddcfb8; }
.application-timeline li.is-complete::before { border-color: var(--success); background: var(--success); }
.application-timeline li.is-current::before { border-color: var(--warning); box-shadow: 0 0 0 4px rgba(169, 104, 39, .14); }
.application-timeline li.is-complete:not(:last-child)::after { background: var(--success); }
.application-timeline small { min-height: 1em; }
.profile-form { border-top: 1px solid var(--border); }
.profile-form__section { border-bottom: 1px solid var(--border); padding: 28px 0; }
.profile-form__section h2 { margin-bottom: 20px; font-size: 1.2rem; }
.avatar-uploader { display: flex; align-items: center; gap: 16px; }
.avatar-uploader img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.avatar-uploader small { color: var(--muted); }
.profile-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.profile-form label { display: grid; gap: 7px; color: var(--ink-soft); font-family: var(--font-sans); font-size: .86rem; }
.profile-form label input, .profile-form label textarea { width: 100%; }
.profile-form label small { color: var(--muted); }
.profile-form__wide { grid-column: 1 / -1; }
.profile-form__actions { display: flex; gap: 12px; padding-top: 26px; }
.password-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 34px; border-top: 1px solid var(--border); padding-top: 28px; }
.password-form { display: grid; gap: 20px; border: 0; }
.password-control { position: relative; display: flex; }
.password-control input { width: 100%; padding-right: 66px; }
.password-control button { position: absolute; right: 5px; top: 4px; width: 56px; height: 36px; color: var(--cinnabar); background: transparent; }
.security-tips { border: 1px solid var(--border); border-radius: 10px; padding: 24px; background: #f6eddd; }
.security-tips h2 { font-size: 1.15rem; }
.security-tips ul { padding-left: 1.25rem; color: var(--ink-soft); }
.security-tips p { margin: 18px 0 0; border-top: 1px solid var(--border); padding-top: 16px; color: var(--muted); }
.profile-content--overview { display: grid; gap: 22px; }
.profile-content--overview .profile-content__header { margin-bottom: 0; }
.profile-overview-heading { align-items: end; }
.profile-quick-search { display: flex; min-width: min(420px, 100%); gap: 8px; }
.profile-quick-search input { flex: 1; }
.profile-research-desk { position: relative; display: grid; grid-template-columns: 1fr 280px; align-items: center; gap: 28px; overflow: hidden; border: 1px solid #c9aa78; border-radius: 10px; padding: 24px 28px; color: #f9e8c8; background: linear-gradient(115deg, #5b2522, #81332c 58%, #4a211f); }
.profile-research-desk::after { position: absolute; right: -48px; bottom: -72px; width: 210px; height: 210px; content: ""; border: 22px double rgba(244, 216, 163, .08); transform: rotate(45deg); }
.profile-research-desk__identity { display: grid; }
.profile-research-desk__identity span { color: #e3bf78; font-family: var(--font-sans); font-size: .72rem; letter-spacing: .16em; }
.profile-research-desk__identity strong { margin-top: 4px; font-size: 1.3rem; }
.profile-research-desk__identity p { margin: 3px 0 0; color: #d9c4ab; font-size: .8rem; }
.profile-completion { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; }
.profile-completion > div { grid-column: 1 / -1; height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.16); }
.profile-completion > div span { display: block; width: min(var(--profile-completion), 100%); height: 100%; background: linear-gradient(90deg, #d5aa58, #f1d293); }
.profile-completion p { margin: 0; color: #ead8bd; font-family: var(--font-sans); font-size: .78rem; }
.profile-completion a { color: #f4cf88; font-family: var(--font-sans); font-size: .78rem; }
.profile-stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.profile-stat-grid a { display: grid; min-height: 116px; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 12px; border: 1px solid var(--border); border-radius: 9px; padding: 14px; background: #fffaf1; }
.profile-stat-grid a > span { display: grid; width: 40px; height: 54px; grid-row: 1 / 3; place-items: center; color: #fff5e4; background: var(--cinnabar-strong); clip-path: polygon(50% 0,100% 14%,92% 100%,8% 100%,0 14%); font-size: .72rem; }
.profile-stat-grid strong { align-self: end; color: var(--cinnabar); font-size: 1.55rem; line-height: 1; }
.profile-stat-grid small { color: var(--muted); font-size: .72rem; }
.profile-overview-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.profile-overview-panel { min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 20px; background: #fffdf8; }
.profile-overview-panel > header, .profile-recommendations > header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.profile-overview-panel h2, .profile-recommendations h2 { margin: 0; font-size: 1.2rem; }
.profile-overview-panel > header > a, .profile-recommendations > header > a { color: var(--cinnabar); font-family: var(--font-sans); font-size: .78rem; }
.profile-overview-panel--reading { grid-column: 1 / -1; }
.profile-continue-card { display: grid; grid-template-columns: 95px 1fr auto; align-items: center; gap: 18px; }
.profile-continue-card > a:first-child img { width: 86px; height: 108px; border-radius: 4px; object-fit: cover; }
.profile-continue-card h3 { margin: 3px 0; font-size: 1.18rem; }
.profile-continue-card p, .profile-continue-card small { color: var(--muted); font-size: .78rem; }
.profile-mini-list { display: grid; }
.profile-mini-list a { display: grid; grid-template-columns: 74px 1fr; gap: 2px 10px; border-bottom: 1px solid #eee3d1; padding: 9px 0; }
.profile-mini-list a:last-child { border: 0; }
.profile-mini-list a > span { grid-row: 1 / 3; color: var(--cinnabar); font-family: var(--font-sans); font-size: .74rem; }
.profile-mini-list strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.profile-mini-list small { color: var(--muted); font-size: .72rem; }
.profile-favorite-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.profile-favorite-strip a { min-width: 0; }
.profile-favorite-strip img { width: 100%; aspect-ratio: 3 / 4; border-radius: 4px; object-fit: cover; }
.profile-favorite-strip span { display: block; overflow: hidden; margin-top: 4px; font-size: .72rem; white-space: nowrap; text-overflow: ellipsis; }
.profile-inline-empty { display: grid; min-height: 98px; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.profile-inline-empty p { margin: 0; }
.profile-inline-empty a { color: var(--cinnabar); }
.profile-recommendations { border-top: 1px solid var(--border); padding-top: 22px; }
.profile-recommendation-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.profile-recommendation-grid article { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: #fffaf1; }
.profile-recommendation-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.profile-recommendation-grid article > div { padding: 10px; }
.profile-recommendation-grid article span { color: var(--cinnabar); font-size: .68rem; }
.profile-recommendation-grid h3 { overflow: hidden; margin: 3px 0; font-size: .86rem; white-space: nowrap; text-overflow: ellipsis; }
.profile-recommendation-grid p { margin: 0; color: var(--muted); font-size: .68rem; }
.profile-list-search { display: flex; gap: 8px; margin-bottom: 20px; }
.profile-list-search input { flex: 1; }
.bookmark-management-list { display: grid; gap: 14px; }
.bookmark-management-list article { display: grid; grid-template-columns: 86px 1fr auto; align-items: center; gap: 18px; border: 1px solid var(--border); border-radius: 9px; padding: 15px; background: #fffdf8; }
.bookmark-management-list__cover img { width: 78px; height: 98px; border-radius: 3px; object-fit: cover; }
.bookmark-management-list h2 { margin: 3px 0; font-size: 1.08rem; }
.bookmark-management-list p, .bookmark-management-list time { margin: 0; color: var(--muted); font-size: .76rem; }
.bookmark-management-list__actions { display: grid; justify-items: center; gap: 6px; }
.bookmark-management-list__actions form button { color: var(--danger); background: transparent; font-family: var(--font-sans); font-size: .76rem; }

/* Error */
.portal-state-page { position: relative; display: grid; min-height: 680px; place-items: center; align-content: center; padding: 70px 24px; text-align: center; }
.portal-state-page__ornament { position: absolute; z-index: -1; color: rgba(154, 119, 73, .07); font-family: Georgia, serif; font-size: clamp(12rem, 32vw, 30rem); font-weight: 700; line-height: 1; }
.portal-state-page h1 { margin-bottom: 12px; font-size: clamp(2rem, 4vw, 3.3rem); }
.portal-state-page > p:not(.portal-eyebrow) { max-width: 580px; color: var(--muted); }
.portal-state-page__actions { display: flex; gap: 12px; margin-top: 12px; }

/* Permission application */
.apply-page { padding-top: 34px; }
.apply-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 36px; align-items: start; }
.apply-document { position: sticky; top: 22px; }
.apply-document > h1 { font-size: 2.15rem; }
.apply-document__card { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 18px; background: rgba(255, 253, 248, .88); box-shadow: var(--shadow-sm); }
.apply-document__card img { width: 105px; height: 140px; border-radius: 4px; object-fit: cover; box-shadow: var(--shadow-sm); }
.apply-document__card h2 { margin-bottom: 8px; font-size: 1.2rem; }
.apply-document__card p { margin-bottom: 7px; color: var(--muted); }
.apply-document__card span { border-radius: 999px; padding: .2rem .6rem; color: var(--cinnabar); background: #f0e3d2; font-size: .74rem; }
.apply-notice { margin-top: 18px; border-left: 4px solid var(--gold); border-radius: 0 9px 9px 0; padding: 18px 20px; background: #f5ebd8; }
.apply-notice h2 { margin-bottom: 6px; font-size: 1rem; }
.apply-notice p { margin: 0; color: var(--ink-soft); font-size: .86rem; }
.apply-flow { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px 0 0; padding: 0; list-style: none; }
.apply-flow li { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; }
.apply-flow li:not(:last-child)::after { content: ""; position: absolute; top: 18px; left: 66%; width: 68%; height: 1px; background: var(--border-strong); }
.apply-flow span { position: relative; z-index: 1; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--paper-light); }
.apply-flow .is-current span { color: #fff; border-color: var(--cinnabar); background: var(--cinnabar); }
.apply-flow strong { font-size: .88rem; }
.apply-flow small { color: var(--muted); font-size: .7rem; }
.apply-form-card { border: 1px solid var(--border); border-radius: 12px; padding: 34px 40px; background: rgba(255, 253, 248, .92); box-shadow: var(--shadow-md); }
.apply-form-card > header { border-bottom: 1px solid var(--border); padding-bottom: 22px; }
.apply-form-card > header h2 { margin-bottom: 6px; font-size: 1.8rem; }
.apply-form-card > header p:last-child { margin: 0; color: var(--muted); }
.apply-form > section { border-bottom: 1px solid var(--border); padding: 28px 0; }
.apply-form h3 { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; }
.apply-form h3 > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: var(--cinnabar); font-size: .78rem; }
.apply-user-info { display: grid; grid-template-columns: 1fr 1fr; gap: 0; overflow: hidden; margin: 0; border: 1px solid var(--border); border-radius: 8px; }
.apply-user-info div { display: grid; grid-template-columns: 96px 1fr; border-bottom: 1px solid var(--border); }
.apply-user-info div:nth-last-child(-n+2) { border-bottom: 0; }
.apply-user-info dt, .apply-user-info dd { margin: 0; padding: 11px 13px; }
.apply-user-info dt { background: #f4ebdc; }
.apply-form__hint { margin: 9px 0 0; color: var(--muted); font-family: var(--font-sans); font-size: .78rem; }
.apply-form__hint a { color: var(--cinnabar); }
.apply-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0; border: 0; padding: 0; }
.apply-options label { display: flex; gap: 12px; border: 1px solid var(--border); border-radius: 9px; padding: 18px; cursor: pointer; }
.apply-options label:has(input:checked) { border-color: var(--cinnabar); background: #f7ebe2; box-shadow: 0 0 0 2px rgba(150, 54, 47, .08); }
.apply-options label.is-disabled { cursor: not-allowed; opacity: .52; }
.apply-options span { display: grid; }
.apply-options small { color: var(--muted); }
.apply-reason { position: relative; display: grid; gap: 8px; }
.apply-reason textarea { width: 100%; }
.apply-reason > small { position: absolute; right: 12px; bottom: 8px; color: var(--muted); font-family: var(--font-sans); }
.apply-urgency { display: flex; gap: 24px; margin: 20px 0 0; border: 0; padding: 0; }
.apply-urgency legend { margin-bottom: 8px; font-weight: 700; }
.apply-urgency label { display: grid; grid-template-columns: 20px auto; gap: 0 8px; align-items: center; }
.apply-urgency label input { grid-row: 1 / 3; }
.apply-urgency small { color: var(--muted); }
.apply-agreement { display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; color: var(--ink-soft); font-family: var(--font-sans); font-size: .84rem; }
.apply-agreement input { margin-top: 5px; flex: 0 0 auto; }
.apply-form__actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 26px; }

/* Reader */
.page-reader { overflow: hidden; background: #e9e0cf; }
.page-reader .portal-main { min-height: 100vh; overflow: visible; }
.reader-app { --reader-zoom: 1; --reader-pan-x: 0px; --reader-pan-y: 0px; display: grid; height: 100vh; height: 100dvh; grid-template-rows: 72px minmax(0, 1fr) 92px; overflow: hidden; color: #332a24; background: #e8dfd0; }
.reader-app [hidden] { display: none !important; }
.reader-topbar { position: relative; z-index: 10; display: grid; grid-template-columns: 260px 1fr 180px; align-items: center; border-bottom: 1px solid #c5b492; padding: 0 28px; background: rgba(255, 253, 247, .94); box-shadow: 0 3px 15px rgba(71, 48, 31, .1); }
.reader-brand { display: flex; align-items: center; gap: 10px; color: var(--cinnabar-dark); font-size: 1.16rem; letter-spacing: .1em; }
.reader-topbar__title { text-align: center; font-size: 1.15rem; letter-spacing: .08em; }
.reader-topbar__title span { color: var(--muted); }
.reader-protection-badge { display: inline-flex; margin-left: 12px; border: 1px solid rgba(122, 41, 37, .26); border-radius: 999px; padding: 3px 9px; color: #774743; background: rgba(122, 41, 37, .06); font-family: var(--font-sans); font-size: .67rem; font-weight: 500; letter-spacing: .05em; vertical-align: 2px; }
.reader-exit { justify-self: end; color: var(--cinnabar-dark); font-family: var(--font-sans); }
.reader-exit span { margin-right: 6px; font-size: 1.5rem; }
[data-protected-media] img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }
.reader-workspace { display: grid; min-height: 0; grid-template-columns: 318px minmax(0, 1fr) 286px; }
.reader-sidebar { position: relative; z-index: 5; min-height: 0; overflow: hidden; background: rgba(250, 246, 237, .96); }
.reader-sidebar--toc { border-right: 1px solid #bfae8d; }
.reader-sidebar--thumbs { border-left: 1px solid #bfae8d; }
.reader-sidebar__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 18px 18px 12px; }
.reader-sidebar__tabs button { min-height: 46px; border-radius: 8px; background: #f4eee2; }
.reader-sidebar__tabs button.is-active { color: #fff8ea; background: var(--cinnabar-dark); }
.reader-sidebar__panel { height: calc(100% - 130px); overflow-y: auto; padding: 0 18px 18px; }
.reader-volume-title { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d4c5aa; padding: 14px 4px; }
.reader-toc-list { margin: 0; padding: 12px 0; list-style: none; }
.reader-toc-list li { border-bottom: 1px solid #dfd3bd; }
.reader-toc-list a { display: grid; grid-template-columns: 45px 1fr; gap: 8px; padding: 11px 8px; }
.reader-toc-list li.is-current a { border-radius: 6px; color: var(--cinnabar-dark); background: #ead8cf; }
.reader-toc-list span { color: var(--muted); font-size: .82rem; }
.reader-empty-small { display: grid; min-height: 280px; place-items: center; align-content: center; text-align: center; }
.reader-empty-small > span { display: grid; width: 58px; height: 70px; place-items: center; color: #fff; background: var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); font-size: 1.4rem; }
.reader-empty-small p { margin: 12px 0 0; }
.reader-empty-small small { color: var(--muted); }
.reader-bookmark-list { display: grid; gap: 10px; padding: 10px 0; }
.reader-bookmark-item { position: relative; display: grid; gap: 2px; border: 1px solid #d9c9ae; border-left: 4px solid var(--gold); border-radius: 7px; padding: 11px 12px; background: #fffaf0; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.reader-bookmark-item:hover { transform: translateX(2px); border-color: var(--cinnabar); border-left-color: var(--cinnabar); background: #f7eadf; }
.reader-bookmark-item span { color: var(--cinnabar); font-family: var(--font-sans); font-size: .74rem; }
.reader-bookmark-item strong { overflow: hidden; font-size: .9rem; white-space: nowrap; text-overflow: ellipsis; }
.reader-bookmark-item small { color: var(--muted); font-size: .7rem; }
.reader-sidebar__collapse { position: absolute; right: 18px; bottom: 10px; left: 18px; min-height: 43px; border: 1px solid #cbb995; border-radius: 7px; color: #80603b; background: #fbf7ee; }
.reader-sidebar__heading { display: flex; min-height: 62px; align-items: center; justify-content: space-between; border-bottom: 1px solid #d1c1a4; padding: 0 22px; }
.reader-sidebar__heading button { width: 38px; height: 38px; background: transparent; }
.reader-thumbnails { height: calc(100% - 62px); overflow-y: auto; padding: 20px; }
.reader-thumbnail { display: grid; width: 100%; justify-items: center; gap: 5px; margin-bottom: 18px; border: 0; padding: 7px; color: var(--ink-soft); background: transparent; }
.reader-thumbnail img { width: 150px; height: 190px; border: 2px solid transparent; object-fit: cover; box-shadow: 0 4px 12px rgba(49, 34, 22, .13); }
.reader-thumbnail.is-current img { border-color: var(--cinnabar); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cinnabar); }
.reader-stage { position: relative; display: grid; min-width: 0; place-items: center; overflow: auto; overscroll-behavior: contain; padding: 24px 62px; background: linear-gradient(rgba(232, 223, 208, .38), rgba(216, 205, 187, .5)), url("/static/assets/portal/generated/reader-paper.jpg") center / cover no-repeat; }
.reader-pages { position: relative; display: flex; width: 100%; min-width: 0; align-items: center; justify-content: center; gap: 0; opacity: 0; perspective: 2200px; perspective-origin: 50% 48%; transform: translate3d(var(--reader-pan-x), var(--reader-pan-y), 0) scale(var(--reader-zoom)); transform-style: preserve-3d; transform-origin: center; transition: transform .2s ease, opacity .16s ease; }
.reader-app.is-reader-ready .reader-pages { opacity: 1; }
.reader-app.is-pan-enabled .reader-stage { overflow: hidden; }
.reader-app.is-pan-enabled .reader-pages { cursor: grab; touch-action: none; will-change: transform; }
.reader-app.is-panning .reader-pages { cursor: grabbing; transition: none; user-select: none; }
.reader-pages::after { position: absolute; top: 1.5%; bottom: 1.5%; left: 50%; z-index: 4; width: 18px; content: ""; pointer-events: none; transform: translateX(-50%); background: linear-gradient(90deg, rgba(59, 36, 22, .18), rgba(255, 249, 230, .38) 42%, rgba(53, 31, 20, .23)); box-shadow: 0 0 18px rgba(44, 27, 17, .2); opacity: .72; }
.reader-app[data-mode="single"] .reader-pages::after { opacity: 0; }
.reader-page { position: relative; z-index: 1; display: none; flex: 0 1 min(48%, 660px); margin: 0; background: #e9daba; filter: drop-shadow(0 12px 13px rgba(55, 37, 24, .25)); transform-style: preserve-3d; }
.reader-page.is-visible { display: block; }
.reader-page.is-selected-page { outline: 2px solid rgba(150, 54, 47, .46); outline-offset: -2px; }
.reader-page img { width: 100%; max-height: calc(100dvh - 230px); object-fit: contain; background: #e9daba; user-select: none; }
.reader-page.is-left-page img { border-radius: 8px 0 0 8px; }
.reader-page.is-right-page img { border-radius: 0 8px 8px 0; }
.reader-page.is-single-page img { border-radius: 8px; }
.reader-page figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.reader-page.is-turning-leaf { position: absolute; z-index: 12; display: block !important; flex: 0 0 auto; overflow: hidden; margin: 0; pointer-events: none; transform: rotateY(0deg); transform-style: preserve-3d; transition: transform .46s cubic-bezier(.35, .05, .18, 1); will-change: transform; }
.reader-page.is-turning-leaf > img { position: relative; z-index: 1; height: 100%; max-height: none; object-fit: contain; backface-visibility: hidden; transform: translateZ(.2px); }
.reader-page.is-turning-leaf::before,
.reader-page.is-turning-leaf::after { position: absolute; inset: 0; content: ""; pointer-events: none; backface-visibility: hidden; }
.reader-page.is-turning-leaf::before { z-index: 3; background: linear-gradient(90deg, rgba(255, 250, 234, 0), rgba(54, 32, 20, .34)); opacity: 0; transition: opacity .23s ease; transform: translateZ(.6px); }
.reader-page.is-turning-leaf::after { z-index: 0; border: 1px solid rgba(113, 83, 51, .22); background: linear-gradient(90deg, rgba(72, 43, 24, .2), rgba(250, 239, 210, .9) 18%, rgba(236, 218, 178, .96)), url("/static/assets/portal/generated/reader-paper.jpg") center / cover; box-shadow: inset 0 0 32px rgba(79, 48, 28, .2); transform: rotateY(180deg) translateZ(.3px); }
.reader-page.is-turning-leaf.is-turning-active::before { opacity: .76; }
.reader-page.reader-page-turn--next { border-radius: 0 8px 8px 0; transform-origin: left center; }
.reader-page.reader-page-turn--next.is-turning-active { transform: rotateY(-180deg); }
.reader-page.reader-page-turn--prev { border-radius: 8px 0 0 8px; transform-origin: right center; }
.reader-page.reader-page-turn--prev.is-turning-active { transform: rotateY(180deg); }
.reader-app.is-page-turning .reader-pages::after { opacity: .92; }
.reader-app[data-mode="single"] .reader-page { flex-basis: min(74%, 760px); }
.reader-app[data-mode="single"] .reader-page.is-visible + .reader-page.is-visible { display: none; }
.reader-edge-button { position: fixed; top: 50%; z-index: 7; width: 44px; height: 84px; transform: translateY(-50%); border-radius: 0 9px 9px 0; color: #fff; background: var(--cinnabar-dark); font-size: 2rem; opacity: .9; }
.reader-edge-button--prev { left: 318px; }
.reader-edge-button--next { right: 286px; border-radius: 9px 0 0 9px; }
.reader-edge-button:disabled { cursor: not-allowed; opacity: .28; }
.reader-loading { position: absolute; border-radius: 8px; padding: 10px 16px; color: #fff; background: rgba(61, 38, 26, .8); }
.reader-pan-hint { position: absolute; bottom: 18px; left: 50%; z-index: 8; display: grid; min-width: 260px; grid-template-columns: 34px auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; border: 1px solid rgba(229, 203, 156, .7); border-radius: 10px; padding: 10px 14px; color: #fff8e8; background: rgba(58, 31, 27, .9); box-shadow: 0 8px 24px rgba(38, 20, 16, .22); font-family: var(--font-sans); pointer-events: none; transform: translateX(-50%); }
.reader-pan-hint > span { display: grid; width: 34px; height: 34px; grid-row: 1 / 3; place-items: center; border-radius: 50%; color: #572822; background: #ead9b7; font-size: 1.1rem; }
.reader-pan-hint strong { font-size: .82rem; line-height: 1.4; }
.reader-pan-hint small { color: #decdb0; font-size: .7rem; }
.reader-toolbar { position: relative; z-index: 10; display: flex; min-width: 0; align-items: center; gap: 8px; overflow-x: auto; padding: 13px 22px; color: #f4e9d5; background: linear-gradient(100deg, #4e2421, #6f2e28, #40201e); box-shadow: 0 -5px 18px rgba(48, 24, 22, .22); font-family: var(--font-sans); }
.reader-toolbar button { flex: 0 0 auto; min-height: 48px; border: 1px solid rgba(232, 206, 164, .38); border-radius: 7px; padding: 0 15px; color: #f4e9d5; background: rgba(255, 255, 255, .04); }
.reader-toolbar button:hover, .reader-toolbar button.is-active { color: #4f251f; background: #ead9b7; }
.reader-toolbar button:disabled { cursor: not-allowed; color: rgba(244, 233, 213, .48); background: rgba(255, 255, 255, .02); opacity: .62; }
.reader-page-indicator { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 0 6px; white-space: nowrap; }
.reader-page-indicator input { width: 64px; min-height: 42px; border-color: rgba(232, 206, 164, .45); color: #fff; background: rgba(255, 255, 255, .08); text-align: center; }
.reader-page-indicator span { color: #dbc6a6; }
.reader-toolbar__divider { flex: 0 0 1px; width: 1px; height: 40px; margin: 0 8px; background: rgba(232, 206, 164, .35); }
.reader-transcript { position: fixed; top: 72px; right: 0; bottom: 92px; z-index: 55; display: grid; width: min(460px, calc(100vw - 32px)); grid-template-rows: auto auto auto minmax(0, 1fr) auto; overflow: hidden; border-left: 1px solid #c9b58f; color: #342b25; background: #fffaf0; box-shadow: -18px 0 42px rgba(49, 31, 22, .22); opacity: 0; pointer-events: none; transform: translateX(105%); transition: transform .18s ease-out, opacity .14s ease-out; }
.reader-transcript.is-open { opacity: 1; pointer-events: auto; transform: translateX(0); }
.reader-transcript__header { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #dfd1b7; padding: 16px 20px; background: linear-gradient(120deg, #fffaf0, #f1e4ce); }
.reader-transcript__eyebrow { display: block; margin-bottom: 3px; color: var(--cinnabar); font-family: var(--font-sans); font-size: .7rem; font-weight: 700; letter-spacing: .16em; }
.reader-transcript__header h2 { margin: 0; color: #33241d; font-size: 1.08rem; line-height: 1.35; }
.reader-transcript__header button { display: grid; min-width: 44px; min-height: 44px; flex: 0 0 44px; place-items: center; border: 1px solid #d8c5a4; border-radius: 8px; color: #6c3a32; background: rgba(255, 255, 255, .72); font-family: var(--font-sans); font-size: 1.45rem; }
.reader-transcript__header button:hover, .reader-transcript__header button:focus-visible { border-color: var(--cinnabar); background: #fff; }
.reader-transcript__meta { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #eadfcd; padding: 9px 20px; color: #756454; font-family: var(--font-sans); font-size: .76rem; }
.reader-transcript__location { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; text-align: right; }
.reader-transcript__location i { color: #b7a58b; font-style: normal; }
.reader-transcript__badge { display: inline-flex; min-height: 28px; align-items: center; border-radius: 999px; padding: 4px 10px; color: #5c4b3c; background: #ece6dd; font-weight: 700; }
.reader-transcript__badge.is-human-verified { color: #1f6846; background: #e3f3e9; }
.reader-transcript__badge.is-human-reviewing { color: #315c88; background: #e5eef8; }
.reader-transcript__badge.is-machine { color: #8a5b18; background: #f8ebcc; }
.reader-transcript__badge.is-loading { color: #5a6470; background: #e9edf2; }
.reader-transcript__note { margin: 0; border-bottom: 1px solid #eadfcd; padding: 12px 20px; color: #756454; background: #fffdf7; font-family: var(--font-sans); font-size: .78rem; line-height: 1.65; }
.reader-transcript__body { position: relative; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 20px; }
.reader-transcript__body pre { min-height: 100%; margin: 0; color: #312823; font-family: "Noto Serif SC", "Songti SC", SimSun, serif; font-size: 1rem; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.reader-transcript__body pre:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 5px; }
.reader-transcript__loading { display: grid; min-height: 220px; place-items: center; align-content: center; gap: 12px; color: #766454; font-family: var(--font-sans); }
.reader-transcript__loading i { width: 30px; height: 30px; border: 3px solid #e4d6bd; border-top-color: var(--cinnabar); border-radius: 50%; animation: reader-transcript-spin .8s linear infinite; }
.reader-transcript__empty { display: grid; min-height: 250px; place-items: center; align-content: center; gap: 10px; border: 1px dashed #d8c6a7; border-radius: 12px; padding: 28px; color: #756454; background: #fffdf8; text-align: center; }
.reader-transcript__empty strong { color: #49372e; font-size: 1rem; }
.reader-transcript__empty p { max-width: 300px; margin: 0; font-family: var(--font-sans); font-size: .8rem; line-height: 1.65; }
.reader-transcript__empty button { min-height: 44px; margin-top: 5px; border: 1px solid #c8aa7c; border-radius: 8px; padding: 0 18px; color: #67312a; background: #f6ead7; font-family: var(--font-sans); }
.reader-transcript__footer { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; border-top: 1px solid #dccbae; padding: 13px 20px; background: #f2e6d3; }
.reader-transcript__footer > span { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #b98f64; border-radius: 50%; color: var(--cinnabar); font-weight: 700; }
.reader-transcript__footer p { display: grid; gap: 2px; margin: 0; }
.reader-transcript__footer strong { font-size: .8rem; }
.reader-transcript__footer small { color: #786655; font-family: var(--font-sans); font-size: .68rem; line-height: 1.45; }
@keyframes reader-transcript-spin { to { transform: rotate(360deg); } }
.reader-app.is-toc-collapsed .reader-workspace { grid-template-columns: 0 minmax(0, 1fr) 286px; }
.reader-app.is-thumbs-collapsed .reader-workspace { grid-template-columns: 318px minmax(0, 1fr) 0; }
.reader-app.is-toc-collapsed .reader-sidebar--toc, .reader-app.is-thumbs-collapsed .reader-sidebar--thumbs { visibility: hidden; }
.reader-app.is-toc-collapsed .reader-edge-button--prev { left: 0; }
.reader-app.is-thumbs-collapsed .reader-edge-button--next { right: 0; }
.reader-app.is-warm-tone .reader-stage { background: radial-gradient(circle at center, #ead8b4, #c9b89b); }
.reader-app.is-warm-tone .reader-page img { filter: sepia(.18) contrast(.96); }

@media (max-width: 1240px) {
    :root { --container: 1160px; }
    .portal-header__inner { gap: 18px; }
    .portal-nav { gap: 16px; }
    .portal-nav a { font-size: .9rem; }
    .portal-header__actions .portal-user-link span { display: none; }
    .home-hero__inner { grid-template-columns: minmax(440px, 1fr) 1fr; }
    .home-hero__art { right: -100px; }
    .document-shelf { grid-template-columns: repeat(3, 1fr); }
    .shelf-card__cover { aspect-ratio: 4 / 5; }
    .search-document-grid { grid-template-columns: repeat(2, 1fr); }
    .favorite-grid { grid-template-columns: repeat(3, 1fr); }
    .related-grid { grid-template-columns: repeat(4, 1fr); }
    .reader-workspace { grid-template-columns: 265px minmax(0, 1fr) 230px; }
    .reader-edge-button--prev { left: 265px; }
    .reader-edge-button--next { right: 230px; }
    .reader-stage { padding-inline: 42px; }
    .reader-app.is-toc-collapsed .reader-workspace { grid-template-columns: 0 minmax(0, 1fr) 230px; }
    .reader-app.is-thumbs-collapsed .reader-workspace { grid-template-columns: 265px minmax(0, 1fr) 0; }
}

@media (max-width: 1020px) {
    .portal-container { width: min(calc(100% - 32px), var(--container)); }
    .portal-nav-toggle { display: flex; margin-left: auto; }
    .portal-nav { position: fixed; top: var(--header-height); right: 0; left: 0; display: grid; max-height: 0; grid-template-columns: repeat(2, 1fr); align-content: start; gap: 0; overflow: hidden; border-bottom: 1px solid var(--border); background: #fffdf8; box-shadow: var(--shadow-md); transition: max-height .25s ease; }
    body.is-nav-open .portal-nav { max-height: 70vh; overflow-y: auto; }
    .portal-nav a { min-height: 58px; border-bottom: 1px solid #eee4d3; padding: 0 24px; }
    .portal-nav a::after { display: none; }
    .portal-nav .portal-nav__mobile-account { display: grid !important; color: var(--cinnabar-dark); background: #f7eddd; font-weight: 700; }
    body.is-nav-open .portal-nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    body.is-nav-open .portal-nav-toggle span:nth-child(2) { opacity: 0; }
    body.is-nav-open .portal-nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .portal-footer__grid { grid-template-columns: 1.4fr repeat(2, 1fr); gap: 34px; }
    .portal-footer__grid > div:last-child { grid-column: 2 / 4; }
    .home-hero__inner { min-height: 650px; grid-template-columns: 1fr; }
    .home-hero__copy { max-width: 650px; }
    .home-hero__art { right: -80px; width: 58%; opacity: .42; }
    .home-member-desk { grid-template-columns: minmax(220px, 1fr) auto; }
    .home-member-desk__actions { grid-column: 1 / -1; }
    .home-catalogue__grid { grid-template-columns: repeat(2, 1fr); }
    .home-functions__grid { grid-template-columns: repeat(2, 1fr); }
    .home-stats__grid > div { padding-inline: 24px; }
    .about-hero__inner { grid-template-columns: 1fr .9fr; }
    .about-intro__layout { grid-template-columns: 1fr; gap: 34px; }
    .about-intro__text { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 28px; }
    .about-collections__grid { grid-template-columns: repeat(2, 1fr); }
    .about-contact__grid { grid-template-columns: 1fr 1.3fr; }
    .about-contact__join { grid-column: 1 / -1; }
    .search-layout { grid-template-columns: 1fr; }
    .search-browse-strip header { align-items: flex-start; flex-direction: column; gap: 8px; }
    .search-filters { position: fixed; inset: 0 auto 0 0; z-index: 300; width: min(86vw, 340px); border-radius: 0; transform: translateX(-105%); transition: transform .25s ease; overflow-y: auto; }
    .search-filters.is-open { transform: translateX(0); }
    .search-filters__close, .search-filter-trigger { display: inline-flex; }
    .detail-layout { grid-template-columns: 340px 1fr; gap: 36px; }
    .detail-cover-frame { min-height: 450px; }
    .related-grid { grid-template-columns: repeat(3, 1fr); }
    .auth-shell { grid-template-columns: 36% 64%; }
    .auth-visual__brand { left: 8%; display: grid; }
    .auth-visual blockquote { left: 12%; }
    .auth-visual__values { display: grid; gap: 10px; }
    .auth-visual__values span { min-width: 0; border: 0; }
    .profile-layout { grid-template-columns: 1fr; }
    .apply-layout { grid-template-columns: 1fr; }
    .apply-document { position: static; }
    .profile-sidebar { min-height: 0; overflow: visible; }
    .profile-identity { display: grid; grid-template-columns: 90px 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 20px; padding: 20px; text-align: left; }
    .profile-avatar { width: 80px; height: 80px; grid-row: 1 / 3; margin: 0; }
    .profile-identity h2 { align-self: end; margin: 0; }
    .profile-role { align-self: start; justify-self: start; }
    .profile-identity p { grid-column: 3; grid-row: 1 / 3; }
    .profile-nav { width: 100%; max-width: 100%; grid-template-columns: repeat(7, minmax(118px, 1fr)); border-top: 1px solid var(--border); overflow-x: auto; overscroll-behavior-inline: contain; }
    .profile-nav a { justify-content: center; border-left: 0; border-bottom: 3px solid transparent; padding: 0 14px; white-space: nowrap; }
    .profile-nav a:hover, .page-profile-overview [data-profile-nav="overview"], .page-profile-favorites [data-profile-nav="favorites"], .page-profile-bookmarks [data-profile-nav="bookmarks"], .page-profile-history [data-profile-nav="history"], .page-profile-applications [data-profile-nav="applications"], .page-profile-account [data-profile-nav="account"], .page-profile-password [data-profile-nav="password"] { border-bottom-color: var(--cinnabar); border-left-color: transparent; }
    .profile-sidebar__art { display: none; }
    .profile-stat-grid { grid-template-columns: repeat(3, 1fr); }
    .profile-overview-grid { grid-template-columns: 1fr 1fr; }
    .profile-recommendation-grid { grid-template-columns: repeat(3, 1fr); }
    .reader-app { grid-template-rows: 64px minmax(0, 1fr) 82px; }
    .reader-topbar { grid-template-columns: 190px 1fr 125px; padding-inline: 16px; }
    .reader-workspace { grid-template-columns: 1fr; }
    .reader-sidebar { position: fixed; top: 64px; bottom: 82px; z-index: 40; width: min(84vw, 320px); box-shadow: var(--shadow-lg); transition: transform .25s ease; }
    .reader-sidebar--toc { left: 0; transform: translateX(-105%); }
    .reader-sidebar--thumbs { right: 0; transform: translateX(105%); }
    .reader-app.is-toc-open .reader-sidebar--toc, .reader-app.is-thumbs-open .reader-sidebar--thumbs { transform: translateX(0); }
    .reader-edge-button--prev { left: 0; }
    .reader-edge-button--next { right: 0; }
    .reader-stage { padding: 22px 46px; }
    .reader-toolbar { padding-inline: 12px; }
    .reader-transcript { top: 64px; bottom: 82px; }
}

@media (max-width: 760px) {
    body { font-size: 15px; }
    .portal-section { padding: 52px 0; }
    .portal-container { width: min(calc(100% - 24px), var(--container)); }
    .portal-brand__copy strong { font-size: 1.15rem; }
    .portal-header .portal-brand__wordmark img { width: 128px; }
    .portal-brand__copy small { font-size: .54rem; }
    .portal-header__actions { display: none; }
    .portal-footer__grid { grid-template-columns: 1fr 1fr; }
    .portal-footer__brand { grid-column: 1 / -1; }
    .portal-footer__grid > div:last-child { grid-column: auto; }
    .portal-section-heading--center h2::before, .portal-section-heading--center h2::after { width: 26px; margin-inline: 8px; }
    .home-hero, .home-hero__inner { min-height: 730px; }
    .home-hero__copy { align-self: start; padding: 48px 0 70px; }
    .home-hero__wordmark img { width: min(100%, 520px); }
    .home-hero__lead { font-size: 1.35rem; }
    .home-hero__art { right: -30px; bottom: -28px; width: 82%; opacity: .72; }
    .home-search { grid-template-columns: 110px 1fr; }
    .home-search .portal-button { grid-column: 1 / -1; margin: 0 6px 6px; }
    .home-member-desk, .home-member-desk--guest { grid-template-columns: 1fr; padding: 15px; }
    .home-member-desk__stats { justify-content: space-around; border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 10px 0; }
    .home-member-desk__stats a { flex: 1; }
    .home-member-desk__actions { grid-column: auto; }
    .home-catalogue { padding-block: 42px; }
    .home-catalogue__grid { grid-template-columns: 1fr; }
    .home-catalogue__grid > a { min-height: 110px; }
    .home-stats__grid { grid-template-columns: 1fr 1fr; }
    .home-stats__grid > div { min-height: 105px; grid-template-columns: 44px 1fr; padding: 15px; border-bottom: 1px solid rgba(236, 204, 144, .25); }
    .home-stats__icon { width: 39px; height: 39px; }
    .home-stats strong { font-size: 1.45rem; }
    .home-functions__grid, .about-collections__grid, .about-partners__grid { grid-template-columns: 1fr; }
    .home-function-card { min-height: 220px; }
    .document-shelf { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .home-latest__grid { grid-template-columns: 1fr; }
    .home-value__grid { grid-template-columns: 1fr 1fr; gap: 24px 0; }
    .home-value__grid > div:nth-child(2) { border-right: 0; }
    .about-hero__inner { min-height: 610px; grid-template-columns: 1fr; }
    .about-hero__copy { padding: 52px 0 12px; }
    .about-hero__inner > img { max-width: 96%; margin-left: auto; }
    .about-timeline { grid-template-columns: 1fr; gap: 0; padding-left: 32px; }
    .about-timeline::before { top: 0; bottom: 0; left: 10px; width: 1px; height: auto; }
    .about-timeline li { grid-template-columns: 96px 1fr; grid-template-rows: auto auto; justify-items: start; padding: 15px 0; text-align: left; }
    .about-timeline li::before { position: absolute; top: 20px; left: -31px; width: 14px; height: 14px; margin: 0; border-width: 4px; }
    .about-timeline time { position: static; grid-row: 1 / 3; }
    .about-timeline strong { margin: 0; }
    .about-contact__grid { grid-template-columns: 1fr; }
    .about-contact__join { grid-column: auto; }
    .search-hero-form { grid-template-columns: 1fr; }
    .search-partner-check, .search-hero-form__hint, .search-advanced { grid-column: 1; }
    .search-hero-form__hint { justify-self: start; }
    .search-advanced__header { align-items: flex-start; flex-direction: column; gap: 6px; }
    .search-advanced__grid { grid-template-columns: 1fr; }
    .search-browse-strip { padding: 25px 0; }
    .search-browse-strip .portal-container > div { scroll-snap-type: x proximity; }
    .search-browse-strip a { min-width: min(78vw, 220px); scroll-snap-align: start; }
    .search-active-filters a { width: 100%; margin-left: 0; text-align: right; }
    .search-results__toolbar { align-items: flex-start; }
    .search-results__toolbar > div:last-child { display: grid; justify-items: end; }
    .search-results__toolbar label { display: flex; align-items: flex-end; flex-direction: column; gap: 2px; font-size: .7rem; }
    .search-results__toolbar label select { min-width: 120px; }
    .search-document-grid { grid-template-columns: 1fr; }
    .search-document-card { min-height: 510px; }
    .search-document-grid.is-list .search-document-card { grid-template-columns: 125px 1fr; min-height: 230px; }
    .search-document-grid.is-list .search-document-card__cover img { height: 175px; }
    .search-document-grid.is-list .search-document-card__body { padding: 18px; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-cover-panel { position: static; }
    .detail-cover-frame { min-height: 430px; }
    .detail-metadata div { grid-template-columns: 105px 1fr; }
    .detail-toc { grid-template-columns: 1fr; }
    .detail-toc li:nth-last-child(-n+2) { border-bottom-color: rgba(213, 193, 158, .65); }
    .detail-download { align-items: stretch; flex-direction: column; }
    .related-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { min-height: 370px; }
    .auth-visual__brand { top: 28px; left: 24px; display: flex; }
    .auth-visual__brand img { width: 56px; height: 56px; }
    .auth-visual__brand h1 { font-size: 2rem; }
    .auth-visual__brand p { font-size: .7rem; }
    .auth-visual blockquote { top: 120px; left: 24px; font-size: 1.35rem; }
    .auth-visual__values { display: none; }
    .auth-panel { min-height: auto; padding: 58px 22px 88px; }
    .auth-back { top: 18px; right: 20px; }
    .auth-legal { bottom: 20px; padding-inline: 20px; }
    .auth-form--grid { grid-template-columns: 1fr; }
    .auth-form--grid .auth-agreement, .auth-form--grid .auth-submit { grid-column: 1; }
    .profile-page { padding-top: 18px; }
    .profile-identity { grid-template-columns: 68px 1fr; }
    .profile-avatar { width: 62px; height: 62px; }
    .profile-identity p { display: none; }
    .profile-nav { grid-template-columns: repeat(7, minmax(108px, 1fr)); }
    .profile-nav a { min-height: 58px; gap: 8px; padding-inline: 10px; font-size: .84rem; }
    .profile-nav a svg { width: 20px; }
    .profile-content { padding: 22px 16px; }
    .profile-content__header { align-items: flex-start; flex-direction: column; }
    .profile-overview-heading { align-items: stretch; }
    .profile-quick-search { width: 100%; min-width: 0; }
    .profile-toolbar { align-items: flex-start; flex-direction: column; }
    .profile-toolbar--filters { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
    .profile-toolbar__search { grid-column: 1 / -1; width: 100%; }
    .favorite-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .history-card { grid-template-columns: 88px 1fr; gap: 15px; }
    .history-card__cover img { width: 82px; height: 106px; }
    .history-card__actions { grid-column: 1 / -1; grid-template-columns: 1fr auto; }
    .application-card { grid-template-columns: 70px 1fr; padding: 15px; }
    .application-card > img { width: 64px; height: 84px; }
    .application-card__actions { grid-column: 1 / -1; }
    .application-card dl { grid-template-columns: 1fr; }
    .application-timeline { overflow-x: auto; grid-template-columns: repeat(4, minmax(82px, 1fr)); padding-bottom: 5px; }
    .profile-research-desk { grid-template-columns: 1fr; padding: 20px; }
    .profile-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-stat-grid a { min-height: 102px; }
    .profile-overview-grid { grid-template-columns: 1fr; }
    .profile-overview-panel--reading { grid-column: auto; }
    .profile-continue-card { grid-template-columns: 78px 1fr; }
    .profile-continue-card > a:first-child img { width: 72px; height: 92px; }
    .profile-continue-card > .portal-button { grid-column: 1 / -1; }
    .profile-recommendation-grid { grid-template-columns: repeat(2, 1fr); }
    .bookmark-management-list article { grid-template-columns: 76px 1fr; gap: 13px; padding: 13px; }
    .bookmark-management-list__cover img { width: 70px; height: 92px; }
    .bookmark-management-list__actions { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; justify-items: stretch; }
    .bookmark-management-list__actions form { text-align: center; }
    .profile-form__grid, .password-layout { grid-template-columns: 1fr; }
    .apply-form-card { padding: 25px 18px; }
    .apply-user-info, .apply-options { grid-template-columns: 1fr; }
    .apply-user-info div:nth-last-child(2) { border-bottom: 1px solid var(--border); }
    .apply-urgency { align-items: flex-start; flex-direction: column; gap: 12px; }
    .apply-form__actions { flex-direction: column-reverse; }
    .avatar-uploader { align-items: flex-start; flex-wrap: wrap; }
    .reader-topbar { grid-template-columns: 50px 1fr 70px; }
    .reader-brand strong { display: none; }
    .reader-topbar__title { overflow: hidden; font-size: .9rem; white-space: nowrap; text-overflow: ellipsis; }
    .reader-topbar__title span { display: none; }
    .reader-protection-badge { display: none; }
    .reader-exit { font-size: 0; }
    .reader-exit span { font-size: 1.7rem; }
    .reader-stage { padding: 18px 35px; }
    .reader-pages { gap: 0; perspective: 1500px; }
    .reader-pages::after { display: none; }
    .reader-page { flex-basis: 100%; }
    .reader-page.is-visible + .reader-page.is-visible { display: none; }
    .reader-page img { max-height: calc(100dvh - 190px); border-radius: 6px !important; }
    .reader-toolbar { gap: 6px; }
    .reader-toolbar button { min-height: 44px; padding-inline: 12px; }
    .reader-toolbar__divider { display: none; }
    .reader-page-indicator span { display: none; }
    .reader-pan-hint { right: 12px; bottom: 12px; left: 12px; min-width: 0; transform: none; }
    .reader-pan-hint small { display: none; }
    .reader-transcript { top: auto; right: 8px; bottom: 82px; left: 8px; width: auto; height: min(58dvh, 520px); border: 1px solid #c9b58f; border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -18px 42px rgba(49, 31, 22, .24); transform: translateY(calc(100% + 92px)); }
    .reader-transcript.is-open { transform: translateY(0); }
    .reader-transcript__header { min-height: 68px; padding: 10px 14px; }
    .reader-transcript__meta, .reader-transcript__note, .reader-transcript__body, .reader-transcript__footer { padding-inline: 14px; }
}

@media (max-width: 460px) {
    .portal-toast { right: 12px; bottom: 12px; left: 12px; width: auto; max-width: none; align-items: stretch; flex-direction: column; }
    .portal-toast__action { text-align: center; }
    .portal-brand__copy small { display: none; }
    .portal-nav { grid-template-columns: 1fr; }
    .portal-footer__grid { grid-template-columns: 1fr; }
    .portal-footer__grid > div:last-child { grid-column: auto; }
    .home-hot-searches a:nth-of-type(n+4) { display: none; }
    .home-function-card { padding-inline: 20px; }
    .home-member-desk__actions { display: grid; }
    .home-latest__grid article { grid-template-columns: 92px 1fr; gap: 13px; padding: 12px; }
    .home-latest__grid article > a img { width: 86px; height: 112px; }
    .home-latest__grid p { -webkit-line-clamp: 1; }
    .document-shelf { grid-template-columns: 1fr 1fr; }
    .shelf-card__body { padding: 11px; }
    .shelf-card h3 { font-size: .9rem; }
    .shelf-card p { font-size: .72rem; }
    .home-value__grid { grid-template-columns: 1fr; }
    .home-value__grid > div { border-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
    .search-document-grid.is-list .search-document-card { grid-template-columns: 1fr; }
    .search-document-grid.is-list .search-document-card__cover { display: none; }
    .detail-cover-frame { min-height: 380px; }
    .related-grid { grid-template-columns: 1fr 1fr; }
    .favorite-grid { grid-template-columns: 1fr; }
    .profile-stat-grid { grid-template-columns: 1fr 1fr; }
    .profile-stat-grid a { grid-template-columns: 34px 1fr; padding: 10px; }
    .profile-stat-grid a > span { width: 34px; }
    .profile-recommendation-grid { grid-template-columns: 1fr 1fr; }
    .bookmark-management-list article { grid-template-columns: 64px 1fr; }
    .bookmark-management-list__cover img { width: 58px; height: 78px; }
    .profile-tabs a { min-width: 0; flex: 1; }
    .portal-state-page__actions { width: 100%; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
    .reader-app.is-motion-enabled .reader-page.is-turning-leaf { transition-duration: .46s !important; }
    .reader-app.is-motion-enabled .reader-page.is-turning-leaf::before { transition-duration: .23s !important; }
    .reader-transcript__loading i { animation: none !important; }
}

@keyframes search-pulse {
    from { opacity: .45; transform: scale(.88); }
    to { opacity: 1; transform: scale(1); }
}

/* Search experience refresh: 检索笺 / 目录签 / 馆际签 */
.search-mode-intro { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 22px; margin-top: 16px; }
.search-mode-intro__slip { position: relative; display: grid; width: 78px; min-height: 94px; align-content: center; gap: 3px; border: 1px solid var(--border-strong); border-top: 4px solid var(--cinnabar); border-radius: 3px 3px 9px 9px; padding: 14px 8px 10px; color: var(--cinnabar-dark); background: linear-gradient(90deg, rgba(195, 151, 80, .08) 1px, transparent 1px) 0 0 / 12px 100%, #fffaf0; box-shadow: 3px 4px 0 rgba(195, 151, 80, .17); text-align: center; }
.search-mode-intro__slip::before { position: absolute; top: 7px; left: 50%; width: 7px; height: 7px; content: ""; border: 1px solid #c8aa78; border-radius: 50%; background: var(--paper); transform: translateX(-50%); }
.search-mode-intro__slip span { font-size: 1rem; font-weight: 700; letter-spacing: .12em; writing-mode: vertical-rl; justify-self: center; }
.search-mode-intro__slip strong { color: var(--muted); font-family: Georgia, serif; font-size: .54rem; font-weight: 400; letter-spacing: .08em; }
.search-mode-intro h1 { margin: 0 0 4px; color: var(--cinnabar-dark); font-size: clamp(1.55rem, 2.5vw, 2.35rem); font-weight: 600; letter-spacing: .06em; }
.search-mode-intro p:last-child { max-width: 760px; margin: 0; color: var(--ink-soft); font-size: .9rem; }
.page-search--category .search-mode-intro__slip { border-top-color: var(--gold); color: #725021; }
.page-search--partner .search-mode-intro__slip { border-top-color: var(--ink-soft); color: var(--ink); }
.search-hero-form { position: relative; border-top: 3px solid rgba(150, 54, 47, .72); margin-top: 16px; }
.page-search--category .search-hero-form { border-top-color: var(--gold); }
.page-search--partner .search-hero-form { border-top-color: var(--ink-soft); }
.search-hero-form--partner { grid-template-columns: 170px minmax(0, 1fr) 116px; }
.search-scope-static { display: grid; min-height: 50px; align-content: center; border: 1px solid var(--border); border-radius: 7px; padding: 5px 12px; background: rgba(255, 255, 255, .72); font-family: var(--font-sans); line-height: 1.25; }
.search-scope-static span { color: var(--muted); font-size: .63rem; }
.search-scope-static strong { margin-top: 3px; color: var(--cinnabar-dark); font-size: .82rem; }
.search-hero-form--partner .search-hero-form__hint { grid-column: 2 / -1; }
.search-advanced:not([hidden]) { animation: search-panel-reveal .18s ease-out both; }
.search-browse-strip__index { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px !important; overflow: visible !important; }
.search-browse-strip__index form { min-width: 0; }
.search-browse-strip__index button { display: grid; width: 100%; min-height: 78px; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; border: 1px solid #d0b58c; border-radius: 7px; padding: 10px 13px; color: var(--ink); background: rgba(255, 253, 248, .76); text-align: left; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.search-browse-strip__index button:hover, .search-browse-strip__index button[aria-current="page"] { border-color: var(--cinnabar); background: #fffdf8; transform: translateY(-1px); }
.search-browse-strip__index button[aria-current="page"] { box-shadow: inset 3px 0 0 var(--cinnabar); }
.search-browse-strip__index button > span:last-child { color: var(--cinnabar); font-family: var(--font-sans); font-size: .72rem; white-space: nowrap; }
.search-browse-strip__callno { color: #9b7b4e !important; font-family: Georgia, serif !important; font-size: .58rem !important; letter-spacing: .04em; }
.search-partner-intro__inner { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(390px, .8fr); align-items: center; gap: 42px; }
.search-partner-intro__inner dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border: 1px solid var(--border); border-radius: 8px; background: rgba(255, 253, 248, .78); }
.search-partner-intro__inner dl div { display: grid; gap: 2px; padding: 15px; border-right: 1px solid var(--border); }
.search-partner-intro__inner dl div:last-child { border-right: 0; }
.search-partner-intro__inner dt { color: var(--muted); font-family: var(--font-sans); font-size: .68rem; }
.search-partner-intro__inner dd { margin: 0; color: var(--cinnabar-dark); font-size: 1.05rem; font-weight: 700; }
.page-search--partner .search-layout { grid-template-columns: 1fr; }
.page-search--partner .search-filters, .page-search--partner .search-filter-trigger { display: none; }
.page-search--partner .search-document-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.page-search--partner .search-document-grid.is-list { grid-template-columns: 1fr; }
.page-search--partner .search-document-card--external { min-height: 440px; grid-template-rows: auto 1fr; border-top: 3px solid var(--gold); }
.partner-resource-media { position: relative; display: grid; overflow: hidden; grid-template-rows: 26px auto; color: var(--ink); background: #f3eadb; isolation: isolate; }
.partner-resource-media__chrome { z-index: 3; display: flex; align-items: center; gap: 5px; border-bottom: 1px solid rgba(156, 124, 82, .35); padding: 0 10px; background: rgba(255, 252, 245, .96); }
.partner-resource-media__chrome i { width: 6px; height: 6px; border: 1px solid rgba(129, 91, 55, .35); border-radius: 50%; background: #dfccb0; }
.partner-resource-media__chrome em { overflow: hidden; margin-left: auto; color: #816b55; font-family: var(--font-sans); font-size: .58rem; font-style: normal; letter-spacing: .08em; text-overflow: ellipsis; white-space: nowrap; }
.partner-resource-media__placeholder, .partner-resource-media__image { width: 100%; aspect-ratio: 16 / 9; grid-area: 2 / 1; }
.partner-resource-media__placeholder { position: relative; z-index: 0; display: flex; align-items: center; flex-direction: column; justify-content: center; overflow: hidden; color: #735a40; text-align: center; }
.partner-resource-media__placeholder > img { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.partner-resource-media__placeholder > span, .partner-resource-media__placeholder > small { position: relative; display: block; font-family: var(--font-sans); }
.partner-resource-media__placeholder > span { border-bottom: 1px solid rgba(150, 54, 47, .3); padding: 0 6px 5px; color: var(--cinnabar-dark); font-size: .82rem; font-weight: 700; letter-spacing: .12em; }
.partner-resource-media__placeholder > small { margin-top: 7px; color: #8a7259; font-size: .62rem; }
.partner-resource-media__image { position: relative; z-index: 1; display: block; background: #f8f4ec; }
.partner-resource-media__image[hidden] { display: none; }
.partner-resource-media--screenshot .partner-resource-media__image { object-fit: cover; object-position: top center; }
.partner-resource-media--logo .partner-resource-media__image { padding: clamp(24px, 8%, 42px); object-fit: contain; background: #fffdf8; }
.partner-resource-media__launch { position: absolute; z-index: 4; right: 10px; bottom: 9px; border: 1px solid rgba(127, 91, 50, .35); border-radius: 999px; padding: 3px 8px; color: #64472f; background: rgba(255, 252, 245, .92); font-family: var(--font-sans); font-size: .58rem; letter-spacing: .04em; }
.partner-resource-media:hover .partner-resource-media__launch { border-color: var(--cinnabar); color: var(--cinnabar-dark); }
.partner-resource-media:focus-visible { z-index: 4; outline-offset: -4px; }
.partner-resource-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.search-document-grid.is-list .search-document-card--external { grid-template-columns: minmax(245px, 30%) minmax(0, 1fr); }
.search-document-grid.is-list .partner-resource-media { align-self: start; }
.page-search.page-search--category .portal-nav [data-nav="search"], .page-search.page-search--partner .portal-nav [data-nav="search"] { color: #453d36; }
.page-search.page-search--category .portal-nav [data-nav="search"]::after, .page-search.page-search--partner .portal-nav [data-nav="search"]::after { transform: scaleX(0); }
.page-search--category .portal-nav [data-nav="category"], .page-search--partner .portal-nav [data-nav="partner"] { color: var(--cinnabar); }
.page-search--category .portal-nav [data-nav="category"]::after, .page-search--partner .portal-nav [data-nav="partner"]::after { transform: scaleX(1); }
.filter-choice { position: relative; min-height: 44px; margin: 0 -8px; border: 1px solid transparent; border-radius: 7px; padding: 7px 8px; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease; }
.filter-choice:hover { color: var(--cinnabar-dark); background: #f7eddd; }
.filter-choice:has(input:checked) { border-color: #d9bf94; color: var(--cinnabar-dark); background: #f2e4ce; font-weight: 700; }
.filter-choice:has(input:focus-visible) { outline: 3px solid rgba(150, 54, 47, .28); outline-offset: 2px; }
.filter-choice input:focus-visible { outline: 0; }
.filter-choice i { color: var(--cinnabar); font-family: var(--font-serif); font-size: 1.1rem; font-style: normal; opacity: 0; transform: translateX(-3px); transition: opacity .16s ease, transform .16s ease; }
.filter-choice:hover i, .filter-choice:has(input:checked) i { opacity: 1; transform: translateX(0); }
.filter-choice.is-pending { cursor: progress; opacity: .68; }
.filter-choice.is-pending::after { width: 14px; height: 14px; content: ""; border: 2px solid rgba(150, 54, 47, .22); border-top-color: var(--cinnabar); border-radius: 50%; animation: search-filter-spin .65s linear infinite; }
.filter-group select { min-height: 46px; }
.filter-live-status { margin: 14px 0 0; color: var(--muted); font-family: var(--font-sans); font-size: .7rem; }
.search-active-filters { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; padding: 12px 14px; border-left: 3px solid var(--gold); }
.search-active-filters__label { color: var(--ink-soft) !important; font-weight: 700; white-space: nowrap; }
.search-active-filters__chips { display: flex; min-width: 0; flex-wrap: wrap; gap: 7px; }
.search-filter-chip { display: inline-flex; width: auto; min-height: 44px; align-items: center; gap: 5px; border: 1px solid #dac19b; border-radius: 999px; padding: 4px 7px 4px 11px; color: #5f3528; background: #f1e2cc; text-align: left; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.search-filter-chip:hover { border-color: var(--cinnabar); color: var(--cinnabar-dark); background: #fff8ea; transform: translateY(-1px); }
.search-filter-chip span { color: #8b6d50; font-size: .68rem; }
.search-filter-chip strong { max-width: 240px; overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.search-filter-chip svg { width: 20px; height: 20px; border-radius: 50%; padding: 3px; color: var(--cinnabar); background: rgba(255, 255, 255, .48); }
.search-active-filters__clear { display: inline-flex; min-height: 44px; align-items: center; color: var(--cinnabar); white-space: nowrap; }
.search-active-filters__clear:hover { text-decoration: underline; text-underline-offset: 3px; }
.search-results__toolbar { border-bottom: 1px solid rgba(201, 173, 123, .55); padding-bottom: 12px; }
.search-document-card__cover img { aspect-ratio: auto; }
.portal-pagination a { transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease; }
.page-search .portal-pagination a, .page-search .portal-pagination > span { min-width: 44px; height: 44px; }
.page-search .view-switch button, .page-search .search-filters__close { min-width: 44px; min-height: 44px; }
.portal-pagination a:hover { transform: translateY(-1px); }

@media (max-width: 1120px) {
    .search-browse-strip__index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .page-search--partner .search-document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .page-search input, .page-search select, .page-search button { font-size: 16px; }
    .search-mode-intro { grid-template-columns: 58px minmax(0, 1fr); gap: 14px; }
    .search-mode-intro__slip { width: 58px; min-height: 78px; padding-inline: 5px; }
    .search-mode-intro__slip span { font-size: .86rem; }
    .search-mode-intro h1 { font-size: 1.45rem; }
    .search-mode-intro p:last-child { font-size: .8rem; line-height: 1.6; }
    .search-hero-form { padding: 15px; }
    .search-hero-form--partner { grid-template-columns: 1fr; }
    .search-hero-form--partner .search-hero-form__hint { grid-column: 1; }
    .search-browse-strip__index { display: flex !important; overflow-x: auto !important; scroll-snap-type: x proximity; }
    .search-browse-strip__index form { min-width: min(76vw, 250px); scroll-snap-align: start; }
    .search-browse-strip__index button { min-height: 70px; }
    .search-partner-intro__inner { grid-template-columns: 1fr; gap: 18px; }
    .search-partner-intro__inner dl { min-width: 0; }
    .search-active-filters { grid-template-columns: 1fr auto; align-items: start; }
    .search-active-filters__label { padding-top: 7px; }
    .search-active-filters__chips { grid-column: 1 / -1; grid-row: 2; }
    .search-filter-chip { width: auto !important; margin: 0 !important; }
    .search-active-filters__clear { width: auto !important; margin: 0 !important; padding-top: 7px; text-align: right; }
    .page-search--partner .search-document-grid { grid-template-columns: 1fr; }
    .search-document-grid.is-list .search-document-card--external { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .search-document-grid.is-list .partner-resource-media { width: 100%; }
}

@media (max-width: 460px) {
    .search-mode-intro { grid-template-columns: 1fr; }
    .search-mode-intro__slip { display: flex; width: max-content; min-height: 34px; align-items: center; gap: 8px; padding: 5px 10px; }
    .search-mode-intro__slip::before { display: none; }
    .search-mode-intro__slip span { writing-mode: horizontal-tb; }
    .search-partner-intro__inner dl { grid-template-columns: 1fr; }
    .search-partner-intro__inner dl div { grid-template-columns: 1fr auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .search-partner-intro__inner dl div:last-child { border-bottom: 0; }
    .search-active-filters { grid-template-columns: 1fr; }
    .search-active-filters__chips { grid-column: 1; grid-row: auto; }
    .search-active-filters__clear { justify-self: end; }
    .search-filter-chip strong { max-width: 180px; }
    .partner-resource-media { display: grid; min-height: 196px; }
    .partner-resource-media__placeholder, .partner-resource-media__image { min-height: 170px; }
    .partner-resource-media--logo .partner-resource-media__image { padding: 25px; }
}

@keyframes search-panel-reveal {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes search-filter-spin { to { transform: rotate(1turn); } }

/* Approval feedback inbox: a restrained archival docket rather than a chat feed. */
.portal-message-link { position: relative; display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--ink-soft); background: #fffdf8; transition: border-color .16s ease, color .16s ease, background .16s ease; }
.portal-message-link:hover { border-color: #c89c64; color: var(--cinnabar); background: #fbf2e5; }
.portal-message-link svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.portal-message-link > span { position: absolute; top: -5px; right: -4px; display: grid; min-width: 19px; height: 19px; place-items: center; border: 2px solid #fffdf8; border-radius: 999px; padding: 0 4px; color: #fff; background: var(--cinnabar); font: 700 .62rem/1 var(--font-sans); }
.portal-user-menu__badge { min-width: 20px; margin-left: auto; border-radius: 999px; padding: 2px 6px; color: #fff; background: var(--cinnabar); font-size: .65rem; text-align: center; }
.profile-nav__badge { display: grid; min-width: 21px; height: 21px; place-items: center; margin-left: auto; border-radius: 999px; padding: 0 6px; color: #fff; background: var(--cinnabar); font-size: .65rem; }
.profile-stat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.profile-notification-heading form { flex: 0 0 auto; }
.profile-tabs a > span { display: inline-grid; min-width: 18px; height: 18px; place-items: center; margin-left: 4px; border-radius: 999px; color: var(--cinnabar); background: #fff; font-size: .65rem; }
.profile-notification-list { display: grid; gap: 12px; }
.profile-notification { position: relative; display: grid; min-height: 132px; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 17px; align-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; padding: 18px 18px 18px 16px; background: rgba(255, 253, 248, .78); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.profile-notification::before { position: absolute; inset: 0 auto 0 0; width: 3px; content: ""; background: #b79a75; opacity: .38; }
.profile-notification.is-unread { border-color: #cfad76; background: #fffaf0; box-shadow: 0 8px 23px rgba(91, 57, 28, .08); }
.profile-notification.is-unread::before { opacity: 1; background: var(--cinnabar); }
.profile-notification:hover { border-color: #c9a16c; transform: translateY(-1px); }
.profile-notification__seal { display: grid; width: 52px; height: 66px; place-items: center; border: 1px solid #c9a879; color: var(--cinnabar-dark); background: linear-gradient(180deg, #fff8e8, #f0dfc5); clip-path: polygon(50% 0,100% 10%,93% 100%,7% 100%,0 10%); font-family: var(--font-serif); font-size: 1.15rem; font-weight: 700; }
.profile-notification__body { min-width: 0; }
.profile-notification__body > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-family: var(--font-sans); font-size: .7rem; }
.profile-notification__body > div > span { color: var(--cinnabar); font-weight: 700; letter-spacing: .05em; }
.profile-notification__body i { border-radius: 999px; padding: 2px 7px; color: #fff; background: var(--cinnabar); font-size: .62rem; font-style: normal; }
.profile-notification__body time { margin-left: auto; }
.profile-notification__body h2 { margin: 8px 0 4px; color: var(--ink); font-size: 1.08rem; }
.profile-notification__body p { margin: 0; color: var(--ink-soft); font-size: .86rem; line-height: 1.75; }
.profile-notification__action { min-width: 104px; }
.profile-notification__action .portal-button { width: 100%; white-space: nowrap; }
.profile-notification--success .profile-notification__seal { color: #38644c; border-color: #9eb7a7; background: linear-gradient(180deg, #f3f8ef, #e2ecdc); }
.profile-notification--warning .profile-notification__seal { color: #874037; border-color: #d0a097; background: linear-gradient(180deg, #fff2eb, #f4d9cc); }
.profile-notification-empty > span { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 14px; border-radius: 50%; color: #4f8065; background: #edf5ee; font-size: 1.55rem; }
@media (max-width: 1180px) { .profile-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .profile-notification { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 15px 14px; }
    .profile-notification__seal { width: 44px; height: 56px; }
    .profile-notification__action { grid-column: 2; min-width: 0; }
    .profile-notification__action .portal-button { width: auto; }
    .profile-notification__body time { width: 100%; margin-left: 0; }
    .xssdc { margin: 0 }
}
@media (max-width: 520px) {
    .profile-notification { grid-template-columns: 1fr; }
    .profile-notification__seal { display: none; }
    .profile-notification__action { grid-column: 1; }
    .xssdc { margin: 0 }
}
