/* ==========================================================================
   LTHY · Page compositions: hero, index, post, about, 404
   ========================================================================== */

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  position: relative;
  /* 底部不留内边距。实测统计与立绘的实际底边会溢出到网格之外(网格底 751、
     统计底 776)，这段内边距就被它们吃掉了大半，剩下的部分在下面露出一条空带，
     人物看着像被裁掉一截。下一段的 .section 自带 clamp(3.5rem, 9vw, 7rem) 上边距，
     所以去掉之后段与段之间不会挤在一起。 */
  padding-block: clamp(3rem, 10vw, 7rem) clamp(2.5rem, 5vw, 3.5rem);
}

.hero__grid {
  display: grid;
  /* 右列尽量宽：完整立绘是横向的(约 1.1:1)，contain 的高度被栏宽卡住，栏越宽她越大。
     但左列也得留住宽度，否则毛体大标题会挤成 3-4 行 —— 所以标题字号下面另外收了一档。 */
  grid-template-columns: minmax(0, .7fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__title {
  /* 右列让出宽度给立绘之后，这里必须收一档，否则「技术笔记与读书摘录。」会断成 3-4 行 */
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 720;
  margin-block: 1rem .9rem;
}
.hero__title span { display: block; }

.hero__lead {
  font-size: var(--fs-lead);
  color: var(--ink-dim);
  max-width: 46ch;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.2rem, 4vw, 2.8rem);
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}
.stat__num {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  display: block;
  margin-top: .15rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* --- Portrait --------------------------------------------------------- */
/* 立绘要跟左边那一列一样高，而且必须完整显示。
   踩过的坑：
     · .portrait__disc 用 height:100% -> 父级高度由内容撑出，循环依赖，图片按原始
       1082px 渲染，人物顶出屏幕；
     · 改成绝对定位后，里面的 <img> 加 height:100% 依然被忽略（base.css 有全局
       img{height:auto}，且这套布局里百分比高度实测不解析），图片盒子仍是 725x1066。
   结论：不用 <img> 了，改用 background-size:contain —— 永远完整显示、不裁切、
   不依赖百分比高度。替代文本用 role="img" aria-label 保留。 */
.portrait { position: relative; align-self: stretch; min-height: 0; }

.portrait__disc {
  position: absolute;
  inset: 0;
  /* 只有立绘本身，没有任何底色/光晕。
     之前这里还挂了一层红色径向渐变 —— 圆盘是圆的时候它像光晕，改成矩形之后
     就在人物背后糊出一团红晕，看着很脏。 */
  background: url("../img/portrait.webp") center / contain no-repeat;
}
.portrait__badge {
  position: absolute;
  /* 立绘铺满之后这个胶囊会压在人物身上，所以要抬层级 + 加实底才读得清 */
  z-index: 2;
  bottom: 3%;
  right: 0;
  padding: .45rem .85rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border-hi);
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  /* 立绘塌成 0 宽时，绝对定位的角标可用宽度也为 0，会收缩到「最宽的一个字」，
     文字一列竖下来。禁止换行，保证它永远是一行胶囊。 */
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  box-shadow: var(--shadow-card);
}
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-gold);
}

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  /* 窄屏是上下堆叠，这时立绘回到正方形，别去跟列高较劲 */
  /* 必须给 width：立绘内容是绝对定位的，没有在流里的内容撑宽，
     只写 max-width 会收缩到 0，aspect-ratio 再把它算成 0 高 —— 立绘整个消失。 */
  .portrait { width: 100%; max-width: 300px; margin-inline: auto; order: -1; align-self: auto; aspect-ratio: 1; }
}

/* ==========================================================================
   Section headings & toolbar
   ========================================================================== */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.6rem, 4vw, 2.4rem);
}
.section-head h2 { font-size: var(--fs-h2); }
.section-head p { color: var(--ink-faint); font-size: var(--fs-sm); margin-top: .4rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.6rem;
  padding: .75rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.search-field {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1 1 220px;
  padding: .5rem .85rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search-field:focus-within {
  border-color: color-mix(in oklab, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 14%, transparent);
}
.search-field svg { width: 16px; height: 16px; stroke: var(--ink-faint); fill: none; stroke-width: 1.9; stroke-linecap: round; flex: none; }
.search-field input { flex: 1; border: 0; outline: none; background: transparent; font-size: var(--fs-sm); min-width: 0; }
.search-field input::placeholder { color: var(--ink-faint); }

.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; }

.result-count { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-faint); }

