/* ============================================================
   楞严经官网 — 古典中国高级风
   墨色 / 宣纸 / 赭石暗金 / 朱红点缀
   ============================================================ */

/* ----------------------------------------------------------
   @font-face 本地化方案
   将 Noto Serif SC / Source Han Serif SC 字体文件放入
   /assets/fonts/ 后取消下方注释即可启用本地加载。
   示例文件名：NotoSerifSC-Regular.otf / NotoSerifSC-Bold.otf
   ---------------------------------------------------------- */
/*
@font-face {
  font-family: "Noto Serif SC";
  src: url("/assets/fonts/NotoSerifSC-Regular.otf") format("opentype"),
       url("/assets/fonts/NotoSerifSC-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC";
  src: url("/assets/fonts/NotoSerifSC-SemiBold.otf") format("opentype"),
       url("/assets/fonts/NotoSerifSC-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC";
  src: url("/assets/fonts/NotoSerifSC-Bold.otf") format("opentype"),
       url("/assets/fonts/NotoSerifSC-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
*/

:root {
  --ink: #1a1814;
  --ink-soft: #3a342c;
  --ink-muted: #6b6358;
  --paper: #f3efe6;
  --paper-deep: #e8e0d0;
  --paper-warm: #f7f3ea;
  --ochre: #8b6914;
  --ochre-soft: #a8842a;
  --ochre-pale: rgba(139, 105, 20, 0.12);
  --cinnabar: #6b2e2e;
  --cinnabar-soft: #8a4545;
  --line: rgba(26, 24, 20, 0.12);
  --line-strong: rgba(26, 24, 20, 0.22);
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "宋体", serif;
  --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "宋体", serif;
  --max: 72rem;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.85;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 120% 80% at 10% -10%, rgba(139, 105, 20, 0.07), transparent 50%),
    radial-gradient(ellipse 90% 70% at 95% 5%, rgba(107, 46, 46, 0.04), transparent 45%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(26, 24, 20, 0.04), transparent 55%),
    linear-gradient(180deg, var(--paper-warm) 0%, var(--paper) 40%, var(--paper-deep) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ochre);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

a:hover {
  color: var(--cinnabar);
}

a:focus-visible {
  outline: 1px solid var(--ochre);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 0.75em;
  letter-spacing: 0.06em;
}

p {
  margin: 0 0 1.1em;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* ---------- 阅读进度条 ---------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--ochre), var(--cinnabar));
  z-index: 1000;
  pointer-events: none;
  transform-origin: left;
  transition: width 0.08s linear;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(243, 239, 230, 0.88);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1.5rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--ink);
  flex-shrink: 0;
}

.brand:hover {
  color: var(--ink);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.2;
}

.brand-tag {
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.28em;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 1.1rem;
  height: 1px;
  background: var(--ink);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
}

.nav-toggle span::before {
  transform: translate(-50%, calc(-50% - 5px));
}

.nav-toggle span::after {
  transform: translate(-50%, calc(-50% + 5px));
}

.nav-toggle[aria-expanded="true"] span {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.75rem;
}

.site-nav a {
  position: relative;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  padding: 0.35rem 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ochre);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

/* ---------- Ad slots ---------- */
.ad-slot {
  min-height: 0;
}

.ad-slot:not(:empty) {
  margin: 1rem auto;
  width: min(100% - 2.5rem, var(--max));
}

/* ---------- Hero（首屏完整构图） ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4rem 0 5rem;
}

.hero-ink {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ink-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  animation: ink-float 18s ease-in-out infinite;
}

.ink-blob--1 {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  background: radial-gradient(circle, rgba(26, 24, 20, 0.28) 0%, transparent 70%);
  top: -8%;
  right: -5%;
  animation-delay: 0s;
}

.ink-blob--2 {
  width: 28vw;
  height: 28vw;
  max-width: 360px;
  max-height: 360px;
  background: radial-gradient(circle, rgba(139, 105, 20, 0.22) 0%, transparent 70%);
  bottom: 10%;
  left: -6%;
  animation-delay: -6s;
  animation-duration: 22s;
}

.ink-blob--3 {
  width: 18vw;
  height: 18vw;
  max-width: 220px;
  max-height: 220px;
  background: radial-gradient(circle, rgba(107, 46, 46, 0.12) 0%, transparent 70%);
  top: 40%;
  left: 55%;
  animation-delay: -11s;
  animation-duration: 16s;
}

@keyframes ink-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(2%, -3%) scale(1.05); }
  66% { transform: translate(-2%, 2%) scale(0.97); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 40rem;
  padding-inline: 1.25rem;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.75rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--ink);
  margin: 0 0 1.75rem;
  text-indent: 0.28em;
}

.hero-brand span {
  display: inline-block;
  border-bottom: 1px solid var(--ochre);
  padding-bottom: 0.35rem;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.35em;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
  text-indent: 0.35em;
}

.hero-lead {
  font-size: 1rem;
  color: var(--ink-muted);
  letter-spacing: 0.12em;
  max-width: 28rem;
  margin: 0 auto 2.5rem;
  line-height: 1.9;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8.5rem;
  padding: 0.7rem 1.6rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
  text-indent: 0.2em;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn--ghost {
  border-color: var(--ochre);
  color: var(--ochre);
}

.btn--ghost:hover {
  background: var(--ochre);
  color: var(--paper);
  border-color: var(--ochre);
}

.hero-ornament {
  margin-top: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--ochre);
  opacity: 0.7;
}

.hero-ornament::before,
.hero-ornament::after {
  content: "";
  width: 3.5rem;
  height: 1px;
  background: currentColor;
}

.hero-ornament i {
  font-style: normal;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
}

/* ---------- Sections ---------- */
.section {
  padding: 4.5rem 0;
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 2.5rem;
  max-width: 36rem;
}

