/* ============================================================
   PHZ.log — 白夜漫游
   深空低保真风格 · 双端适配 · 高交互版
   ============================================================ */

:root {
  --bg: #07080f;
  --ink: #ece9e2;
  --mut: #9aa0b4;
  --acc-v: #8b6cff;            /* 极光紫 */
  --acc-c: #3fd8d2;            /* 青 */
  --acc-o: #ff9a5a;            /* 暖橙 */
  --card: rgba(255, 255, 255, .045);
  --card-hi: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .12);
  --radius: 18px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-booting { overflow: hidden; }

.mono { font-family: var(--mono); letter-spacing: .06em; }

::selection { background: var(--acc-v); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2d42; border-radius: 5px; }

/* ============================================================
   斩切开屏 Loader（斜切裂开）
   ============================================================ */

.loader { position: fixed; inset: 0; z-index: 300; pointer-events: none; }

.loader__panel {
  position: absolute;
  left: 0;
  width: 100%;
  height: 51%;
  background: #04050b;
  transition: transform .85s cubic-bezier(.76, 0, .24, 1);
  will-change: transform;
}
/* 斜向斩缝：上板底边与下板顶边互补 */
.loader__panel--top {
  top: 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4vw), 0 100%);
}
.loader__panel--bottom {
  bottom: 0;
  clip-path: polygon(0 4vw, 100% 0, 100% 100%, 0 100%);
}
.loader.is-done .loader__panel--top    { transform: translateY(-110%); }
.loader.is-done .loader__panel--bottom { transform: translateY(110%); }

.loader__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 14px;
  transition: opacity .3s ease;
}
.loader.is-done .loader__center { opacity: 0; }

.loader__logo {
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 700;
  color: var(--ink);
}
.loader__logo span { color: var(--acc-c); }

.loader__status {
  font-size: 13px;
  color: var(--mut);
  letter-spacing: .25em;
}

/* ============================================================
   自定义磁力光标（仅桌面端创建）
   ============================================================ */

@media (pointer: fine) {
  body.has-cursor,
  body.has-cursor a,
  body.has-cursor button,
  body.has-cursor .card,
  body.has-cursor .chip { cursor: none; }
}

.cursor-dot {
  position: fixed;
  left: 0; top: 0;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  z-index: 210;
  pointer-events: none;
  mix-blend-mode: difference;
}

.cursor-ring {
  position: fixed;
  left: 0; top: 0;
  width: 36px; height: 36px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  z-index: 205;
  pointer-events: none;
  mix-blend-mode: difference;
  display: grid;
  place-items: center;
  transition: width .22s ease, height .22s ease,
              border-radius .22s ease, background-color .22s ease;
  will-change: transform;
}
.cursor-ring__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: #fff;
  opacity: 0;
  transition: opacity .2s;
}
/* 框选按钮模式 */
.cursor-ring.is-snap {
  background: rgba(255, 255, 255, .1);
  border-radius: 12px;
}
/* 卡片放大模式 */
.cursor-ring.is-big .cursor-ring__label { opacity: 1; }

/* ============================================================
   背景层
   ============================================================ */

#gl-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
}

body.no-webgl #gl-bg { display: none; }
body.no-webgl {
  background:
    radial-gradient(120% 90% at 20% 10%, #1b1440 0%, transparent 55%),
    radial-gradient(100% 80% at 85% 30%, #0b3038 0%, transparent 55%),
    radial-gradient(80% 60% at 60% 90%, #3a2118 0%, transparent 50%),
    var(--bg);
}

/* 噪点颗粒：低保真的灵魂 */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 60;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -8%); }
  30% { transform: translate(4%, 6%); }
  50% { transform: translate(-6%, 4%); }
  70% { transform: translate(6%, -5%); }
  90% { transform: translate(-3%, 7%); }
}

/* CRT 扫描线 */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 59;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 3px,
    rgba(255, 255, 255, .018) 3px 4px
  );
}

