/* ============================================================
   课本库 · 中小学课本及教辅资料大全
   设计语言：书卷气 / 纸墨 / 印泥红印章 / 楷体标题
   ============================================================ */

:root {
  /* 纸张与墨色 */
  --paper:      #f5efe3;
  --paper-2:    #efe7d6;
  --paper-3:    #e9dfca;
  --card:       #fffdf8;
  --card-soft:  #fbf6ec;

  --ink:        #2a2521;
  --ink-soft:   #6c6256;
  --ink-faint:  #9a9081;

  --line:       #e1d6c0;
  --line-soft:  #ece3d2;

  /* 印泥红（主强调） */
  --red:        #ad3a2c;
  --red-deep:   #8c2e22;
  --red-soft:   #c56a5c;

  /* 赭金（细线、点缀） */
  --gold:       #bd9a4e;
  --gold-soft:  #d8bd7e;

  /* 黛青（辅色） */
  --jade:       #3f5d57;

  --shadow-sm:  0 1px 2px rgba(42, 37, 33, .05);
  --shadow-md:  0 8px 24px -12px rgba(42, 37, 33, .22);
  --shadow-lg:  0 18px 48px -20px rgba(42, 37, 33, .30);

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong,
           "SimSun", "宋体", Georgia, serif;
  --kai:   "LXGW WenKai Screen", "Kaiti SC", STKaiti, "KaiTi", "楷体",
           "Noto Serif SC", serif;
  --sans:  "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC",
           "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;

  --maxw: 1120px;
  --radius: 6px;
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  line-height: 1.75;
  font-size: 16px;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}
/* 纸张纹理 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
::selection { background: rgba(173, 58, 44, .18); }
img { max-width: 100%; display: block; }
a { color: var(--jade); text-decoration: none; }
a:hover { color: var(--red); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.3; color: var(--ink); margin: 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- 印章 Logo（SVG） ---------- */
.seal-svg {
  width: 42px; height: 42px; flex: none;
  filter: drop-shadow(0 2px 5px rgba(140, 46, 34, .35));
}
.seal-svg--sm { width: 36px; height: 36px; }

/* ---------- 顶部通告条 ---------- */
.topbar {
  background: var(--paper-3);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 7px 16px;
  letter-spacing: .06em;
}
.topbar b { color: var(--red-deep); font-family: var(--serif); letter-spacing: .12em; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 239, 227, .82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__name { font-family: var(--kai); font-size: 22px; font-weight: 600; letter-spacing: .1em; color: var(--ink); }
.brand__sub { font-size: 11px; color: var(--ink-faint); letter-spacing: .22em; margin-top: 1px; }
.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a {
  color: var(--ink-soft); font-size: 15px; padding: 8px 14px; border-radius: 5px;
  transition: color .2s, background .2s;
  position: relative;
}
.nav__links a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--red); border-radius: 1px; transform: scaleX(0); transform-origin: left;
  transition: transform .25s;
}
.nav__links a:hover { color: var(--ink); background: rgba(173, 58, 44, .07); }
.nav__links a.is-active { color: var(--red); }
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; cursor: pointer; color: var(--ink); font-size: 18px; }

/* ---------- 顶部通告 ---------- */
.announcement {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--paper-3); border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft); padding: 8px 16px; letter-spacing: .05em;
}
.announcement b { color: var(--red-deep); font-family: var(--serif); letter-spacing: .1em; }
.announcement::before, .announcement::after {
  content: ""; width: 28px; height: 1px; background: var(--gold-soft);
}

/* ---------- Hero ---------- */
.hero { padding: 80px 0 44px; position: relative; overflow: hidden; }
/* 底纹大字 */
.hero::before {
  content: "书";
  position: absolute; right: -30px; top: -60px;
  font-family: var(--kai); font-size: 380px; line-height: 1;
  color: rgba(173, 58, 44, .045);
  pointer-events: none; user-select: none;
}
.hero__grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 48px; align-items: center; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: .2em; color: var(--red);
  font-family: var(--serif); margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--red); display: inline-block; }