.section-eyebrow {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  color: var(--ochre);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  margin-bottom: 0.6rem;
  letter-spacing: 0.18em;
}

.section-desc {
  color: var(--ink-muted);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  margin: 0;
}

/* 卷次 / 导航列表 — 非卡片堆砌，行式古典排版 */
.volume-list,
.nav-list,
.article-list {
  display: grid;
  gap: 0;
}

.volume-list {
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0 2.5rem;
}

.volume-item,
.nav-item,
.article-item {
  border-bottom: 1px solid var(--line);
}

.volume-item a,
.nav-item a,
.article-item a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.15rem 0;
  color: var(--ink);
}

.volume-item a:hover,
.nav-item a:hover,
.article-item a:hover {
  color: var(--ochre);
}

.item-index {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--ochre);
  letter-spacing: 0.1em;
  min-width: 2.2rem;
}

.item-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
}

.item-meta {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}

.article-item a {
  flex-wrap: wrap;
}

.article-item .item-excerpt {
  flex-basis: 100%;
  margin: 0.35rem 0 0 3.2rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.7;
}

/* 修持资料 — 疏朗三列，无卡片框 */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 3rem;
}

.practice-block {
  padding-top: 1.25rem;
  border-top: 1px solid var(--ochre);
}

.practice-block h3 {
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
}

.practice-block p {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.practice-block a {
  position: relative;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
}

.practice-block a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--ochre);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.practice-block a:hover {
  color: var(--ochre);
}

.practice-block a:hover::after {
  transform: scaleX(1);
}

/* ---------- Reveal 动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  padding: 1.5rem 0 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: "·";
  margin-left: 0.5rem;
  color: var(--line-strong);
}

.breadcrumb a {
  color: var(--ink-muted);
}

.breadcrumb a:hover {
  color: var(--ochre);
}

.breadcrumb [aria-current="page"] {
  color: var(--ink-soft);
}

/* ---------- Page head ---------- */
.page-head {
  padding: 1.5rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.page-head h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
}

.page-head .page-desc {
  color: var(--ink-muted);
  margin: 0;
  max-width: 36rem;
}

/* ---------- List / Pagination ---------- */
.list-main {
  padding: 2.5rem 0 4rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
}

.pagination a:hover {
  color: var(--ochre);
  border-bottom-color: var(--ochre);
}

.pagination .is-current {
  color: var(--ink);
  border-bottom-color: var(--ochre);
  font-weight: 600;
}

.pagination .is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.empty-hint {
  padding: 3rem 0;
  text-align: center;
  color: var(--ink-muted);
  letter-spacing: 0.12em;
}

/* ---------- Article ---------- */
.article-main {
  padding: 2rem 0 4.5rem;
}

.article-header {
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.article-header h1 {
  font-size: clamp(1.55rem, 3.5vw, 2.15rem);
  letter-spacing: 0.16em;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.article-body {
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 2.05;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

.article-body p {
  margin: 0 0 1.35em;
  text-align: justify;
  text-indent: 2em;
}

.article-body h2,
.article-body h3 {
  margin: 2.4em 0 1em;
  text-align: center;
  text-indent: 0;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.28em;
  font-size: 1.2em;
}

.article-body h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 1px;
  margin: 0.85rem auto 0;
  background: var(--ochre);
  opacity: 0.55;
}

.article-body blockquote {
  margin: 1.75em 0;
  padding: 0.5em 0 0.5em 1.25em;
  border-left: 2px solid var(--ochre);
  color: var(--ink-muted);
  font-style: normal;
  text-indent: 0;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.75em auto;
}

.article-body a {
  color: var(--ochre);
  border-bottom: 1px solid var(--ochre-pale);
  text-decoration: none;
}

.article-body strong {
  color: var(--ink);
  font-weight: 600;
}

.article-nav {
  max-width: 40rem;
  margin: 3.5rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.article-nav a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.article-nav a:hover {
  color: var(--ochre);
}

.article-nav .label {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.2em;
  margin-bottom: 0.35rem;
}

.article-nav .next {
  text-align: right;
}

.related {
  max-width: 40rem;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.related h2 {
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  margin-bottom: 1.25rem;
  text-align: center;
}

.related .article-list {
  max-width: 100%;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0 2.5rem;
  margin-top: 2rem;
  background: linear-gradient(180deg, transparent, rgba(232, 224, 208, 0.5));
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-start;
}

.footer-brand {
  max-width: 22rem;
}

.footer-brand .name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin-bottom: 0.6rem;
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  margin: 0;
  line-height: 1.8;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.footer-nav a {
  color: var(--ink-soft);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

.footer-nav a:hover {
  color: var(--ochre);
}

.footer-copy {
  width: 100%;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-align: center;
}

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .container {
    width: min(100% - 1.75rem, var(--max));
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 1.25rem 1.25rem;
    background: rgba(243, 239, 230, 0.97);
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a::after {
    display: none;
  }

  .hero {
    min-height: calc(100svh - var(--header-h));
    padding: 3rem 0 4rem;
  }

  .hero-brand {
    letter-spacing: 0.18em;
    text-indent: 0.18em;
  }

  .hero-headline {
    letter-spacing: 0.2em;
    text-indent: 0.2em;
  }

  .practice-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .volume-list {
    grid-template-columns: 1fr;
  }

  .article-item .item-excerpt {
    margin-left: 0;
  }

  .article-nav {
    grid-template-columns: 1fr;
  }

  .article-nav .next {
    text-align: left;
  }

  .article-body > p:first-of-type::first-letter {
    font-size: 2.6em;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ink-blob {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .site-nav a::after,
  .practice-block a::after {
    transition: none;
  }
}