.empty-note {
  grid-column: 1 / -1;
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--ink-faint);
  border: 1px dashed var(--border-hi);
  border-radius: var(--r-lg);
}

/* ==========================================================================
   About page
   ========================================================================== */

.about-hero { padding-block: clamp(2.5rem, 7vw, 4.5rem) 1rem; }
/* 注意：.portrait 里面是绝对定位的背景，所以它必须由「有确定宽度」的网格列撑开。
   这里原来是 minmax(0,1fr) auto —— auto 列没有内容撑，宽度塌成 0，关于页的立绘
   就整个看不见了。首页那列是 fr（有确定宽度）所以一直正常。 */
.about-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .78fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (max-width: 780px) { .about-hero__grid { grid-template-columns: 1fr; }
  .about-hero__grid .portrait { width: 100%; max-width: 300px; margin-inline: auto; aspect-ratio: 1; } }

/* --- Social links ----------------------------------------------------- */
.social { display: flex; flex-wrap: wrap; gap: .6rem; }
.social a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .95rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--ink-dim);
  transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.social a:hover {
  color: var(--ink);
  border-color: color-mix(in oklab, var(--accent) 55%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 0 28px -10px var(--accent);
}
.social svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   Post page
   ========================================================================== */

.post-head { padding-block: clamp(2rem, 6vw, 3.6rem) 1.4rem; }
.post-head__cover {
  height: clamp(120px, 22vw, 220px);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--cover);
  filter: saturate(135%);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.8rem;
}
.post-head__cover.cover--image { height: clamp(200px, 30vw, 400px); background: none; }

.post-head__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, color-mix(in oklab, var(--bg) 88%, transparent), transparent 70%);
}

.post-head h1 { font-size: var(--fs-h1); margin-block: .7rem .9rem; }
.post-head__meta { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; color: var(--ink-faint); font-size: var(--fs-sm); }

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
@media (max-width: 1020px) { .post-layout { grid-template-columns: minmax(0, 1fr); } }

.prose {
  max-width: 70ch;
  /* min-width:0 + anywhere：正文里的长路径、长 URL 不能把栅格列撑宽。
     anywhere 会参与 min-content 计算，break-word 不会 —— 这里是关键区别。 */
  min-width: 0;
  overflow-wrap: anywhere;
}

.prose > * + * { margin-top: 1.25rem; }

.prose h2 {
  font-size: var(--fs-h2);
  margin-top: 2.8rem;
  padding-top: .4rem;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.prose h2::before {
  content: "";
  display: block;
  width: 42px; height: 3px;
  border-radius: 3px;
  background: var(--grad-brand);
  margin-bottom: .9rem;
}
.prose h3 { font-size: var(--fs-h3); margin-top: 2rem; scroll-margin-top: calc(var(--nav-h) + 1.5rem); }
/* 子标题：比 h3 再小一点，左侧一条短线，跟 h2 的品牌色横条区分开 */
.prose h4 {
  font-size: 1.02rem;
  margin-top: 1.7rem;
  color: var(--ink);
  padding-left: .8rem;
  border-left: 2px solid color-mix(in oklab, var(--accent) 55%, transparent);
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.prose p { color: var(--ink-dim); }
.prose strong { color: var(--ink); font-weight: 640; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 38%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }

.prose ul, .prose ol { padding-left: 1.35rem; color: var(--ink-dim); }
.prose li + li { margin-top: .5rem; }
.prose li::marker { color: var(--accent); }

.prose code:not(pre code) {
  font-family: var(--font-mono);
  font-size: .875em;
  padding: .16em .45em;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  color: color-mix(in oklab, var(--accent) 72%, var(--ink));
  /* 原来是 white-space: nowrap —— 长路径/长 URL 因此完全不能断行，把整列撑宽。
     overflow-wrap 对 nowrap 无效，所以必须去掉 nowrap。 */
  white-space: normal;
  overflow-wrap: anywhere;
}

.prose blockquote {
  margin-block: 1.8rem;
  padding: 1.1rem 1.3rem 1.1rem 1.5rem;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  border-left: 3px solid transparent;
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 12%, transparent), transparent 70%),
    var(--surface);
  position: relative;
}
.prose blockquote::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--grad-brand);
}
.prose blockquote p { color: var(--ink); font-style: italic; }
.prose blockquote p + p { margin-top: .6rem; }