/* ============================================================
   导航
   ============================================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 56px);
  transition: background .35s, backdrop-filter .35s, border-color .35s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(7, 8, 15, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav__logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .02em;
}
.nav__logo span { color: var(--acc-c); }

.nav__links { display: flex; gap: clamp(18px, 3vw, 36px); }
.nav__links a {
  color: var(--mut);
  text-decoration: none;
  font-size: 15px;
  position: relative;
  transition: color .25s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--acc-c), var(--acc-v));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: 0;
  padding: 8px;
  z-index: 55;
}
.nav__burger span {
  width: 24px; height: 2px;
  background: var(--ink);
  transition: transform .3s;
}
.nav__burger.is-open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 0 24px 90px; /* 底部给 ticker 留位 */
}

.hero__inner { will-change: transform, opacity; }

/* 载入前隐藏，loader 斩切后 stagger 入场 */
.is-booting .hero__kicker,
.is-booting .hero__title,
.is-booting .hero__typed,
.is-booting .hero__cta { opacity: 0; }

.hero__kicker {
  font-size: clamp(11px, 1.4vw, 13px);
  color: var(--acc-c);
  letter-spacing: .35em;
  margin-bottom: 22px;
}
.is-loaded .hero__kicker { animation: fadeUp .9s .1s both; }

