/* 张灵韵小说 · 全局样式 */
:root {
  --bg: #f5e6a8;
  --bg-deep: #edd978;
  --ink: #3a2e0a;
  --ink-soft: #6b5a28;
  --line: #c9b45a;
  --accent: #8a6d1d;
  --card: rgba(255, 248, 220, 0.72);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f8ecc0 0%, var(--bg) 40%, #f0d98a 100%);
  position: relative;
  overflow-x: hidden;
  line-height: 1.75;
}

/* 背景横向大字「张灵韵」 */
.bg-name {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(6rem, 28vw, 18rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: rgba(138, 109, 29, 0.07);
  white-space: nowrap;
  user-select: none;
  writing-mode: horizontal-tb;
  transform: translateY(-4%);
}

/* 最上层斜向循环水印，鼠标穿透 */
.watermark {
  position: fixed;
  inset: -50%;
  z-index: 9999;
  pointer-events: none;
  user-select: none;
  background-image: repeating-linear-gradient(
    -28deg,
    transparent 0,
    transparent 72px,
    rgba(90, 70, 10, 0.045) 72px,
    rgba(90, 70, 10, 0.045) 73px
  );
}

.watermark::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='160'%3E%3Ctext x='20' y='90' fill='rgba(90,70,10,0.08)' font-size='18' font-family='sans-serif' transform='rotate(-28 140 80)'%3E作者张灵韵%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 280px 160px;
  transform: translate(40px, 20px);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.08em;
}

.brand:hover { color: var(--accent); }

.brand-sub {
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

h1 .author-mark {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.2em;
  margin-bottom: 0.35rem;
}

.lead {
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.novel-list,
.chapter-list {
  list-style: none;
}

.novel-list li,
.chapter-list li {
  margin-bottom: 0.65rem;
}

.novel-list a,
.chapter-list a {
  display: block;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.novel-list a:hover,
.chapter-list a:hover {
  background: #fff8dc;
  border-color: var(--accent);
}

.novel-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.novel-meta {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.tags {
  margin-top: 0.35rem;
}

.tag {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.75rem;
  color: var(--accent);
}

.crumb {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.crumb a {
  color: var(--accent);
  text-decoration: none;
}

.crumb a:hover { text-decoration: underline; }

.article {
  font-size: 1.05rem;
}

.article h1,
.article h2,
.article h3,
.article h4 {
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 1.75rem 0 0.85rem;
  color: var(--ink);
}

.article h2 { font-size: 1.25rem; }
.article h3 { font-size: 1.1rem; }

.article p {
  margin-bottom: 1.1rem;
  text-indent: 2em;
}

.article p:has(> img:only-child) {
  text-indent: 0;
}

.article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem auto;
}

.article pre {
  margin: 1rem 0 1.25rem;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  background: rgba(58, 46, 10, 0.08);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  line-height: 1.5;
  text-indent: 0;
}

.article code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.article :not(pre) > code {
  padding: 0.1em 0.35em;
  background: rgba(58, 46, 10, 0.08);
  border-radius: 2px;
}

.article blockquote {
  margin: 1rem 0;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}

.article blockquote p {
  text-indent: 0;
}

.article ul,
.article ol {
  margin: 0.75rem 0 1.1rem 1.5rem;
}

.article li {
  margin-bottom: 0.35rem;
}

.article li > p {
  text-indent: 0;
  margin-bottom: 0.35rem;
}

.article hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

.article a {
  color: var(--accent);
}

.nav-chapters {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.nav-chapters a {
  color: var(--accent);
  text-decoration: none;
}

.nav-chapters a:hover { text-decoration: underline; }

.nav-chapters .disabled {
  color: var(--line);
  visibility: hidden;
}

.stamp {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: rgba(138, 109, 29, 0.55);
  border: 1px dashed rgba(138, 109, 29, 0.4);
  padding: 0.15rem 0.5rem;
}

@media (max-width: 520px) {
  .page { padding: 1.1rem 0.9rem 2.5rem; }
  h1 { font-size: 1.4rem; }
  .article { font-size: 1rem; }
}