.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); overflow: hidden; border-radius: var(--r-sm); }
.prose th, .prose td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border); }
.prose thead th { background: var(--surface-hi); font-weight: 620; }
.prose img { border-radius: var(--r-md); border: 1px solid var(--border); }

.prose hr { margin-block: 2.4rem; }

.post-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
}

.post-nav { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.post-nav a {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform var(--dur), border-color var(--dur), box-shadow var(--dur);
}
.post-nav a:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--accent) 45%, transparent); box-shadow: 0 0 34px -14px var(--accent); }
.post-nav span:first-child { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-faint); letter-spacing: .08em; }
.post-nav span:last-child { font-weight: 600; font-size: .95rem; }

/* --- Table of contents ------------------------------------------------ */
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  padding: 1.1rem 1.2rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  max-height: calc(100svh - var(--nav-h) - 3rem);
  overflow-y: auto;
}
.toc__title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .8rem;
}
.toc__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.toc__list a {
  display: block;
  padding: .35rem .6rem;
  border-radius: var(--r-xs);
  font-size: var(--fs-sm);
  color: var(--ink-faint);
  border-left: 2px solid transparent;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.toc__list a:hover { color: var(--ink); background: var(--surface-hi); }
.toc__list a.is-active { color: var(--accent); border-left-color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, transparent); }
.toc__list .toc__sub a { padding-left: 1.3rem; font-size: var(--fs-xs); }
.toc__list .toc__sub2 a { padding-left: 2.5rem; font-size: var(--fs-xs); opacity: .9; }

@media (max-width: 1020px) { .toc { display: none; } }

/* ==========================================================================
   404
   ========================================================================== */

.error-page {
  min-height: 70svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(3rem, 10vw, 6rem);
}
.error-code {
  font-size: clamp(5rem, 22vw, 12rem);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1;
}
.error-page p { color: var(--ink-dim); max-width: 44ch; margin: 1rem auto 2rem; }
.error-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

/* ==========================================================================
   立场 · the stance block
   ========================================================================== */

.stance {
  position: relative;
  overflow: hidden;
  padding: clamp(1.7rem, 4vw, 2.9rem);
  border-radius: var(--r-xl);
  border: 1px solid color-mix(in oklab, var(--c-gold) 32%, transparent);
  background:
    radial-gradient(ellipse 68% 122% at 6% 0%, color-mix(in oklab, var(--c-red) 44%, transparent), transparent 62%),
    radial-gradient(ellipse 62% 112% at 104% 106%, color-mix(in oklab, var(--c-gold) 20%, transparent), transparent 60%),
    color-mix(in oklab, var(--surface-solid) 84%, transparent);
  box-shadow: var(--shadow-pop);
}

.stance__watermark {
  position: absolute;
  top: -3.4rem;
  right: -2.6rem;
  width: clamp(180px, 24vw, 300px);
  color: var(--c-gold);
  opacity: .1;
  pointer-events: none;
  rotate: 14deg;
}
.stance__watermark svg { width: 100%; height: auto; fill: currentColor; }

.stance .eyebrow { color: var(--c-gold); }

.stance h2 { margin-block: .8rem .9rem; }

.stance__lead {
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  line-height: 1.6;
  font-weight: 640;
  letter-spacing: -.015em;
  color: var(--ink);
  max-width: 44ch;
}

.stance__body { margin-top: 1.3rem; max-width: 68ch; }
.stance__body p { color: color-mix(in oklab, var(--ink) 84%, transparent); }
.stance__body p + p { margin-top: .95rem; }

.stance__slogan { margin-top: 1.9rem; }


.stance--compact { padding-block: clamp(1.5rem, 3.5vw, 2.2rem); }
.stance--compact h2 { font-size: var(--fs-h2); }

.stance__pull {
  position: relative;
  margin-top: 1.5rem;
  padding-left: 1.2rem;
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  font-weight: 640;
  letter-spacing: -.01em;
  color: color-mix(in oklab, var(--c-gold) 72%, var(--ink));
}

.stance__pull::before {
  content: "";
  position: absolute;
  left: 0;
  top: .12em;
  bottom: .12em;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--c-star), var(--c-gold));
}

.stance__summary {
  margin-top: 1.3rem;
  max-width: 72ch;
  color: color-mix(in oklab, var(--ink) 84%, transparent);
}

.stance__outline {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1.6rem;
}

