﻿/* =========================================================
   Extended sections: 慈宗 / 历史 / 谱系 / 典籍 / 百科 /
   文章合集 / 课程详情
   ========================================================= */

/* ---------- 慈宗要义 ---------- */
.cizong-principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 28px; }
.cizong-principle { padding: 20px 18px; border: 1px solid var(--line); background: rgba(252, 250, 245, 0.58); }
.cizong-principle b { display: block; font-size: 18px; font-weight: 600; }
.cizong-principle span { display: block; margin-top: 5px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.cizong-quote { margin: 34px 0; padding: 26px 30px; border-left: 2px solid var(--red); background: var(--paper-2); font-size: 20px; line-height: 1.9; }
.cizong-quote cite { display: block; margin-top: 10px; font-size: 14px; font-style: normal; color: var(--muted); }
.teacher-line { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.teacher-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); }
.teacher-card img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; filter: saturate(0.7) sepia(0.08); }
.teacher-card b { display: block; font-size: 14px; font-weight: 600; }
.teacher-card span { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ---------- 历史源流 ---------- */
.history-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 60px; padding: 50px 0 90px; align-items: start; }
.history-side { position: sticky; top: 150px; }
.history-side .side-label { font-size: 14px; font-weight: 600; letter-spacing: 0.14em; color: var(--quiet); text-transform: uppercase; }
.history-side nav { margin-top: 13px; border-left: 1px solid var(--line); }
.history-side nav a { display: block; padding: 9px 0 9px 15px; margin-left: -1px; border-left: 1px solid transparent; font-size: 14px; color: var(--muted); }
.history-side nav a:hover, .history-side nav a.is-active { color: var(--red); border-left-color: var(--red); }
.history-side .side-note { margin-top: 30px; padding: 16px; border: 1px solid var(--line); font-size: 14.5px; line-height: 1.8; color: var(--muted); background: rgba(252, 250, 245, 0.55); }
.history-main { min-width: 0; }
.era-block { scroll-margin-top: 145px; margin-bottom: 58px; }
.era-head { display: flex; align-items: baseline; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line-strong); }
.era-head .era-index { margin-left: 0; font-family: var(--sans); font-size: 14px; color: var(--red); letter-spacing: 0.08em; }
.era-head h2 { font-size: 32px; font-weight: 600; }
.era-head > span:last-child { margin-left: auto; font-size: 13.5px; letter-spacing: 0.12em; color: var(--quiet); }
.era-intro { max-width: 760px; margin-top: 14px; font-size: 15.5px; line-height: 1.85; color: var(--muted); }
.era-events { margin-top: 18px; border-top: 1px solid var(--line); }
.era-event { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.era-event .year { font-family: var(--sans); font-size: 15px; color: var(--red); letter-spacing: 0.02em; }
.era-event h3 { font-size: 19px; font-weight: 600; }
.era-event p { margin-top: 5px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.era-event .era-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 9px; font-size: 14px; }
.era-event .era-links a { color: var(--ink-2); border-bottom: 1px solid var(--line-strong); }
.era-event .era-links a:hover { color: var(--red); border-color: var(--red); }

/* ---------- 传承谱系 ---------- */
.puxi-map { position: relative; margin-top: 26px; padding: 38px 34px 30px; color: #f3ecdf; background: var(--green); overflow: hidden; }
.puxi-map::after { content: "脉"; position: absolute; right: 10px; bottom: -60px; font-family: var(--display); font-size: 220px; line-height: 1; color: rgba(243, 236, 223, 0.04); }
.puxi-branches { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 42px; }
.puxi-branch h3 { font-size: 14px; font-weight: 500; letter-spacing: 0.1em; color: #d6bf99; }
.puxi-branch h3 span { display: block; margin-top: 4px; font-size: 11.5px; letter-spacing: 0.16em; color: rgba(243, 236, 223, 0.4); }
.puxi-list { margin-top: 16px; border-top: 1px solid rgba(243, 236, 223, 0.16); }
.puxi-node { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; padding: 10px 0 10px 16px; border-bottom: 1px solid rgba(243, 236, 223, 0.13); }
.puxi-node::before { content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 1px; background: rgba(216, 185, 126, 0.55); }
.puxi-node img, .puxi-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; filter: saturate(0.6) sepia(0.08); }
.puxi-avatar { display: grid; place-items: center; border: 1px solid rgba(216, 185, 126, 0.45); font-family: var(--display); font-style: normal; font-size: 15px; color: #d6bf99; filter: none; }
.puxi-node b { display: block; font-size: 14px; font-weight: 500; }
.puxi-node span { display: block; font-size: 13px; color: rgba(243, 236, 223, 0.48); }
.puxi-node:hover b { color: #e0c99f; }
.puxi-note { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.puxi-note div { padding-top: 14px; border-top: 1px solid var(--line-strong); }
.puxi-note b { font-size: 14px; }
.puxi-note p { margin-top: 5px; font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ---------- 典籍丛稿 ---------- */
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.project-card { padding: 22px 22px 18px; border: 1px solid var(--line); background: rgba(252, 250, 245, 0.58); }
.project-card:hover { border-color: rgba(166, 64, 45, 0.4); }
.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.project-top .project-tag { font-size: 13.5px; letter-spacing: 0.1em; color: var(--red); }
.project-top .project-state { font-size: 13.5px; color: var(--quiet); }
.project-card h3 { margin-top: 12px; font-size: 22px; font-weight: 600; }
.project-card h3 a:hover { color: var(--red); }
.project-card p { margin-top: 5px; font-size: 15px; line-height: 1.75; color: var(--muted); }
.project-progress { margin-top: 18px; }
.project-progress .bar { height: 3px; background: var(--paper-3); }
.project-progress .bar i { display: block; height: 100%; background: var(--red); }
.project-progress span { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--quiet); }
.project-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.project-foot a { color: var(--ink-2); }
.project-foot a:hover { color: var(--red); }
.sample-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 26px; background: var(--line); border: 1px solid var(--line); }
.sample-box { padding: 22px 24px; background: var(--surface); }
.sample-box .sample-label { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; letter-spacing: 0.1em; color: var(--quiet); }
.sample-box .sample-label b { color: var(--red); font-weight: 500; }
.sample-text { margin-top: 14px; font-size: 16px; line-height: 2.1; color: var(--ink-2); }
.sample-text mark { background: rgba(166, 64, 45, 0.12); color: var(--ink); padding: 1px 2px; }
.sample-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ---------- 唯识百科 ---------- */
.baike-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 54px; padding: 44px 0 90px; align-items: start; }
.baike-side { position: sticky; top: 150px; }
.baike-side .side-label { font-size: 14px; font-weight: 600; letter-spacing: 0.13em; color: var(--quiet); }
.baike-side nav { margin-top: 10px; border-left: 1px solid var(--line); }
.baike-side nav a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0 8px 14px; margin-left: -1px; border-left: 1px solid transparent; font-size: 15px; color: var(--muted); }
.baike-side nav a span { font-size: 12.5px; color: var(--quiet); }
.baike-side nav a:hover, .baike-side nav a.is-active { color: var(--red); border-left-color: var(--red); }
.baike-main { min-width: 0; }
.baike-search { display: flex; align-items: center; gap: 13px; height: 52px; padding: 0 18px; border: 1px solid var(--line); background: var(--surface); }
.baike-search svg { width: 19px; height: 19px; color: var(--red); }
.baike-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 14px; }
.baike-search input::placeholder { color: var(--quiet); }
.glossary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.term-card { display: flex; flex-direction: column; min-height: 170px; padding: 20px 21px 17px; border: 1px solid var(--line); background: rgba(252, 250, 245, 0.6); transition: border-color 0.2s ease, transform 0.25s var(--ease); }
.term-card:hover { transform: translateY(-3px); border-color: rgba(166, 64, 45, 0.38); }
.term-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.term-head h3 { font-size: 23px; font-weight: 600; }
.term-head span { font-size: 12.5px; letter-spacing: 0.08em; color: var(--quiet); }
.term-card p { margin-top: 8px; font-size: 15px; line-height: 1.8; color: var(--muted); }
.term-card .term-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line); font-size: 13px; color: var(--quiet); }
.term-card .term-foot a { color: var(--ink-2); }
.term-card .term-foot a:hover { color: var(--red); }