.hero__title {
  position: relative;
  font-size: clamp(56px, 12vw, 148px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: .04em;
  background: linear-gradient(115deg, #fff 20%, var(--acc-c) 45%, var(--acc-v) 70%, var(--acc-o) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.is-loaded .hero__title { animation: fadeUp .9s .28s both, hueFlow 10s linear infinite alternate; }
.hero__title em { font-style: normal; }
@keyframes hueFlow {
  from { background-position: 0% 0; }
  to   { background-position: 100% 0; }
}

/* --- glitch 故障切片（低保真的高光时刻） --- */
.hero__title::before,
.hero__title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  -webkit-text-fill-color: currentColor;
  background: none;
  opacity: 0;
  pointer-events: none;
}
.hero__title::before { color: var(--acc-c); }
.hero__title::after  { color: var(--acc-v); }
.is-glitch .hero__title::before { opacity: .8; animation: gl-a .38s steps(3) both; }
.is-glitch .hero__title::after  { opacity: .8; animation: gl-b .38s steps(3) both; }
@keyframes gl-a {
  0%   { transform: translate(0);        clip-path: inset(0 0 68% 0); }
  35%  { transform: translate(-7px, 2px); clip-path: inset(28% 0 32% 0); }
  70%  { transform: translate(5px, -2px); clip-path: inset(62% 0 6% 0); }
  100% { transform: translate(0);        clip-path: inset(0 0 100% 0); opacity: 0; }
}
@keyframes gl-b {
  0%   { transform: translate(0);        clip-path: inset(60% 0 0 0); }
  35%  { transform: translate(6px, -2px); clip-path: inset(10% 0 62% 0); }
  70%  { transform: translate(-5px, 2px); clip-path: inset(40% 0 28% 0); }
  100% { transform: translate(0);        clip-path: inset(100% 0 0 0); opacity: 0; }
}

.hero__typed {
  margin-top: 26px;
  min-height: 1.8em;
  font-size: clamp(14px, 2vw, 18px);
  color: var(--mut);
}
.hero__typed::before { content: "> "; color: var(--acc-c); }
.is-loaded .hero__typed { animation: fadeUp .9s .46s both; }

.caret { color: var(--acc-c); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__cta {
  margin-top: 44px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.is-loaded .hero__cta { animation: fadeUp .9s .62s both; }

.btn {
  display: inline-block;
  padding: 13px 34px;
  border-radius: 999px;
  font-size: 15px;
  text-decoration: none;
  color: #0a0b14;
  background: linear-gradient(90deg, var(--acc-c), var(--acc-v));
  font-weight: 600;
  will-change: transform;
  transition: box-shadow .25s;
}
.btn:hover { box-shadow: 0 12px 32px rgba(124, 108, 255, .35); }
.btn--ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.btn--ghost:hover { border-color: var(--acc-c); box-shadow: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- 兴趣跑马灯 --- */
.ticker {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 15, .5);
  backdrop-filter: blur(6px);
  overflow: hidden;
  padding: 14px 0;
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__track span {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .22em;
  color: var(--mut);
  white-space: nowrap;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ============================================================
   通用 Section
   ============================================================ */

.section {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(72px, 10vw, 130px) clamp(20px, 5vw, 48px);
}

.section__head { margin-bottom: 42px; }

.section__title {
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: .03em;
}
.section__en {
  display: block;
  font-size: 12px;
  color: var(--acc-c);
  letter-spacing: .4em;
  margin-top: 6px;
  font-weight: 400;
}
.section__sub { color: var(--mut); margin-top: 12px; }

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* SVG 波浪分隔线（点状正弦波） */
.wave-line {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 40px;
  opacity: .8;
}

/* ============================================================
   关于
   ============================================================ */

.about__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  margin-top: 8px;
}
.about__body p { color: var(--mut); font-size: 16px; margin-top: 18px; }

.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.facts li {
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  transition: border-color .25s, transform .25s;
}
.facts li:hover { border-color: var(--acc-c); transform: translateY(-2px); }

/* ASCII 乌鸫：CRT 荧光微闪 */
.ascii { text-align: center; user-select: none; }
.ascii pre {
  font-size: 15px;
  line-height: 1.3;
  color: var(--acc-c);
  opacity: .85;
  text-shadow: 0 0 14px rgba(63, 216, 210, .45);
  animation: crt 4s steps(2) infinite;
}
.ascii figcaption {
  margin-top: 12px;
  font-size: 10.5px;
  letter-spacing: .15em;
  color: var(--mut);
}
@keyframes crt {
  0%, 92% { opacity: .85; }
  94% { opacity: .5; }
  96%, 100% { opacity: .85; }
}

/* ============================================================
   日志卡片
   ============================================================ */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.chip {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mut);
  will-change: transform;
  transition: color .25s, border-color .25s, background-color .25s;
}
.chip:hover { color: var(--ink); border-color: var(--acc-c); }
.chip.is-active {
  color: #0a0b14;
  background: var(--acc-c);
  border-color: var(--acc-c);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1),
              border-color .35s, background .35s;
  transform-style: preserve-3d;
  will-change: transform;
  animation: cardIn .5s ease both;
}
/* 顶部高光线：玻璃拟态的棱 */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  z-index: 2;
  pointer-events: none;
}
.card:hover {
  border-color: rgba(139, 108, 255, .5);
  background: var(--card-hi);
}

.card__cover {
  height: 130px;
  display: flex;
  align-items: flex-end;
  padding: 16px 20px;
  background:
    radial-gradient(120% 140% at 15% 0%, hsl(var(--h) 80% 60% / .5), transparent 60%),
    radial-gradient(120% 160% at 90% 110%, hsl(calc(var(--h) + 60) 70% 55% / .35), transparent 55%),
    rgba(255, 255, 255, .02);
  border-bottom: 1px dashed var(--line);
}
.card__glyph {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 0 14px hsl(var(--h) 85% 60% / .55));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.card:hover .card__glyph { transform: translateY(-6px) rotate(-6deg) scale(1.08); }

.card__body { padding: 20px 22px 24px; }
.card__meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--acc-c);
  letter-spacing: .12em;
  margin-bottom: 10px;
}
.card__title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 10px;
  transition: color .25s;
}
.card:hover .card__title { color: var(--acc-c); }
.card__excerpt {
  font-size: 14px;
  color: var(--mut);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__more {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--acc-o);
  letter-spacing: .1em;
}