.stance__outline a.chip {
  font-family: var(--font-ui);
  text-decoration: none;
  transition: transform var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.stance__outline a.chip:hover {
  transform: translateY(-2px);
  background: color-mix(in oklab, var(--tone) 24%, transparent);
  border-color: color-mix(in oklab, var(--tone) 60%, transparent);
}

/* ==========================================================================
   独立页面（content/pages）与书法体装饰
   ========================================================================== */

.page-rule {
  width: 68px;
  height: 4px;
  border-radius: 4px;
  background: var(--grad-brand);
  margin-bottom: 1.5rem;
}

.post-head--page h1 {
  font-size: clamp(2.3rem, 1.2rem + 4.6vw, 3.9rem);
  margin-block: .8rem 1rem;
}

.post-head--page .post-head__meta { margin-top: 1rem; }

/* 书法体只用在短而大的标题上 —— 子集是按字挑的，正文字形不在里面，长句子会退化成混排。 */
.post-head--page h1,
.prose--brush h2,
.stance__title,
.stance__pull,
.slogan--brush,
.hero__lead,
.hero__title {
  font-family: var(--font-brush);
  font-weight: 400;
  letter-spacing: .04em;
}

.prose--brush h2 { font-size: clamp(1.7rem, 1.2rem + 1.9vw, 2.35rem); }

.slogan--brush {
  font-size: 1.02rem;
  letter-spacing: .13em;
  padding-inline: 1rem;
}

.slogan--brush span { line-height: 1.5; }

/* ==========================================================================
   压在照片上的正文
   --------------------------------------------------------------------------
   背景是一张到处都有中间调的老照片，正文光靠压暗蒙版还是不够，得补一点投影。

   注意：标题是渐变文字（background-clip: text + color: transparent），对它用
   text-shadow 会在字形内部透出一团黑影 —— 所以标题只能用 drop-shadow。
   ========================================================================== */

.hero__title { filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .62)); }

.eyebrow,
.hero__lead,
.stat__num,
.stat__label,
.section-head h2,
.section-head p {
  text-shadow: 0 1px 4px rgba(0, 0, 0, .62);
}

[data-theme="light"] .hero__title { filter: drop-shadow(0 2px 10px rgba(255, 255, 255, .75)); }

[data-theme="light"] .eyebrow,
[data-theme="light"] .hero__lead,
[data-theme="light"] .stat__num,
[data-theme="light"] .stat__label,
[data-theme="light"] .section-head h2,
[data-theme="light"] .section-head p {
  text-shadow: 0 1px 4px rgba(255, 255, 255, .88);
}

/* --- 文库 ------------------------------------------------------------- */
/* .section-head 是「标题在左、导语在右」的横排（给「最新文章」那种区块用的），
   文库这边要的是纵向堆叠，所以用它自己的头部。 */
.doclist__head { max-width: 62ch; margin-bottom: 2rem; }
.doclist__title { font-size: var(--fs-h2); margin-block: .6rem 0; }
.doclist { display: grid; gap: .85rem; }
.doc {
  padding: 1.05rem 1.25rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.doc__head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.doc__title { font-size: 1.06rem; line-height: 1.4; }
.doc__meta {
  margin-top: .4rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-faint);
}
.doc__note { margin-top: .65rem; color: var(--ink-dim); font-size: var(--fs-sm); line-height: 1.8; }
/* 反面参考用红边框标出来，免得一扫而过把它当成同阵营的东西 */
.doc--counter { border-color: color-mix(in oklab, var(--c-red) 42%, var(--border)); }
.doc__get {
  display: inline-block;
  margin-top: .9rem;
  font-size: var(--fs-xs);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
  padding-bottom: 1px;
}
.doc__get:hover { border-bottom-color: var(--accent); }

/* --- PDF 在线预览弹层 -------------------------------------------------- */
.preview { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: clamp(0px, 2vw, 1.5rem); }
.preview[hidden] { display: none; }
/* 遮罩**不要**加 backdrop-filter。
   曾经加过全屏的 blur(3px)，结果：整页背景被糊住、材质发暗、合成器直接卡死，
   连主题都切不动，只能刷新。原因是这一层全屏 backdrop 压在页面上几十个玻璃面
   之上，下面还有 PDF 插件 iframe —— 这是 Chromium 合成器的经典死法。
   暗色遮罩本身足够，不需要再糊一次。 */
