/* ============================================================
   温州铁路专场 · 视觉样式（轨道交通主题）
   ============================================================ */

body {
  line-height: 1.85;
  color: #3a4051;
  font-size: 1.04rem;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 内容主区域：收敛阅读宽度 + 充足留白，提升清爽度与可读性 */
main.content { max-width: 810px; padding-top: .5rem; }

/* 段落与列表的呼吸感 */
main.content p { margin: 0 0 1.05em; }
main.content li { margin-bottom: .45em; line-height: 1.8; }
main.content ul, main.content ol { margin-bottom: 1.05em; padding-left: 1.4em; }
main.content ul ul, main.content ol ol { margin-bottom: .2em; margin-top: .3em; }
/* 加粗用主色，避免大片黑色发闷 */
main.content strong, main.content b { color: #2a2f3d; font-weight: 700; }

/* 首页隐藏 Quarto 默认标题块（用自定义 hero 代替，借助 :has 仅作用于含 .hero 的首页） */
body:has(.rail-hero) #title-block-header { display: none; }

/* ---------- 首页 Hero ---------- */
.rail-hero {
  position: relative;
  margin: -0.5rem 0 2rem;
  padding: 2.8rem 2.3rem 2.3rem;
  border-radius: 22px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(820px 420px at -8% -25%, rgba(236,72,153,.55), transparent 55%),
    radial-gradient(820px 460px at 118% -10%, rgba(34,211,238,.50), transparent 55%),
    radial-gradient(700px 500px at 60% 130%, rgba(245,158,11,.38), transparent 55%),
    linear-gradient(120deg, #5b1fa8 0%, #4f37e8 36%, #2f7bff 68%, #06b6d4 100%);
  box-shadow: 0 22px 54px rgba(58, 30, 120, .40);
}
/* 柔和光点纹理装饰 */
.rail-hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,.16) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 70%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 70%);
  pointer-events: none;
}
.rail-hero > * { position: relative; z-index: 1; }
.rail-hero .eyebrow {
  display: inline-block;
  font-size: .82rem; font-weight: 600; letter-spacing: .04em;
  padding: .3rem .7rem; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  margin-bottom: 1rem;
}
.rail-hero h1.hero-title {
  font-size: 2.15rem; line-height: 1.25; font-weight: 800;
  margin: 0 0 .6rem; color: #fff; letter-spacing: .01em;
}
.rail-hero .hero-sub { font-size: 1.02rem; opacity: .92; margin: 0 0 1.4rem; }

/* 讲座信息芯片 */
.session-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.session-chips .chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .85rem; border-radius: 12px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  font-size: .92rem; backdrop-filter: blur(2px);
}
.session-chips .chip b { font-weight: 700; }
.session-chips .chip .ic { font-size: 1.05rem; }

