/* ==========================================================
   书城模板样式
   配色参考：米白纸面 + 墨蓝 + 玉绿点缀
   ========================================================== */

:root {
  --ink: #102a43;
  --ink-2: #243b53;
  --muted: #6b7c8f;
  --faint: #9aa8b7;
  --line: #d9e0e7;
  --paper: #fbfaf6;
  --white: #fff;
  --soft: #f1f4f5;
  --blue: #174a72;
  --blue-2: #0f3657;
  --jade: #1d7a63;
  --red: #a44437;
  --shadow: 0 10px 32px rgba(16, 42, 67, .08);
  --radius: 4px;
  --max: 1360px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* 卡片化设计令牌 */
  --surface: #ffffff;
  --surface-soft: #f2f6f5;
  --card-shadow: 0 4px 18px rgba(16, 42, 67, .06);
  --card-shadow-hover: 0 16px 40px rgba(16, 42, 67, .12);
  --radius-md: 11px;
  --radius-lg: 14px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="dark"] {
  --ink: #e7edf3;
  --ink-2: #c3d0dd;
  --muted: #93a5b6;
  --faint: #74879a;
  --line: #2b3b4d;
  --paper: #10171f;
  --white: #18222c;
  --soft: #1b2632;
  --blue: #6fa9d8;
  --blue-2: #9cc6e8;
  --jade: #4fbfa0;
  --red: #e08a7c;
  --shadow: 0 10px 32px rgba(0, 0, 0, .4);

  --surface: #14212a;
  --surface-soft: #17262f;
  --card-shadow: 0 12px 34px rgba(0, 0, 0, .24);
  --card-shadow-hover: 0 20px 52px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }

h1, h2, h3 {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid rgba(29, 122, 99, .35);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.skip-link:focus {
  position: fixed !important;
  left: 16px; top: 12px;
  z-index: 9999;
  width: auto; height: auto;
  padding: 10px 18px;
  clip: auto;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
}

.icon {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------------- 头部 ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid rgba(16, 42, 67, .12);
}
html[data-theme="dark"] .site-header { border-bottom-color: var(--line); }

.header-inner {
  width: min(var(--max), calc(100% - 48px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.8;
  stroke-linejoin: round;
  flex: none;
}
html[data-theme="dark"] .brand-mark { stroke: var(--blue); }
.brand-logo { max-width: 190px; height: 44px; object-fit: contain; }
.brand span { display: grid; line-height: 1.15; }
.brand strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  letter-spacing: .08em;
  color: var(--ink);
}
.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .13em;
}

.primary-nav { min-width: max-content; }
.nav-list {
  display: flex;
  gap: 26px;
  margin: 0; padding: 0;
  list-style: none;
}
.nav-list a {
  position: relative;
  display: inline-block;
  padding: 22px 0;
  font-weight: 600;
  color: var(--ink-2);
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 15px;
  height: 2px;
  background: var(--jade);
  transition: right .28s var(--ease);
}
.nav-list a:hover::after,
.nav-list a[aria-current="page"]::after { right: 0; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 16px; height: 2px;
  background: var(--ink-2);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  width: min(300px, 34vw);
  padding: 0 4px 0 12px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--muted);
}
.header-search:focus-within { border-color: var(--jade); }
.header-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  outline: none;
  font-size: 14px;
}
.header-search button {
  border: 0;
  padding: 6px 12px;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
html[data-theme="dark"] .header-search button { color: #10171f; }

.theme-toggle {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  flex: none;
}
.theme-toggle:hover { border-color: var(--jade); color: var(--jade); }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }
html[data-theme="dark"] .icon-sun { display: none; }

/* ---------------- 面包屑 ---------------- */

.crumbs { background: none; border: 0; }
.crumbs-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--jade); }
.crumbs .sep { margin: 0 5px; color: var(--faint); }
.crumbs .cur { color: var(--ink); font-weight: 600; }

/* ---------------- 通用布局 ---------------- */

