/* 边框/分隔线统一改成青色（浅色 #color-border / 深色 #color-border-dark）。
   原浅色为紫 #663399、深色为刺眼亮蓝 #0066ff */
:root {
  --color-border: #56b6c2;
  --color-border-dark: #56b6c2;
  --color-text-dark: #e2e2e5;   /* 深色正文：原为纯白，在深灰底上对比过强、刺眼 */
}

/* 全站只用系统字体，不加载任何网络字体（加载最快，也没有字体替换时的跳动）。
   英文：苹果系统字体 / Segoe UI（Windows）/ 系统默认无衬线；中文交给系统黑体
   （雅黑 / 苹方 / 思源黑体）。也不再用等宽字体（汉字 + 全角标点本身就近乎等宽）；
   Archie 原本 html 用 Roboto Mono、p 用 Fira Sans，这里两处都覆盖。
   例外：code/pre 由浏览器默认样式指定等宽字体，代码需要对齐，保持不变。 */
html,
p {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* 页脚社交图标（内联 SVG，见 layouts/partials/footer.html）：与原图标字体同尺寸 */
.soc-icon {
  width: 1rem;
  height: 1rem;
  vertical-align: middle;
}

/* 原图标字体按一行文字撑高（1.6 倍行高 = 24px），图标间的竖分隔线随之拉伸；
   改成 SVG 后保持同样的行高，分隔线长度不变 */
footer .soc {
  min-height: calc(1rem * 1.6);
}

/* 正文字体放大：Archie 默认 15px 为英文设计，中文偏小 */
.post-content .body {
  font-size: 1.15rem;   /* ≈ 17px */
  line-height: 1.9;
}

/* 段落：Archie 给 p 单独写死了 1.5 倍行距，导致上面的 1.9 对段落不生效，
   这里让 p 继承所在容器的行距（脚注、引文等各自的行距也随之生效）。
   中文段落不缩进，段距加大到约一个字高，便于分段。 */
.post-content .body p {
  line-height: inherit;
  margin-block: 1em;
}

/* 修复松散列表：列表项之间有空行时，Hugo 会把内容包进 <p> 块级元素，
   而 Archie 的项目符号是 li::before 伪造的行内星号，块级 <p> 会另起一行，
   导致星号单独占一行、文字掉到下一行。让首段回到行内即可对齐。 */
.post-content .body li > p:first-child {
  display: inline;
}

/* 默认引文：悬挂开引号。只靠青色引号和缩进区分声部（字体与正文相同），
   保持 Archie 的轻量感；同时显式清掉主题自带的左边框。 */
.post-content .body blockquote {
  position: relative;
  margin: 1.7em 0.2em 1.7em 2.1em;
  padding: 0;
  border: 0;
  border-inline-start: 0;
  color: inherit;
  font-style: normal;
}

.post-content .body blockquote::before {
  content: "“";
  position: absolute;
  top: -0.32em;
  left: -0.82em;
  color: #56b6c2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.65em;
  line-height: 1;
}

.post-content .body blockquote > :first-child {
  margin-top: 0;
}

.post-content .body blockquote > :last-child {
  margin-bottom: 0;
}

/* 长篇摘录：通过 {{< excerpt >}} 手动调用。
   上下细线和极淡中性底色模拟夹入正文的书页，亮暗模式均成立。 */
.post-content .body .excerpt {
  margin: 1.8em 0;
}

.post-content .body .excerpt__body {
  margin: 0;
  padding: 1.2em 1.45em 1.15em 2em;
  border: 0;
  border-top: 1px solid rgba(128, 128, 128, 0.28);
  border-bottom: 1px solid rgba(128, 128, 128, 0.28);
  background: rgba(128, 128, 128, 0.06);
  color: var(--color-text-meta, #999);
}

.post-content .body .excerpt__body::before {
  top: -0.16em;
  left: 0.2em;
  font-size: 2.15em;
}

.post-content .body .excerpt__source {
  margin-top: 0.55em;
  padding-inline: 0.35em;
  color: var(--color-text-meta, #999);
  font-size: 0.82em;
  line-height: 1.6;
  text-align: end;
}

/* --- 脚注：页下注 ---
   行内编号保持轻巧；文末注释以青色细线、两位数悬挂编号和较小字号
   构成独立声部。全部使用主题无关颜色，兼容 Archie 的手动暗色切换。 */
.post-content .body sup[id^="fnref:"] {
  line-height: 0;
}

.post-content .body a.footnote-ref {
  margin-inline: 0.08em;
  padding: 0;
  border-bottom: 1px solid transparent;   /* 预留下划线位置，悬停只换颜色，避免撑高行 */
  color: #56b6c2;
  font-size: 0.78em;
  font-weight: 500;
  text-decoration: none;
}

.post-content .body a.footnote-ref:hover,
.post-content .body a.footnote-ref:focus {
  background: transparent;
  color: #56b6c2;
  border-bottom: 1px solid currentColor;
}

.post-content .body .footnotes {
  position: relative;
  margin-top: 2.6em;
  padding-top: 0.85em;
  border-top: 1px solid #56b6c2;
  color: inherit;
  font-size: 0.82em;
  line-height: 1.75;
}

.post-content .body .footnotes::before {
  content: "注释";
  display: block;
  margin-bottom: 0.95em;
  color: #56b6c2;
  font-size: 0.78em;
  letter-spacing: 0.16em;
}

.post-content .body .footnotes hr {
  display: none;
}

.post-content .body .footnotes ol {
  margin: 0;
  padding: 0;
  counter-reset: footnote-item;
  list-style: none;
}

.post-content .body .footnotes li {
  position: relative;
  margin: 0 0 0.8em;
  padding-inline-start: 2.8em;
  counter-increment: footnote-item;
}

.post-content .body .footnotes li::before {
  content: counter(footnote-item, decimal-leading-zero);
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  color: #56b6c2;
  font-variant-numeric: tabular-nums;
}

.post-content .body .footnotes li p {
  margin: 0;
}

.post-content .body .footnotes li p + p {
  margin-top: 0.5em;
}

.post-content .body .footnote-backref {
  display: inline-block;
  margin-inline-start: 0.25em;
  padding: 0;
  border-bottom: 1px solid transparent;   /* 同上：inline-block 悬停加边框会改变行高 */
  color: #56b6c2;
  text-decoration: none;
}

.post-content .body .footnote-backref:hover,
.post-content .body .footnote-backref:focus {
  background: transparent;
  color: #56b6c2;
  border-bottom: 1px solid currentColor;
}

/* --- 目录：环线站点 ---
   一条青色竖线串起各标题：一级标题是空心圆（站），二级及以下是小实心点，
   悬停时空心圆填满。桌面侧栏与手机折叠目录共用这一套。
   竖线由每个 <a> 自己的 ::before 拼接而成（ul/li 不留外边距，<a> 用内边距
   撑开，相邻 <a> 首尾相接），因此标题换行也不会断线；首站线从圆心起、
   末站线到圆心止。空心圆处的竖线用渐变留空，而不是靠底色遮挡，
   因此亮/暗模式都成立（Archie 没有可供钩住的暗色 class）。
   几何量用变量表达（em 相对 <a> 的字号）：
     --toc-x   竖线中心横坐标（固定 px，保证各级对齐）
     --toc-pad 条目上下内边距；圆心 y = --toc-pad + 半行高 0.75em
     --toc-r   空心圆半径 */
.toc nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc nav li {
  margin: 0;
  text-indent: 0;
}

.toc nav li::before {
  content: none;
}

.toc nav a {
  --toc-x: 6px;
  --toc-pad: 0.3em;
  --toc-r: 0.375em;
  --toc-cy: calc(var(--toc-pad) + 0.75em);
  position: relative;
  display: block;
  padding: var(--toc-pad) 0 var(--toc-pad) 1.6em;
  border: 0;
  color: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.2s ease;
}

.toc nav ul ul a {
  padding-inline-start: 2.4em;
  font-size: 0.85rem;
}

.toc nav ul ul ul a {
  padding-inline-start: 3.2em;
}

.toc nav a:hover,
.toc nav a:focus {
  background: none;
  color: #56b6c2;
  outline: none;
}

.toc nav a:focus-visible {
  outline: 2px solid #56b6c2;
  outline-offset: 2px;
}

/* 竖线：一级标题在空心圆处留空 */
.toc nav a::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--toc-x) - 1px);
  width: 2px;
  background: linear-gradient(to bottom,
    #56b6c2 0 calc(var(--toc-cy) - var(--toc-r)),
    transparent calc(var(--toc-cy) - var(--toc-r)) calc(var(--toc-cy) + var(--toc-r)),
    #56b6c2 calc(var(--toc-cy) + var(--toc-r)) 100%);
}

/* 二级及以下是实心点，竖线直接穿过即可 */
.toc nav ul ul a::before {
  background: #56b6c2;
}

/* 站点：一级空心圆 */
.toc nav a::after {
  content: "";
  position: absolute;
  top: var(--toc-cy);
  left: var(--toc-x);
  box-sizing: border-box;
  width: calc(var(--toc-r) * 2);
  height: calc(var(--toc-r) * 2);
  border: 2px solid #56b6c2;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: background-color 0.2s ease;
}

.toc nav a:hover::after {
  background: #56b6c2;
}

/* 二级及以下：小实心点 */
.toc nav ul ul a::after {
  width: 0.4em;
  height: 0.4em;
  border: 0;
  background: #56b6c2;
}

/* 首站：线从圆心以下开始 */
.toc nav > ul > li:first-child > a::before {
  background: linear-gradient(to bottom,
    transparent 0 calc(var(--toc-cy) + var(--toc-r)),
    #56b6c2 calc(var(--toc-cy) + var(--toc-r)) 100%);
}

/* 末站：线到圆心为止（覆盖到三级标题） */
.toc nav > ul > li:last-child > a:last-child::before {
  background: linear-gradient(to bottom,
    #56b6c2 0 calc(var(--toc-cy) - var(--toc-r)),
    transparent calc(var(--toc-cy) - var(--toc-r)) 100%);
}

.toc nav > ul > li:last-child > ul > li:last-child > a:last-child::before,
.toc nav > ul > li:last-child > ul > li:last-child > ul > li:last-child > a:last-child::before {
  bottom: auto;
  height: var(--toc-cy);
}

/* 只有一个一级标题且无子项时，不画线 */
.toc nav > ul > li:only-child > a:only-child::before {
  content: none;
}

/* 桌面侧栏：去掉 Archie 的灰底卡片与边框 */
.toc.toc-desktop {
  max-inline-size: 16rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.toc-desktop .toc-title {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: normal;
  letter-spacing: 0.2em;
  opacity: 0.6;
}

/* 移动端目录：标题之后的原生折叠区，默认收起；桌面端仍使用 Archie
   的右侧粘性目录。透明底与细线减少首屏占用，不再呈现为大卡片。 */
.toc-mobile {
  display: none;
}

@media screen and (max-width: 59.99em) {
  .toc-desktop {
    display: none;
  }

  .post-content .toc-mobile {
    display: block;
    max-width: none;
    max-inline-size: none;
    margin: 1.35rem 0 1.7rem;
    padding: 0.65rem 0;
    border: 0;
    border-top: 1px solid #56b6c2;
    border-bottom: 1px solid rgba(128, 128, 128, 0.28);
    border-radius: 0;
    background: transparent;
    color: inherit;
    overflow: visible;
  }

  .toc-mobile summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    color: inherit;
    font-weight: 600;
    list-style: none;
  }

  .toc-mobile summary::-webkit-details-marker {
    display: none;
  }

  .toc-mobile summary::after {
    content: "+";
    color: #56b6c2;
    font-weight: 400;
  }

  .toc-mobile[open] summary::after {
    content: "−";
  }

  .toc-mobile nav {
    margin-top: 0.65rem;
    padding-top: 0.6rem;
    border-top: 1px dotted rgba(128, 128, 128, 0.35);
  }

  /* 手机上目录占满正文宽度，字号与正文一致，条目略加高，便于手指点按 */
  .toc-mobile nav a {
    --toc-pad: 0.4em;
    font-size: 1rem;
  }
}

/* --- 音乐卡片（music-card 短代码）---
   意象：专辑封面是「唱片套」，一张黑胶从右侧探出一角，悬停时滑出并缓缓旋转，
   胶芯标签用站点青色。配色全部用主题无关的中性值（黑胶本身就是黑的），
   亮/暗模式都成立：Archie 暗色靠切换整张 dark.css，没有可供钩住的 class/属性 */
.music-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin: 20px auto;
  border-radius: 12px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  background: rgba(128, 128, 128, 0.06);
  max-width: 480px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.music-card:hover {
  border-color: rgba(86, 182, 194, 0.55);
}

/* 唱片区：为黑胶探出的部分预留 26px 宽度 */
.music-card-disc {
  position: relative;
  width: 106px;   /* 80(封面) + 26(黑胶探出) */
  height: 80px;
  flex-shrink: 0;
}

/* 封面 = 唱片套，压在黑胶上层 */
.music-card-cover,
.music-card-cover-empty {
  position: relative;
  z-index: 1;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 1px 0 4px rgba(0, 0, 0, 0.35);
}

.music-card-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(128, 128, 128, 0.2);
  color: var(--color-text-meta, #999);
}

/* 黑胶：沟纹用重复径向渐变，胶芯标签用站点青色 */
.music-card-vinyl {
  position: absolute;
  top: 3px;
  left: 0;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  transform: translateX(18px);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  background:
    repeating-radial-gradient(circle,
      rgba(255, 255, 255, 0.055) 0 1px,
      transparent 1px 3px),
    radial-gradient(circle,
      #111214 0 7%,          /* 中心孔 */
      #56b6c2 7% 26%,        /* 胶芯标签：站点青 */
      #3d8992 26% 27.5%,     /* 标签边缘压深一圈 */
      #17181a 27.5% 98%,     /* 胶面 */
      rgba(0, 0, 0, 0.5) 100%);
}

/* 高光扇面：让旋转肉眼可见 */
.music-card-vinyl::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 320deg,
    transparent 0deg 20deg,
    rgba(255, 255, 255, 0.07) 55deg,
    transparent 90deg 200deg,
    rgba(255, 255, 255, 0.045) 235deg,
    transparent 270deg 360deg);
}

