/* ============================================================
   二〇二六年夏季训练 · 统一阅读设计系统
   设计语言：暖纸背景 · 墨绿主色 · 衬线正文 · 清晰层级 · 简约大气
   ============================================================ */
:root{
  --paper:#FBF8F1;        /* 暖纸白 */
  --paper-2:#F4EFE4;      /* 略深底，用于卡片/按钮 */
  --card:#FFFFFF;
  --ink:#000;             /* 正文：纯黑 */
  --ink-2:#6B6354;        /* 次级文字 */
  --ink-3:#9A9382;        /* 辅助/分隔文字 */
  --line:#E7DECE;         /* 暖色分隔线 */
  --line-2:#D9CDB6;
  --accent:#2E6B5B;       /* 精炼墨绿（主色） */
  --accent-d:#1E4A3E;     /* 深墨绿 */
  --accent-soft:#EAF2EE;  /* 主色淡底 */
  --link:#3A5A8C;         /* 经文/链接 静蓝 */
  --verse:#000;           /* 经文引文（卷号 .vr 仍用墨绿区分） */
  --rose:#9C4A52;         /* 诗歌点缀 */
  --toolbar-h:54px;
  --read-w:720px;
  --serif:"Songti SC","STSong","Noto Serif SC","Source Han Serif SC","SimSun",serif;
  --sans:"PingFang SC","Microsoft YaHei","Hiragino Sans GB","Segoe UI",system-ui,-apple-system,sans-serif;
}
html{ font-size:17px; }              /* 基础字号，字号切换改变此值 */
html.fs-small{ font-size:15px; }
html.fs-medium{ font-size:18px; }
html.fs-large{ font-size:22px; }

*{ box-sizing:border-box; }
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--serif);
  font-size:1.06rem;
  line-height:1.95;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  padding:calc(var(--toolbar-h) + 20px) 18px 72px;
}

/* 阅读栏：所有正文容器居中限宽 */
.notion-page-content,
#outline-content,
.entry-content,
.th-read{
  max-width:var(--read-w);
  margin:0 auto;
}

p{ margin:.85em 0; }
a{ color:var(--link); text-decoration:none; transition:color .15s; }
a:hover{ color:var(--accent); text-decoration:underline; }
hr{ border:0; border-top:1px solid var(--line); margin:1.6em auto; max-width:var(--read-w); }
mark{ background:var(--accent-soft); color:var(--accent-d); padding:0 .15em; border-radius:3px; }