.hero h1 {
  font-family: var(--kai); font-weight: 600;
  font-size: clamp(52px, 7vw, 76px); letter-spacing: .06em;
  display: flex; align-items: flex-end; gap: 14px;
}
.hero__stamp { flex: none; transform: rotate(6deg) translateY(-8px); }
.hero__tag {
  font-family: var(--serif); font-size: 19px; color: var(--ink-soft);
  margin: 14px 0 20px; letter-spacing: .16em;
}
.hero__tag i { font-style: normal; color: var(--gold); margin: 0 10px; }
.hero__lead { font-size: 16.5px; color: var(--ink-soft); max-width: 30em; margin: 0 0 30px; }
.hero__lead b { color: var(--red-deep); }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }

/* 数据行 */
.hero__stats { display: flex; flex-wrap: wrap; }
.stat { padding: 0 28px; border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: none; }
.stat__num { font-family: var(--kai); font-size: 28px; color: var(--red-deep); line-height: 1.2; }
.stat__num small { font-size: 15px; margin-left: 2px; }
.stat__label { font-size: 12.5px; color: var(--ink-faint); letter-spacing: .08em; }

/* Hero 插画 */
.hero__art { display: flex; justify-content: center; position: relative; }
.hero__art svg { width: 100%; max-width: 400px; height: auto; filter: drop-shadow(0 20px 32px rgba(42,37,33,.16)); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  padding: 12px 22px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, box-shadow .2s, background .2s, color .2s;
  letter-spacing: .03em;
}
.btn--primary { background: var(--red); color: #fdf6ec; box-shadow: 0 6px 16px -8px rgba(140,46,34,.7); }
.btn--primary:hover { background: var(--red-deep); color: #fdf6ec; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--red); color: var(--red); transform: translateY(-1px); }
.btn--block { width: 100%; justify-content: center; }

/* ---------- 区块通用 ---------- */
.section { padding: 64px 0; }
.section--alt { background: var(--paper-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section__head { max-width: 680px; margin-bottom: 36px; }
.section__title {
  font-family: var(--kai); font-weight: 600;
  font-size: clamp(27px, 3.4vw, 35px); letter-spacing: .05em;
  display: flex; align-items: center; gap: 14px;
}
.section__title::before {
  content: ""; flex: none; width: 10px; height: 10px;
  background: var(--red); border-radius: 2px; transform: rotate(45deg);
}
.section__desc { color: var(--ink-soft); margin: 14px 0 0; font-size: 16px; }
.section__desc b { color: var(--red-deep); font-family: var(--serif); }

/* 分隔印章 */
.divider { display: flex; align-items: center; gap: 16px; margin: 8px 0 40px; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ---------- 简介卡 ---------- */
.intro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.intro__card {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px 26px; box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .25s;
  overflow: hidden;
}
.intro__card::before {
  content: ""; position: absolute; top: 0; left: 26px; right: 26px; height: 3px;
  background: linear-gradient(90deg, var(--red), rgba(189, 154, 78, 0));
  opacity: 0; transition: opacity .25s;
}
.intro__card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.intro__card:hover::before { opacity: 1; }
.intro__no {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--red); border-radius: 7px; color: var(--red);
  font-family: var(--kai); font-size: 19px; margin-bottom: 16px;
  transform: rotate(-3deg); background: rgba(173, 58, 44, .04);
}
.intro__card h3 { font-family: var(--kai); font-size: 20px; letter-spacing: .04em; margin-bottom: 10px; }
.intro__card p { color: var(--ink-soft); font-size: 15px; margin: 0; }
.intro__card p b { color: var(--red-deep); }

/* ---------- 学科宫格 ---------- */
.subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 14px; }
.subject-tile {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  padding: 13px 15px; color: var(--ink);
  transition: transform .18s, box-shadow .22s, border-color .2s;
}
.subject-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--red-soft); color: var(--ink); }
.subject-tile__glyph {
  flex: none; width: 42px; height: 42px; border-radius: 8px;
  background: var(--red); color: #fdf6ec;
  font-family: var(--kai); font-size: 21px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1.5px rgba(253, 246, 236, .35);
}
.subject-tile:nth-child(even) .subject-tile__glyph { background: var(--jade); }
.subject-tile__name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.subject-tile__count { font-size: 12px; color: var(--ink-faint); letter-spacing: .05em; }

/* ---------- 分类 chips ---------- */
.band { margin-top: 26px; }
.band__label {
  font-family: var(--serif); font-size: 15px; color: var(--ink-soft);
  margin-bottom: 12px; display: flex; align-items: center; gap: 10px; letter-spacing: .1em;
}
.band__label::before { content: ""; width: 7px; height: 7px; background: var(--gold); border-radius: 2px; transform: rotate(45deg); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-size: 14px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px;
  transition: border-color .2s, color .2s, background .2s;
}
.chip:hover { border-color: var(--red); color: var(--red); background: var(--card-soft); }
.cta-center { text-align: center; margin-top: 34px; }

/* ---------- 下载面板 ---------- */
.download { display: grid; gap: 24px; }
.panel {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-md); overflow: hidden;
}
.panel::before {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--red), var(--gold) 55%, rgba(189,154,78,0));
}
.panel__top {
  display: flex; align-items: flex-start; gap: 18px; padding: 26px 28px 22px;
  border-bottom: 1px dashed var(--line);
}
.panel__badge {
  flex: none; width: 48px; height: 48px; border-radius: 9px;
  background: var(--red); color: #fdf6ec; display: flex; align-items: center; justify-content: center;
  font-family: var(--kai); font-weight: 600; font-size: 22px;
  box-shadow: inset 0 0 0 2px rgba(253, 246, 236, .35), 0 3px 8px -3px rgba(140, 46, 34, .55);
}
.panel__title { font-family: var(--kai); font-size: 22px; letter-spacing: .03em; margin-bottom: 4px; }
.panel__meta { font-size: 13px; color: var(--ink-faint); letter-spacing: .06em; }
.panel__desc { color: var(--ink-soft); font-size: 15px; margin: 6px 0 0; }
.panel__links { padding: 8px 28px 24px; }