.preview__scrim { position: absolute; inset: 0; background: color-mix(in oklab, #000 62%, transparent); }
.preview__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1100px, 100%);
  height: min(92vh, 100%);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.preview__head { display: flex; align-items: center; gap: 1rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border); }
.preview__title { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview__acts { display: flex; gap: .5rem; flex: none; }
.preview__body { flex: 1; min-height: 0; background: var(--bg); }
.preview__body iframe { display: block; width: 100%; height: 100%; border: 0; }
.doc__actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .95rem; }


/* 立绘截断线下面那块：一条播放条，撑满整幅宽度。
   整条只有一个播放键（不是一排按钮）；进度条可点、也可用左右方向键。
   min-height 是按实测定的：1478px 宽时 166px，让它自己把这块空档吃掉，
   下面的「最新文章」保持原位（原来是靠缩减段间距把它提上去，方向错了）。 */
.player {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-areas: "art toggle meta track";
  align-items: center;
  gap: clamp(.8rem, 2vw, 1.4rem);
  margin-top: clamp(1rem, 2vw, 1.5rem);
  padding: clamp(1rem, 2vw, 1.55rem) clamp(1.1rem, 2.4vw, 1.9rem);
  /* 高度写死（含内边距，box-sizing: border-box）—— 实测要让下面「最新文章」
     回到改动前的位置（1478px 宽时它在 1033），播放条底边要落在 967，
     而播放条顶边在 778，所以整条高 189px。用 min-height 算不准。 */
  box-sizing: border-box;
  height: clamp(118px, 11.6vw, 171px);
  /* 底色与边框交给 .lg 的玻璃材质（玻璃底色要薄，见 components.css 的说明），
     这里再写一层不透明的 var(--surface) 会把折射盖掉。 */
  position: relative;
  border-radius: var(--r-lg);
}

.player__art {
  grid-area: art;
  display: grid;
  place-items: center;
  width: clamp(54px, 5.6vw, 84px);
  aspect-ratio: 1;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 25%, color-mix(in oklab, var(--c-red) 32%, transparent), transparent 70%),
    var(--surface-hi);
  color: color-mix(in oklab, var(--c-gold) 78%, var(--ink));
}
.player__art svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.player__toggle {
  grid-area: toggle;
  display: grid;
  place-items: center;
  width: clamp(46px, 4.6vw, 60px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast);
}
.player__toggle:hover { transform: translateY(-2px); box-shadow: 0 0 30px -8px var(--accent); }
.player__toggle svg { width: 44%; height: 44%; fill: currentColor; }
.player__icon--pause { display: none; }
.player[data-playing="true"] .player__icon--play { display: none; }
.player[data-playing="true"] .player__icon--pause { display: block; }

.player__meta { grid-area: meta; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.player__title { font-size: clamp(1.05rem, 1.5vw, 1.35rem); font-weight: 640; letter-spacing: -.012em; color: var(--ink); }
.player__sub { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-faint); }

.player__track { grid-area: track; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.player__bar {
  position: relative;
  height: 6px;
  border-radius: var(--r-full);
  background: color-mix(in oklab, var(--ink) 15%, transparent);
  cursor: pointer;
}
.player__fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: var(--r-full); background: var(--grad-brand); }
.player__bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.player__time {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* 音频文件缺失时整条标记为不可用：置灰、时长显示 --:--，不放一个点不动的假按钮 */
.player[data-unavailable="true"] .player__toggle { opacity: .4; cursor: default; }
.player[data-unavailable="true"] .player__bar { cursor: default; }

@media (max-width: 760px) {
  .player {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "art toggle meta"
      "track track track";
    row-gap: 1rem;
  }
}

/* hero 下面紧挨着就是「最新文章」。全站段间距 clamp(3.5rem,9vw,7rem) 会叠在 hero
   自己的下边距上，两层加起来（1478px 宽时约 194px）就是那条空档。
   播放条自己长高了、把这块吃掉，所以这里不该再叠一层。 */
.hero + .section { padding-top: 0; }

/* 播放条里的当前歌词句（在卡片内部）。min-height 占住一行，
   免得换行时把上面的歌名顶得上下跳。 */
.player__line {
  font-size: var(--fs-sm);
  min-height: 1.45em;
  color: color-mix(in oklab, var(--c-gold) 58%, var(--ink));
  transition: color var(--dur-fast) var(--ease-out);
}
.player__lrc { display: none; }
