/* ---- 自托管字体（v1.9.0）----
   Playfair Display / Manrope / JetBrains Mono 本地化（fonts/ 目录，fontsource 发行版），
   不再引用 Google Fonts CDN（国内不可达曾导致项目页首屏阻塞与字体回退）。
   font-display:block 强制等字体就绪；引用带 ?v= 版本参数防缓存 */
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400; font-display: block; src: url('../fonts/playfair-display-latin-400-normal.woff2?v=20260904') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 500; font-display: block; src: url('../fonts/playfair-display-latin-500-normal.woff2?v=20260904') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 600; font-display: block; src: url('../fonts/playfair-display-latin-600-normal.woff2?v=20260904') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400; font-display: block; src: url('../fonts/playfair-display-latin-400-italic.woff2?v=20260904') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 500; font-display: block; src: url('../fonts/playfair-display-latin-500-italic.woff2?v=20260904') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: block; src: url('../fonts/manrope-latin-wght-normal.woff2?v=20260904') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: block; src: url('../fonts/jetbrains-mono-latin-400-normal.woff2?v=20260904') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: block; src: url('../fonts/jetbrains-mono-latin-500-normal.woff2?v=20260904') format('woff2'); }

/* ============================================================
   Project Pages — 高级深色编辑风设计系统（v1.8.9）
   ------------------------------------------------------------
   8 个项目独立页共用。每个页面通过 body.theme-xxx 覆盖 --acc 实现逐页定制
   （不同项目：强调色 / hero 主视觉 / 布局重心）。
   设计原则：简约高级 · 极其可视化 · 易读性优先。
   复用字体：Playfair Display（展示标题） / Manrope（正文） / JetBrains Mono（元信息/数字）。
   所有类名以 p- 前缀，避免与主页样式冲突。
   ============================================================ */

:root {
  /* 基础深色底 + 分层表面 + 发丝细线 */
  --p-bg: #0a0b0f;
  --p-bg2: #0f1016;
  --p-bg3: #15171f;
  --p-line: rgba(245, 241, 232, 0.09);
  --p-line-strong: rgba(245, 241, 232, 0.16);
  --p-ink: #f2efe8;
  --p-ink-dim: #b7bcc8;
  --p-muted: #8a90a1;
  --p-faint: #5f6472;
  /* 逐页强调色（body.theme-xxx 覆盖） */
  --acc: #ff5d4d;
  /* 间距节奏 */
  --p-gutter: clamp(20px, 5vw, 56px);
  --p-maxw: 1180px;
  /* 圆角（轻微，偏编辑风） */
  --p-r: 14px;
}

