:root {
  --ink: #14211c;
  --muted: #66726c;
  --forest: #173f32;
  --forest-deep: #0e2d24;
  --cream: #f3efe6;
  --paper: #fffdf8;
  --clay: #b96747;
  --line: #dcd8cf;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, input { font: inherit; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr); }
.login-intro { min-height: 100vh; padding: clamp(34px, 5vw, 76px); display: flex; flex-direction: column; justify-content: space-between; color: #f8f4e9; background: radial-gradient(circle at 18% 15%, rgba(211,171,113,.15), transparent 28%), linear-gradient(145deg, var(--forest) 0%, var(--forest-deep) 72%); }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: .08em; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; font-family: Georgia, serif; font-size: 12px; }
.intro-main { max-width: 760px; margin: 12vh 0 8vh; }
.eyebrow, .card-kicker { margin: 0 0 20px; color: #d9b98c; font-size: 11px; font-weight: 800; letter-spacing: .23em; }
.intro-main h1 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: clamp(44px, 5vw, 74px); font-weight: 500; line-height: 1.2; letter-spacing: -.04em; }
.intro-main p:last-child { max-width: 600px; margin: 28px 0 0; color: rgba(248,244,233,.72); font-size: 17px; line-height: 1.9; }
.intro-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.intro-meta span { padding: 7px 11px; color: rgba(248,244,233,.72); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; font-size: 11px; }
.login-panel { min-height: 100vh; padding: 42px clamp(24px, 5vw, 78px); display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 95% 8%, rgba(185,103,71,.09), transparent 28%), var(--cream); }
.login-card { width: min(100%, 455px); padding: clamp(30px, 4vw, 50px); background: rgba(255,253,248,.96); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 70px rgba(21,38,30,.12); }
.card-kicker { margin-bottom: 10px; color: var(--clay); }
.login-card h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 35px; font-weight: 600; }
.card-lead { margin: 11px 0 31px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-card form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 700; }
.field input { width: 100%; min-height: 50px; padding: 0 14px; color: var(--ink); background: #fff; border: 1px solid #cbd0ca; border-radius: 10px; outline: none; }
.field input:focus { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(23,63,50,.1); }
.login-button { min-height: 52px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: var(--forest); border: 0; border-radius: 10px; cursor: pointer; font-weight: 750; }
.login-button:hover { background: var(--forest-deep); }
.privacy-note { margin: 24px 0 0; color: #828b86; font-size: 11px; line-height: 1.7; text-align: center; }
.form-alert { margin-bottom: 18px; padding: 12px 13px; color: #873725; background: #fff0ea; border: 1px solid #edc7ba; border-radius: 9px; font-size: 12px; }
.login-panel footer { margin-top: 22px; color: #8a928e; font-size: 11px; }
.login-panel footer a { color: inherit; text-underline-offset: 3px; }
.placeholder { min-height: 100vh; display: grid; place-content: center; text-align: center; }

.library-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 2%, rgba(185,103,71,.07), transparent 24rem),
    var(--cream);
}

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 9px 13px; color: #fff; background: var(--forest-deep); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(220,216,207,.92); background: rgba(243,239,230,.92); backdrop-filter: blur(16px); }
.site-header__inner { width: min(calc(100% - 40px), 1180px); min-height: 76px; margin: 0 auto; display: flex; align-items: center; gap: 34px; }
.library-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.library-brand__mark { width: 39px; height: 39px; display: grid; place-items: center; color: #fff; background: var(--forest); border-radius: 50%; font-family: Georgia, serif; font-size: 10px; letter-spacing: .06em; }
.library-brand strong { display: block; font-family: "Songti SC", "STSong", serif; font-size: 16px; letter-spacing: .03em; }
.library-brand small { display: block; margin-top: 3px; color: #7a837f; font-size: 8px; font-weight: 700; letter-spacing: .17em; }
.site-nav { align-self: stretch; display: flex; align-items: stretch; gap: 3px; }
.site-nav a, .site-nav span { position: relative; padding: 0 13px; display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; }
.site-nav span { opacity: .46; cursor: not-allowed; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--forest); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; right: 13px; bottom: -1px; left: 13px; height: 2px; background: var(--clay); }
.account-area { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.account-area form { margin: 0; }
.account-pill { padding: 6px 10px; color: var(--forest); background: #e3ece7; border: 1px solid #c7d8cf; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.quiet-button { padding: 7px 9px; color: var(--muted); background: transparent; border: 0; cursor: pointer; font-size: 12px; font-weight: 700; }
.quiet-button:hover { color: var(--forest); }

.page-shell { width: min(calc(100% - 40px), 1180px); min-height: calc(100vh - 140px); margin: 0 auto; padding: 48px 0 78px; }
.page-shell--narrow { width: min(calc(100% - 40px), 890px); }
.messages { margin-bottom: 20px; }
.message { padding: 12px 14px; background: #e4eee8; border: 1px solid #c9dacf; border-radius: 9px; font-size: 13px; }

.archive-hero { padding: 11px 0 42px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 50px; }
.archive-kicker, .panel-heading p, .results-heading p { margin: 0 0 9px; color: var(--clay); font-size: 10px; font-weight: 850; letter-spacing: .2em; }
.archive-hero h1 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: clamp(43px, 5vw, 65px); font-weight: 600; letter-spacing: -.045em; }
.archive-hero__copy > p:last-child { max-width: 670px; margin: 17px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.archive-stats { margin: 0; padding: 19px 23px; display: grid; grid-template-columns: repeat(3, auto); gap: 25px; background: rgba(255,253,248,.72); border: 1px solid var(--line); border-radius: 13px; }
.archive-stats div { min-width: 68px; }
.archive-stats dt { color: var(--muted); font-size: 10px; white-space: nowrap; }
.archive-stats dd { margin: 6px 0 0; color: var(--forest); font-family: Georgia, serif; font-size: 23px; }

.search-section { margin-bottom: 34px; }
.library-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.search-box { min-height: 64px; padding: 7px 8px 7px 19px; display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid #d3d4ce; border-radius: 14px; box-shadow: 0 13px 35px rgba(20,38,29,.07); }
.search-box > span { color: var(--forest); font-family: Georgia, serif; font-size: 28px; transform: rotate(-18deg); }
.search-box input { min-width: 0; flex: 1; padding: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 15px; }
.search-box input::placeholder { color: #969e99; }
.search-box button { min-height: 48px; padding: 0 23px; color: #fff; background: var(--forest); border: 0; border-radius: 10px; cursor: pointer; font-weight: 750; }
.search-box button:hover { background: var(--forest-deep); }
.search-note { margin-top: 10px; display: flex; align-items: center; gap: 8px; color: #818984; font-size: 10px; }
.status-dot { width: 6px; height: 6px; background: #5d9478; border-radius: 50%; box-shadow: 0 0 0 4px rgba(93,148,120,.11); }

.library-layout { display: grid; grid-template-columns: 225px minmax(0,1fr); align-items: start; gap: 34px; }
.category-panel { position: sticky; top: 105px; padding: 22px; background: rgba(255,253,248,.68); border: 1px solid var(--line); border-radius: 14px; }
.panel-heading { padding-bottom: 15px; border-bottom: 1px solid #e6e2d9; }
.panel-heading h2, .results-heading h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 23px; font-weight: 650; }
.category-nav { margin-top: 11px; display: grid; gap: 2px; }
.category-nav a { padding: 10px 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); border-radius: 8px; text-decoration: none; font-size: 12px; }
.category-nav a strong { color: #89918c; font-family: Georgia, serif; font-size: 11px; }
.category-nav a:hover { color: var(--forest); background: #eef1ec; }
.category-nav a[aria-current="page"] { color: var(--forest); background: #e3ece7; font-weight: 750; }
.category-nav a[aria-current="page"] strong { color: var(--forest); }
.owner-note { margin-top: 20px; padding-top: 18px; display: flex; align-items: flex-start; gap: 10px; border-top: 1px solid #e6e2d9; }
.owner-note__mark { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; color: var(--forest); background: #e3ece7; border-radius: 50%; font-family: "Songti SC", serif; font-size: 12px; }
.owner-note strong { font-size: 11px; }
.owner-note p { margin: 5px 0 0; color: #858c88; font-size: 9px; line-height: 1.6; }

.materials-section { min-width: 0; }
.results-heading { min-height: 54px; margin-bottom: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.results-heading > span { color: var(--muted); font-size: 11px; }
.material-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.material-card { position: relative; min-height: 270px; padding: 22px; display: flex; flex-direction: column; background: rgba(255,253,248,.88); border: 1px solid var(--line); border-radius: 13px; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.material-card:hover { transform: translateY(-2px); border-color: #c5c7c0; box-shadow: 0 14px 35px rgba(20,38,29,.07); }
.material-card__head { min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.file-kind { min-width: 38px; padding: 6px 8px; display: inline-grid; place-items: center; color: var(--forest); background: #e3ece7; border-radius: 6px; font-size: 9px; font-weight: 850; letter-spacing: .06em; }
.pin-label { color: var(--clay); font-size: 9px; font-weight: 800; }
.material-category { margin: 18px 0 7px; color: var(--clay); font-size: 10px; font-weight: 750; }
.material-card h3 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 21px; font-weight: 650; line-height: 1.35; }
.material-card h3 a { color: var(--ink); text-decoration: none; }
.material-card h3 a::after { content: ""; position: absolute; inset: 0; }
.material-summary { margin: 10px 0; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.keyword-line { overflow: hidden; color: #89918d; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.material-card__foot { margin-top: auto; padding-top: 16px; display: flex; justify-content: space-between; color: #8a918d; border-top: 1px solid #ebe7df; font-size: 9px; }
.material-card__foot span:last-child { color: var(--forest); font-weight: 750; }
.empty-results { padding: 70px 20px; display: grid; justify-items: center; background: rgba(255,253,248,.56); border: 1px dashed #c9c7c0; border-radius: 14px; text-align: center; }
.empty-results > span { width: 48px; height: 48px; display: grid; place-items: center; color: var(--forest); background: #e3ece7; border-radius: 50%; font-family: "Songti SC", serif; }
.empty-results h3 { margin: 14px 0 7px; font-family: "Songti SC", serif; font-size: 22px; }
.empty-results p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.empty-results a { color: var(--forest); font-size: 12px; font-weight: 750; }

.back-link { display: inline-flex; margin-bottom: 26px; color: var(--forest); text-decoration: none; font-size: 12px; font-weight: 750; }
.document-view { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 20px 55px rgba(20,38,29,.07); }
.document-head { padding: clamp(28px, 5vw, 52px); background: radial-gradient(circle at 95% 0, rgba(185,103,71,.08), transparent 19rem); border-bottom: 1px solid var(--line); }
.document-labels { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 10px; }
.document-head h1 { max-width: 700px; margin: 21px 0 11px; font-family: "Songti SC", "STSong", serif; font-size: clamp(35px, 5vw, 52px); font-weight: 600; letter-spacing: -.035em; }
.document-head > p { max-width: 710px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.document-head dl { margin: 28px 0; padding: 17px 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; border-top: 1px solid #e6e2da; border-bottom: 1px solid #e6e2da; }
.document-head dl div { min-width: 0; }
.document-head dt { color: #8b928e; font-size: 9px; }
.document-head dd { margin: 5px 0 0; overflow: hidden; font-size: 11px; line-height: 1.5; text-overflow: ellipsis; }
.download-button { min-height: 43px; padding: 0 16px; display: inline-flex; align-items: center; color: #fff; background: var(--forest); border-radius: 9px; text-decoration: none; font-size: 12px; font-weight: 750; }
.document-body { padding: clamp(28px, 5vw, 52px); }
.document-body h2 { margin: 0 0 24px; font-family: "Songti SC", "STSong", serif; font-size: 27px; }
.document-body > div { color: #34413b; font-size: 14px; line-height: 2; }
.document-body > div p { margin: 0 0 1.1em; }
.file-attached { margin-top: 25px; padding: 12px 14px; color: var(--muted); background: #f1eee7; border-radius: 8px; font-size: 11px; }
.related-section { margin-top: 34px; }
.related-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.related-list a { min-width: 0; padding: 16px; display: grid; gap: 8px; color: var(--ink); background: rgba(255,253,248,.78); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.related-list a span { color: var(--clay); font-size: 9px; font-weight: 800; }
.related-list a strong { overflow: hidden; font-family: "Songti SC", serif; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.related-list a small { color: var(--muted); font-size: 9px; }

.form-heading { margin-bottom: 25px; }
.form-heading h1 { margin: 0; font-family: "Songti SC", serif; font-size: 44px; }
.form-heading > p:last-child { color: var(--muted); font-size: 13px; }
.material-form { padding: 30px; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.form-control { min-width: 0; display: grid; gap: 7px; }
.form-control--wide { grid-column: 1/-1; }
.form-control label { font-size: 12px; font-weight: 750; }
.form-control label em { color: var(--clay); font-style: normal; }
.form-control input, .form-control select, .form-control textarea { width: 100%; padding: 11px 12px; color: var(--ink); background: #fff; border: 1px solid #cbd0ca; border-radius: 9px; font: inherit; font-size: 13px; outline: none; }
.form-control textarea { resize: vertical; line-height: 1.65; }
.form-control input:focus, .form-control select:focus, .form-control textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(23,63,50,.08); }
.field-errors { color: #8a3827; font-size: 10px; }
.upload-note { margin: 20px 0 0; padding: 11px 13px; color: var(--muted); background: #f1eee7; border-left: 3px solid var(--clay); font-size: 10px; line-height: 1.6; }
.form-actions { margin-top: 24px; padding-top: 19px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; border-top: 1px solid #e7e3da; }
.form-actions a, .form-actions button { min-height: 42px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; font-size: 12px; font-weight: 750; text-decoration: none; }
.form-actions a { color: var(--forest); border: 1px solid #ccd0ca; }
.form-actions button { color: #fff; background: var(--forest); border: 0; cursor: pointer; }

.site-footer { border-top: 1px solid var(--line); }
.site-footer > div { width: min(calc(100% - 40px), 1180px); min-height: 68px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 15px; color: #858d88; font-size: 10px; }
.site-footer a { color: inherit; text-underline-offset: 3px; }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; }
.library-brand:focus-visible, .site-nav a:focus-visible, .quiet-button:focus-visible, .search-box button:focus-visible, .material-card a:focus-visible, .download-button:focus-visible, .category-nav a:focus-visible, .form-actions a:focus-visible, .form-actions button:focus-visible { outline: 3px solid rgba(185,103,71,.34); outline-offset: 3px; }

@media (max-width: 900px) {
  .site-header__inner { gap: 18px; }
  .site-nav a, .site-nav span { padding: 0 8px; }
  .archive-hero { grid-template-columns: 1fr; gap: 24px; }
  .archive-stats { width: fit-content; }
  .library-layout { grid-template-columns: 195px minmax(0,1fr); gap: 20px; }
  .material-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .site-header { position: static; }
  .site-header__inner { width: calc(100% - 28px); min-height: 68px; flex-wrap: wrap; }
  .library-brand { padding-top: 12px; }
  .account-area { padding-top: 12px; }
  .site-nav { width: 100%; height: 44px; order: 3; }
  .site-nav a, .site-nav span { flex: 1; justify-content: center; }
  .page-shell, .page-shell--narrow { width: calc(100% - 28px); padding: 34px 0 60px; }
  .archive-hero { padding-top: 2px; }
  .archive-hero h1 { font-size: 41px; }
  .archive-stats { width: 100%; gap: 12px; padding: 16px; }
  .archive-stats div { min-width: 0; }
  .archive-stats dd { font-size: 20px; }
  .search-box { min-height: 58px; padding-left: 14px; }
  .search-box button { min-height: 44px; padding: 0 17px; }
  .library-layout { grid-template-columns: 1fr; }
  .category-panel { position: static; padding: 16px; }
  .panel-heading, .owner-note { display: none; }
  .category-nav { margin: 0; display: flex; overflow-x: auto; }
  .category-nav a { flex: 0 0 auto; }
  .material-card { min-height: 245px; }
  .document-head dl { grid-template-columns: 1fr; gap: 12px; }
  .related-list { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-control--wide { grid-column: auto; }
  .site-footer > div { width: calc(100% - 28px); flex-direction: column; gap: 4px; text-align: center; }
}

@media (max-width: 880px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: 42vh; padding: 28px; }
  .intro-main { margin: 8vh 0 5vh; }
  .intro-main h1 { font-size: clamp(37px, 9vw, 56px); }
  .intro-main p:last-child { display: none; }
  .login-panel { min-height: 58vh; padding: 35px 20px; }
  .login-card { margin-top: -54px; position: relative; }
}