.card.is-hide { display: none; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   实验室
   ============================================================ */

.section--lab {
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(10, 12, 24, .55);
  backdrop-filter: blur(8px);
}
#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: .8;
}
.section--lab > *:not(#particles) { position: relative; z-index: 1; }

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.lab-card {
  padding: 26px 24px;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  background: rgba(7, 8, 15, .55);
  transition: transform .3s, border-color .3s;
}
.lab-card:hover {
  transform: translateY(-6px);
  border-color: var(--acc-o);
}
.lab-card__tag {
  display: inline-block;
  font-size: 11px;
  color: var(--acc-o);
  border: 1px solid rgba(255, 154, 90, .4);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
  letter-spacing: .15em;
}
.lab-card h3 { font-size: 18px; margin-bottom: 10px; }
.lab-card p { font-size: 14px; color: var(--mut); }
.lab-card__status {
  display: block;
  margin-top: 16px;
  font-size: 11px;
  color: var(--acc-c);
  letter-spacing: .15em;
}

/* ============================================================
   页脚
   ============================================================ */

.footer {
  border-top: 1px solid var(--line);
  padding: 0 24px 44px;
  text-align: center;
  color: var(--mut);
  font-size: 13.5px;
}
.footer .wave-line { max-width: 640px; margin: 10px auto 26px; }
.footer__en {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: .25em;
  color: #565b70;
}

/* ============================================================
   文章弹窗
   ============================================================ */

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 10, .7);
  backdrop-filter: blur(8px);
  animation: fadeIn .3s;
}
.modal__card {
  position: relative;
  width: min(680px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #0d0f1c;
  padding: clamp(26px, 5vw, 46px);
  animation: popIn .35s cubic-bezier(.2, .9, .3, 1.2);
}
/* 内层虚线框：低保真便签感 */
.modal__card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(255, 255, 255, .08);
  border-radius: 14px;
  pointer-events: none;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.modal__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mut);
  font-size: 14px;
  transition: color .25s, border-color .25s, transform .25s;
  z-index: 2;
}
.modal__close:hover { color: var(--ink); border-color: var(--acc-o); transform: rotate(90deg); }
.modal__meta { font-size: 12px; color: var(--acc-c); letter-spacing: .15em; }
.modal__title { font-size: clamp(22px, 4vw, 30px); margin: 12px 0 18px; line-height: 1.4; }
.modal__content p { color: var(--mut); font-size: 15px; margin-bottom: 14px; }
.modal__content p:last-child { margin-bottom: 0; }

body.is-locked { overflow: hidden; }

/* ============================================================
   在做项目（Projects）
   ============================================================ */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  margin-top: 8px;
}

.project {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 26px 26px 22px;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1),
              border-color .35s, background .35s;
}
/* 顶部高光线 */
.project::before {
  content: "";
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  pointer-events: none;
}
/* 每个项目左侧色条作身份色 */
.project::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--proj-color, var(--acc-c));
  opacity: .8;
}
.project:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 108, 255, .45);
  background: var(--card-hi);
}

.project:nth-child(1) { --proj-color: #8b6cff; }  /* 紫 - 视频 */
.project:nth-child(2) { --proj-color: #3fd8d2; }  /* 青 - Anki */
.project:nth-child(3) { --proj-color: #ff9a5a; }  /* 橙 - 大学 */

.project__head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .15em;
  margin-bottom: 14px;
}
.project__num { color: var(--proj-color); font-weight: 700; }
.project__cat {
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid currentColor;
  color: var(--proj-color);
}
.project__status {
  margin-left: auto;
  color: var(--mut);
  font-size: 10.5px;
  letter-spacing: .12em;
}

.project__title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 10px;
}
.project__desc {
  color: var(--mut);
  font-size: 14px;
  margin-bottom: 16px;
}

/* 视频项目的四组流水线 */
.project__groups {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: rgba(0, 0, 0, .25);
}
.project__groups li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.project__groups b {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--proj-color);
  letter-spacing: .12em;
  font-weight: 700;
}
.project__groups span {
  font-size: 12px;
  color: var(--mut);
  line-height: 1.45;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.project__tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  color: var(--ink);
  letter-spacing: .08em;
}

.project__progress {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  overflow: hidden;
}
.project__progress-bar {
  position: absolute;
  inset: 1px auto 1px 1px;
  width: var(--p, 0);
  background: linear-gradient(90deg, var(--proj-color), transparent 140%);
  opacity: .85;
  transition: width 1.2s cubic-bezier(.2, .8, .2, 1);
}
.project__progress-bar--pending {
  background: repeating-linear-gradient(
    45deg,
    var(--proj-color) 0 8px,
    transparent 8px 16px
  );
  opacity: .35;
}
.project__progress-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  color: var(--ink);
  letter-spacing: .2em;
  text-shadow: 0 0 6px rgba(0, 0, 0, .8);
}