/* ---- 主题强调色（8 页各自） ---- */
body.theme-acc      { --acc: #ff5d4d; }
body.theme-f1       { --acc: #35d98f; }
body.theme-bilibili { --acc: #47b8ff; }
body.theme-ai       { --acc: #9d8cff; }
body.theme-stops    { --acc: #ffb454; }
body.theme-bji      { --acc: #ff6b9d; }
body.theme-xianyu   { --acc: #ffa42b; }

/* ---- 基础 ---- */
body.page-proj {
  background: var(--p-bg);
  color: var(--p-ink);
  font-family: 'Manrope', ui-sans-serif, sans-serif;
  line-height: 1.7;
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
* { box-sizing: border-box; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* 顶部氛围背景：细腻径向光 + 极淡颗粒，为深色留白层加分 */
.p-ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 620px at 78% -8%, color-mix(in srgb, var(--acc) 10%, transparent), transparent 60%),
    radial-gradient(900px 500px at 4% 12%, rgba(255,255,255,0.035), transparent 55%);
}

/* ---- 顶栏：返回主页（左上角）+ 横排项目切换（居中） ---- */
.p-top {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 14px var(--p-gutter);
  background: rgba(10, 11, 15, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--p-line);
}
.p-menu {
  display: flex; align-items: center; gap: 4px;
  overflow: visible; padding: 2px;
}
/* 分类标签：hover 时导航栏向下扩出一整行，横排展示该标签下的具体项目 */
/* 注意：.p-cat 不要设 position，否则 .p-cat__row(left/right:0) 会相对标签定位而无法整行铺满 */
/* 用 padding-bottom 向下扩展标签的可命中区、负 margin 补偿，使"标签→展开行"移动过程中保持 hover */
.p-cat {
  padding-bottom: 24px;
  margin-bottom: -24px;
}
.p-cat__name {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--p-muted); cursor: pointer; white-space: nowrap;
  transition: color .22s ease, background .22s ease;
}
.p-cat:hover .p-cat__name,
.p-cat.is-active .p-cat__name {
  color: var(--p-ink); background: color-mix(in srgb, var(--acc) 20%, transparent);
}
.p-cat__row {
  position: absolute; top: 100%; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px var(--p-gutter);
  background: rgba(10, 11, 15, 0.85);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--p-line);
  z-index: 70;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition:
    opacity .34s cubic-bezier(.22, 1, .36, 1),
    transform .42s cubic-bezier(.22, 1, .36, 1);
}
.p-cat:hover .p-cat__row {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.p-cat__row .p-menu__item {
  transform: translateY(6px); opacity: 0;
  transition:
    opacity .34s cubic-bezier(.22, 1, .36, 1),
    transform .42s cubic-bezier(.22, 1, .36, 1);
}
.p-cat:hover .p-cat__row .p-menu__item {
  transform: translateY(0); opacity: 1;
}
.p-cat:hover .p-cat__row .p-menu__item:nth-child(1) { transition-delay: .04s; }
.p-cat:hover .p-cat__row .p-menu__item:nth-child(2) { transition-delay: .09s; }
.p-cat:hover .p-cat__row .p-menu__item:nth-child(3) { transition-delay: .14s; }
.p-cat:hover .p-cat__row .p-menu__item:nth-child(4) { transition-delay: .19s; }
.p-menu__item {
  padding: 6px 12px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--p-muted); white-space: nowrap;
  transition: color .22s ease, background .22s ease;
}
.p-menu__item:hover { color: var(--p-ink); background: var(--p-bg3); }
.p-menu__item.is-active { color: var(--p-ink); background: color-mix(in srgb, var(--acc) 20%, transparent); }
.p-back {
  position: absolute; left: var(--p-gutter); top: 50%;
  transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 0.8rem; font-weight: 600; color: var(--p-muted);
  transition: color .22s ease;
}
.p-back:hover { color: var(--p-ink); }

/* ---- 主容器 ---- */
.p-main {
  width: min(var(--p-maxw), 100% - var(--p-gutter) * 2);
  margin: 0 auto;
  padding: clamp(48px, 8vh, 96px) 0 120px;
}

/* ---- Hero ---- */
.p-hero { max-width: 980px; }
.p-kicker {
  margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline;
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--p-muted);
}
.p-kicker .dot::before { content: "·"; margin: 0 10px; color: var(--p-faint); }
.p-title {
  margin: 0 0 26px;
  font-family: 'Playfair Display', serif;
  font-weight: 500; line-height: 1.06; letter-spacing: -0.02em;
  font-size: clamp(2.6rem, 7.2vw, 6rem); color: var(--p-ink);
  text-wrap: balance;
}
.p-title .acc { color: var(--acc); font-style: normal; }
.p-lead {
  margin: 0 0 30px; max-width: 640px;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem); line-height: 1.75; color: var(--p-ink-dim);
}
.p-tags { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 44px; }
.p-tag {
  padding: 6px 14px; border: 1px solid var(--p-line-strong); border-radius: 999px;
  font-size: 0.76rem; font-weight: 600; color: var(--p-ink-dim); letter-spacing: 0.03em;
}
.p-tag--acc { color: var(--p-ink); border-color: color-mix(in srgb, var(--acc) 55%, transparent); background: color-mix(in srgb, var(--acc) 12%, transparent); }

/* Hero 主视觉（大幅图 + 压角元信息） */
.p-hero-fig { position: relative; margin: 0; border-radius: var(--p-r); overflow: hidden; border: 1px solid var(--p-line); }
.p-hero-fig img { width: 100%; height: clamp(320px, 52vh, 560px); object-fit: cover; object-position: center; }
.p-hero-fig figcaption {
  position: absolute; left: 16px; bottom: 14px;
  padding: 6px 12px; background: rgba(6,7,10,0.62); backdrop-filter: blur(8px);
  border-radius: 8px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; color: rgba(255,255,255,0.82); letter-spacing: 0.05em;
}

/* Hero 数字卡（吸附或在图右） */
.p-hero-stat {
  margin: 30px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.p-stat {
  padding: 22px 22px; border: 1px solid var(--p-line); border-radius: var(--p-r);
  background: var(--p-bg2);
}
.p-stat__num {
  font-family: 'Playfair Display', serif; font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 500; line-height: 1; color: var(--p-ink); letter-spacing: -0.02em;
}
.p-stat__num .acc { color: var(--acc); font-weight: 500; }
.p-stat__label { margin-top: 12px; font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--p-faint); }
.p-stat__desc { margin-top: 8px; font-size: 0.84rem; line-height: 1.55; color: var(--p-muted); }

/* ---- 章节 ---- */
.p-sec { padding: clamp(56px, 9vh, 110px) 0; border-top: 1px solid var(--p-line); }
.p-sec--soft { background: linear-gradient(180deg, var(--p-bg2), transparent); }
.p-sec__index {
  margin: 0 0 14px; font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--acc);
  display: inline-flex; align-items: center; gap: 10px;
}
.p-sec__index::before { content: ""; width: 26px; height: 1px; background: var(--acc); }
.p-h2 {
  margin: 0 0 18px; max-width: 780px;
  font-family: 'Playfair Display', serif; font-weight: 500; line-height: 1.15; letter-spacing: -0.015em;
  font-size: clamp(1.8rem, 4vw, 3rem); color: var(--p-ink); text-wrap: balance;
}
.p-h2 .acc { color: var(--acc); }
.p-lead2 { margin: 0 0 34px; max-width: 620px; font-size: 1rem; line-height: 1.75; color: var(--p-ink-dim); }

/* 排版文本（正文段） */
.p-prose p { margin: 0 0 18px; max-width: 720px; font-size: 1rem; line-height: 1.85; color: var(--p-ink-dim); }
.p-prose em { color: var(--p-ink); font-style: normal; font-weight: 700; }

/* 引用 */
.p-quote {
  margin: 0 0 26px; padding: clamp(24px, 4vw, 40px) clamp(24px, 4vw, 44px);
  border: 1px solid var(--p-line); border-left: 3px solid var(--acc);
  border-radius: var(--p-r); background: var(--p-bg2);
}
.p-quote .mark { font-family: 'Playfair Display', serif; font-size: 70px; line-height: .6; display: block; color: var(--acc); margin-bottom: 18px; }
.p-quote p:first-of-type { margin-top: 0; }
.p-quote__text { font-family: 'Playfair Display', serif; font-size: clamp(1.2rem, 2.4vw, 1.6rem); line-height: 1.5; color: var(--p-ink); letter-spacing: -0.01em; }
.p-quote__cite { margin-top: 18px; font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--p-faint); }

/* 双列（正文 + 引用 / 正文 + 侧栏） */
.p-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 820px) { .p-split { grid-template-columns: 1fr; } }

