:root {
  --bg: #e9ecf0;
  --paper: #fbfcfd;
  --ink: #1c2430;
  --muted: #6b7380;
  --line: #d3d8e0;
  --cinnabar: #c23a2b;
  --inksoft: #2c3645;
  --stitch: #9aa3b0;
  --header-h: 4.5rem;
  --max: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --song: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(194, 58, 43, 0.07), transparent 60%),
    linear-gradient(90deg, #dfe3e9 0, #dfe3e9 18px, transparent 18px),
    repeating-linear-gradient(
      0deg,
      transparent 0 31px,
      rgba(28, 36, 48, 0.035) 31px 32px
    ),
    var(--bg);
  line-height: 1.75;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--cinnabar); }
button { font: inherit; }

.zb-skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--cinnabar);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
}
.zb-skip:focus { left: 0.75rem; top: 0.75rem; }

.zb-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 252, 253, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.zb-header-inner {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.4rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: -1px;
}

.zb-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  color: var(--ink) !important;
}
.zb-brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--cinnabar);
  color: var(--cinnabar);
  font-family: var(--song);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  transform: rotate(-6deg);
  background: #fff;
  box-shadow: 2px 2px 0 rgba(194, 58, 43, 0.2);
}
.zb-brand span:last-child {
  font-family: var(--song);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: clamp(1.02rem, 2.2vw, 1.28rem);
  white-space: nowrap;
}

.zb-nav-toggle {
  margin-left: auto;
  height: 2.4rem;
  padding: 0 0.9rem 0 0.75rem;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  display: none;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 60;
  border-radius: 0;
}
.zb-nav-toggle b {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  font-family: var(--song);
}
.zb-nav-toggle i {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.zb-nav-toggle i span {
  width: 14px;
  height: 1.5px;
  background: var(--ink);
}

.zb-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--max), calc(100% - 2rem));
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 51;
  pointer-events: none;
}
.zb-nav > ul {
  pointer-events: auto;
  display: flex;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.zb-nav-item { position: relative; }
.zb-nav-parent {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem 0.55rem;
  font-family: var(--song);
  font-weight: 700;
  letter-spacing: 0.22em;
  cursor: default;
  color: var(--inksoft);
  border-bottom: 2px solid transparent;
}
.zb-nav-item:hover .zb-nav-parent,
.zb-nav-item:focus-within .zb-nav-parent {
  color: var(--cinnabar);
  border-bottom-color: var(--cinnabar);
}
.zb-sub {
  display: none;
  position: absolute;
  top: calc(100% + 0.15rem);
  right: 0;
  min-width: 9.5rem;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(28, 36, 48, 0.08);
}
.zb-nav-item:hover .zb-sub,
.zb-nav-item:focus-within .zb-sub { display: block; }
.zb-sub a {
  display: block;
  padding: 0.48rem 0.9rem;
  color: var(--ink);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}
.zb-sub a:hover {
  background: rgba(194, 58, 43, 0.08);
  color: var(--cinnabar);
}

.zb-wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin: 1.5rem auto 3.2rem;
}
.zb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16.5rem;
  gap: 1.75rem;
  align-items: start;
}

.zb-banner {
  margin: 0 0 1.15rem;
  overflow: hidden;
  background: #dde2e9;
  border: 1px solid var(--line);
  position: relative;
}
.zb-banner::before {
  content: "线装卷";
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
  writing-mode: vertical-rl;
  padding: 0.7rem 0.35rem;
  background: var(--cinnabar);
  color: #fff;
  font-family: var(--song);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
}
.zb-banner img {
  width: 100%;
  max-height: 176px;
  object-fit: cover;
  opacity: 0.9;
}

.zb-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
}