/* ---------- 文章合集 ---------- */
.series-feature { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 34px; margin-top: 24px; padding: 26px; border: 1px solid var(--line); background: var(--paper-2); }
.series-feature-img { overflow: hidden; background: var(--paper-3); }
.series-feature-img img { width: 100%; height: 100%; min-height: 250px; object-fit: cover; }
.series-feature-body { align-self: center; }
.series-feature-body h2 { margin-top: 10px; font-size: 31px; font-weight: 600; line-height: 1.5; }
.series-feature-body p { max-width: 650px; margin-top: 9px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.series-feature-body .series-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 15px; font-size: 14px; color: var(--quiet); }
.series-feature-body .btn { margin-top: 20px; }
.series-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.series-card { display: flex; flex-direction: column; border: 1px solid var(--line); background: rgba(252, 250, 245, 0.56); }
.series-card:hover { border-color: rgba(166, 64, 45, 0.38); }
.series-cover { position: relative; height: 160px; overflow: hidden; background: var(--paper-3); }
.series-cover img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.7) sepia(0.08); }
.series-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(22, 28, 24, 0.6)); }
.series-cover span { position: absolute; left: 14px; bottom: 12px; z-index: 1; color: #f5efe4; font-size: 13.5px; letter-spacing: 0.06em; }
.series-body { display: flex; flex-direction: column; flex: 1; padding: 17px 18px 15px; }
.series-body h3 { font-size: 19px; font-weight: 600; line-height: 1.55; }
.series-body p { margin-top: 5px; font-size: 14.5px; line-height: 1.7; color: var(--muted); }
.series-body .series-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line); font-size: 13px; color: var(--quiet); }
.series-body .series-foot a { color: var(--ink-2); }