.main {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.panel { min-width: 0; }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: .06em;
}
.panel-more {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.panel-more::after { content: " →"; }
.panel-more:hover { color: var(--jade); }

.panel-wide {
  margin-top: 44px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.empty-tip, .empty-box {
  padding: 34px 0;
  color: var(--muted);
  font-size: 14px;
}
.empty-box { text-align: center; }
.empty-box .btn-primary { margin-top: 16px; }

/* ---------------- 按钮 ---------------- */

.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
html[data-theme="dark"] .btn-primary { color: #10171f; }
.btn-primary:hover { background: var(--blue-2); color: #fff; }
html[data-theme="dark"] .btn-primary:hover { color: #10171f; }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--jade); color: var(--jade); }

/* ---------------- 首页 Hero / 轮播 ---------------- */

.hero {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.hero-inner { width: 100%; }

.hero-feature {
  position: relative;
  padding: clamp(16px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 88% 12%, rgba(29, 122, 99, .07), transparent 42%),
    radial-gradient(circle at 6% 90%, rgba(23, 74, 114, .07), transparent 40%),
    var(--white);
}

/* 叠层舞台：所有片子占同一格，高度取最高一屏，切换不跳动 */
.hero-stage { display: grid; }
.hero-slide {
  grid-area: 1 / 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(150px, 232px) minmax(0, 1fr);
  gap: clamp(20px, 3.2vw, 42px);
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out), visibility 0s linear .5s;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out), visibility 0s;
}

.hero-art { display: grid; place-items: center; }
.hero-art img {
  width: 100%;
  max-width: 232px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid rgba(16, 42, 67, .14);
  border-radius: 2px;
  box-shadow: 0 14px 32px rgba(16, 42, 67, .16);
}
.hero-slide:not(.is-active) .hero-art img { box-shadow: none; }

.kicker {
  margin: 0 0 10px;
  color: var(--jade);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.hero-title {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.22;
  letter-spacing: .03em;
}
.hero-title a:hover { color: var(--blue); }
.hero-meta {
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13.5px;
}
.hero-meta a { color: var(--ink-2); border-bottom: 1px solid var(--line); }
.hero-meta a:hover { color: var(--jade); border-color: currentColor; }
.hero-meta .dot { color: var(--faint); }
.hero-intro {
  margin: 0 0 20px;
  max-width: 580px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.85;
}

/* 控制条：进度点 + 计数 + 上下翻 */
.hero-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(14px, 1.8vw, 20px);
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.hero-dots { display: flex; align-items: center; gap: 3px; }
.hero-dot {
  position: relative;
  width: 26px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  cursor: pointer;
  transition: width .32s var(--ease-out);
}
/* 轨道 */
.hero-dot::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: var(--line);
  transition: background .25s, opacity .25s;
}
/* 进度填充 */
.hero-dot i {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: var(--jade);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}
.hero-dot.is-active { width: 44px; }
.hero-dot.is-active i { animation: heroBar var(--hero-interval, 6000ms) linear forwards; }
.hero-dot:not(.is-active):hover::before { background: var(--jade); opacity: .45; }
.hero-dot:focus-visible { outline-offset: 2px; }

@keyframes heroBar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.hero-ctrl { display: flex; align-items: center; gap: 9px; }
.hero-count {
  margin-right: 3px;
  color: var(--faint);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  letter-spacing: .08em;
}
.hero-count b { color: var(--ink); font-size: 14px; font-weight: 600; }
.hero-count em { margin: 0 3px; font-style: normal; color: var(--line); }
.hero-arrow {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink-2);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.hero-arrow .icon { width: 16px; height: 16px; }
.hero-arrow:hover { border-color: var(--jade); color: var(--jade); background: var(--surface-soft); }
.hero-arrow:active { transform: scale(.96); }

.hero-empty {
  padding: 44px clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.genre-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.genre-chip {
  padding: 7px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-2);
  font-size: 14px;
  transition: border-color .2s, color .2s, background .2s;
}
.genre-chip:hover { border-color: var(--jade); color: var(--jade); }
.genre-chip.is-all { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.genre-chip.is-all:hover { background: var(--blue); border-color: var(--blue); color: #fff; }

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 44px);
  margin-top: 44px;
}

/* ---------------- 排行列表 ---------------- */

.rank-list {
  margin: 0; padding: 0;
  list-style: none;
  counter-reset: rank;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.rank-item:last-child { border-bottom: 0; }
.rank-no {
  width: 26px;
  flex: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  color: var(--faint);
  text-align: center;
}
.rank-no.is-top { color: var(--red); font-weight: 700; }
.rank-cover {
  width: 46px;
  flex: none;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
}
.rank-cover img { width: 100%; height: 100%; object-fit: cover; }
.rank-copy { flex: 1; min-width: 0; }
.rank-copy h3 {
  margin: 0 0 3px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-copy p {
  margin: 0;
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.rank-tag {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------------- 书籍卡片 ---------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: clamp(16px, 2.2vw, 28px);
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: clamp(14px, 2vw, 24px);
}

.book-card { min-width: 0; }
.book-cover {
  position: relative;
  display: flex;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 42, 67, .14);
  background: #e6ebee;
  box-shadow: 0 5px 13px rgba(16, 42, 67, .08);
}
html[data-theme="dark"] .book-cover {
  border-color: var(--line);
  background: var(--soft);
  box-shadow: 0 5px 13px rgba(0, 0, 0, .3);
}
.book-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s var(--ease), filter .3s;
}
.book-card:hover .book-cover img { transform: scale(1.03); filter: saturate(1.05); }
.badge-done {
  position: absolute;
  right: 0; top: 0;
  padding: 2px 7px;
  background: rgba(15, 54, 87, .85);
  color: #fff;
  font-size: 11px;
  letter-spacing: .05em;
}
.book-body { padding-top: 10px; }
.book-title {
  margin: 0 0 4px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-title a:hover { color: var(--blue); }
.book-meta, .book-facts {
  margin: 0 0 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.book-meta .author { color: var(--ink-2); }
.book-meta .author:hover { color: var(--jade); }
.book-meta .dot { color: var(--faint); }
.book-facts { gap: 8px; color: var(--faint); }

/* 封面占位 */
.cover-fallback {
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
  background: linear-gradient(150deg, #dfe7ec, #ccd8e1);
  color: rgba(16, 42, 67, .5);
}
html[data-theme="dark"] .cover-fallback {
  background: linear-gradient(150deg, #22303d, #1a2530);
  color: rgba(231, 237, 243, .4);
}
.cover-fallback b {
  font-family: "Songti SC", serif;
  font-size: 40px;
  letter-spacing: .05em;
}
.cover-fallback.is-sm b { font-size: 20px; }
.cover-fallback.is-lg b { font-size: 72px; }
.cover-fallback.is-xl b { font-size: 84px; }

/* ---------------- 标签云 ---------------- */

.tag-cloud {
  margin-top: 44px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.tag-cloud h2 {
  margin: 0 0 16px;
  font-size: 18px;
  letter-spacing: .06em;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.tag-list a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  transition: border-color .2s, color .2s;
}
.tag-list a:hover { border-color: var(--jade); color: var(--jade); }
.tag-list em {
  font-style: normal;
  font-size: 11px;
  color: var(--faint);
}
.tag-list.is-compact a { padding: 3px 10px; font-size: 12px; }

/* ---------------- 说明区块 ---------------- */

.intro-block {
  margin-top: 44px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}
.intro-block h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.intro-block p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.intro-block p:last-child { margin-bottom: 0; }
.intro-block strong { color: var(--ink); }

/* ---------------- 列表页 ---------------- */

.page-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: clamp(24px, 3vw, 46px);
  align-items: start;
}
.page-main { min-width: 0; }

.page-head { margin-bottom: 26px; }
.page-head h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: .04em;
}
.page-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.search-inline {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
}
.search-inline input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink-2);
  outline: none;
}
.search-inline input:focus { border-color: var(--jade); }
.search-inline button {
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}
html[data-theme="dark"] .search-inline button { color: #10171f; }

.hot-words {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -12px 0 26px;
  font-size: 13px;
}
.hot-words.is-block { margin: 0 0 22px; }
.hot-words-label { color: var(--muted); }
.hot-words a {
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  transition: border-color .2s, color .2s;
}
.hot-words a:hover,
.hot-words a.is-current { border-color: var(--jade); color: var(--jade); }

/* ---------------- 侧栏 ---------------- */

.page-side {
  display: grid;
  gap: 22px;
  position: sticky;
  top: 96px;
}
.side-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.side-panel h2 {
  margin: 0 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  letter-spacing: .08em;
}
.side-cats, .side-links {
  margin: 0; padding: 0;
  list-style: none;
}
.side-cats li, .side-links li {
  border-bottom: 1px dashed var(--line);
}
.side-cats li:last-child, .side-links li:last-child { border-bottom: 0; }
.side-cats a, .side-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--ink-2);
}
.side-cats a:hover, .side-links a:hover { color: var(--jade); }
.side-cats em {
  font-style: normal;
  font-size: 12px;
  color: var(--faint);
}
.side-cats li.is-active a { color: var(--jade); font-weight: 600; }

.side-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 8px 10px;
  font-size: 13px;
}
.side-dl dt { color: var(--muted); }
.side-dl dd { margin: 0; color: var(--ink-2); }

/* ---------------- 书籍详情（文章页 · 水墨） ---------------- */

/* 墨色体系：焦墨 / 中墨 / 淡墨 + 宣纸 + 朱砂（挂到 :root，方便详情页内外的元素共用） */
:root {
  --x-ink: #23211d;
  --x-ink-2: #46413a;
  --x-ink-3: #7a7264;
  --x-line: rgba(35, 33, 29, .13);
  --x-line-2: rgba(35, 33, 29, .26);
  --x-paper: #fffdf7;
  --x-paper-2: #f5efe2;
  --x-seal: #a5402f;
  --x-seal-soft: rgba(165, 64, 47, .09);
  --x-solid: #23211d;
  --x-solid-ink: #f9f3e4;
  --x-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='.045'/%3E%3C/svg%3E");
}
html[data-theme="dark"] {
  --x-ink: #ece5d6;
  --x-ink-2: #c4bcab;
  --x-ink-3: #8f8577;
  --x-line: rgba(236, 229, 214, .13);
  --x-line-2: rgba(236, 229, 214, .24);
  --x-paper: #191713;
  --x-paper-2: #221f19;
  --x-seal: #d06852;
  --x-seal-soft: rgba(208, 104, 82, .14);
  --x-solid: #e6dcc6;
  --x-solid-ink: #16130f;
  --x-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='.07'/%3E%3C/svg%3E");
}

.bd {
  display: block;
  max-width: 1060px;
  margin: 0 auto;
  color: var(--x-ink-2);
}

/* 详情页内的面包屑跟随墨色 */
.main:has(.bd) .crumbs a:hover { color: var(--x-seal); }
.main:has(.bd) .crumbs .cur { color: var(--x-ink); }
.main:has(.bd) .crumbs .sep { color: var(--x-line-2); }

/* 主信息区：封面 + 书目信息 + 操作 */
.bd-hero {
  position: relative;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  grid-template-areas:
    "cover copy"
    "cover extra";
  column-gap: clamp(26px, 3.2vw, 46px);
  align-items: start;
  padding-bottom: 32px;
}
/* 淡墨晕染 */
.bd-hero::before {
  content: "";
  position: absolute;
  right: -4%;
  top: -10%;
  width: min(58%, 520px);
  height: 250px;
  background:
    radial-gradient(40% 48% at 72% 14%, rgba(35, 33, 29, .10), rgba(35, 33, 29, 0) 70%),
    radial-gradient(58% 40% at 94% 62%, rgba(35, 33, 29, .055), rgba(35, 33, 29, 0) 74%);
  filter: blur(3px);
  pointer-events: none;
  z-index: 0;
}
html[data-theme="dark"] .bd-hero::before {
  background:
    radial-gradient(40% 48% at 72% 14%, rgba(236, 229, 214, .08), rgba(236, 229, 214, 0) 70%),
    radial-gradient(58% 40% at 94% 62%, rgba(236, 229, 214, .045), rgba(236, 229, 214, 0) 74%);
}
/* 收笔墨线（替代通栏实线） */
.bd-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--x-line-2), var(--x-line) 42%, rgba(35, 33, 29, 0) 97%);
}
.bd-hero > * { position: relative; z-index: 1; }

.bd-cover {
  grid-area: cover;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--x-line-2);
  border-radius: 2px;
  background: linear-gradient(160deg, #efe9da, #e0d8c5);
  box-shadow: 0 20px 36px -18px rgba(35, 33, 29, .5);
}
html[data-theme="dark"] .bd-cover {
  background: linear-gradient(160deg, #26221b, #1b1813);
  box-shadow: 0 20px 36px -18px rgba(0, 0, 0, .8);
}
.bd-cover img { width: 100%; height: 100%; object-fit: cover; }
.bd-cover-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 3px 8px;
  border-radius: 2px;
  background: rgba(165, 64, 47, .92);
  color: #fdf6e8;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 11px;
  letter-spacing: .14em;
  text-indent: .14em;
}

.bd-copy { grid-area: copy; min-width: 0; }
.bd-title {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: .04em;
  color: var(--x-ink);
}
.bd-title::after {
  content: "";
  display: block;
  width: 200px;
  max-width: 55%;
  height: 2px;
  margin-top: 15px;
  background: linear-gradient(90deg, rgba(35, 33, 29, .5), rgba(35, 33, 29, .12) 58%, rgba(35, 33, 29, 0));
}
html[data-theme="dark"] .bd-title::after {
  background: linear-gradient(90deg, rgba(236, 229, 214, .45), rgba(236, 229, 214, .1) 58%, rgba(236, 229, 214, 0));
}

.bd-author {
  margin: 16px 0 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
}
.bd-author > span {
  color: var(--x-ink-3);
  font-size: 11.5px;
  letter-spacing: .22em;
  text-indent: .22em;
}
.bd-author a {
  color: var(--x-ink);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.bd-author a:hover { color: var(--x-seal); border-bottom-color: currentColor; }

.bd-facts {
  margin: 11px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--x-ink-3);
}
.bd-facts .dot { color: var(--x-line-2); }
.bd-facts a { color: var(--x-ink-2); border-bottom: 1px solid var(--x-line); }
.bd-facts a:hover { color: var(--x-seal); border-bottom-color: currentColor; }

.bd-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.bd-chip {
  padding: 3px 11px;
  border: 1px solid var(--x-line);
  border-radius: 2px;
  background: transparent;
  color: var(--x-ink-3);
  font-size: 12px;
  letter-spacing: .04em;
  transition: color .2s, border-color .2s, background .2s;
}
.bd-chip:hover {
  border-color: var(--x-seal);
  color: var(--x-seal);
  background: var(--x-seal-soft);
}

.bd-extra { grid-area: extra; min-width: 0; margin-top: 24px; }

.bd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bd-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 47px;
  padding: 0 24px;
  border-radius: 2px;
  background: var(--x-solid);
  color: var(--x-solid-ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .1em;
  text-indent: .1em;
  box-shadow: 0 16px 28px -16px rgba(35, 33, 29, .7);
  transition: background .2s, transform .18s var(--ease-out), box-shadow .2s, color .2s;
}
.bd-cta small {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-indent: 0;
  opacity: .72;
}
.bd-cta:hover {
  background: var(--x-seal);
  color: #fffaf0;
  transform: translateY(-1px);
  box-shadow: 0 18px 30px -16px rgba(165, 64, 47, .6);
}
.bd-cta.is-disabled {
  background: transparent;
  color: var(--x-ink-3);
  border: 1px dashed var(--x-line-2);
  box-shadow: none;
  cursor: default;
}
.bd-ghost {
  display: inline-flex;
  align-items: center;
  min-height: 47px;
  padding: 0 22px;
  border: 1px solid var(--x-line-2);
  border-radius: 2px;
  background: transparent;
  color: var(--x-ink-2);
  font-size: 14px;
  letter-spacing: .1em;
  text-indent: .1em;
  transition: color .2s, border-color .2s, background .2s;
}
.bd-ghost:hover { border-color: var(--x-seal); color: var(--x-seal); background: var(--x-seal-soft); }

.bd-formats { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.bd-formats > strong {
  color: var(--x-ink-3);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .22em;
  text-indent: .22em;
}
.bd-formats > div { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-formats span {
  padding: 2px 9px;
  border: 1px solid var(--x-line);
  border-radius: 2px;
  color: var(--x-ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-indent: .14em;
}

/* 正文区 */
.bd-main { display: grid; gap: 18px; min-width: 0; margin-top: 32px; }

.bd-panel {
  position: relative;
  padding: 26px 30px 28px;
  border: 1px solid var(--x-line);
  border-radius: 3px;
  background-color: var(--x-paper);
  background-image: var(--x-grain);
  box-shadow: 0 22px 44px -38px rgba(35, 33, 29, .8);
}
html[data-theme="dark"] .bd-panel { box-shadow: 0 22px 44px -34px rgba(0, 0, 0, .9); }
.bd-panel[id] { scroll-margin-top: 88px; }
.bd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.bd-panel-title {
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--x-ink);
}
.bd-panel-title::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--x-seal);
  transform: rotate(45deg);
}
.bd-panel-title::after {
  content: "";
  flex: 1 1 auto;
  min-width: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--x-line-2), rgba(35, 33, 29, 0) 78%);
}
.bd-panel-head .bd-panel-title { margin-bottom: 0; flex: 1 1 auto; }
.bd-panel-count { color: var(--x-ink-3); font-size: 12px; }
.bd-panel-more { color: var(--x-ink-3); font-size: 12.5px; white-space: nowrap; transition: color .2s; }
.bd-panel-more::after { content: " →"; }
.bd-panel-more:hover { color: var(--x-seal); }