/* 下载按钮 */
.btn--app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 11px 26px;
  border-radius: 10px;
  font-size: 14px;
  text-decoration: none;
  color: #0a0b14;
  background: linear-gradient(90deg, var(--acc-o), var(--acc-v));
  font-weight: 700;
  transition: transform .25s, box-shadow .25s;
}
.btn--app:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(255, 154, 90, .35);
}
.btn--app__icon { font-size: 15px; }

/* ============================================================
   AI 助手
   ============================================================ */

.ai {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 75;
}

.ai__fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(13, 15, 28, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--acc-c);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  transition: transform .3s, border-color .3s, color .3s;
}
.ai__fab:hover { transform: scale(1.08); border-color: var(--acc-c); color: var(--ink); }
.ai__fab.is-open { color: var(--acc-o); border-color: var(--acc-o); }
.ai__fab-icon { width: 26px; height: 26px; }

/* 关键：面板直接用 fixed 定位视口，不依赖容器尺寸；
   且 [hidden] 必须优先于 display:flex，否则面板不受开关控制 */
.ai__panel {
  position: fixed;
  right: 44px;
  bottom: 118px;
  z-index: 76;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, rgba(20, 22, 31, .97), rgba(10, 11, 20, .97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 18px 50px rgba(0, 0, 0, .6);
  overflow: hidden;
  animation: popIn .28s cubic-bezier(.2, .9, .3, 1.2);
}
.ai__panel[hidden] { display: none !important; }

.ai__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #1c1f2e, #14161f);
  flex: none;
}
.ai__name { font-size: 14px; font-weight: 700; color: var(--ink); }
.ai__status {
  font-size: 10px;
  color: var(--mut);
  letter-spacing: .15em;
  margin-top: 2px;
}
.ai__dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--acc-c);
  margin-right: 5px;
  animation: aiPulse 2s ease-in-out infinite;
}
@keyframes aiPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(63, 216, 210, .5); }
  50%      { box-shadow: 0 0 0 5px rgba(63, 216, 210, 0); }
}

.ai__close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mut);
  font-size: 12px;
  cursor: pointer;
  transition: color .25s, border-color .25s, transform .25s;
  flex: none;
}
.ai__close:hover { color: var(--ink); border-color: var(--acc-o); transform: rotate(90deg); }

/* 消息区：flex:1 + min-height:0 保证可滚动 */
.ai__msg {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai__row { display: flex; }
.ai__row--user { justify-content: flex-end; }
.ai__row--ai { justify-content: flex-start; }

.ai__bubble {
  max-width: 82%;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  border-radius: 14px;
  word-break: break-word;
  white-space: pre-wrap;
  animation: cardIn .3s ease both;
}
.ai__row--ai .ai__bubble {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  color: var(--ink);
}
.ai__row--user .ai__bubble {
  background: linear-gradient(135deg, var(--acc-c), var(--acc-v));
  color: #0a0b14;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

/* 气泡内 Markdown 富文本（对齐秘塔 AI 的渲染体验） */
.ai__bubble p { margin: 6px 0; }
.ai__bubble p:first-child { margin-top: 0; }
.ai__bubble p:last-child { margin-bottom: 0; }
.ai__bubble strong { color: var(--acc-c); font-weight: 700; }
.ai__bubble em { font-style: italic; opacity: .92; }
.ai__bubble a { color: var(--acc-c); text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }
.ai__bubble ul, .ai__bubble ol { margin: 6px 0; padding-left: 20px; }
.ai__bubble li { margin: 3px 0; }
.ai__bubble li::marker { color: var(--acc-c); }
.ai__bubble code {
  font-family: var(--mono);
  font-size: .88em;
  background: rgba(63, 216, 210, .1);
  border: 1px solid rgba(63, 216, 210, .25);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--acc-c);
  word-break: break-all;
}
.ai__bubble pre {
  background: rgba(0, 0, 0, .45);
  border: 1px solid var(--line);
  border-left: 3px solid var(--acc-v);
  border-radius: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  margin: 8px 0;
}
.ai__bubble pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
}
.ai__row--user .ai__bubble code,
.ai__row--user .ai__bubble pre { display: none; } /* 用户消息不渲染富文本 */