/* ---------- 课程详情 ---------- */
.course-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; padding: 42px 0 90px; align-items: start; }
.course-detail-main { min-width: 0; }
.course-detail-side { position: sticky; top: 150px; }
.course-summary { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 30px; padding: 26px; border: 1px solid var(--line); background: var(--paper-2); }
.course-summary img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; }
.course-summary h1 { margin-top: 8px; font-size: 34px; font-weight: 600; line-height: 1.45; }
.course-summary p { margin-top: 9px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.course-summary .course-meta-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.course-summary .course-meta-row span { padding: 4px 8px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.course-progress-block { margin-top: 18px; }
.course-progress-block .bar { height: 4px; background: var(--paper-3); }
.course-progress-block .bar i { display: block; height: 100%; background: var(--red); }
.course-progress-block span { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13.5px; color: var(--quiet); }
.lesson-section { margin-top: 42px; }
.lesson-section h2 { font-size: 28px; font-weight: 600; }
.lesson-list { margin-top: 18px; border-top: 1px solid var(--line-strong); }
.lesson-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 76px; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.lesson-row .lesson-no { font-family: var(--sans); font-size: 15px; color: var(--quiet); }
.lesson-row h4 { font-size: 15.5px; font-weight: 500; }
.lesson-row p { margin-top: 3px; font-size: 14px; color: var(--muted); }
.lesson-row .lesson-state { justify-self: end; font-size: 13px; color: var(--quiet); }
.lesson-row.is-done .lesson-state { color: var(--green-3); }
.lesson-row.is-current { margin: 0 -14px; padding: 16px 14px; background: rgba(166, 64, 45, 0.05); border-bottom-color: rgba(166, 64, 45, 0.2); }
.lesson-row.is-current h4 { color: var(--red); }
.lesson-row.is-current .lesson-state { color: var(--red); }
.course-side-card { padding: 22px; border: 1px solid var(--line); background: rgba(252, 250, 245, 0.6); }
.course-side-card + .course-side-card { margin-top: 14px; }
.course-side-card .side-label { font-size: 13px; letter-spacing: 0.14em; color: var(--quiet); }
.course-side-card h3 { margin-top: 10px; font-size: 19px; font-weight: 600; }
.course-side-card p { margin-top: 6px; font-size: 14px; line-height: 1.75; color: var(--muted); }
.instructor { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.instructor img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.instructor b { display: block; font-size: 14px; }
.instructor span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.course-outcomes { margin-top: 16px; border-top: 1px solid var(--line); }
.course-outcomes li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.7; color: var(--muted); }
.course-outcomes li::before { content: "·"; color: var(--red); font-size: 18px; line-height: 1.2; }
.course-side-card .btn { width: 100%; margin-top: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .history-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 34px; }
  .baike-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 30px; }
  .course-detail-layout { grid-template-columns: 1fr; }
  .course-detail-side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .course-side-card + .course-side-card { margin-top: 0; }
  .puxi-branches { gap: 22px; }
  .series-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .history-layout, .baike-layout { grid-template-columns: 1fr; padding: 34px 0 60px; }
  .history-side, .baike-side { position: static; }
  .history-side nav, .baike-side nav { display: flex; flex-wrap: wrap; gap: 6px; border-left: 0; }
  .history-side nav a, .baike-side nav a { padding: 6px 10px; border: 1px solid var(--line); }
  .history-side .side-note { display: none; }
  .history-side .side-label, .baike-side .side-label { display: none; }
  .era-block { margin-bottom: 38px; }
  .era-head h2 { font-size: 27px; }
  .era-event { grid-template-columns: 86px 1fr; gap: 14px; }
  .puxi-map { padding: 28px 22px 22px; }
  .puxi-branches { display: flex; gap: 22px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
  .puxi-branch { flex: 0 0 250px; scroll-snap-align: start; }
  .puxi-note { grid-template-columns: 1fr; gap: 12px; }
  .project-grid { grid-template-columns: 1fr; }
  .sample-grid { grid-template-columns: 1fr; }
  .glossary-grid { grid-template-columns: 1fr; }
  .series-feature { grid-template-columns: 1fr; padding: 18px; }
  .series-feature-img { max-height: 220px; }
  .series-grid { grid-template-columns: 1fr; }
  .course-summary { grid-template-columns: 1fr; padding: 18px; }
  .course-summary img { max-height: 200px; }
  .course-detail-side { grid-template-columns: 1fr; }
  .cizong-principles { grid-template-columns: 1fr 1fr; }
  .teacher-line { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .history-side nav a, .baike-side nav a { font-size: 14px; }
  .era-event { grid-template-columns: 1fr; gap: 4px; }
  .era-event .year { font-size: 13.5px; }
  .puxi-branch { flex-basis: 235px; }
  .project-card { padding: 18px; }
  .sample-box { padding: 18px; }
  .series-feature-body h2 { font-size: 24px; }
  .course-summary h1 { font-size: 27px; }
  .lesson-row { grid-template-columns: 32px 1fr; }
  .lesson-row .lesson-state { grid-column: 2; justify-self: start; margin-top: -7px; }
  .cizong-principles { grid-template-columns: 1fr; }
}

/* ---------- dark mode ---------- */
[data-theme="dark"] .cizong-principle,
[data-theme="dark"] .teacher-card,
[data-theme="dark"] .history-side .side-note,
[data-theme="dark"] .project-card,
[data-theme="dark"] .term-card,
[data-theme="dark"] .series-card,
[data-theme="dark"] .course-side-card {
  background: rgba(25, 31, 27, 0.72);
  border-color: var(--line);
}
[data-theme="dark"] .cizong-quote { background: #1c221e; }
[data-theme="dark"] .sample-box { background: var(--surface); }
[data-theme="dark"] .sample-text mark { background: rgba(210, 113, 90, 0.22); }
[data-theme="dark"] .series-feature { background: #181f1b; border-color: var(--line); }
[data-theme="dark"] .series-cover img,
[data-theme="dark"] .course-summary img { filter: saturate(0.6) sepia(0.04) brightness(0.8); }
[data-theme="dark"] .course-summary { background: #181f1b; border-color: var(--line); }
[data-theme="dark"] .lesson-row.is-current { background: rgba(210, 113, 90, 0.08); }
[data-theme="dark"] .puxi-map { background: #242e29; }
[data-theme="dark"] .puxi-node img { filter: saturate(0.55) sepia(0.04) brightness(0.8); }