/* 三列卡片（愿景/方向） */
.p-cardgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 940px) { .p-cardgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .p-cardgrid { grid-template-columns: 1fr; } }
.p-card {
  padding: 26px 24px; border: 1px solid var(--p-line); border-radius: var(--p-r);
  background: var(--p-bg2); transition: transform .4s cubic-bezier(.2,.8,.2,1), border-color .3s ease, box-shadow .4s ease;
}
.p-card:hover { transform: translateY(-4px); border-color: var(--p-line-strong); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.p-card__num { font-family: 'Playfair Display', serif; font-style: normal; font-size: 1.6rem; font-weight: 500; color: var(--acc); letter-spacing: -0.02em; }
.p-card h3 { margin: 16px 0 8px; font-size: 1.08rem; font-weight: 800; color: var(--p-ink); }
.p-card p { margin: 0; font-size: 0.88rem; line-height: 1.7; color: var(--p-muted); }

/* 时间线 */
.p-timeline { position: relative; margin: 8px 0 0; padding-left: 30px; }
.p-timeline::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 1px; background: var(--p-line-strong); }
.p-step { position: relative; padding: 0 0 30px; }
.p-step:last-child { padding-bottom: 0; }
.p-step::before { content: ""; position: absolute; left: -27px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 3px var(--p-bg); }
.p-step__num { font-family: 'JetBrains Mono', monospace; font-size: 0.64rem; letter-spacing: 0.16em; color: var(--acc); text-transform: uppercase; }
.p-step h3 { margin: 6px 0 6px; font-size: 1.1rem; font-weight: 800; color: var(--p-ink); }
.p-step p { margin: 0; max-width: 720px; font-size: 0.94rem; line-height: 1.75; color: var(--p-muted); }

/* 技术清单 */
.p-techlist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 40px; }
@media (max-width: 720px) { .p-techlist { grid-template-columns: 1fr; } }
.p-techlist__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--p-line);
}
.p-techlist__name { font-size: 0.9rem; font-weight: 700; color: var(--p-ink); }
.p-techlist__value { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--acc); text-align: right; }

/* 技能胶囊 */
.p-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.p-chip { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--p-line-strong); font-size: 0.82rem; font-weight: 600; color: var(--p-ink-dim); transition: all .25s ease; }
.p-chip:hover { color: var(--p-ink); border-color: color-mix(in srgb, var(--acc) 60%, transparent); background: color-mix(in srgb, var(--acc) 12%, transparent); }