/* 打字指示器 */
.ai__typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.ai__typing i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--acc-c);
  animation: aiBounce 1.2s ease-in-out infinite;
}
.ai__typing i:nth-child(2) { animation-delay: .15s; }
.ai__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* 快捷问题 */
.ai__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0 4px;
  flex: none;
}
.ai__chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed rgba(139, 108, 255, .5);
  background: rgba(139, 108, 255, .06);
  color: var(--ink);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.ai__chip:hover { background: rgba(139, 108, 255, .14); border-color: var(--acc-v); transform: translateY(-1px); }

/* 输入区 */
.ai__form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  flex: none;
}
.ai__input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  font-size: 13.5px;
  font-family: var(--font);
  outline: none;
  transition: border-color .25s;
}
.ai__input::placeholder { color: #565b70; }
.ai__input:focus { border-color: var(--acc-c); }

.ai__send {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--acc-c), var(--acc-v));
  color: #0a0b14;
  font-size: 15px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.ai__send:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(124, 108, 255, .4); }

@media (max-width: 768px) {
  .ai__panel {
    right: 34px;
    bottom: 100px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 100px);
  }
  .ai { right: 12px; }
  .lofi { right: 76px; }
}

/* ============================================================
   lo-fi 磁带播放器
   ============================================================ */

.lofi {
  position: fixed;
  right: 84px;
  bottom: clamp(16px, 3vw, 28px);
  z-index: 70;
}
/* 保险：hidden 必须生效 */
.lofi__player[hidden] { display: none !important; }

/* --- 浮动小按钮 --- */
.lofi__fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(13, 15, 28, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--acc-c);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  transition: transform .3s, border-color .3s, color .3s;
}
.lofi__fab:hover { transform: scale(1.08); border-color: var(--acc-c); color: var(--ink); }
.lofi__fab.is-open { color: var(--acc-o); border-color: var(--acc-o); }
.lofi__fab-icon { width: 26px; height: 26px; }

/* --- 磁带主体 --- */
.lofi__player {
  position: fixed;
  right: 16px;
  bottom: 88px;
  z-index: 70;
  width: min(320px, calc(100vw - 32px));
  padding: 14px 18px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, #14161f 0%, #0a0b14 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 -1px 0 rgba(0, 0, 0, .5),
    0 18px 50px rgba(0, 0, 0, .6);
  animation: popIn .28s cubic-bezier(.2, .9, .3, 1.2);
}

.lofi__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: .2em;
  margin: -14px -18px 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #1c1f2e, #14161f);
  border-bottom: 1px solid var(--line);
}
.lofi__win-close {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mut);
  font-size: 11px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.lofi__win-close:hover { color: var(--ink); border-color: var(--acc-o); background: rgba(255, 154, 90, .1); }
.lofi__btn--up {
  color: var(--acc-o);
  border-color: rgba(255, 154, 90, .4);
}
.lofi__btn--up:hover { border-color: var(--acc-o); color: var(--acc-o); }
.lofi__track-badge {
  margin-left: auto;
  font-size: 9px;
  color: var(--acc-o);
  border: 1px solid rgba(255, 154, 90, .35);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: .1em;
}

/* 外链播放器（网易云 iframe） */
.lofi__embed {
  margin-top: 12px;
}
.lofi__embed[hidden] { display: none !important; }
.lofi__embed iframe {
  display: block;
  width: 100%;
  height: 430px;
  border: 0;
  border-radius: 10px;
  background: #0a0b14;
}
.lofi__tape[hidden] { display: none !important; }
.lofi__label { color: var(--acc-c); }
.lofi__status { color: var(--acc-o); }

/* --- 频谱 --- */
.lofi__viz {
  display: block;
  width: 100%;
  height: 56px;
  margin: 12px 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--line);
}