/* ---------- 顶部固定工具条 ---------- */
.th-toolbar{
  position:fixed; top:0; left:0; right:0; height:var(--toolbar-h);
  display:flex; align-items:center; gap:8px; padding:0 14px;
  background:var(--accent-d); color:#fff; z-index:1000;
  box-shadow:0 1px 0 rgba(0,0,0,.15), 0 2px 10px rgba(0,0,0,.12);
  font-family:var(--sans);
}
.th-toolbar .th-title{
  flex:1 1 auto; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
  font-weight:600; letter-spacing:.04em; font-size:.95rem;
}
.th-toolbar a.th-home{ color:#fff; font-weight:600; white-space:nowrap; font-size:.95rem; }
.th-toolbar a.th-home:hover{ color:#dfeee8; text-decoration:none; }
.th-toolbar .th-sep{ opacity:.45; }
.th-btn{
  border:1px solid rgba(255,255,255,.35); background:rgba(255,255,255,.1);
  color:#fff; border-radius:7px; padding:5px 10px; cursor:pointer;
  font-size:.95rem; line-height:1; font-weight:600; min-width:36px;
  font-family:var(--sans); transition:background .15s, transform .1s;
}
.th-btn:hover{ background:rgba(255,255,255,.22); }
.th-btn:active{ transform:translateY(1px); }
.th-spacer{ width:2px; }

/* ---------- 篇题（每页顶部） ---------- */
.th-msgtitle{
  text-align:center; font-weight:700; color:var(--ink);
  font-size:1.7rem; letter-spacing:.05em; line-height:1.5;
  margin:6px auto 26px; max-width:var(--read-w);
}
.th-msgtitle::after{
  content:""; display:block; width:54px; height:2px; margin:14px auto 0;
  background:linear-gradient(90deg,transparent,var(--accent),transparent);
}

/* ---------- 顶部页面导航：目录 · 纲目 · 晨兴 · 听抄 · 诗歌 · 中英 ---------- */
.th-pagenav{
  display:flex; flex-wrap:nowrap; align-items:center; gap:2px;
  overflow-x:auto; -webkit-overflow-scrolling:touch;
  font-family:var(--sans); font-size:.9rem;
  color:var(--ink-3); margin:0 auto 26px; max-width:var(--read-w);
  letter-spacing:.04em; padding-bottom:4px;
}
.th-pagenav a{ color:var(--accent); padding:4px 10px; border-radius:6px; white-space:nowrap; }
.th-pagenav a:hover{ background:var(--accent-soft); text-decoration:none; }
.th-pagenav i{ color:var(--line-2); font-style:normal; margin:0 1px; }

/* ---------- 章节 / 小节 标题 ---------- */
h2, .calibre_content_title{
  font-family:var(--serif); font-weight:700; color:var(--accent-d);
  font-size:1.35rem; line-height:1.5; margin:2.2em auto 1em;
  max-width:var(--read-w); padding-bottom:.35em;
  border-bottom:1px solid var(--line);
}
.notion-sub_header-block h3{
  font-family:var(--serif); font-weight:700; color:var(--accent);
  font-size:1.12rem; line-height:1.6; margin:1.8em auto .8em;
  max-width:var(--read-w); padding-left:.7em; border-left:3px solid var(--accent);
}
.notion-sub_header-block h3:empty{ display:none; }
/* 晨兴日签：第一周 • 周一 */
.notion-page-block h1{
  font-family:var(--sans); font-weight:600; color:var(--ink-2);
  font-size:.95rem; letter-spacing:.18em; text-align:center;
  margin:0 auto 1.6em; max-width:var(--read-w);
}
.notion-page-block h1::after{
  content:""; display:block; width:40px; height:1px; margin:12px auto 0;
  background:var(--line-2);
}
/* 晨兴日签导航：[1] … [6] */
.th-daynav{
  text-align:center; font-family:var(--sans); font-size:.95rem;
  color:var(--ink-3); margin:0 auto 26px; max-width:var(--read-w);
}
.th-daynav a{
  display:inline-block; margin:0 4px; padding:4px 12px; border-radius:20px;
  border:1px solid var(--line-2); color:var(--accent); font-weight:600;
}
.th-daynav a:hover{ background:var(--accent-soft); text-decoration:none; }
/* 晨兴内小节（读经：…） */
.notion-sub_sub_header-block h4{
  font-family:var(--serif); font-weight:700; color:var(--ink-2);
  font-size:1rem; margin:1.2em auto .6em; max-width:var(--read-w);
}
/* Notion 标注强调（黄/红） */
.notion-enable-hover[data-notion-highlight="yellow"]{ background:#FBEFC9; color:#6b5418; border-radius:3px; padding:0 .15em; }
.notion-enable-hover[data-notion-highlight="red"]{ background:#F6DCDD; color:#8a2f37; border-radius:3px; padding:0 .15em; }
.notion-enable-hover[data-notion-highlight="blue"]{ background:#DCE6F6; color:#274a86; border-radius:3px; padding:0 .15em; }

/* Notion toggle 折叠块：箭头是内联 SVG（viewBox 16×16，无宽高属性），
   原尺寸靠被剥离的 Notion 在线 CSS 控制；缺失时 SVG 宽度会撑满整行，
   渲染成约 700px 的巨型黑色三角。此处恢复为标题左侧的小箭头。 */
.notion-toggle-block > div > div{
  display:flex; align-items:flex-start; gap:10px;
  max-width:var(--read-w); margin:1em auto;
}
.notion-toggle-block .notion-list-item-box-left{ flex:none; padding-top:.45em; }
.notion-toggle-block svg.arrowCaretDownFillSmall{
  width:13px; height:13px; display:block; fill:var(--accent);
}
/* 保险丝：Notion 导出里的任何内联图标一律不许超过 18px */
.notion-selectable svg{ max-width:18px; max-height:18px; }

/* ---------- 纲目（outline）层级 ---------- */
#outline-content .c1, #outline-content .c2, #outline-content .c3,
#outline-content .c4, #outline-content .c5,
#outline-content .cr1,#outline-content .cr2,#outline-content .cr3,
#outline-content .cr4,#outline-content .cr5{
  display:block; margin:1.5em auto .6em; max-width:var(--read-w);
  font-weight:700; line-height:1.8; padding-left:0;
}
#outline-content .c1{ font-size:1.2rem; color:var(--ink); }
#outline-content .c2{ font-size:1.1rem; color:var(--accent-d); }
#outline-content .c3{ font-size:1.02rem; color:var(--ink); padding-left:1.4em; }
#outline-content .c4{ font-size:1rem;  color:var(--ink-2); padding-left:2.4em; }
#outline-content .c5{ font-size:1rem;  color:var(--ink-2); padding-left:3.4em; }
#outline-content .bold{ font-weight:700; }
/* 经文引文（无 class 的 p） */
#outline-content > p:not([class]){
  max-width:var(--read-w); margin:.45em auto; color:var(--verse);
  padding-left:1.7em; font-size:.98rem; line-height:1.9;
}

/* ---------- 晨兴 / 听抄 正文（notion 文本块） ---------- */
.notion-text-block{ max-width:var(--read-w); margin:.7em auto; line-height:1.95; }
.notion-header-block{ max-width:var(--read-w); margin:0 auto; }

/* ---------- 媒体：图片 / 音频 / 视频 ---------- */
img{ max-width:100%; height:auto; }
.notion-page-content img, .entry-content img, #outline-content img, .th-read img{
  display:block; margin:20px auto; border-radius:10px;
  box-shadow:0 3px 14px rgba(40,30,10,.12);
}
.entry-content img, .th-read img{ cursor:zoom-in; transition:filter .2s, box-shadow .2s; }
.entry-content img:hover, .th-read img:hover{ filter:brightness(.97); }
audio{
  display:block; width:100%; max-width:var(--read-w);
  margin:12px auto; border-radius:8px; color:var(--accent);
}
video{
  display:block; width:100%; max-width:var(--read-w); height:auto;
  margin:20px auto; border-radius:12px; box-shadow:0 3px 14px rgba(40,30,10,.12);
}

/* ---------- 诗歌页标签（mp3 / 教唱 / 词谱 / 伴奏） ---------- */
.has-medium-font-size{
  font-family:var(--sans); font-size:.8rem; font-weight:700;
  letter-spacing:.12em; color:var(--ink-3); text-transform:uppercase;
  margin:1.5em auto .3em; max-width:var(--read-w);
}
.wp-block-audio{ margin:.4em auto 1em; max-width:var(--read-w); }
.entry-title{
  font-family:var(--serif); font-weight:700; color:var(--ink);
  font-size:1.5rem; text-align:center; margin:0 auto 1.4em; max-width:var(--read-w);
}

/* ---------- 标语页 ---------- */
.banner{
  background:var(--accent-soft); border-left:4px solid var(--accent);
  border-radius:0 10px 10px 0; padding:16px 20px; margin:16px auto;
  max-width:var(--read-w); font-size:1.08rem; line-height:2;
}
.banner .grayW{
  display:block; color:var(--ink-2); font-size:.85rem; font-style:italic;
  margin-top:8px; line-height:1.8;
}

/* ---------- 目录页 index ---------- */
.th-index{ max-width:960px; margin:0 auto; padding-top:8px; }
.th-hero{
  background:linear-gradient(135deg,var(--accent-d),var(--accent));
  color:#fff; border-radius:16px; padding:34px 22px; text-align:center;
  box-shadow:0 8px 28px rgba(30,74,62,.28); margin-bottom:26px;
}
.th-hero h1{ margin:0 0 8px; font-size:1.7rem; letter-spacing:.14em; font-weight:700; font-family:var(--serif); }
.th-hero .th-zongti{ font-size:1.1rem; font-weight:600; opacity:.95; font-family:var(--sans); }
.th-hero .th-links{ margin-top:16px; }
.th-hero .th-links a{
  color:#fff; background:rgba(255,255,255,.16); padding:7px 16px; border-radius:22px;
  margin:0 6px; display:inline-block; font-weight:600; font-family:var(--sans); font-size:.95rem;
}
.th-hero .th-links a:hover{ background:rgba(255,255,255,.3); text-decoration:none; }
.th-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:16px; }
.th-card{
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  padding:18px 18px 16px; box-shadow:0 1px 3px rgba(40,30,10,.06);
  transition:transform .18s, box-shadow .18s, border-color .18s;
}
.th-card:hover{ transform:translateY(-3px); box-shadow:0 10px 26px rgba(30,74,62,.16); border-color:var(--accent); }
.th-card .th-no{
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:50%;
  background:var(--accent); color:#fff; font-weight:700; font-size:.9rem;
  font-family:var(--sans); margin-right:10px;
}
.th-card .th-mtitle{ font-weight:700; font-size:1.05rem; color:var(--ink); font-family:var(--serif); }
.th-card .th-btns{ margin-top:14px; display:flex; flex-wrap:wrap; gap:8px; }
.th-pill{
  flex:1 1 auto; text-align:center; padding:9px 6px; border-radius:9px;
  font-weight:600; font-size:.92rem; font-family:var(--sans);
  border:1px solid var(--line-2); background:var(--paper-2); color:var(--ink-2);
  transition:background .15s, color .15s, border-color .15s;
}
.th-pill:hover{ text-decoration:none; background:var(--accent-soft); color:var(--accent-d); border-color:var(--accent); }
.th-pill.ts{ color:var(--link);  border-color:#cdd9f3; background:#f3f6fd; }
.th-pill.hy{ color:var(--rose);  border-color:#e7cdd4; background:#fdf3f5; }
.th-pill.cx{ color:var(--accent);border-color:#cfe9e2; background:#f1faf7; }

/* 回到顶部 */
.th-top{
  position:fixed; right:16px; bottom:18px; width:46px; height:46px; border-radius:50%;
  background:var(--accent-d); color:#fff; border:none; font-size:20px; cursor:pointer;
  box-shadow:0 3px 12px rgba(0,0,0,.25); display:none; z-index:900;
}
.th-top.show{ display:block; }

/* ---------- 夜间模式（护眼） ---------- */
html.night{
  --paper:#1B1D1A; --paper-2:#242622; --card:#232521;
  --ink:#FFFFFF; --ink-2:#C9C2B2; --ink-3:#968E7D;
  --line:#36322B; --line-2:#4A4334;
  --accent:#62A892; --accent-d:#3C7D68; --accent-soft:#1F2E29;
  --link:#8FB0E0; --verse:#E2DAC6; --rose:#CE8E96;
}
html.night body{ background:var(--paper); color:var(--ink); }
html.night .th-card{ background:var(--card); border-color:var(--line); }
html.night .th-pill{ background:var(--paper-2); }
html.night .banner{ background:var(--accent-soft); }
html.night .notion-page-content img, html.night .entry-content img,
html.night #outline-content img, html.night .th-read img,
html.night video{ box-shadow:0 3px 14px rgba(0,0,0,.5); }
html.night .th-hero{ box-shadow:0 8px 28px rgba(0,0,0,.5); }

/* ---------- 灯箱 ---------- */
.th-lightbox{
  position:fixed; inset:0; z-index:9999; display:none;
  align-items:center; justify-content:center; padding:24px;
  background:rgba(0,0,0,.86); cursor:zoom-out;
  -webkit-tap-highlight-color:transparent;
}
.th-lightbox.open{ display:flex; }
.th-lightbox img{
  max-width:94vw; max-height:92vh; width:auto; height:auto;
  border-radius:6px; background:#fff;
  box-shadow:0 10px 50px rgba(0,0,0,.55); cursor:zoom-out;
}
.th-lightbox .th-lb-hint{
  position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
  color:#fff; opacity:.72; font-size:13px; font-family:var(--sans);
  pointer-events:none; user-select:none;
}

@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; }
}
@media (max-width:560px){
  body{ padding-left:12px; padding-right:12px; }
  .th-grid{ grid-template-columns:1fr; }
}

/* ============================================================
   SPA 内容排版（语义化 HTML：由 app.js 渲染）
   ============================================================ */
.th-read{ max-width:var(--read-w); margin:0 auto; }
.th-read h2{
  font-family:var(--serif); font-weight:700; color:var(--accent-d);
  font-size:1.32rem; line-height:1.5; margin:2.1em auto 1em;
  padding-bottom:.35em; border-bottom:1px solid var(--line);
}
.th-read h3{
  font-family:var(--serif); font-weight:700; color:var(--ink);
  font-size:1.12rem; line-height:1.6; margin:1.8em auto .8em;
  padding-left:.7em; border-left:3px solid var(--accent);
}
/* 小点 / 子点：按秋训要求不加粗（仅大点·中点为结构标题加粗），
   靠字号、次级色与缩进保持层级（对齐夏训 c4/c5 缩进） */
.th-read h4{
  font-family:var(--serif); font-weight:400; color:var(--ink-2);
  font-size:1.02rem; line-height:1.8; margin:1.3em auto .6em; padding-left:1.4em;
}
.th-read h5{
  font-family:var(--serif); font-weight:400; color:var(--ink-2);
  font-size:1.02rem; line-height:1.8; margin:1.3em auto .6em; padding-left:2.4em;
}
.th-read p{ margin:.85em auto; }
.th-read p.sub{ margin-left:1.8em; color:var(--ink-2); font-size:1rem; }
.th-read p.en{ margin-left:1.8em; color:var(--ink-3); font-style:italic; font-family:var(--sans); font-size:.92rem; line-height:1.7; }
.th-read .th-verse{ color:var(--verse); padding-left:1.7em; font-size:.98rem; line-height:1.9; }
.th-read .th-verse .vr{ color:var(--accent); font-weight:700; margin-right:.25em; }
.th-read blockquote{
  border-left:3px solid var(--accent); background:var(--accent-soft);
  margin:1em auto; padding:.6em 1em; border-radius:0 8px 8px 0; color:var(--ink-2);
}
.th-read .th-callout{
  border:1px solid var(--line-2); background:var(--paper-2);
  border-radius:10px; padding:12px 16px; margin:1em auto;
}
.th-read ul, .th-read ol{ max-width:var(--read-w); margin:.8em auto; padding-left:1.6em; }
.th-read li{ margin:.3em 0; }
.th-read .th-label{
  font-family:var(--sans); font-size:.8rem; font-weight:700; letter-spacing:.12em;
  color:var(--ink-3); text-transform:uppercase; margin:1.5em auto .3em;
}
.th-read .th-day{
  font-family:var(--sans); font-weight:600; color:var(--ink-2);
  font-size:.95rem; letter-spacing:.18em; text-align:center; margin:0 auto 1.6em;
}
.th-read .th-day::after{
  content:""; display:block; width:40px; height:1px; margin:12px auto 0; background:var(--line-2);
}
.th-read .lyric{ font-size:1.08rem; line-height:2; }
.th-read .th-media{ display:block; width:100%; max-width:var(--read-w); margin:14px auto; color:var(--accent); }
.th-read .th-fig{
  display:block; margin:20px auto; max-width:100%; height:auto; border-radius:10px;
  box-shadow:0 3px 14px rgba(40,30,10,.12); cursor:zoom-in; transition:filter .2s;
}
.th-read .th-fig:hover{ filter:brightness(.97); }
/* 折叠块（Notion toggle → details） */
.th-read details.th-toggle{
  max-width:var(--read-w); margin:1em auto; border:1px solid var(--line);
  border-radius:10px; background:var(--card); padding:0 14px;
}
.th-read details.th-toggle>summary{
  cursor:pointer; font-weight:700; color:var(--ink);
  padding:12px 2px; list-style:none; display:flex; align-items:center; gap:8px;
}
.th-read details.th-toggle>summary::-webkit-details-marker{ display:none; }
.th-read details.th-toggle>summary::before{ content:"▸"; color:var(--accent); font-size:.8em; }
.th-read details.th-toggle[open]>summary::before{ content:"▾"; }
.th-read details.th-toggle>summary:last-child{ margin-bottom:0; }

/* 当前导航项高亮 */
.th-pagenav a.on{ background:var(--accent); color:#fff; }
.th-daynav a.on{ background:var(--accent); color:#fff; border-color:var(--accent); }

/* SPA 夜间模式内容覆盖 */
html.night .th-read details.th-toggle{ background:var(--card); border-color:var(--line); }
html.night .th-read .th-callout{ background:var(--paper-2); }
html.night .th-read .th-fig, html.night .th-read video{ box-shadow:0 3px 14px rgba(0,0,0,.5); }
html.night .th-read blockquote{ background:var(--accent-soft); }
