/* ============================================
   CAPEST · 院徽组件系统 · Emblem Component Library
   ============================================
   • .emblem        基础容器（PNG bg）
   • .emblem-mono   单色描边版（mask 处理 PNG）
   • .emblem-white  深色底白色版
   • .emblem-stamp  红色印章版（中体能体科院 · 官方发布）
   • .emblem-watermark  极淡水印版
   • 尺寸：xs(20) · sm(32) · md(48) · lg(72) · xl(110) · 2xl(160)
   ============================================ */

:root {
  /* 注意：用绝对路径，避免在内联 <style> 或别处通过 var() 调用时按 HTML 路径解析导致 404 */
  --emblem-url: url("/assets/capest-emblem.png");
  --emblem-url-512: url("/assets/emblem-512.png");
  --emblem-url-white: url("/assets/emblem-white-512.png");
  --capest-blue: oklch(0.42 0.13 255);
  --capest-blue-deep: oklch(0.32 0.11 255);
  --capest-stamp: oklch(0.5 0.18 25);
}

/* —— 基础徽志 —— */
.emblem {
  display: inline-block;
  vertical-align: middle;
  background: var(--emblem-url-512) center / contain no-repeat;
  flex-shrink: 0;
}
.emblem-xs { width: 20px; height: 20px; }
.emblem-sm { width: 32px; height: 32px; }
.emblem-md { width: 48px; height: 48px; }
.emblem-lg { width: 72px; height: 72px; }
.emblem-xl { width: 110px; height: 110px; }
.emblem-2xl { width: 160px; height: 160px; }

/* —— 白色版（用 PNG 白色版 + 不需要 mask）—— */
.emblem-white {
  background-image: var(--emblem-url-white);
}

/* —— 单色染色版（用 mask 把蓝色 PNG 当模板，自定义着色）—— */
.emblem-mono {
  background: currentColor;
  -webkit-mask: var(--emblem-url-512) center / contain no-repeat;
  mask: var(--emblem-url-512) center / contain no-repeat;
}

/* —— 极淡水印版 —— */
.emblem-watermark {
  position: absolute;
  background: var(--emblem-url-512) center / contain no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* —— 印章版：红色双圈 + 院徽轮廓 + 中文环字 —— */
.emblem-stamp {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 110px; height: 110px;
  border: 2.5px solid var(--capest-stamp);
  border-radius: 50%;
  color: var(--capest-stamp);
  font-family: var(--f-serif);
  background:
    radial-gradient(circle, transparent 60%, rgba(180,30,30,0.04) 70%),
    var(--bg-card);
  box-shadow: inset 0 0 0 4px var(--bg-card), inset 0 0 0 5px var(--capest-stamp);
  transform: rotate(-6deg);
  filter: contrast(0.95);
}
.emblem-stamp::before {
  content: "";
  position: absolute;
  inset: 14px;
  background: var(--emblem-url-512) center / contain no-repeat;
  filter:
    sepia(1) saturate(8) hue-rotate(310deg) brightness(0.85);
  opacity: 0.7;
}
.emblem-stamp .stamp-text {
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  letter-spacing: 1px;
  font-weight: 700;
  z-index: 1;
}
.emblem-stamp .stamp-date {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-mono);
  font-size: 7px;
  letter-spacing: 1px;
  z-index: 1;
}

.emblem-stamp.stamp-sm { width: 72px; height: 72px; }
.emblem-stamp.stamp-sm::before { inset: 10px; }
.emblem-stamp.stamp-sm .stamp-text { font-size: 5px; top: 4px; }
.emblem-stamp.stamp-sm .stamp-date { font-size: 5px; bottom: 5px; }

/* —— 院徽 + 文字组合（masthead 用）—— */
.emblem-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}
.emblem-lockup .emblem {
  position: relative;
}
.emblem-lockup .lockup-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.emblem-lockup .lockup-cn {
  font-family: var(--f-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--fg);
  line-height: 1.15;
}
.emblem-lockup .lockup-en {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--fg-muted);
  text-transform: uppercase;
}
.emblem-lockup .lockup-tag {
  font-family: var(--f-serif);
  font-size: 13px;
  color: var(--capest-blue);
  letter-spacing: 3px;
  margin-top: 4px;
  padding-left: 8px;
  border-left: 2px solid var(--accent);
}

/* —— Footer 用：横排锁定 —— */
.emblem-footer-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}
.emblem-footer-lockup .emblem {
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
.emblem-footer-lockup .ft-text .cn {
  font-family: var(--f-serif);
  font-size: 19px;
  letter-spacing: 3px;
  color: #fff;
  font-weight: 700;
}
.emblem-footer-lockup .ft-text .en {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  opacity: 0.65;
  margin-top: 3px;
}

/* —— 占位图 / 卡片角标用：徽志暗水印 —— */
.has-emblem-corner {
  position: relative;
}
.has-emblem-corner::after {
  content: "";
  position: absolute;
  bottom: 12px; right: 12px;
  width: 32px; height: 32px;
  background: var(--emblem-url-512) center / contain no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 1;
}

/* —— 大背景版心淡水印（仅 brand-wash 区域）—— */
.bg-wash-emblem {
  position: relative;
  isolation: isolate;
}
.bg-wash-emblem::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--emblem-url-512) right -80px top -80px / 360px no-repeat;
  opacity: 0.04;
  pointer-events: none;
  z-index: -1;
}