.music-card:hover .music-card-vinyl {
  transform: translateX(32px);
}

.music-card:hover .music-card-vinyl::after {
  animation: music-vinyl-spin 4s linear infinite;
}

@keyframes music-vinyl-spin {
  to { transform: rotate(360deg); }
}

.music-card-body {
  flex: 1;
  min-width: 0;
}

/* 标题最多两行，不再单行截断长歌名 */
.music-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: inherit;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 3px;
}

.music-card-meta {
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--color-text-meta, #999);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 9px;
}

.music-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 平台图标：默认中性灰描边保持安静，悬停/聚焦才亮出品牌色 */
.music-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  border: 1px solid rgba(128, 128, 128, 0.4);
  color: var(--color-text-meta, #8f8f8f);
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.music-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.music-link:focus-visible {
  outline: 2px solid #56b6c2;
  outline-offset: 2px;
}

.music-link-netease:hover    { background: #e02020; border-color: #e02020; color: #fff; }
.music-link-qq:hover         { background: #31c27c; border-color: #31c27c; color: #fff; }
.music-link-spotify:hover    { background: #1db954; border-color: #1db954; color: #fff; }
.music-link-apple:hover      { background: #fc3c44; border-color: #fc3c44; color: #fff; }
.music-link-youtube:hover    { background: #f00;    border-color: #f00;    color: #fff; }
.music-link-bilibili:hover   { background: #00aeec; border-color: #00aeec; color: #fff; }
.music-link-soundcloud:hover { background: #f50;    border-color: #f50;    color: #fff; }
.music-link-bandcamp:hover   { background: #408294; border-color: #408294; color: #fff; }
.music-link-url:hover        { background: #56b6c2; border-color: #56b6c2; color: #fff; }

@media (max-width: 480px) {
  .post-content .body blockquote {
    margin-inline-start: 1.55em;
  }
  .post-content .body blockquote::before {
    left: -0.7em;
    font-size: 2.35em;
  }
  .post-content .body .excerpt {
    margin-inline: 0;
  }
  .post-content .body .excerpt__body {
    padding: 1.05em 1em 1em 1.55em;
  }
  .post-content .body .excerpt__body::before {
    left: 0.14em;
    font-size: 2em;
  }
  .music-card {
    max-width: 100%;
    gap: 12px;
    padding: 12px;
  }
  .music-card-disc {
    width: 80px;   /* 60 + 20 */
    height: 60px;
  }
  .music-card-cover,
  .music-card-cover-empty {
    width: 60px;
    height: 60px;
  }
  .music-card-vinyl {
    top: 2px;
    width: 56px;
    height: 56px;
    transform: translateX(14px);
  }
  .music-card:hover .music-card-vinyl {
    transform: translateX(24px);
  }
  .music-card-title {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .music-card,
  .music-card-vinyl,
  .music-link {
    transition: none;
  }
  .music-card:hover .music-card-vinyl::after {
    animation: none;
  }
}