/* 简介 */
.bd-intro {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 15.5px;
  line-height: 2.1;
  color: var(--x-ink-2);
}
.bd-intro p { margin: 0 0 14px; text-indent: 2em; }
.bd-intro p:last-child { margin-bottom: 0; }
.bd-intro.is-clamp { position: relative; max-height: 13em; overflow: hidden; }
.bd-intro.is-clamp::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4em;
  background: linear-gradient(to bottom, rgba(255, 253, 247, 0), var(--x-paper));
  pointer-events: none;
}
html[data-theme="dark"] .bd-intro.is-clamp::after {
  background: linear-gradient(to bottom, rgba(25, 23, 19, 0), var(--x-paper));
}
.bd-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--x-seal);
  font-size: 12.5px;
  letter-spacing: .08em;
  cursor: pointer;
}
.bd-more .icon { width: 15px; height: 15px; transition: transform .2s var(--ease-out); }
.bd-more[aria-expanded="true"] .icon { transform: rotate(180deg); }

/* 详细内容 */
.bd .prose {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  color: var(--x-ink-2);
  line-height: 2.05;
}
.bd .prose p { text-indent: 2em; }
.bd .prose a { color: var(--x-seal); }

/* 下载列表：卷轴式分隔线 */
.bd-pans { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.bd-pan {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-bottom: 1px dashed var(--x-line);
  transition: background .2s;
}
.bd-pan:last-child { border-bottom: 0; }
.bd-pan:hover { background: rgba(35, 33, 29, .028); }
html[data-theme="dark"] .bd-pan:hover { background: rgba(236, 229, 214, .04); }
.bd-pan-copy { flex: 1; min-width: 0; display: grid; gap: 3px; }
.bd-pan-copy strong { font-size: 14px; font-weight: 600; color: var(--x-ink); overflow-wrap: anywhere; }
.bd-pan-copy span { font-size: 12px; color: var(--x-ink-3); }
.bd-pwd {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px dashed var(--x-line-2);
  border-radius: 2px;
  background: transparent;
  color: var(--x-ink-3);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.bd-pwd code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--x-seal);
}
.bd-pwd:hover { border-color: var(--x-seal); color: var(--x-ink-2); }
.bd-pwd.is-copied { border-color: var(--x-seal); background: var(--x-seal-soft); }
.bd-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 2px;
  background: var(--x-solid);
  color: var(--x-solid-ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-indent: .12em;
  transition: background .2s, color .2s;
}
.bd-btn:hover { background: var(--x-seal); color: #fffaf0; }
.bd-tip { margin: 16px 0 0; color: var(--x-ink-3); font-size: 12px; line-height: 1.9; }
.bd-empty { margin: 0; color: var(--x-ink-3); font-size: 14px; }

/* 相关书籍 / 作者其他作品 */
.card-grid.is-related { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: clamp(16px, 2vw, 22px); }
/* 作者其他作品：PC 端横排作品条（信息更完整，避免与「相关书籍」重复成片小封面） */
.bd-works {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 22px;
}
.book-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 3px;
  transition: background .2s;
}
.book-row:hover { background: rgba(35, 33, 29, .032); }
html[data-theme="dark"] .book-row:hover { background: rgba(236, 229, 214, .04); }
.book-row-cover {
  flex: none;
  width: 62px;
  height: 83px;
  overflow: hidden;
  border: 1px solid var(--x-line);
  border-radius: 2px;
  background: linear-gradient(160deg, #efe9da, #e0d8c5);
  box-shadow: 0 8px 16px -12px rgba(35, 33, 29, .8);
}
html[data-theme="dark"] .book-row-cover { background: linear-gradient(160deg, #26221b, #1b1813); }
.book-row-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.book-row:hover .book-row-cover img { transform: scale(1.04); }
.book-row-cover .cover-fallback { background: none; color: rgba(35, 33, 29, .45); }
html[data-theme="dark"] .book-row-cover .cover-fallback { background: none; color: rgba(236, 229, 214, .42); }
.book-row-cover .cover-fallback b { font-size: 23px; }
.book-row-body { min-width: 0; display: grid; gap: 3px; align-content: start; }
.book-row-title {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .02em;
  color: var(--x-ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.book-row-title a:hover { color: var(--x-seal); }
.book-row-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  font-size: 11.5px;
  color: var(--x-ink-3);
}
.book-row-meta span + span::before {
  content: "·";
  margin-right: 6px;
  color: var(--x-line-2);
}
.book-row-brief {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--x-ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 详情页内的书籍卡片：去圆角、墨色细边，贴合水墨气质 */
.bd .book-cover {
  border-color: var(--x-line);
  border-radius: 2px;
  background: linear-gradient(160deg, #efe9da, #e0d8c5);
  box-shadow: 0 14px 26px -18px rgba(35, 33, 29, .65);
}
html[data-theme="dark"] .bd .book-cover {
  background: linear-gradient(160deg, #26221b, #1b1813);
  border-color: var(--x-line);
  box-shadow: 0 14px 26px -16px rgba(0, 0, 0, .9);
}
.bd .book-card { transition: transform .24s var(--ease-out); }
.bd .book-card:hover { transform: translateY(-3px); }
.bd .book-cover { transition: box-shadow .25s, border-color .25s; }
.bd .book-card:hover .book-cover {
  border-color: var(--x-line-2);
  box-shadow: 0 22px 34px -20px rgba(35, 33, 29, .72);
}
html[data-theme="dark"] .bd .book-card:hover .book-cover { box-shadow: 0 22px 34px -18px rgba(0, 0, 0, .95); }
.bd .book-card:hover .book-cover img { transform: scale(1.02); filter: none; }
.bd .book-title {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--x-ink);
}
.bd .book-title a:hover { color: var(--x-seal); }
.bd .book-meta, .bd .book-facts { color: var(--x-ink-3); }
.bd .book-meta .author { color: var(--x-ink-2); }
.bd .book-meta .author:hover, .bd .book-meta .dot { color: var(--x-seal); }
.bd .badge-done {
  border-radius: 0;
  background: rgba(165, 64, 47, .9);
  color: #fdf6e8;
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: .1em;
  text-indent: .1em;
}
.bd .cover-fallback {
  background: linear-gradient(160deg, #efe9da, #ded5c0);
  color: rgba(35, 33, 29, .42);
}
html[data-theme="dark"] .bd .cover-fallback {
  background: linear-gradient(160deg, #26221b, #1b1813);
  color: rgba(236, 229, 214, .4);
}

/* 作者作品区：PC 端信息更完整的一行式标题 */
.bd-author-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: 12.5px;
  color: var(--x-ink-3);
  white-space: nowrap;
}
.bd-author-meta .num {
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  color: var(--x-seal);
}

/* 深色模式的按钮文字补偿 */
html[data-theme="dark"] .bd-cta:hover,
html[data-theme="dark"] .bd-btn:hover { color: #fff7ef; }
html[data-theme="dark"] .bd-cta.is-disabled { color: var(--x-ink-3); }

/* 单页（关于/声明等） */
.page-main .single {
  padding: 26px clamp(20px, 3vw, 40px) 34px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.single .prose { max-width: none; }

/* ---------------- 分页 ---------------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}
.page-link {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink-2);
  font-size: 14px;
}
a.page-link:hover { border-color: var(--jade); color: var(--jade); }
.page-link.is-current {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
html[data-theme="dark"] .page-link.is-current { color: #10171f; }
.page-link.is-disabled { color: var(--faint); background: transparent; }
.page-gap { display: inline-grid; place-items: center; width: 24px; color: var(--faint); }

/* ---------------- 404 ---------------- */

.notfound {
  padding: 60px 0 40px;
  text-align: center;
}
.nf-code {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(64px, 12vw, 120px);
  line-height: 1;
  color: var(--line);
  letter-spacing: .06em;
}
.notfound h1 { margin: 8px 0 12px; font-size: 24px; }
.nf-tip { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.nf-actions { display: flex; justify-content: center; gap: 12px; }

/* ---------------- 页脚 ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-inner {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 32px;
}
.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}
.footer-brand:hover strong { color: var(--jade); }
.footer-brand strong {
  font-family: "Songti SC", serif;
  font-size: 17px;
  letter-spacing: .08em;
  color: var(--ink);
  white-space: nowrap;
  transition: color .18s var(--ease);
}
.footer-brand span {
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
}
.footer-nav a { font-size: 13px; color: var(--muted); transition: color .18s var(--ease); }
.footer-nav a:hover { color: var(--jade); }

.footer-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
}
.footer-copy {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}
.footer-copy a { color: var(--faint); transition: color .18s var(--ease); }
.footer-copy a:hover { color: var(--jade); }
.footer-cats {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.footer-cats a { color: var(--faint); transition: color .18s var(--ease); }
.footer-cats a:hover { color: var(--jade); }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1100px) {
  .nav-list { gap: 20px; }
  .bd-works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-wrap { grid-template-columns: minmax(0, 1fr); }
  .page-side { position: static; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .footer-inner { gap: 12px 24px; }
  .footer-nav { gap: 4px 16px; }
}

@media (max-width: 900px) {
  .header-inner {
    width: calc(100% - 32px);
    height: 64px;
    gap: 12px;
  }
  .brand small { display: none; }
  .header-search { width: auto; flex: 1; min-width: 0; }
  .header-search input { font-size: 15px; }
  .header-search button { display: none; }
  .nav-toggle { display: flex; order: 3; }
  .primary-nav {
    position: absolute;
    left: 0; right: 0; top: 64px;
    display: none;
    padding: 8px 16px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 12px rgba(16, 42, 67, .08);
    z-index: 100;
  }
  .primary-nav.is-open { display: block; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list a { display: block; padding: 13px 0; border-bottom: 1px dashed var(--line); }
  .nav-list a::after { display: none; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-slide { grid-template-columns: minmax(0, 1fr); text-align: center; row-gap: 18px; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 180px; }
  .hero-meta, .hero-dots { justify-content: center; }
  .hero-intro { margin-left: auto; margin-right: auto; }
  .hero-nav { justify-content: center; flex-wrap: wrap; gap: 12px; }

  .crumbs-inner { width: 100%; margin-bottom: 14px; }
  .main { width: calc(100% - 32px); padding-top: 22px; }
  .panel { padding: 18px; }
  .panel-wide { padding: 18px; }
  .page-side { gap: 18px; }
  .side-panel { padding: 16px; }
  .rank-list { gap: 14px; }
  .hot-words { margin: -10px 0 20px; font-size: 12px; }
  .hot-words a { padding: 2px 10px; }
  .search-inline { gap: 8px; margin-bottom: 20px; }
  .search-inline input { height: 42px; padding: 0 12px; font-size: 15px; }
  .search-inline button { padding: 0 18px; font-size: 14px; }
}

@media (max-width: 760px) {
  .bd-hero {
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-areas:
      "cover copy"
      "extra extra";
    column-gap: 14px;
    padding-bottom: 22px;
  }
  .bd-hero::before { display: none; }
  .bd-cover { box-shadow: 0 12px 22px -12px rgba(35, 33, 29, .55); }
  .bd-title { font-size: 23px; letter-spacing: .02em; }
  .bd-title::after { width: 120px; margin-top: 10px; }
  .bd-author { margin-top: 10px; font-size: 13px; }
  .bd-facts { margin-top: 8px; font-size: 11.5px; gap: 5px; }
  .bd-chips { margin-top: 12px; gap: 5px; }
  .bd-chip { padding: 2px 9px; font-size: 11px; }
  .bd-extra { margin-top: 18px; }
  .bd-actions { margin-top: 0; }
  .bd-cta, .bd-ghost { flex: 1 1 auto; justify-content: center; min-height: 44px; padding: 0 14px; font-size: 14px; }
  .bd-cta small { display: none; }
  .bd-formats { margin-top: 14px; }

  .bd-main { gap: 12px; margin-top: 20px; }
  .bd-panel { padding: 18px 16px 20px; border-radius: 3px; }
  .bd-panel-title { font-size: 16px; margin-bottom: 14px; }
  .bd-intro { font-size: 14.5px; line-height: 2.05; }
  .bd-pan { flex-wrap: wrap; padding: 13px 6px; }
  .bd-btn { flex: 1 1 100%; order: 3; min-height: 40px; }
  .card-grid.is-related { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 14px; }
  .bd-works { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .bd-author-meta { gap: 10px; }
  .page-main .single { padding: 20px 16px 26px; border-radius: 12px; }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 20px 0 16px;
  }
  .footer-brand span { display: none; }
  .footer-nav { gap: 6px 16px; }
  .footer-meta { padding-top: 10px; gap: 6px 16px; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .brand strong { font-size: 18px; }
  .brand-mark { width: 30px; height: 30px; }
  .header-search input { padding: 0 12px; font-size: 14px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 16px; }
  .mini-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .panel-wide { padding: 16px; }
  .page-head h1 { font-size: 22px; }
  .page-sub { font-size: 13px; }
  .tag-cloud, .intro-block { padding: 16px; }
  .hero-feature { padding: 14px 12px 12px; }
  .hero-title { font-size: 22px; }
  .hero-intro { font-size: 14px; margin-bottom: 18px; }
  .hero-count { display: none; }
  .hero-dot { width: 20px; }
  .hero-dot.is-active { width: 32px; }
  .hero-dots { gap: 1px; }
  .footer-inner { padding: 18px 0 14px; }
  .footer-meta { flex-direction: column; align-items: flex-start; }
  .footer-cats { gap: 4px 12px; }
  .nf-actions { flex-direction: column; align-items: stretch; }
  .nf-actions a { justify-content: center; }
  .btn-primary, .btn-ghost { padding: 10px 18px; font-size: 14px; }
  .hot-words { font-size: 11px; gap: 6px; }
  .hot-words a { padding: 2px 9px; }
  .hot-words-label { font-size: 12px; }
  .search-inline input { height: 40px; }
  .rank-no { width: 20px; height: 20px; font-size: 11px; }
  .rank-cover { width: 48px; height: 64px; }
  .rank-cover img { width: 48px; height: 64px; }
  .cover-fallback.is-sm { width: 48px; height: 64px; font-size: 16px; }
  .bd-title { font-size: 21px; }
  .book-row-cover { width: 54px; height: 72px; }
}

/* 触摸设备移除 hover 残留 */
.touch-device a:active { opacity: .7; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .hero-dot.is-active::before { background: var(--jade); }
  .hero-dot.is-active i { animation: none; }
}
