/* 提灯 · THE ENLIGHTEN — 全站样式
 * 视觉体系延续 v0.4 原型：米白纸张、墨色、深绿、柔和金色。
 * 字体使用系统中文衬线字体，不加载网络字体，保证手机端速度。 */

:root {
  --bg: #f7f4ec;
  --paper: #fffdf8;
  --ink: #293b38;          /* 墨绿 / 深绿 */
  --muted: #64716c;
  --gold: #a07a43;          /* 柔和金（已略加深以满足文字对比度） */
  --gold-soft: #d7c9a9;
  --line: #e4ddd0;
  --tint: #f5f0e5;
  --panel: #ece9df;
  --ok: #4f6a3c;
  --radius: 4px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --measure: 40em;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.85;
  /* 极轻的纸张肌理（纯 CSS，无额外图片请求） */
  background-image: radial-gradient(#00000005 1px, transparent 1px);
  background-size: 3px 3px;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }
button, input, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.skip-link { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; border-radius: var(--radius); }
.skip-link:focus { top: 10px; color: #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- 页眉与导航 ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: #f7f4ecee; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav { max-width: 1160px; margin: auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; gap: 20px; }
.brand { font-size: 23px; letter-spacing: .18em; font-weight: bold; white-space: nowrap; line-height: 1.3; }
.brand small { display: block; font: 10px var(--sans); letter-spacing: .23em; color: var(--gold); }
.nav-links { display: flex; gap: 22px; font-size: 14px; }
.nav-links a { padding: 4px 0; border-bottom: 1px solid transparent; white-space: nowrap; }
.nav-links a[aria-current="page"] { border-bottom-color: var(--gold); color: var(--gold); }

/* 阅读进度条（文章页） */
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .1s linear; }

/* ---------- 通用 ---------- */
.eyebrow { color: var(--gold); letter-spacing: .3em; font: 12px var(--sans); }
.wrap { max-width: 1100px; margin: auto; padding: 72px 24px; }
.narrow { max-width: 860px; }
.section-top { text-align: center; margin-bottom: 38px; }
.section-top .eyebrow { display: block; }
.section-top h2, .section-top h1 { font-size: 32px; font-weight: 500; letter-spacing: .1em; margin: 8px 0; }
.section-top p { color: var(--muted); font-size: 14px; margin: 0; }
.btn { border: 1px solid var(--ink); background: var(--ink); color: #fff; padding: 10px 24px; cursor: pointer; display: inline-block; border-radius: 3px; font-size: 14px; line-height: 1.6; }
.btn:hover { opacity: .85; color: #fff; }
.btn.alt { background: transparent; color: var(--ink); }
.btn.alt:hover { color: var(--gold); border-color: var(--gold); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pill { display: inline-block; font-size: 12px; border: 1px solid var(--line); border-radius: 20px; padding: 2px 12px; color: var(--muted); margin: 3px; background: var(--paper); }
.pill.status-placeholder { border-style: dashed; }
.pill.status-draft { color: #8a6a3a; border-color: var(--gold-soft); }
.pill.status-reviewed { color: var(--ok); border-color: #b9c8a9; }
.note { padding: 16px 18px; background: var(--tint); border-left: 3px solid var(--gold); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- 首页 ---------- */
.hero { min-height: 600px; display: grid; place-items: center; text-align: center; position: relative; overflow: hidden; padding: 40px 20px 70px; background: radial-gradient(ellipse at 50% 42%, #fffaf0 0%, #f7f4ec00 65%); }
.halo { position: absolute; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, #e9d6aa77 0%, #e9d6aa15 40%, transparent 72%); top: 15%; left: 50%; transform: translateX(-50%); opacity: .25; }
.hero-inner { position: relative; }
/* 透明背景版官方标识（由官方原图去背景，原图保留于 tideng-logo-official.*） */
.hero-logo { display: block; width: min(940px, 100%); height: auto; margin: 0 auto 10px; }
.intro-logo { display: block; width: min(460px, 100%); height: auto; margin: 0 auto 22px; }
.hero p { color: var(--muted); max-width: 570px; margin: 8px auto 27px; font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { display: block; border: 1px solid var(--line); background: var(--paper); padding: 30px; min-height: 180px; transition: transform .2s, box-shadow .2s; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px #403b2810; color: inherit; }
.card .num { color: var(--gold); font: 13px Georgia, serif; }
.card h3 { font-size: 20px; font-weight: 500; margin: 14px 0 7px; }
.card p { font-size: 14px; color: var(--muted); margin: 0; }
.card .more { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--gold); }
.featured { padding-top: 55px; padding-bottom: 60px; }
.featured-inner { border: 1px solid var(--line); background: var(--paper); display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; padding: 44px; }
.featured-inner h3 { font-size: 30px; font-weight: 500; margin: 10px 0; }
.featured-inner p { color: var(--muted); font-size: 15px; margin-bottom: 26px; }
.featured-quote { text-align: center; font-size: clamp(27px, 4vw, 45px); line-height: 1.9; letter-spacing: .12em; color: #a47d45; }
.featured-quote span { display: block; font-size: 12px; letter-spacing: 0; color: var(--muted); }
.panel { background: var(--panel); padding: 60px 20px; text-align: center; }
.panel blockquote { max-width: 690px; margin: 0 auto; font-size: clamp(20px, 3vw, 27px); line-height: 2.1; }
.panel p { color: var(--muted); font-size: 13px; }

.searchbar { display: flex; max-width: 600px; margin: 0 auto 24px; border: 1px solid var(--line); background: #fff; }
.searchbar input { border: 0; outline: 0; padding: 13px 17px; width: 100%; background: transparent; min-width: 0; }
.searchbar button { border: 0; background: var(--ink); color: #fff; padding: 0 20px; cursor: pointer; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 30px; }
.filter { background: transparent; border: 1px solid var(--line); border-radius: 25px; padding: 5px 16px; cursor: pointer; color: var(--muted); font-size: 13px; }
.filter[aria-pressed="true"] { background: var(--ink); color: #fff; }
.article-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.article-card { background: var(--paper); border: 1px solid var(--line); padding: 25px; }
.article-card small { color: var(--gold); }
.article-card h3 { margin: 9px 0; font-size: 19px; font-weight: 500; }
.article-card p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.link { border: 0; background: transparent; color: var(--ink); cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 5px; }
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.about h2, .about h1 { font-size: 30px; font-weight: 500; }
.about p { color: var(--muted); font-size: 15px; }
.about-logo { display: block; width: 100%; max-width: 500px; height: auto; margin: 0 auto; }

dialog { border: 1px solid var(--line); max-width: 740px; width: calc(100% - 28px); max-height: 85vh; overflow: auto; background: var(--paper); color: var(--ink); padding: 34px; box-shadow: 0 20px 100px #0003; }
dialog::backdrop { background: #15221b99; }
.close { float: right; border: 0; background: transparent; font-size: 25px; cursor: pointer; line-height: 1; padding: 4px 8px; }
.reading h2 { font-weight: 500; }
.reading h3 { font-size: 16px; margin-top: 22px; }
.reading p { font-size: 15px; color: #4d5955; }

/* 浮动「观心手札」入口 */
.float-journal { position: fixed; right: 16px; bottom: 18px; z-index: 30; display: block; padding: 11px 17px; background: var(--ink); color: #fff; border-radius: 28px; box-shadow: 0 5px 22px #0002; font-size: 14px; }
.float-journal:hover { color: #fff; opacity: .9; }

/* ---------- 栏目页 ---------- */
.page-intro { max-width: 850px; text-align: center; margin: 0 auto; padding: 64px 22px 36px; }
.page-intro h1 { font-size: clamp(32px, 6vw, 52px); font-weight: 500; letter-spacing: .12em; margin: 14px 0 8px; }
.page-intro p { font-size: 15px; color: var(--muted); }
.list { display: grid; gap: 14px; }
.row-card { display: grid; grid-template-columns: 70px 1fr auto; gap: 16px; align-items: center; background: var(--paper); border: 1px solid var(--line); padding: 18px 22px; }
a.row-card:hover { border-color: var(--gold-soft); color: inherit; }
.row-card .no { font: 22px Georgia, serif; color: var(--gold); }
.row-card h3 { margin: 0; font-size: 18px; font-weight: 500; }
.row-card p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.row-card.is-pending { background: transparent; border-style: dashed; }
.row-card.is-pending h3 { color: var(--muted); }

/* ---------- 文章阅读页 ---------- */
.article-head { max-width: 860px; margin: 0 auto; text-align: center; padding: 56px 22px 30px; }
.article-head h1 { font-size: clamp(30px, 5.5vw, 48px); font-weight: 500; letter-spacing: .08em; margin: 14px 0 6px; line-height: 1.4; }
.article-head .subtitle { color: var(--muted); font-size: 16px; margin: 0 0 10px; }
.article-head .passage { color: #8a6a3a; font-size: 17px; letter-spacing: .06em; }
.series-dots { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin: 16px auto 0; max-width: 420px; padding: 0; list-style: none; }
.series-dots a { display: block; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--gold-soft); font: 10px/20px var(--sans); text-align: center; color: var(--muted); }
.series-dots a.done { background: var(--tint); }
.series-dots a.empty { border-style: dashed; opacity: .6; }
.series-dots a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); opacity: 1; }

.layout { max-width: 1120px; margin: auto; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 38px; padding: 0 22px 70px; }
.toc { position: sticky; top: 96px; align-self: start; border-left: 1px solid var(--line); padding-left: 16px; }
.toc strong { font-size: 13px; }
.toc ol { list-style: none; margin: 6px 0 0; padding: 0; }
.toc a { display: block; font-size: 13px; color: var(--muted); padding: 5px 0; }
.toc a.active { color: var(--gold); }
.content { min-width: 0; }
.chapter { background: var(--paper); border: 1px solid var(--line); padding: 32px 38px; margin-bottom: 22px; scroll-margin-top: 90px; }
.chapter h2 { font-size: 25px; font-weight: 500; margin: 2px 0 16px; }
.chapter h3 { font-size: 18px; margin: 22px 0 6px; font-weight: 600; }
.chapter p, .chapter li { font-size: 16px; }
.chapter > p, .chapter > ul, .chapter > ol { max-width: var(--measure); }
.chapter a, .chapter li, .chapter p { overflow-wrap: anywhere; }
.chapter p a, .chapter li a, .chapter td a, .chapter dd a { color: #7d5f36; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.chapter p a:hover, .chapter li a:hover, .chapter td a:hover, .chapter dd a:hover { color: var(--ink, #293b38); }
.journal-extra { margin-top: 40px; scroll-margin-top: 96px; }
.chapter blockquote { margin: 16px 0; padding: 18px 22px; background: var(--tint); border-left: 3px solid var(--gold); }
#original blockquote, .sutra { font-size: 18px; line-height: 2.3; letter-spacing: .06em; }
#original blockquote p { font-size: inherit; }
.source, .chapter .source { font-size: 12px; color: var(--muted); }
.quote { border-left: 2px solid var(--gold); padding: 10px 18px; color: #7d5f36; background: #f8f4eb; }
.segment { padding: 17px 0; border-top: 1px solid var(--line); }
.segment:first-of-type { border-top: 0; }
.segment h3 { margin-top: 2px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0; }
.chapter table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.7; }
.chapter th, .chapter td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.chapter th { color: #7d5f36; font-weight: 600; background: var(--tint); }
.pending { display: grid; gap: 2px; padding: 18px 20px; border: 1px dashed var(--gold-soft); background: #fbf8f1; color: var(--muted); font-size: 14px; border-radius: var(--radius); }
.pending strong { color: #8a6a3a; font-weight: 600; }
.article-lead { margin-bottom: 22px; }
.status-banner { max-width: 860px; margin: 0 auto 24px; padding: 0 22px; }
.status-banner .note { font-size: 13px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.pager a, .pager span { display: block; background: var(--paper); border: 1px solid var(--line); padding: 16px 20px; min-height: 84px; }
.pager a:hover { border-color: var(--gold-soft); color: inherit; }
.pager small { display: block; color: var(--gold); font: 12px var(--sans); letter-spacing: .12em; }
.pager .next { text-align: right; }
.pager span { visibility: hidden; }
.back-to { text-align: center; margin-top: 22px; font-size: 14px; }

/* ---------- 观心手札 ---------- */
.journal { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 20px; }
.journal-intro { color: var(--muted); font-size: 14px; }
.journal-form { display: grid; gap: 20px; }
.journal-field { display: grid; gap: 6px; }
.journal-field label { font-size: 15px; font-weight: 600; }
.journal-field .hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.journal-field textarea { width: 100%; min-height: 96px; resize: vertical; border: 1px solid #d9cebd; border-radius: 8px; background: #fffefa; padding: 13px 15px; font: 16px/1.8 var(--serif); color: var(--ink); }
.journal-field textarea:focus { outline: 2px solid #b89867; outline-offset: 1px; }
.journal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.journal-section-title { border-top: 1px solid var(--line); padding-top: 17px; margin-top: 5px; font-size: 16px; }
.journal-privacy { display: flex; align-items: start; gap: 8px; font-size: 13px; color: var(--muted); }
.journal-privacy input { margin-top: 6px; width: 18px; height: 18px; flex: none; }
.journal-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.journal-actions button { cursor: pointer; font: 14px var(--serif); padding: 11px 17px; border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: #fff; min-height: 44px; }
.journal-actions button.secondary { background: transparent; color: var(--ink); border-color: #bdb2a1; }
.journal-status { min-height: 20px; font-size: 12px; color: var(--ok); }
.journal-disclaimer { font-size: 12px; color: var(--muted); background: #f6f1e8; padding: 14px; border-radius: 6px; }
.journal-saved { color: var(--ok); font-size: 12px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 35px 20px 90px; text-align: center; color: var(--muted); font-size: 12px; }
.site-footer nav { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* ---------- 手机端 ---------- */
@media (max-width: 780px) {
  .nav { flex-direction: column; gap: 6px; padding: 10px 0 0; }
  .nav-links { gap: 16px; overflow-x: auto; max-width: 100%; padding: 0 16px 8px; font-size: 13px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-links::-webkit-scrollbar { display: none; }
  .grid, .article-grid, .about, .featured-inner { grid-template-columns: 1fr; }
  .wrap { padding: 52px 16px; }
  .hero { min-height: auto; padding: 26px 16px 56px; }
  .hero-logo { width: calc(100% + 20px); max-width: none; margin: 0 -10px 8px; } /* 透明图自带留白，手机上可略超出文字边距 */
  .about { gap: 25px; }
  .card { min-height: auto; padding: 24px; }
  .featured-inner { padding: 25px; }
  .layout { display: block; padding: 0 12px 60px; }
  .toc { position: static; border: 1px solid var(--line); background: var(--paper); padding: 10px 16px; margin-bottom: 18px; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 0 14px; }
  .chapter { padding: 24px 18px; }
  .chapter p, .chapter li { font-size: 17px; line-height: 1.95; }
  #original blockquote { font-size: 18px; padding: 16px; }
  .journal-grid { grid-template-columns: 1fr; }
  .journal-actions button { flex: 1 1 40%; }
  .row-card { grid-template-columns: 46px 1fr; padding: 16px; }
  .row-card .no { font-size: 18px; }
  .row-card .pill { grid-column: 2; justify-self: start; margin: 0; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .pager span { display: none; }
  dialog { padding: 24px 18px; }
  .page-intro, .article-head { padding-top: 40px; }
  .section-top h2, .section-top h1 { font-size: 24px; letter-spacing: .06em; }
  .float-journal { padding: 8px 13px; font-size: 13px; right: 12px; bottom: 12px; opacity: .92; }
}

@media print {
  .site-header, .float-journal, .toc, .pager, .journal-actions, .site-footer nav { display: none !important; }
  body { background: #fff; }
  .chapter { border: 0; padding: 0; }
}
.tags { font-size: 12px; color: var(--gold); }
.chapter th:first-child, .chapter td:first-child { white-space: nowrap; }

/* ---------- 原稿中的结构图、模型与摘要（纯文字样式，无图片） ---------- */
.flow { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 0; counter-reset: flow; }
.flow li { position: relative; padding: 12px 16px 12px 44px; background: var(--tint); border-left: 3px solid var(--gold); margin-bottom: 22px; }
.flow li::before { counter-increment: flow; content: counter(flow); position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); font: 12px/20px var(--sans); text-align: center; }
.flow li:not(:last-child)::after { content: "↓"; position: absolute; left: 50%; bottom: -21px; color: var(--gold); font-size: 14px; line-height: 20px; }
.flow strong, .model strong { display: block; font-size: 17px; font-weight: 600; letter-spacing: .04em; }
.flow span, .model span { display: block; font-size: 14px; color: var(--muted); }
/* 十二支次第（第11篇「十二缘起 · 流转次第」，原稿编号作文字保留） */
.chain { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.chain li { background: var(--tint); border-top: 3px solid var(--gold); padding: 10px 8px; text-align: center; }
.chain em { display: block; font: 12px/1.4 var(--sans); font-style: normal; color: var(--gold); letter-spacing: .08em; }
.chain strong { display: block; font-size: 17px; font-weight: 600; letter-spacing: .06em; }
@media (max-width: 780px) { .chain { grid-template-columns: repeat(4, 1fr); gap: 8px; } .chain strong { font-size: 16px; } }
.model { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.model li { background: var(--tint); padding: 14px; text-align: center; border-top: 2px solid var(--gold); }
.chapter > .skandha { grid-template-columns: repeat(5, 1fr); max-width: none; }
.skandha em { display: block; font: italic 13px/1.4 var(--sans); color: #7d5f36; margin: 2px 0 4px; }
.scene .scene-steps { grid-template-columns: repeat(5, 1fr); margin-bottom: 0; }
.scene-result { position: relative; margin: 28px 0 16px; padding: 14px 16px; text-align: center; border: 1px solid var(--gold); background: var(--paper, #f7f4ec); }
.scene-result::before { content: "↓"; position: absolute; left: 50%; top: -24px; color: var(--gold); font-size: 14px; line-height: 20px; }
.scene-result strong { display: block; font-size: 17px; font-weight: 600; }
.scene-result span { display: block; font-size: 14px; color: var(--muted); }
.numbered em { display: block; font: 600 13px/1.4 var(--sans); color: var(--gold); letter-spacing: .1em; margin-bottom: 4px; font-style: normal; }
.model.two { grid-template-columns: repeat(2, 1fr); }
.skandha.four, .chapter > .skandha.four { grid-template-columns: repeat(4, 1fr); max-width: none; }
.scene .skandha em { font-style: normal; }
.scene-result span + strong { margin-top: 4px; }
.tcards em { display: block; font-style: normal; font-size: 13px; color: #7d5f36; margin: 2px 0 4px; }
.core { padding-left: 1.2em; }
.core li { margin: 6px 0; }
.qa { margin: 16px 0; }
.qa dt { font-weight: 600; margin-top: 14px; color: #7d5f36; }
.qa dd { margin: 4px 0 0; padding-left: 14px; border-left: 2px solid var(--line); }
.journal-title { margin: 6px 0 0; font-size: 17px; }
.journal-line { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .08em; }
@media (max-width: 780px) { .model, .model.two, .chapter > .skandha, .skandha.four, .chapter > .skandha.four, .scene .scene-steps { grid-template-columns: 1fr; } .flow strong, .model strong { font-size: 16px; } }
