/* ============================================================
   空间漫游（图文详情页）样式 — 暗色 + 古铜金强调
   ============================================================ */

.article-page { background: var(--bg-primary); }

/* 正文宽度与后台编辑器编辑窗口完全一致（WYSIWYG）：
   编辑器 .edit-container 内宽 = 1280 - 2*20 = 1240，wangEditor 文本区再内缩 10px 两侧 → 实际文本列 1220px。
   前台用同样的 max-width(1280) + 30px 左右内边距（20 容器 + 10 文本区），文本列同为 1220px。 */
body.article-detail .article-content .container-narrow {
  max-width: 1280px;
  padding-left: 30px;
  padding-right: 30px;
}
/* 全屏：区块编辑器 magazine-root 正文铺满视口，去掉宽度限制与左右留白 */
body.article-detail .article-content .container-narrow.is-magazine {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* v3 区块 (.b-article) 铺满视口：覆盖 style.css .container 的 max-width:1280px + margin:auto + padding */
body.article-detail .article-content .container-block {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.article-loading {
  min-height: 60vh;
  display: grid; place-items: center;
  color: var(--text-tertiary, #888);
  font-size: 0.95rem;
}

/* ---------- 头部 ---------- */
.article-hero {
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(1rem, 3vw, 1.5rem);
  text-align: left;
}
/* 面包屑在文章 hero 顶部、满屏最左侧（脱离 .container-narrow 居中约束） */
.article-hero__breadcrumb {
  justify-content: flex-start;
  padding: 0 var(--content-padding);
  margin-bottom: 1.5rem;
}
.article-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 1rem;
  color: var(--text-primary);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.article-badge {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  background: rgba(196, 154, 84, 0.12);
  color: var(--accent, #c49a54);
  border: 1px solid rgba(196, 154, 84, 0.3);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.article-badge--home { background: rgba(96, 165, 250, 0.10); color: #93c5fd; border-color: rgba(96, 165, 250, 0.3); }

.article-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.article-tag {
  font-size: 0.78rem;
  padding: 0.15rem 0.6rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* ---------- 封面大图 ---------- */
.article-cover {
  margin: 0 0 clamp(2rem, 5vw, 4rem);
}
.article-cover img {
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-secondary);
}

/* ---------- 简介 ---------- */
.article-summary {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.article-summary p {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text-secondary);
  font-style: italic;
  margin: 0;
}

/* ---------- 内容块 ---------- */
.article-content { padding: clamp(1rem, 3vw, 2rem) 0 clamp(3rem, 6vw, 5rem); }
.article-h {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.005em;
  margin: 2.5rem 0 1rem;
}
.article-h--l2 { font-size: clamp(1.5rem, 3vw, 1.85rem); }
.article-h--l3 { font-size: clamp(1.2rem, 2.5vw, 1.45rem); color: var(--text-secondary); }
.article-p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 0 0 1.1rem;
}
.article-list {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--text-secondary);
  line-height: 1.85;
}
.article-list li { margin-bottom: 0.4rem; }

.article-quote {
  margin: 2.5rem 0;
  padding: 1.5rem 1.8rem;
  border-left: 3px solid var(--accent, #c49a54);
  background: rgba(196, 154, 84, 0.06);
  border-radius: 0 4px 4px 0;
}
.article-quote p {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text-primary);
  font-weight: 500;
}
.article-quote cite {
  font-style: normal;
  font-size: 0.88rem;
  color: var(--text-tertiary, #888);
  letter-spacing: 0.05em;
}

.article-delimiter {
  border: none;
  text-align: center;
  margin: 3rem 0;
  position: relative;
  height: 1.2em;
}
.article-delimiter::before {
  content: '· · ·';
  color: var(--text-tertiary, #888);
  letter-spacing: 0.6em;
  font-size: 1.2rem;
}

.article-image {
  margin: 2rem 0;
}
.article-image--full img { width: 100%; height: auto; display: block; margin: 0 auto; }
.article-image--inline img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.article-image figcaption {
  margin-top: 0.7rem;
  font-size: 0.88rem;
  color: var(--text-tertiary, #888);
  text-align: center;
  font-style: italic;
}

/* ---------- 装饰符号主题语义色 ---------- */
:root {
  --symbol-ink: #e8e4df;
  --symbol-paper: #34343b;
}
[data-theme="light"] {
  --symbol-ink: #2a2a2e;
  --symbol-paper: #f5f0e8;
}

/* ---------- 装饰符号：圆形/方块数字徽章 + 三角形 ---------- */
.num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: var(--accent, #c49a54);
  color: #fff;
  font-size: 0.9em;
  font-weight: 600;
  margin: 0 0.2em;
  vertical-align: middle;
  line-height: 1;
  user-select: text;
  -webkit-user-select: text;
}
.num-badge--sq { border-radius: 4px; }
.num-badge--sm { width: 1.2em; height: 1.2em; font-size: 0.7em; }
.num-badge--lg { width: 2.2em; height: 2.2em; font-size: 1.1em; }
/* 颜色变体（data-color 由编辑器写入，对应 class 由前端生成） */
.num-badge--accent { background: var(--accent, #c49a54); }
.num-badge--wine   { background: #8b1a1a; }
.num-badge--ink    { background: var(--symbol-ink); color: var(--symbol-paper); }
.num-badge--white  { background: var(--symbol-paper); color: var(--symbol-ink); border: 1px solid var(--border-light, rgba(0,0,0,.12)); }

/* 三角形（CSS 边框实现，不依赖字体） */
.ico-tri,
.ico-tri-rev {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: middle;
  margin: 0 0.2em;
}
.ico-tri       { border-left: 0.45em solid transparent; border-right: 0.45em solid transparent; border-bottom: 0.7em solid currentColor; }
.ico-tri-rev   { border-left: 0.45em solid transparent; border-right: 0.45em solid transparent; border-top:    0.7em solid currentColor; }
.ico-tri--sm,
.ico-tri-rev--sm { border-left-width: 0.32em; border-right-width: 0.32em; border-bottom-width: 0.5em; border-top-width: 0.5em; }
.ico-tri--lg,
.ico-tri-rev--lg { border-left-width: 0.6em;  border-right-width: 0.6em;  border-bottom-width: 0.95em; border-top-width: 0.95em; }
.ico-tri--accent,
.ico-tri-rev--accent { color: var(--accent, #c49a54); }
.ico-tri--wine,
.ico-tri-rev--wine   { color: #8b1a1a; }
.ico-tri--ink,
.ico-tri-rev--ink    { color: var(--symbol-ink); }
.ico-tri--white,
.ico-tri-rev--white  { color: var(--symbol-paper); }

.article-video { margin: 2rem 0; }
.article-video__ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}
.article-video__ratio iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}

.article-embed-link { margin: 1rem 0; }
.article-unknown { color: var(--text-tertiary, #666); font-style: italic; }

/* ---------- 移动端 ---------- */


@media (max-width: 720px) {
  .article-hero { padding-top: 2rem; }
  .article-meta { gap: 0.4rem 1rem; font-size: 0.85rem; }
  .article-p { font-size: 1rem; line-height: 1.75; }
  .article-quote { padding: 1rem 1.2rem; }
  .article-quote p { font-size: 1.05rem; }
}

/* ============================================================
   前台增强样式：内容排版 / 目录 / 灯箱 / 相关作品
   ============================================================ */

/* 平滑锚点滚动（尊重减弱动效偏好） */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- 富文本正文基础排版（wangEditor 原生标签） ---------- */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5 {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 2.4rem 0 1rem;
  line-height: 1.3;
  scroll-margin-top: 88px;
}
.article-content h1 { font-size: clamp(1.7rem, 3.4vw, 2.1rem); }
.article-content h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); }
.article-content h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); color: var(--text-secondary); }
.article-content h4 { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-secondary); }
.article-content h5 { font-size: 1rem; color: var(--text-secondary); margin: 1.6rem 0 0.8rem; }
.article-content p { font-size: 1.05rem; line-height: 1.9; color: var(--text-secondary); margin: 0 0 1.1rem; }
.article-content img { display: block; max-width: 100%; height: auto !important; cursor: zoom-in; margin: 0.5rem auto; }
/* 富文本路径（wangEditor 输出的 <p><img></p>）：图片也要在 <p> 内居中 */
.article-content p img { display: block; margin: 0.5rem auto; }
.article-content ul,
.article-content ol { margin: 0 0 1.5rem 1.5rem; color: var(--text-secondary); line-height: 1.9; }
.article-content li { margin-bottom: 0.4rem; }
.article-content blockquote {
  margin: 2.2rem 0;
  padding: 1.2rem 1.6rem;
  border-left: 3px solid var(--accent, #c49a54);
  background: rgba(196, 154, 84, 0.06);
  border-radius: 0 4px 4px 0;
  color: var(--text-primary);
}
.article-content blockquote p { margin: 0 0 0.5rem; }
.article-content a { color: var(--accent, #c49a54); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 侧边浮动按钮：返回作品集 / 回到顶部 / 分享 ---------- */
.side-fab {
  position: fixed;
  right: 1.25rem;
  z-index: 55;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #333;
  cursor: pointer;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
.side-fab.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.side-fab.is-visible:hover { transform: translateY(-2px); box-shadow: none; }
.side-fab svg { width: 18px; height: 18px; }
.top-fab { bottom: 92px; }
.back-fab { bottom: 140px; }
.share-fab { bottom: 44px; }
@media (max-width: 768px) {
  .side-fab { width: 40px; height: 40px; box-shadow: none; }
  .side-fab svg { width: 20px; height: 20px; }
  .top-fab { bottom: 80px; }
  .back-fab { bottom: 132px; }
  .share-fab { display: none; }
}


/* ---------- 相关作品 ---------- */
.article-related {
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1rem, 3vw, 2rem);
  margin-top: clamp(2rem, 5vw, 3rem);
  border-top: none;
  width: 100%;
  box-sizing: border-box;
}
.related-title {
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  font-size: 25px;
  font-weight: 400;
  color: #111827;
  letter-spacing: 0.04em;
  margin: 0 0 30px;
  padding-left: 80px;
  line-height: 1.2;
}
.related-slider { position: relative; }
.related-viewport { overflow: hidden; margin: 0 20px; }
.related-track {
  display: flex;
  gap: 16px;
  transition: transform .6s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
.related-card {
  position: relative;
  display: block;
  flex: 0 0 calc((100% - 4 * 16px) / 5);
  border-radius: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  text-decoration: none;
  border: none;
  transition: transform .25s ease;
}
.related-card:hover { transform: translateY(-2px); }
.related-card__media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-primary);
}
.related-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s ease;
}
.related-card:hover .related-card__media img { transform: scale(1.04); }
.related-card__media--empty {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(196, 154, 84, 0.18), rgba(96, 165, 250, 0.12));
}
.related-card__media--empty span { font-size: 2.4rem; font-weight: 700; color: var(--accent, #c49a54); }
.related-card__overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex; align-items: flex-end;
  pointer-events: none;
  transition: background .35s ease;
}
.related-card:hover .related-card__overlay { background: rgba(0, 0, 0, 0.5); }
.related-card__info {
  width: 100%;
  padding: 14px 16px 18px;
  color: #fff;
  font-family: "PingFang SC", -apple-system, "Microsoft YaHei", sans-serif;
  transform: translateY(100%);
  transition: transform 2s cubic-bezier(.22, .61, .36, 1);
  display: flex; flex-direction: column; gap: 4px;
}


/* 未滚动：透明，覆盖在 hero 之上 */
/* 正文宽度与后台编辑器编辑窗口完全一致（WYSIWYG）：
   编辑器 .edit-container 内宽 = 1280 - 2*20 = 1240，wangEditor 文本区再内缩 10px 两侧 → 实际文本列 1220px。
   前台用同样的 max-width(1280) + 30px 左右内边距（20 容器 + 10 文本区），文本列同为 1220px。 */
body.article-detail .article-content .container-narrow {
  max-width: 1280px;
  padding-left: 30px;
  padding-right: 30px;
}
/* 全屏：区块编辑器 magazine-root 正文铺满视口，去掉宽度限制与左右留白 */
body.article-detail .article-content .container-narrow.is-magazine {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* v3 区块 (.b-article) 铺满视口：覆盖 style.css .container 的 max-width:1280px + margin:auto + padding */
body.article-detail .article-content .container-block {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.article-loading {
  min-height: 60vh;
  display: grid; place-items: center;
  color: var(--text-tertiary, #888);
  font-size: 0.95rem;
}

/* ---------- 头部 ---------- */
.article-hero {
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(1rem, 3vw, 1.5rem);
  text-align: left;
}
/* 面包屑在文章 hero 顶部、满屏最左侧（脱离 .container-narrow 居中约束） */
.article-hero__breadcrumb {
  justify-content: flex-start;
  padding: 0 var(--content-padding);
  margin-bottom: 1.5rem;
}
.article-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 1rem;
  color: var(--text-primary);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.article-badge {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  background: rgba(196, 154, 84, 0.12);
  color: var(--accent, #c49a54);
  border: 1px solid rgba(196, 154, 84, 0.3);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.article-badge--home { background: rgba(96, 165, 250, 0.10); color: #93c5fd; border-color: rgba(96, 165, 250, 0.3); }

.article-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.article-tag {
  font-size: 0.78rem;
  padding: 0.15rem 0.6rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* ---------- 封面大图 ---------- */
.article-cover {
  margin: 0 0 clamp(2rem, 5vw, 4rem);
}
.article-cover img {
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-secondary);
}

/* ---------- 简介 ---------- */
.article-summary {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.article-summary p {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text-secondary);
  font-style: italic;
  margin: 0;
}

/* ---------- 内容块 ---------- */
.article-content { padding: clamp(1rem, 3vw, 2rem) 0 clamp(3rem, 6vw, 5rem); }
.article-h {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.005em;
  margin: 2.5rem 0 1rem;
}
.article-h--l2 { font-size: clamp(1.5rem, 3vw, 1.85rem); }
.article-h--l3 { font-size: clamp(1.2rem, 2.5vw, 1.45rem); color: var(--text-secondary); }
.article-p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 0 0 1.1rem;
}
.article-list {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--text-secondary);
  line-height: 1.85;
}
.article-list li { margin-bottom: 0.4rem; }

.article-quote {
  margin: 2.5rem 0;
  padding: 1.5rem 1.8rem;
  border-left: 3px solid var(--accent, #c49a54);
  background: rgba(196, 154, 84, 0.06);
  border-radius: 0 4px 4px 0;
}
.article-quote p {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text-primary);
  font-weight: 500;
}
.article-quote cite {
  font-style: normal;
  font-size: 0.88rem;
  color: var(--text-tertiary, #888);
  letter-spacing: 0.05em;
}

.article-delimiter {
  border: none;
  text-align: center;
  margin: 3rem 0;
  position: relative;
  height: 1.2em;
}
.article-delimiter::before {
  content: '· · ·';
  color: var(--text-tertiary, #888);
  letter-spacing: 0.6em;
  font-size: 1.2rem;
}

.article-image {
  margin: 2rem 0;
}
.article-image--full img { width: 100%; height: auto; display: block; margin: 0 auto; }
.article-image--inline img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.article-image figcaption {
  margin-top: 0.7rem;
  font-size: 0.88rem;
  color: var(--text-tertiary, #888);
  text-align: center;
  font-style: italic;
}

/* ---------- 装饰符号主题语义色 ---------- */
:root {
  --symbol-ink: #e8e4df;
  --symbol-paper: #34343b;
}
[data-theme="light"] {
  --symbol-ink: #2a2a2e;
  --symbol-paper: #f5f0e8;
}

/* ---------- 装饰符号：圆形/方块数字徽章 + 三角形 ---------- */
.num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: var(--accent, #c49a54);
  color: #fff;
  font-size: 0.9em;
  font-weight: 600;
  margin: 0 0.2em;
  vertical-align: middle;
  line-height: 1;
  user-select: text;
  -webkit-user-select: text;
}
.num-badge--sq { border-radius: 4px; }
.num-badge--sm { width: 1.2em; height: 1.2em; font-size: 0.7em; }
.num-badge--lg { width: 2.2em; height: 2.2em; font-size: 1.1em; }
/* 颜色变体（data-color 由编辑器写入，对应 class 由前端生成） */
.num-badge--accent { background: var(--accent, #c49a54); }
.num-badge--wine   { background: #8b1a1a; }
.num-badge--ink    { background: var(--symbol-ink); color: var(--symbol-paper); }
.num-badge--white  { background: var(--symbol-paper); color: var(--symbol-ink); border: 1px solid var(--border-light, rgba(0,0,0,.12)); }

/* 三角形（CSS 边框实现，不依赖字体） */
.ico-tri,
.ico-tri-rev {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: middle;
  margin: 0 0.2em;
}
.ico-tri       { border-left: 0.45em solid transparent; border-right: 0.45em solid transparent; border-bottom: 0.7em solid currentColor; }
.ico-tri-rev   { border-left: 0.45em solid transparent; border-right: 0.45em solid transparent; border-top:    0.7em solid currentColor; }
.ico-tri--sm,
.ico-tri-rev--sm { border-left-width: 0.32em; border-right-width: 0.32em; border-bottom-width: 0.5em; border-top-width: 0.5em; }
.ico-tri--lg,
.ico-tri-rev--lg { border-left-width: 0.6em;  border-right-width: 0.6em;  border-bottom-width: 0.95em; border-top-width: 0.95em; }
.ico-tri--accent,
.ico-tri-rev--accent { color: var(--accent, #c49a54); }
.ico-tri--wine,
.ico-tri-rev--wine   { color: #8b1a1a; }
.ico-tri--ink,
.ico-tri-rev--ink    { color: var(--symbol-ink); }
.ico-tri--white,
.ico-tri-rev--white  { color: var(--symbol-paper); }

.article-video { margin: 2rem 0; }
.article-video__ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}
.article-video__ratio iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}

.article-embed-link { margin: 1rem 0; }
.article-unknown { color: var(--text-tertiary, #666); font-style: italic; }

/* ---------- 移动端 ---------- */

/* H5（max-width: 720px）下，顶栏顶部透明、滚动后实底，并加过渡 */
@media (max-width: 720px) {
    }

@media (max-width: 720px) {
  .article-hero { padding-top: 2rem; }
  .article-meta { gap: 0.4rem 1rem; font-size: 0.85rem; }
  .article-p { font-size: 1rem; line-height: 1.75; }
  .article-quote { padding: 1rem 1.2rem; }
  .article-quote p { font-size: 1.05rem; }
}

/* ============================================================
   前台增强样式：内容排版 / 目录 / 灯箱 / 相关作品
   ============================================================ */

/* 平滑锚点滚动（尊重减弱动效偏好） */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- 富文本正文基础排版（wangEditor 原生标签） ---------- */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5 {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 2.4rem 0 1rem;
  line-height: 1.3;
  scroll-margin-top: 88px;
}
.article-content h1 { font-size: clamp(1.7rem, 3.4vw, 2.1rem); }
.article-content h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); }
.article-content h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); color: var(--text-secondary); }
.article-content h4 { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-secondary); }
.article-content h5 { font-size: 1rem; color: var(--text-secondary); margin: 1.6rem 0 0.8rem; }
.article-content p { font-size: 1.05rem; line-height: 1.9; color: var(--text-secondary); margin: 0 0 1.1rem; }
.article-content img { display: block; max-width: 100%; height: auto !important; cursor: zoom-in; margin: 0.5rem auto; }
/* 富文本路径（wangEditor 输出的 <p><img></p>）：图片也要在 <p> 内居中 */
.article-content p img { display: block; margin: 0.5rem auto; }
.article-content ul,
.article-content ol { margin: 0 0 1.5rem 1.5rem; color: var(--text-secondary); line-height: 1.9; }
.article-content li { margin-bottom: 0.4rem; }
.article-content blockquote {
  margin: 2.2rem 0;
  padding: 1.2rem 1.6rem;
  border-left: 3px solid var(--accent, #c49a54);
  background: rgba(196, 154, 84, 0.06);
  border-radius: 0 4px 4px 0;
  color: var(--text-primary);
}
.article-content blockquote p { margin: 0 0 0.5rem; }
.article-content a { color: var(--accent, #c49a54); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 侧边浮动按钮：返回作品集 / 回到顶部 / 分享 ---------- */
.side-fab {
  position: fixed;
  right: 1.25rem;
  z-index: 55;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #333;
  cursor: pointer;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
.side-fab.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.side-fab.is-visible:hover { transform: translateY(-2px); box-shadow: none; }
.side-fab svg { width: 18px; height: 18px; }
.top-fab { bottom: 92px; }
.back-fab { bottom: 140px; }
.share-fab { bottom: 44px; }
@media (max-width: 768px) {
  .side-fab { width: 40px; height: 40px; box-shadow: none; }
  .side-fab svg { width: 20px; height: 20px; }
  .top-fab { bottom: 80px; }
  .back-fab { bottom: 132px; }
  .share-fab { display: none; }
}

/* ---------- 相关作品 ---------- */
.article-related {
  /* 满屏 + 左右 60px padding，跟 .b-block/.custom-grid 完全一致：
     上方 5 个 3:4 seg（custom-grid 内的）left=60、width=345，
     这里同样内边距 60 + flex 等分，确保 5 张相关作品卡的左边界与上方 seg 完全对齐。
     取消 v5 居中 max-width:1280；改成 width:100% + box-sizing:border-box；
     视口 <~1240 时仍满屏；视口 >=1240 时仍与上方 .b-block 同 60px inset。 */
  padding: clamp(2rem, 5vw, 3.5rem) 60px clamp(1rem, 3vw, 2rem);
  margin-top: clamp(2rem, 5vw, 3rem);
  border-top: none;
  width: 100%;
  box-sizing: border-box;
}
.related-title {
  /* 英杂衬线字体：var(--serif) 由 block-v3-published.css 的 :root 定义为 'YS-Optima','YS-Deng','YS-AdobeTextPro','YS-Futura',system-ui,sans-serif。
     YS-Optima 风格是人文主义字形 + 无衬线但有古典韵脚，与「MORE PROJECTS」这种英杂装饰标题气质匹配。
     letter-spacing 放宽到 0.08em 让 Optima 的字符间距更舒展。 */
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  /* [v13] 默认（暗主题）：金色（与全站 --accent 一致：#c9a96e） */
  color: var(--accent);
  letter-spacing: 0.08em;
  margin: 0 0 30px;
  padding-left: 0;
  line-height: 1.2;
  text-transform: none;
}
/* [v13] 浅色主题覆盖：金色 #b8914f 在浅米白页面上对比不足，回到深色 #111827 */
[data-theme="light"] .related-title {
  color: #111827;
}
.related-slider { position: relative; }
.related-viewport { overflow: hidden; margin: 0; }
.related-track {
  display: flex;
  gap: 16px;
  transition: transform .6s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
.related-card {
  position: relative;
  display: block;
  flex: 0 0 calc((100% - 4 * 16px) / 5);
  border-radius: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  text-decoration: none;
  border: none;
  transition: transform .25s ease;
}
.related-card:hover { transform: translateY(-2px); }
.related-card__media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-primary);
}
.related-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s ease;
}
.related-card:hover .related-card__media img { transform: scale(1.04); }
.related-card__media--empty {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(196, 154, 84, 0.18), rgba(96, 165, 250, 0.12));
}
.related-card__media--empty span { font-size: 2.4rem; font-weight: 700; color: var(--accent, #c49a54); }
.related-card__overlay {
  position: absolute; inset: 0;
  /* [v12] 去掉渐变遮罩，让 .related-card__info 实体背景承担分层 */
  background: rgba(0, 0, 0, 0);
  display: flex; align-items: flex-end;
  pointer-events: none;
  transition: background 0.7s cubic-bezier(.22, .61, .36, 1);
}
.related-card:hover .related-card__overlay { /* [v8] hover 时遮罩完全透明，露出原图 */ background: rgba(0, 0, 0, 0); }
.related-card__info {
  width: 100%;
  /* [v15] 左右 padding 归零，让三行文字两端直接贴齐卡片边缘，不留内边距；
     上下 padding 保留 14/18px 维持三行行间呼吸感 */
  padding: 14px 0 18px;
  /* [v13] 背景跟主题走：暗模式 --bg-primary = #141414 / 浅模式 #fffdfa；与 body bg 融合 */
  background: var(--bg-primary);
  /* 文字色跟随主题：暗模式暖白 #e8e4df / 浅模式深色 #1c1a17 */
  color: var(--text-primary);
  /* [v13] 改苹黑：var(--font-body) = 'Noto Sans SC','PingFang SC','Microsoft YaHei',...，
     中文小字号苹黑更稳，比 var(--serif) 的 YS-Optima 字符密度更适合信息条 */
  font-family: var(--font-body);
  /* 默认显示：信息条停在卡片底部（hover 时下滑 100% 整体消失） */
  transform: translateY(0);
  /* 默认 -> hover 下滑的过渡 0.7s */
  transition: transform 0.7s cubic-bezier(.22, .61, .36, 1);
  display: flex; flex-direction: column; gap: 4px;
}
.related-card:hover .related-card__info { /* [v8] hover 时信息条整体下滑消失 */ transform: translateY(100%); }
.related-card__line { line-height: 1.4; }
.related-card__line--title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.related-card__line--desc  { font-size: 12px; color: var(--text-secondary);
  /* [v17] 撤回 v16 的 justify 三件套（text-align: justify-all / text-align-last: justify / text-justify: inter-ideograph）。
     原因：描述文字自然换行成两行，第二行「墙。」只有 2 个字，被 justify 字距拉伸后字符间距巨大，
     破坏中文阅读舒适度。用户原诉求「文字的两侧到头」= padding 左右归零（v15 已达成），
     短行末尾留白属于中文正常排版，不应强行两端对齐。
     文字按自然宽度排，左端到 div left=60，div 本身 width=345px（=卡片宽），
     文字物理上左右两端均贴合卡片边缘。 */ }
.related-card__line--addr  { font-size: 12px; color: var(--text-secondary); }
.related-arrow {
  position: static;
  /* [v14] 去掉圆形磨砂按钮：36×36 固定尺寸、border-radius:50%、背景、磨砂、阴影全撤 */
  border: none;
  background: transparent;
  /* [v14] 加大箭头：18px -> 28px（更醒目的英杂装饰箭头） */
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  /* [v14] 颜色跟主题走：默认暗主题 = 纯白 #fff */
  color: #ffffff;
  /* [v14] 仅保留 opacity 过渡；hover 用透明度反馈，不出现背景变化 */
  transition: opacity .2s ease;
  flex: 0 0 auto;
  /* [v14] 留点击区：28px 文字两侧 padding 让按钮有手指可点的视觉锚点 */
  padding: 4px 10px;
}
/* [v14] 浅色主题覆盖：纯黑 #000000 */
[data-theme="light"] .related-arrow {
  color: #000000;
}
/* [v14] hover：透明度反馈（替代原背景变化） */
.related-arrow:hover { opacity: .6; }
/* 禁用态：透明度更低，与新视觉一致 */
.related-arrow.is-disabled { opacity: 0.2; cursor: not-allowed; }
.related-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  font-family: var(--serif, "PingFang SC", sans-serif);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--text-tertiary, #888);
}
.related-pager__num {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 48px;
  justify-content: center;
}
.related-pager__cur { color: #111; font-weight: 500; }
.related-pager__sep { opacity: 0.45; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .related-card { flex: 0 0 calc((100% - 2 * 16px) / 3); }
  .article-related { padding-left: 40px; padding-right: 40px; }
}
@media (max-width: 900px) {
  .related-title { padding-left: 0; font-size: 22px; margin-bottom: 24px; }
  .related-viewport { margin: 0; }
  .article-related { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 560px) {
  .related-title { padding-left: 0; font-size: 20px; margin-bottom: 20px; }
  .related-viewport { margin: 0; overflow: visible; }
  .article-related { padding-left: 16px; padding-right: 16px; }
  .related-track { display: block; transform: none !important; }
  .related-card { flex: 0 0 auto; margin-bottom: 16px; }
  .related-card:last-child { margin-bottom: 0; }
  .related-arrow, .related-pager { display: none; }
}

/* ---------- 减弱动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .related-card, .related-card__media img, .related-card__overlay, .related-card__info, .related-track, .side-fab { transition: none !important; }
  /* [v8] 减弱动效：hover 也保持默认可见（不随 transition 滑出） */
  .related-card:hover .related-card__info { transform: translateY(0); }
  /* [v8] 减弱动效：hover 仍 0 透明（与主 hover 对齐） */
  .related-card:hover .related-card__overlay { background: rgba(0, 0, 0, 0); }
}

/* ---------- 减弱动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .related-card, .related-card__media img, .related-card__overlay, .related-card__info, .related-track, .side-fab { transition: none !important; }
  /* [v8] 减弱动效：hover 也保持默认可见（不随 transition 滑出） */
  .related-card:hover .related-card__info { transform: translateY(0); }
  /* [v8] 减弱动效：hover 仍 0 透明（与主 hover 对齐） */
  .related-card:hover .related-card__overlay { background: rgba(0, 0, 0, 0); }
}

/* ---------- 减弱动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .related-card, .related-card__media img, .side-fab { transition: none !important; }
}


/* ================= 图片灯箱（dinzd 还原版） ================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: #fff;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility 0s linear .5s;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .5s ease, visibility 0s; }
.lightbox[hidden] { display: none; }

/* 入场/出场：header 与 body 从下方 30px + 淡入（还原 dinzd GSAP timeline） */
.lightbox__header,
.lightbox__body {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s ease, transform .8s ease;
}
.lightbox.is-open .lightbox__header { opacity: 1; transform: translateY(0); }
.lightbox.is-open .lightbox__body { opacity: 1; transform: translateY(0); transition-delay: .3s; }

/* ---------- header（还原 dinzd .gallery-header + .header__function-area） ---------- */
.lightbox__header {
  flex: 0 0 3.90625vw;
  position: relative;
  width: 100%;
  min-height: 52px;
  z-index: 20;
}
.lightbox__title.text-center {
  position: absolute;
  left: 0; right: 0; top: 0;
  line-height: 3.90625vw;
  min-height: 52px;
  text-align: center;
  font-size: 0.95rem;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 12vw;
  font-weight: 400;
  pointer-events: none;
}
.header__function-area {
  position: absolute;
  right: 0; top: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 21;
}
.header__function-area .area__item {
  position: relative;
  height: 3.90625vw;
  min-height: 52px;
  width: 3.54167vw;
  min-width: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: #333;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.lightbox__counter {
  font-size: 0.85rem;
  color: #888;
  letter-spacing: 0.05em;
  cursor: default;
}
.icon-button .lb-ico {
  width: 1.04167vw;
  min-width: 18px;
  height: 1.04167vw;
  min-height: 18px;
  display: block;
  fill: none;
  stroke: #333;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-button.icon-list .lb-ico { stroke: #626262; }
.icon-button.icon-list:hover .lb-ico { stroke: #333; }
.lightbox__close:hover .lb-ico { stroke: #000; }

/* ---------- body ---------- */
.lightbox__body {
  flex: 1;
  position: relative;
  overflow: hidden;
  width: 100%;
}
.mode-detail__container {
  height: 100%;
  position: relative;
  width: 100%;
  padding: 3.64583vw 0;
  box-sizing: border-box;
}
.main-hero { height: 100%; position: relative; }
.main-hero .lightbox__img {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  opacity: 0;                                  /* 默认隐藏，is-active 才显示 */
  transition: opacity .8s ease;                /* 还原 dinzd .fadein 0.8s */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.main-hero .lightbox__img.is-active { opacity: 1; z-index: 2; }
.main-hero .lightbox__img.is-hidden { opacity: 0; z-index: 1; }

/* ---------- 列表模式缩略图（还原 dinzd .mode-list__container 5 列网格） ---------- */
.mode-list__container { display: none; height: 100%; padding: 0 2.60417vw; width: 100%; box-sizing: border-box; }
.lightbox.is-list .mode-detail__container { display: none; }
.lightbox.is-list .mode-list__container { display: block; }
.lightbox.is-list .side-btn { display: none; }
.mode-detail__scrollbar { height: 100%; width: 100%; overflow-y: auto; padding: 3.64583vw 0; box-sizing: border-box; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* v226lb9-row3：确定性 justify 行（JS 现算每格宽高）
   盒子比例 = 图片自身比例(--lb-ar) → object-fit:cover 零裁切（文章页同款清晰机制）；
   行高/宽度由 layoutLbRows() 直接写 inline（fill 行精确填满行宽、末行固定 rowH 不拉伸），
   不再用 flex-grow/basis —— 结构上不存在"末行被撑大"的竞态。 */
.mode-detail__inner { display: flex; flex-wrap: wrap; gap: 16px; width: 100%; }
.detail__item {
  flex: 0 0 auto;
  cursor: pointer;
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
  /* 列表出现时的逐张渐入初始态：上移 24px + 透明，由 --reveal-delay 错峰 */
  opacity: 0;
  transform: translateY(24px);
  /* v226lb9-slow4x：整体速度再减半 —— 单张淡入 .6s → 1.2s（错峰间隔同步加倍，见 JS --reveal-delay） */
  transition: opacity 1.2s ease, transform 1.2s ease;
  transition-delay: var(--reveal-delay, 0ms);
}
.detail__item img { height: 100%; width: 100%; object-fit: cover; object-position: center; display: block; }
/* v226lb9-nohover：老板要求取消列表模式缩略图的悬停遮罩（原 :hover 时 img 降到 0.85 透明度），
   只保留鼠标指针形态提示可点；选中态仍用 is-current 描边标识。 */
.detail__item.is-current { outline: 2px solid #333; outline-offset: -2px; }
/* 列表模式渐入最终态：视口扫描（scroll/load/resize 后 revealLbVisible）逐批加 is-in
   （首屏批次=网格错峰 row*240+col*120，下滑批次=批内 120ms 错峰，观感一致） */
.detail__item.is-in { opacity: 1; transform: translateY(0); }

/* ---------- 左右切换箭头（还原 dinzd .side-btn） ---------- */
.side-btn {
  position: absolute;
  top: 0;
  height: 100%;
  padding: 0 1.5625vw;
  z-index: 15;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.side-btn.--left { left: 0; }
.side-btn.--right { right: 0; }
.side-btn__ico {
  width: 2.08333vw;
  min-width: 22px;
  height: 2.08333vw;
  min-height: 22px;
  fill: none;
  stroke: #999;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .2s ease;
}
.side-btn:hover .side-btn__ico { stroke: #333; }

/* ---------- mobile ---------- */
@media (max-width: 768px) {
  .lightbox__header { flex: 0 0 52px; min-height: 52px; }
  /* v236 (2026-09-19)：手机端标题/项目名称靠左显示。
     右侧留出 164px（功能区 3×52px + 余量）避免长标题被图标压住；左侧对齐列表 16px 内边距。
     选择器特异性 (0,2,0) > style.css 的 .text-center (0,1,0)，无需 !important。 */
  .lightbox__title.text-center { text-align: left; line-height: 52px; padding: 0 164px 0 16px; font-size: 0.82rem; }
  .header__function-area .area__item { height: 52px; min-height: 52px; width: 52px; min-width: 52px; }
  .icon-button .lb-ico { width: 20px; height: 20px; }
  /* v236：竖向手势交还原生滚动（列表模式上下滚动需要），横向留给 JS 做滑动切换。
     overscroll-behavior-x:none 兜住「横向侧滑 = 浏览器返回」的连锁导航 */
  .lightbox { touch-action: pan-y; overscroll-behavior-x: none; }
  .side-btn { padding: 0 10px; }
  .side-btn__ico { width: 22px; height: 22px; }
  .mode-detail__container { padding: 4vw 0; }
  .mode-list__container { padding: 0 16px; }
  .mode-detail__scrollbar { padding: 4vw 0; }
  /* v236：列表模式图片间距减半 16px → 8px。JS layoutLbRows() 直接读 computed 的这个 gap 算行宽，两处必须一致 */
  .mode-detail__inner { gap: 8px; }
  .main-hero .lightbox__img { max-width: 100%; }
}

/* v237：下架作品直链 → 友好提示页（公网打开已下架作品时显示） */
.article-offline {
  min-height: 68vh;
  display: grid; place-items: center;
  padding: clamp(2rem, 6vw, 4rem) 1.25rem;
  text-align: center;
}
.article-offline__box {
  max-width: 520px;
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
}
.article-offline__icon {
  color: var(--text-tertiary, #888);
  opacity: .8;
  line-height: 0;
}
.article-offline__title {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text, #1a1a1a);
}
.article-offline__desc {
  margin: 0;
  font-size: .92rem;
  line-height: 1.75;
  color: var(--text-tertiary, #888);
}
.article-offline__btn {
  margin-top: .6rem;
  display: inline-block;
  padding: .62rem 1.5rem;
  border: 1px solid var(--border, rgba(0,0,0,.18));
  border-radius: 999px;
  font-size: .88rem;
  color: var(--text, #1a1a1a);
  text-decoration: none;
  transition: opacity .2s, border-color .2s;
}
.article-offline__btn:hover { opacity: .72; }
