/* ============================================================
   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.theme-gamebook { --acc: #7fd6c2; }

/* ---- 基础 ---- */
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%);
}

/* ---- 顶栏：品牌 + 横排项目切换 + 返回主页（移除左侧切换 Logo） ---- */
.p-top {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  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-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--p-ink); white-space: nowrap;
}
.p-brand span { color: var(--acc); }
.p-menu {
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none; padding: 2px;
}
.p-menu::-webkit-scrollbar { display: none; }
.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 {
  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; }

/* 占位（无图资源时） */
.p-ph { display: grid; place-items: center; min-height: 220px; border: 1px dashed var(--p-line-strong); border-radius: var(--p-r); font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--p-faint); }

/* ---- 页脚 ---- */
.p-foot { border-top: 1px solid var(--p-line); padding: 40px var(--p-gutter) 56px; text-align: center; }
.p-foot .mark { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--p-ink); }
.p-foot .mark span { color: var(--acc); }
.p-foot .meta { margin-top: 8px; font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; letter-spacing: 0.1em; color: var(--p-faint); }
.p-foot .nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 22px; font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; letter-spacing: 0.05em; color: var(--p-muted); }
.p-foot .nav a { transition: color .2s ease; }
.p-foot .nav a:hover, .p-foot .nav a.is-active { color: var(--acc); }

/* ---- 滚动渐显 ---- */
.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; }
}

/* 移动端提示遮罩由 styles.css 控制（本页不引入 styles.css，单独兜底） */
.mobile-notice { display: none; }
@media (max-width: 768px) {
  .mobile-notice {
    display: grid; place-items: center; position: fixed; inset: 0; z-index: 9999;
    background: #090a0d; color: #f2efe8; text-align: center; padding: 24px;
  }
  .mobile-notice__title { margin: 0 0 8px; font-size: 1.3rem; }
  .mobile-notice__sub { color: #8a90a1; font-size: 0.9rem; }
  .mobile-notice__inner > * { max-width: 320px; margin-inline: auto; }
  .mobile-notice__mark { font-size: 2rem; margin-bottom: 14px; }
  .mobile-notice__kicker { letter-spacing: .2em; text-transform: uppercase; font-size: .7rem; color: #8a90a1; margin-bottom: 10px; }
  .mobile-notice__line { height: 1px; background: #2a2d36; width: 44px; margin: 0 auto 16px; }
  .page-proj main, .page-proj .p-top, .page-proj .p-foot { display: none; }
}