.linkrow {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line-soft);
}
.linkrow:last-child { border-bottom: none; }
.provider { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; }
.provider__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.provider__dot--baidu { background: #2932e1; }
.provider__dot--pan123 { background: #1f9d55; }
.linkrow__info { font-size: 13px; color: var(--ink-soft); min-width: 0; }
.linkrow__info b { color: var(--ink); font-weight: 600; }

/* 提取码 + 复制 */
.codebox {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper-2); border: 1px dashed var(--gold);
  border-radius: 6px; padding: 6px 8px 6px 12px; font-size: 14px;
}
.codebox__label { color: var(--ink-faint); font-size: 12px; }
.codebox__val { font-family: var(--serif); font-weight: 700; letter-spacing: .14em; color: var(--red-deep); font-size: 16px; }
.copybtn {
  border: none; background: var(--ink); color: #fdf6ec; cursor: pointer;
  font-size: 12px; padding: 6px 11px; border-radius: 5px; transition: background .2s;
  font-family: var(--sans);
}
.copybtn:hover { background: var(--red); }
.copybtn.is-done { background: var(--jade); }

.gobtn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--card-soft); border: 1px solid var(--line); color: var(--ink);
  font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 6px;
  transition: border-color .2s, color .2s, background .2s; white-space: nowrap;
}
.gobtn:hover { border-color: var(--red); color: var(--red); background: #fff; }

/* ---------- 使用说明 ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px 24px;
}
.step__no {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--red); color: var(--red);
  font-family: var(--kai); font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; background: rgba(173, 58, 44, .04);
}
.step h3 { font-family: var(--kai); font-size: 19px; letter-spacing: .04em; margin-bottom: 10px; }
.step p { color: var(--ink-soft); font-size: 15px; margin: 0; }
/* 步骤连线（桌面端） */
@media (min-width: 881px) {
  .step:not(:last-child)::after {
    content: ""; position: absolute; top: 45px; right: -14px; width: 8px; height: 8px;
    border-top: 2px dashed var(--gold-soft); border-right: 2px dashed var(--gold-soft);
    transform: rotate(45deg);
  }
}

/* ---------- 说明横幅 ---------- */
.note {
  border-left: 3px solid var(--gold); background: var(--card-soft);
  padding: 16px 20px; border-radius: 0 6px 6px 0; color: var(--ink-soft);
  font-size: 15px; margin-top: 26px;
}
.note b { color: var(--ink); }

/* ---------- 关于页 ---------- */
.about-hero { padding: 64px 0 40px; }
.about-hero h1 { font-family: var(--kai); font-size: clamp(34px, 5vw, 48px); letter-spacing: .05em; }
.about-hero p { color: var(--ink-soft); font-size: 17px; max-width: 34em; margin-top: 16px; }
.prose { max-width: 760px; }
.prose h2 {
  font-family: var(--kai);
  font-size: 23px; margin: 40px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); letter-spacing: .04em; position: relative;
}
.prose h2::before {
  content: ""; position: absolute; left: -16px; top: 11px; width: 8px; height: 8px;
  background: var(--red); border-radius: 2px; transform: rotate(45deg);
}
.prose p { color: #433c34; margin: 0 0 16px; }
.prose ul { color: #433c34; padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.prose b { color: var(--ink); }
.prose .lead { font-size: 17px; color: var(--ink); }

/* 时间线 */
.timeline { border-left: 2px solid var(--line); margin: 8px 0 8px 8px; padding-left: 22px; }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -29px; top: 6px; width: 12px; height: 12px;
  background: var(--card); border: 2px solid var(--red); border-radius: 50%;
}
.tl-item time { font-family: var(--serif); color: var(--red); font-size: 14px; font-weight: 700; }
.tl-item p { margin: 4px 0 0; color: var(--ink-soft); font-size: 15px; }

/* 免责卡 */
.disclaimer {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 26px 28px; margin-top: 18px;
}
.disclaimer h2 { border: none; padding: 0; margin: 0 0 12px; font-size: 20px; }
.disclaimer p { color: var(--ink-soft); font-size: 14px; margin: 0 0 10px; }
.disclaimer p:last-child { margin-bottom: 0; }

/* ---------- 页脚 ---------- */
.footer { position: relative; background: #2a2521; color: #d9cfbe; padding: 50px 0 30px; margin-top: 30px; }
.footer::before {
  content: ""; display: block; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--red), var(--gold) 50%, var(--red));
}
.footer a { color: #d9cfbe; }
.footer a:hover { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer__brand b { font-family: var(--kai); font-size: 20px; color: #fdf6ec; letter-spacing: .1em; }
.footer__about { font-size: 14px; color: #b3a895; max-width: 30em; }
.footer__col h4 { color: #fdf6ec; font-size: 15px; margin-bottom: 14px; font-family: var(--sans); letter-spacing: .1em; }
.footer__col a { display: block; font-size: 14px; color: #c2b6a2; padding: 5px 0; }
.footer__col a:hover { color: #fff; }
.footer__bottom {
  border-top: 1px solid #443d33; margin-top: 34px; padding-top: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 13px; color: #9a8f7c;
}

/* ---------- 入场动效（JS 加载后才启用，保证无 JS 可见） ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; gap: 30px; }
  .hero__art { order: -1; }
  .hero__art svg { max-width: 250px; }
  .hero::before { font-size: 260px; right: -60px; }
  .intro, .steps { grid-template-columns: 1fr; }
  .subjects { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .footer__grid { grid-template-columns: 1fr; gap: 26px; }
  .nav__links { display: none; position: absolute; top: 66px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column;
    align-items: stretch; padding: 8px 16px 16px; gap: 2px; }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px 14px; }
  .nav__links a::after { display: none; }
  .nav__toggle { display: inline-flex; }
  .stat { padding: 0 18px; }
  .stat__num { font-size: 24px; }
}
@media (max-width: 560px) {
  .container { padding: 0 20px; }
  .linkrow { grid-template-columns: 1fr; gap: 10px; }
  .linkrow__cta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .panel__top { flex-direction: column; }
  .hero { padding: 52px 0 36px; }
  .hero__stats { gap: 10px 0; }
  .stat:nth-child(3) { border-left: none; padding-left: 0; }
}

/* 焦点可见性（可访问性） */
a:focus-visible, button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ============================================================
   课本封面馆（books.html）
   ============================================================ */

/* 页头 */
.lib-hero { padding: 56px 0 8px; }
.lib-hero h1 { font-family: var(--kai); font-size: clamp(32px, 4.6vw, 46px); letter-spacing: .05em; margin-bottom: 12px; }
.lib-hero__lead { color: var(--ink-soft); font-size: 16px; max-width: 36em; margin: 0; }
.lib-hero__lead b { color: var(--red); font-family: var(--serif); font-size: 18px; }

/* 工具栏 */
.lib-toolbar { padding: 26px 0 6px; }
.lib-toolbar .container { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.lib-search { position: relative; flex: 1 1 320px; max-width: 460px; }
.lib-search input {
  width: 100%; padding: 11px 40px 11px 16px;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  transition: border-color .2s, box-shadow .2s;
}
.lib-search input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(173, 58, 44, .12); }
.lib-search input::placeholder { color: var(--ink-faint); }
.lib-search__clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: var(--paper-2); color: var(--ink-soft);
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1;
}
.lib-search__clear:hover { background: var(--red); color: #fdf6ec; }
.lib-selects { display: flex; gap: 10px; flex-wrap: wrap; }
.lib-selects select {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; cursor: pointer; max-width: 160px;
}
.lib-selects select:focus { outline: none; border-color: var(--red); }

/* 筛选面板 */
.lib-filters { padding: 14px 0 4px; }
.frow { display: flex; gap: 14px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); }
.frow:last-child { border-bottom: none; }
.frow__label {
  flex: none; width: 44px; text-align: justify; text-align-last: justify;
  font-family: var(--serif); font-size: 14px; color: var(--ink-soft);
  padding-top: 8px; letter-spacing: 2px;
}
.frow__opts { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.frow--tail { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.frow__active { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 28px; }
.frow__meta { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--ink-soft); }
.frow__meta b { color: var(--red); font-family: var(--serif); }

/* 筛选 chip */
button.chip { cursor: pointer; font-family: var(--sans); }
.chip i {
  font-style: normal; font-size: 11.5px; color: var(--ink-faint);
  margin-left: 6px; font-family: Georgia, serif;
}
.chip.on { background: var(--red); border-color: var(--red); color: #fdf6ec; }
.chip.on i { color: rgba(253, 246, 236, .8); }
.chip.on:hover { color: #fdf6ec; background: var(--red-deep); border-color: var(--red-deep); }

/* 活动标签 / 文字按钮 */
.a-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(173, 58, 44, .08); border: 1px solid rgba(173, 58, 44, .35);
  color: var(--red-deep); font-size: 13px; border-radius: 999px; padding: 4px 6px 4px 12px;
}
.a-chip button {
  border: none; background: var(--red); color: #fdf6ec; width: 18px; height: 18px;
  border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1;
}
.link-btn { border: none; background: none; color: var(--jade); font-size: 14px; cursor: pointer; padding: 4px 6px; font-family: var(--sans); }
.link-btn:hover { color: var(--red); }

/* 网格与卡片 */
.lib-main { padding: 20px 0 60px; }
.lib-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px;
}
.bkcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .2s, border-color .2s;
}
.bkcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--red-soft); }
.bkcard__cover {
  position: relative; aspect-ratio: 3 / 4.15; background: var(--paper-2);
  cursor: pointer; overflow: hidden;
}
.bkcard__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.bkcard:hover .bkcard__cover img { transform: scale(1.04); }
.bkcard__stage {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-size: 11px; letter-spacing: .05em; color: #fdf6ec;
  background: rgba(42, 37, 33, .72); border-radius: 4px; padding: 3px 7px;
  backdrop-filter: blur(4px);
}
.bkcard__body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.bkcard__title {
  font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink);
  font-family: var(--sans); min-height: 2.9em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bkcard__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 11.5px; color: var(--ink-soft); background: var(--card-soft);
  border: 1px solid var(--line-soft); border-radius: 4px; padding: 2px 7px; white-space: nowrap;
}
.tag--subject { color: var(--red-deep); border-color: rgba(173, 58, 44, .3); background: rgba(173, 58, 44, .06); }
.tag--ver { color: var(--jade); border-color: rgba(63, 93, 87, .3); background: rgba(63, 93, 87, .06); }
.bkcard__foot { display: flex; gap: 8px; margin-top: auto; }
.bkcard__btn { flex: 1; padding: 8px 6px; font-size: 13px; justify-content: center; }

/* 封面缺失占位 */
.ph {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(160deg, #efe7d6, #e2d5bc);
}
.ph-t { font-family: var(--kai); font-size: 42px; color: var(--red); opacity: .8; font-weight: 600; }
.ph-s {
  font-size: 12px; color: var(--ink-soft); padding: 0 14px; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* 空状态 / 分页 */
.lib-empty { text-align: center; padding: 60px 0; color: var(--ink-soft); }
.lib-pager { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 34px 0 6px; }
.pg {
  min-width: 36px; padding: 8px 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); border-radius: 6px; cursor: pointer; font-size: 14px; font-family: var(--sans);
  transition: border-color .2s, color .2s, background .2s;
}
.pg:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.pg.on { background: var(--red); border-color: var(--red); color: #fdf6ec; }
.pg:disabled { opacity: .4; cursor: default; }
.pg-gap { color: var(--ink-faint); align-self: center; }

/* 详情弹层 */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__mask { position: absolute; inset: 0; background: rgba(42, 37, 33, .55); backdrop-filter: blur(3px); }
.modal__card {
  position: relative; background: var(--card); border-radius: 12px;
  width: min(720px, 100%); max-height: min(86vh, 640px);
  display: grid; grid-template-columns: 240px 1fr; gap: 0;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal__close {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(42, 37, 33, .08); color: var(--ink); font-size: 18px; cursor: pointer;
}
.modal__close:hover { background: var(--red); color: #fdf6ec; }
.modal__cover { background: var(--paper-2); min-height: 320px; }
.modal__cover img { width: 100%; height: 100%; object-fit: cover; }
.modal__cover.noimg {
  background: linear-gradient(160deg, #efe7d6, #e2d5bc);
  display: flex; align-items: center; justify-content: center;
}
.modal__cover.noimg::after { content: "封面待补"; font-family: var(--kai); color: var(--ink-faint); font-size: 15px; }
.modal__info { padding: 26px 26px 24px; overflow-y: auto; }
.modal__info h3 { font-size: 20px; line-height: 1.4; padding-right: 30px; margin-bottom: 12px; }
.modal__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.modal__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0 0 20px; }
.modal__meta div { display: flex; gap: 8px; font-size: 13.5px; border-bottom: 1px dashed var(--line-soft); padding-bottom: 6px; }
.modal__meta dt { color: var(--ink-faint); flex: none; }
.modal__meta dd { margin: 0; color: var(--ink); }
.modal__actions { display: flex; gap: 12px; }

/* 响应式（封面馆） */
@media (max-width: 720px) {
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 12px; }
  .frow { flex-direction: column; gap: 6px; }
  .frow__label { width: auto; padding-top: 0; text-align-last: auto; }
  .modal__card { grid-template-columns: 1fr; max-height: 88vh; overflow-y: auto; }
  .modal__cover { min-height: 240px; max-height: 300px; }
}