/* --- 曲目信息 --- */
.lofi__info { text-align: center; margin-bottom: 14px; }
.lofi__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lofi__artist {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mut);
  margin-top: 2px;
  letter-spacing: .12em;
}

/* --- 磁带轮 --- */
.lofi__wheels {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 4px 0 14px;
  gap: 12px;
}
.lofi__wheel {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1d2a, #0a0b14);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .7);
}
.lofi__wheel-inner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 7px, #2a2d40 7px, #2a2d40 9px, transparent 9px),
    repeating-conic-gradient(#1a1d2a 0deg 30deg, #2a2d40 30deg 60deg);
}
.is-playing .lofi__wheel-inner { animation: spin 2.5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- 进度条 --- */
.lofi__progress {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
  margin-bottom: 14px;
}
.lofi__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--acc-c), var(--acc-v));
  transition: width .25s linear;
}

/* --- 控制按钮 --- */
.lofi__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.lofi__btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  transition: transform .2s, border-color .2s, color .2s;
}
.lofi__btn:hover { border-color: var(--acc-c); color: var(--acc-c); transform: scale(1.06); }
.lofi__btn--play {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--acc-c), var(--acc-v));
  color: #0a0b14;
  border: 0;
  font-size: 16px;
}
.lofi__btn--play:hover { color: #0a0b14; border: 0; }

/* --- 音量条 --- */
.lofi__volume {
  flex: 1;
  max-width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .1);
  outline: none;
  cursor: pointer;
}
.lofi__volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--acc-c);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(63, 216, 210, .5);
}
.lofi__volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--acc-c);
  cursor: pointer;
  border: 0;
}

/* --- 曲目列表 --- */
.lofi__tracklist {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lofi__track {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--mut);
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  transition: background .2s, color .2s;
  width: 100%;
}
.lofi__track:hover { background: rgba(255, 255, 255, .04); color: var(--ink); }
.lofi__track.is-cur { color: var(--acc-c); background: rgba(63, 216, 210, .08); }
.lofi__track-num {
  font-size: 10px;
  opacity: .65;
  min-width: 22px;
}

/* --- 移动端 --- */
@media (max-width: 768px) {
  .lofi__player {
    right: 12px;
    bottom: 64px;
    width: min(300px, calc(100vw - 24px));
    padding: 14px;
  }
  .lofi__wheel { width: 44px; height: 44px; }
  .lofi__wheel-inner { width: 26px; height: 26px; }
  .lofi__btn { width: 32px; height: 32px; font-size: 12px; }
  .lofi__btn--play { width: 42px; height: 42px; }
}

/* ============================================================
   移动端适配（≤768px）
   ============================================================ */

@media (max-width: 768px) {
  .nav { padding: 14px 20px; }

  .nav__burger { display: flex; }

  .nav__links {
    position: fixed;
    inset: 0;
    z-index: 52;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 34px;
    background: rgba(7, 8, 15, .96);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s;
  }
  .nav__links.is-open { opacity: 1; pointer-events: auto; }
  .nav__links a { font-size: 22px; color: var(--ink); }

  .hero { padding-bottom: 76px; }
  .hero__cta .btn { padding: 12px 28px; font-size: 14px; }

  .about__grid { grid-template-columns: 1fr; }
  .ascii { order: -1; }
  .ascii pre { font-size: 13px; }

  .projects { grid-template-columns: 1fr; gap: 16px; }
  .project { padding: 22px 20px 18px; }
  .project__groups { grid-template-columns: 1fr; }
  .project__title { font-size: 20px; }

  .grid { grid-template-columns: 1fr; gap: 16px; }
  .card__cover { height: 108px; }

  .section--lab { border-radius: 20px; }

  .facts li { font-size: 12px; padding: 7px 13px; }

  .modal { padding: 12px; }
  .modal__card { max-height: 88vh; }

  .card { transition: border-color .3s, background .3s; }
}

/* 尊重系统减弱动效设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .is-booting .hero__kicker,
  .is-booting .hero__title,
  .is-booting .hero__typed,
  .is-booting .hero__cta { opacity: 1; }
  .ticker__track { animation: none; }}