.zb-card {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1.05rem;
  align-items: start;
  padding: 1.05rem 1.1rem 1.05rem 1.55rem;
  background: var(--paper);
  border: 1px solid var(--line);
  position: relative;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.zb-card::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 1rem;
  bottom: 1rem;
  width: 0.45rem;
  background:
    radial-gradient(circle, var(--cinnabar) 0 35%, transparent 36%) center 10% / 0.38rem 0.38rem no-repeat,
    radial-gradient(circle, var(--cinnabar) 0 35%, transparent 36%) center 35% / 0.38rem 0.38rem no-repeat,
    radial-gradient(circle, var(--cinnabar) 0 35%, transparent 36%) center 60% / 0.38rem 0.38rem no-repeat,
    radial-gradient(circle, var(--cinnabar) 0 35%, transparent 36%) center 85% / 0.38rem 0.38rem no-repeat,
    linear-gradient(90deg, transparent 40%, var(--stitch) 40% 60%, transparent 60%);
}
.zb-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(28, 36, 48, 0.08);
  border-color: rgba(194, 58, 43, 0.35);
}
.zb-card-cover {
  overflow: hidden;
  background: #e4e8ee;
  min-height: 5.5rem;
  height: 5.5rem;
  border: 1px solid var(--line);
}
.zb-card-cover img {
  width: 100%;
  height: 5.5rem;
  object-fit: cover;
  min-height: 5.5rem;
}
.zb-card h2 {
  margin: 0 0 0.3rem;
  font-family: var(--song);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.zb-card h2 a { color: var(--ink); }
.zb-card h2 a:hover { color: var(--cinnabar); }
.zb-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.zb-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.55rem;
  color: var(--cinnabar);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.zb-meta-l {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.zb-avatar {
  width: 1.05rem;
  height: 1.05rem;
  object-fit: cover;
  border-radius: 0;
  border: 1px solid var(--line);
}

.zb-crumb {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
}
.zb-crumb a { color: var(--cinnabar); }

.zb-pager {
  display: flex;
  justify-content: flex-start;
  gap: 0.6rem;
  margin: 1.25rem 0 0.2rem;
}
.zb-pager a {
  min-width: 6.4rem;
  text-align: center;
  padding: 0.62rem 1.05rem;
  background: var(--ink);
  color: #fff !important;
  font-weight: 700;
  letter-spacing: 0.16em;
  font-family: var(--song);
  border-radius: 0;
}
.zb-pager a:hover { background: var(--cinnabar); }

.zb-aside {
  position: sticky;
  top: calc(var(--header-h) + 0.9rem);
  display: grid;
  gap: 1rem;
}
.zb-side {
  background: var(--paper);
  padding: 1rem 0.95rem 0.6rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
}
.zb-side h3 {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  letter-spacing: 0.28em;
  color: var(--ink);
  font-family: var(--song);
  font-weight: 700;
}
.zb-side h3::after {
  content: "";
  display: block;
  width: 2rem;
  height: 2px;
  margin-top: 0.4rem;
  background: var(--cinnabar);
}
.zb-side ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.zb-side li { border-top: 1px solid var(--line); }
.zb-side li a {
  display: flex;
  gap: 0.5rem;
  padding: 0.58rem 0;
  color: var(--ink);
  font-size: 0.88rem;
}
.zb-side .zb-widlist a:hover { color: var(--cinnabar); }
.zb-topthub a {
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0;
}
.zb-topthub img {
  width: 100%;
  height: 7rem;
  object-fit: cover;
  border: 1px solid var(--line);
}
.zb-topthub span { font-weight: 650; }

.zb-article-card {
  background: var(--paper);
  padding: clamp(1.25rem, 3.4vw, 2.4rem);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--ink);
}
.zb-article-card h1 {
  margin: 0 0 0.8rem;
  text-align: left;
  font-family: var(--song);
  font-size: clamp(1.4rem, 3.1vw, 2rem);
  line-height: 1.4;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.zb-bloginfo {
  display: flex;
  justify-content: flex-start;
  color: var(--cinnabar);
  font-size: 0.82rem;
  margin-bottom: 1.35rem;
  letter-spacing: 0.06em;
}
.zb-bloginfo ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.zb-prose {
  font-size: clamp(1rem, 1.15vw, 1.08rem);
  line-height: 2;
  color: var(--inksoft);
  max-width: 42rem;
}
.zb-prose img,
.zb-prose video,
.zb-prose iframe,
.zb-prose table { max-width: 100%; }
.zb-prose table { display: block; overflow-x: auto; }
.zb-copyright {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}
.zb-pagerow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.2rem;
}
.zb-pagerow a {
  display: block;
  padding: 0.85rem 0.95rem;
  background: #f3f5f8;
  border: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.45;
}
.zb-pagerow .next { text-align: right; }

.zb-footer {
  background: var(--ink);
  padding: 1.6rem 1rem 2.5rem;
  text-align: center;
  color: #a8b0bc;
  font-size: 0.86rem;
}
.zb-footer p { margin: 0 0 0.7rem; }
.zb-footer a { color: #f0c7c2; margin: 0 0.35rem; }

#go-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1.2rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--cinnabar);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 0;
  border: 2px solid var(--ink);
}
#go-to-top::after {
  content: "上";
  font-family: var(--song);
  font-size: 0.9rem;
  font-weight: 700;
}

.zb-mask { display: none; }

@media (max-width: 980px) {
  .zb-layout { grid-template-columns: 1fr; }
  .zb-aside { position: static; }
  body {
    background:
      radial-gradient(ellipse 80% 40% at 50% -10%, rgba(194, 58, 43, 0.07), transparent 60%),
      var(--bg);
  }
}

@media (max-width: 768px) {
  .zb-nav-toggle { display: inline-flex; }
  .zb-nav {
    left: auto;
    right: 0;
    top: 0;
    width: min(84vw, 19.5rem);
    height: 100dvh;
    margin: 0;
    display: block;
    background: #fff;
    box-shadow: -8px 0 28px rgba(28, 36, 48, 0.14);
    padding: 5rem 1.1rem 1.5rem;
    transform: translateX(110%);
    transition: transform 0.35s var(--ease), visibility 0.35s;
    overflow-y: auto;
    visibility: hidden;
    z-index: 55;
    pointer-events: auto;
    border-left: 3px solid var(--cinnabar);
  }
  body.nav-open .zb-nav {
    transform: translateX(0);
    visibility: visible;
  }
  .zb-nav > ul {
    flex-direction: column;
    gap: 0.1rem;
  }
  .zb-sub {
    display: block;
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0 0 0.35rem 0.75rem;
    background: transparent;
  }
  .zb-nav-parent {
    width: 100%;
    border-bottom: 0;
  }
  .zb-nav-item:hover .zb-nav-parent {
    background: rgba(194, 58, 43, 0.07);
  }
  .zb-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(28, 36, 48, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
    z-index: 40;
  }
  body.nav-open .zb-mask {
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }
  .zb-card {
    grid-template-columns: 4.4rem minmax(0, 1fr);
    gap: 0.7rem;
    padding: 0.85rem 0.85rem 0.85rem 1.35rem;
  }
  .zb-card-cover,
  .zb-card-cover img {
    min-height: 4.4rem;
    height: 4.4rem;
  }
  .zb-pagerow { grid-template-columns: 1fr; }
  .zb-pagerow .next { text-align: left; }
}

@media (max-width: 420px) {
  .zb-card {
    grid-template-columns: 1fr;
    padding-left: 1.45rem;
  }
  .zb-card-cover,
  .zb-card-cover img {
    width: 100%;
    height: 8.4rem;
    min-height: 8.4rem;
  }
  .zb-brand span:last-child {
    letter-spacing: 0.08em;
  }
}

@media (min-width: 1440px) {
  :root { --max: 1220px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