/* 数值区（影响/成果） */
.p-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 820px) { .p-stats { grid-template-columns: 1fr; } }
.p-stats .p-stat { background: transparent; }

/* 大叙述语句 */
.p-narrative {
  margin-top: 40px; padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--p-line); border-radius: var(--p-r);
  font-family: 'Playfair Display', serif; font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  line-height: 1.5; letter-spacing: -0.01em; color: var(--p-ink);
}
.p-narrative em { color: var(--acc); font-style: normal; }

/* 反思 文本 + 要点 */
.p-takeaways { padding: 28px 26px; border: 1px solid var(--p-line); border-radius: var(--p-r); background: var(--p-bg2); }
.p-takeaways h3 { margin: 0 0 18px; font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--p-faint); }
.p-takeaway { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--p-line); }
.p-takeaway:last-child { border-bottom: none; padding-bottom: 0; }
.p-takeaway__num { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--acc); flex-shrink: 0; }
.p-takeaway strong { display: block; font-size: 0.96rem; color: var(--p-ink); margin-bottom: 3px; }
.p-takeaway span { font-size: 0.86rem; line-height: 1.6; color: var(--p-muted); }

/* 图片：单图/双图/画廊 */
.p-fig { margin: 14px 0; border-radius: var(--p-r); overflow: hidden; border: 1px solid var(--p-line); position: relative; background: var(--p-bg2); }
.p-fig img { width: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.p-fig:hover img { transform: scale(1.03); }
.p-fig--hero img { max-height: 460px; }
.p-fig--med img { height: 320px; }
.p-fig--sm img { height: 220px; }
.p-fig figcaption { padding: 12px 16px; font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--p-muted); letter-spacing: 0.04em; border-top: 1px solid var(--p-line); }
.p-fig--med figcaption, .p-fig--sm figcaption { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(6,7,10,.86)); border-top: none; color: rgba(255,255,255,.85); padding: 26px 14px 10px; }
.p-figpair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .p-figpair { grid-template-columns: 1fr; } }
.p-figgal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 940px) { .p-figgal { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .p-figgal { grid-template-columns: 1fr; } }
.p-figgal .p-fig img { height: 210px; object-fit: cover; }

/* ---- 滚动渐显 ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .9s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.is-in { opacity: 1; transform: none; }

/* 尊重减少动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---- 移动端提示弹窗（可关闭） ---- */
/* 项目页沿用主题；页面正文正常加载，≤768px 显示居中小弹窗，点击「继续使用」关闭 */
.mobile-notice { display: none; }
@media (max-width: 768px) {
  .mobile-notice {
    display: flex; align-items: center; justify-content: center;
    position: fixed; inset: 0; z-index: 9999; padding: 24px;
    background: rgba(6, 8, 12, 0.55);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
  .mobile-notice__card {
    width: min(340px, 100%); box-sizing: border-box; padding: 30px 26px;
    display: flex; flex-direction: column; align-items: center; gap: 22px;
    text-align: center; background: #13161c; border: 1px solid #2a2d36;
    border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    font-family: inherit; animation: mobileNoteIn 0.35s ease;
  }
  .mobile-notice__text { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.55; color: #f2efe8; }
  .mobile-notice__btn {
    appearance: none; -webkit-appearance: none; border: 0; cursor: pointer;
    padding: 11px 30px; border-radius: 999px; font-size: .98rem; font-weight: 700;
    font-family: inherit; letter-spacing: .02em; color: #13161c; background: #f2efe8;
    transition: opacity .2s ease;
  }
  .mobile-notice__btn:active { opacity: .72; }
  @keyframes mobileNoteIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* ---- 项目页自定义光标：小圆圈 + 细环，无放大圈 ---- */
.cursor-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--p-ink, #f2efe8);
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 10000;
  transform: translate(-50%, -50%);
}
.cursor-expand { display: none; } /* 项目页不需要放大圈 */
.cursor-ring {
  width: 34px; height: 34px;
  border: 1.5px solid rgba(242, 239, 232, 0.28);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
}
@media (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* ---- 项目页内容保护：禁止选中文字、图片禁止选中/拖拽/下载 ---- */
body.page-proj {
  -webkit-user-select: none;
  user-select: none;
}
body.page-proj img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 精确指针设备：隐藏系统默认光标，使用自定义小圆圈光标 */
@media (pointer: fine) {
  body.page-proj,
  body.page-proj a,
  body.page-proj button { cursor: none !important; }
}