:root {
  --ink: #17231d;
  --muted: #65736b;
  --paper: #f5f2e9;
  --card: #fffef9;
  --green: #174c3c;
  --green-soft: #dce8df;
  --gold: #b8843d;
  --line: #d9d6ca;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
.hero { color: #f8f5eb; background: linear-gradient(135deg, #102f27, #1d5745 58%, #376f55); padding: 0 6vw 4.5rem; position: relative; overflow: hidden; }
.hero::after { content: "学"; position: absolute; right: 5vw; bottom: -7rem; font: 22rem/1 serif; color: rgba(255,255,255,.045); pointer-events: none; }
.topbar { max-width: 1180px; margin: auto; height: 74px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.16); }
.brand, .scope-link { text-decoration: none; }
.brand { font: 700 1.08rem/1 serif; letter-spacing: .12em; }
.scope-link { border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .52rem .95rem; font-size: .85rem; }
.hero-copy { max-width: 860px; margin: 4rem auto 0; position: relative; z-index: 1; }
.eyebrow { color: #d8b77d; font-size: .72rem; letter-spacing: .28em; }
h1 { margin: .5rem 0 .8rem; font: 700 clamp(2.4rem, 7vw, 4.8rem)/1.1 Georgia, "STSong", serif; letter-spacing: .03em; }
.intro { color: rgba(255,255,255,.74); margin-bottom: 2rem; }
.search-box { height: 62px; max-width: 760px; display: flex; align-items: center; gap: .85rem; padding: 0 1.2rem; color: var(--green); background: #fff; border-radius: 8px; box-shadow: 0 18px 44px rgba(0,0,0,.22); }
.search-box > span:first-child { font-size: 1.8rem; transform: rotate(-15deg); }
.search-box input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: 1rem; background: transparent; }
kbd { color: #77827d; background: #eef0ec; border: 1px solid #d9ddd8; border-radius: 4px; padding: .15rem .5rem; }
main { max-width: 1180px; margin: auto; padding: 2.2rem 2rem 4rem; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem; }
.categories { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip { border: 1px solid var(--line); border-radius: 999px; background: transparent; padding: .52rem .9rem; color: var(--muted); cursor: pointer; }
.chip.active, .chip:hover { color: white; background: var(--green); border-color: var(--green); }
.count { color: var(--muted); white-space: nowrap; font-size: .88rem; }
.library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.document-card { display: flex; flex-direction: column; min-height: 250px; padding: 1.6rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; transition: transform .2s, box-shadow .2s; }
.document-card:hover { transform: translateY(-3px); box-shadow: 0 13px 30px rgba(31,55,43,.1); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .72rem; }
.visibility { color: var(--green); background: var(--green-soft); padding: .28rem .5rem; border-radius: 3px; }
.category { color: var(--muted); }
.card-title { margin: 1rem 0 .7rem; font: 700 1.35rem/1.4 Georgia, "STSong", serif; }
.card-title a { text-decoration: none; }
.excerpt { color: var(--muted); line-height: 1.75; font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { margin-top: auto; padding-top: 1rem; display: flex; align-items: center; gap: .45rem; border-top: 1px solid #ece9df; }
.format-link { color: var(--gold); font-size: .7rem; text-decoration: none; border: 1px solid #dec9a7; border-radius: 3px; padding: .25rem .42rem; }
.read-link { margin-left: auto; color: var(--green); font-size: .86rem; text-decoration: none; font-weight: 700; }
.empty { text-align: center; padding: 5rem 1rem; color: var(--muted); }
.empty-mark { font-size: 3rem; }
footer { text-align: center; padding: 2rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .82rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media (max-width: 720px) {
  .hero { padding: 0 1.25rem 3rem; }
  .hero-copy { margin-top: 2.8rem; }
  .hero::after { display: none; }
  main { padding: 1.5rem 1rem 3rem; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .library-grid { grid-template-columns: 1fr; }
  .document-card { min-height: 220px; }
  kbd { display: none; }
}