/* ---------- 章节卡片网格 ---------- */
.chapter-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem; margin: 1.2rem 0 .5rem;
}
.chapter-card {
  --a1: var(--c-indigo); --a2: var(--c-cyan);
  position: relative; display: block;
  padding: 1.15rem 1.2rem 1.2rem; border-radius: 16px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(140deg, var(--a1), var(--a2)) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 4px 14px rgba(58,30,120,.07);
  text-decoration: none !important; color: var(--rail-ink) !important;
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
/* 卡片右上角柔和彩色光晕 */
.chapter-card::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, var(--a2), transparent 70%);
  opacity: .14; transition: opacity .18s ease, transform .18s ease;
}
.chapter-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 38px color-mix(in srgb, var(--a1) 32%, transparent);
}
.chapter-card:hover::after { opacity: .26; transform: scale(1.25); }
.chapter-card .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 11px; font-weight: 800; font-size: 1rem;
  color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2));
  box-shadow: 0 5px 14px color-mix(in srgb, var(--a1) 45%, transparent);
  margin-bottom: .65rem;
}
.chapter-card h3 { margin: .1rem 0 .35rem; font-size: 1.1rem; color: var(--rail-deep); }
.chapter-card p { margin: 0; font-size: .9rem; color: #5b6573; line-height: 1.62; }

/* ---------- 资料下载卡片 ---------- */
.dl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .85rem; margin: 1rem 0 1.4rem;
}
.dl-card {
  display: flex; flex-direction: column; gap: .25rem;
  padding: .95rem 1.05rem; border-radius: 14px;
  background: linear-gradient(135deg, #faf8ff, #f1f7ff);
  border: 1px solid var(--rail-line);
  text-decoration: none !important; color: var(--rail-ink) !important;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.dl-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(58,30,120,.14);
  border-color: #cdbcff;
}
.dl-card .ic { font-size: 1.5rem; }
.dl-card .t { font-weight: 700; color: var(--rail-deep); font-size: .98rem; line-height: 1.4; }
.dl-card .sz { font-size: .78rem; color: #8a8aa3; letter-spacing: .02em; }

/* 首页"彩蛋"下载条 */
.egg-card {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: 1.4rem 0 .5rem; padding: 1.1rem 1.3rem; border-radius: 16px;
  color: #fff; text-decoration: none !important;
  background: linear-gradient(120deg, #7c3aed, #2f7bff 60%, #06b6d4);
  box-shadow: 0 12px 30px rgba(91,61,245,.28);
  transition: transform .16s ease, box-shadow .16s ease;
}
.egg-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(91,61,245,.36); }
.egg-card .ic { font-size: 2rem; }
.egg-card .tx { flex: 1 1 220px; }
.egg-card .tx b { color: #fff; font-size: 1.08rem; }
.egg-card .tx span { display: block; opacity: .9; font-size: .9rem; margin-top: .15rem; }
.egg-card .go {
  padding: .5rem 1.1rem; border-radius: 999px; font-weight: 700; white-space: nowrap;
  background: rgba(255,255,255,.92); color: #4f1f9c;
}

/* 7 张卡片各自的彩虹配色 */
.chapter-card:nth-child(1) { --a1: var(--c-violet);  --a2: var(--c-indigo); }
.chapter-card:nth-child(2) { --a1: var(--c-indigo);  --a2: var(--c-blue);   }
.chapter-card:nth-child(3) { --a1: var(--c-blue);    --a2: var(--c-cyan);   }
.chapter-card:nth-child(4) { --a1: var(--c-cyan);    --a2: var(--c-emerald);}
.chapter-card:nth-child(5) { --a1: var(--c-emerald); --a2: var(--c-amber);  }
.chapter-card:nth-child(6) { --a1: var(--c-amber);   --a2: var(--c-rose);   }
.chapter-card:nth-child(7) { --a1: var(--c-rose);    --a2: var(--c-violet); }

/* ---------- 作者简介卡片 ---------- */
.author-card {
  position: relative; overflow: hidden;
  display: flex; gap: 1.35rem; align-items: flex-start;
  margin: 1rem 0 .5rem;
  padding: 1.35rem 1.5rem 1.35rem 1.7rem;
  border-radius: 16px;
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(124,58,237,.10), transparent 60%),
    linear-gradient(135deg, #faf8ff, #f2f7ff);
  border: 1px solid var(--rail-line);
  box-shadow: 0 6px 20px rgba(58,30,120,.08);
}
.author-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: linear-gradient(180deg, var(--c-violet), var(--c-blue), var(--c-cyan));
}
.author-portrait {
  flex: 0 0 132px; width: 132px; height: 168px;
  object-fit: cover; border-radius: 12px;
  border: 3px solid #fff;
  box-shadow: 0 8px 22px rgba(58,30,120,.22);
  background: #e9eef5;
}
.author-bio { flex: 1 1 auto; min-width: 0; }
.author-bio > p { margin: 0 0 .6rem; line-height: 1.75; }
.author-bio .author-name { color: var(--rail-deep); font-size: 1.15rem; }
.author-bio .author-name b { font-size: 1.25rem; }
@media (max-width: 560px) {
  .author-card { flex-direction: column; align-items: center; text-align: left; }
  .author-portrait { width: 120px; height: 152px; }
}

/* ---------- 章节顶部 banner 图 ---------- */
main .quarto-figure img,
main p > img {
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(13,43,84,.12);
}

/* ---------- Callout 美化 ---------- */
.callout {
  border-radius: 13px !important; border-width: 1px;
  border-left-width: 5px !important;
  box-shadow: 0 4px 16px rgba(58,30,120,.06);
}
.callout-title-container { font-weight: 700; }
.callout.callout-style-default > .callout-header {
  border-top-left-radius: 13px; border-top-right-radius: 13px;
  padding-top: .5rem; padding-bottom: .5rem;
}
/* 更鲜明的 callout 配色 */
.callout-tip   { border-left-color: var(--c-emerald) !important; }
.callout-tip   > .callout-header { background: rgba(16,185,129,.12) !important; }
.callout-note  { border-left-color: var(--c-blue) !important; }
.callout-note  > .callout-header { background: rgba(47,123,255,.12) !important; }
.callout-important { border-left-color: var(--c-rose) !important; }
.callout-important > .callout-header { background: rgba(251,92,141,.12) !important; }
.callout-warning { border-left-color: var(--c-amber) !important; }
.callout-warning > .callout-header { background: rgba(245,158,11,.14) !important; }
.callout-caution { border-left-color: var(--c-violet) !important; }
.callout-caution > .callout-header { background: rgba(124,58,237,.12) !important; }

/* ---------- 代码块 ---------- */
div.sourceCode {
  border-radius: 12px; border: 1px solid var(--rail-line);
  box-shadow: 0 3px 12px rgba(58,30,120,.06);
}
pre code { font-size: .92em; }

/* 行内代码 */
code:not(.sourceCode) {
  color: var(--c-violet); background: rgba(124,58,237,.10);
  padding: .12em .4em; border-radius: 6px; font-weight: 600;
}

/* ---------- 引用块 ---------- */
blockquote {
  border-left: 5px solid transparent;
  border-image: linear-gradient(180deg, var(--c-indigo), var(--c-cyan)) 1;
  background: linear-gradient(135deg, rgba(124,58,237,.06), rgba(6,182,212,.06));
  padding: .8rem 1.1rem; border-radius: 0 10px 10px 0;
  color: #3a4150;
}

/* ---------- 表格 ---------- */
table { font-size: .95em; }
.table { border-radius: 12px; overflow: hidden; box-shadow: 0 3px 14px rgba(58,30,120,.07); }
.table > thead {
  background: linear-gradient(135deg, var(--c-indigo), var(--c-blue));
}
.table > thead th { color: #fff !important; border: none; }
.table > tbody tr:nth-child(even) { background: var(--rail-soft); }

/* ---------- 页脚 ---------- */
.nav-footer {
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--c-violet), var(--c-blue), var(--c-cyan), var(--c-amber), var(--c-rose)) 1;
  font-size: .86rem; color: #6b7280;
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .rail-hero { padding: 1.8rem 1.3rem; }
  .rail-hero h1.hero-title { font-size: 1.6rem; }
}
