/* ============================================================
   PANGHU AI · 胖虎智能系统工场
   深空暗主题 · 玻璃拟态 · 青紫品红渐变
   ============================================================ */

:root {
  /* 背景层 */
  --bg: #05060a;
  --bg-soft: #0a0c14;
  --bg-card: rgba(18, 21, 33, 0.55);

  /* AI 主色 */
  --cyan: #22d3ee;
  --purple: #7c3aed;
  --magenta: #e11d8f;
  --grad: linear-gradient(120deg, #22d3ee 0%, #7c3aed 52%, #e11d8f 100%);
  --grad-soft: linear-gradient(120deg, rgba(34, 211, 238, 0.16), rgba(124, 58, 237, 0.16), rgba(225, 29, 143, 0.16));

  /* 文字 */
  --text: #eef1f8;
  --text-dim: #99a1b8;
  --text-faint: #5b6178;

  /* 描边 */
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1180px;

  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Sora", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;

  /* 背景径向光晕（暗色） */
  --halo-1: rgba(34, 211, 238, 0.10);
  --halo-2: rgba(225, 29, 143, 0.10);
  --halo-3: rgba(124, 58, 237, 0.12);

  /* 组件杂项（暗色） */
  --nav-bg: rgba(5, 6, 10, 0.72);
  --footer-bg: rgba(5, 6, 10, 0.6);
  --surface-1: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.04);
  --grid-line: rgba(255, 255, 255, 0.022);
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.4);
  --cursor-glow: rgba(124, 58, 237, 0.14);
}

/* ---------- 浅色主题 ---------- */
:root[data-theme="light"] {
  --bg: #f5f7fc;
  --bg-soft: #eef1f8;
  --bg-card: rgba(255, 255, 255, 0.72);

  --purple: #6d28d9;
  --magenta: #c81c81;
  --grad: linear-gradient(120deg, #0891b2 0%, #6d28d9 52%, #c81c81 100%);
  --grad-soft: linear-gradient(120deg, rgba(8, 145, 178, 0.12), rgba(109, 40, 217, 0.12), rgba(200, 28, 129, 0.12));

  --text: #131725;
  --text-dim: #4a5268;
  --text-faint: #8a91a6;

  --line: rgba(15, 23, 42, 0.10);
  --line-strong: rgba(15, 23, 42, 0.18);

  --halo-1: rgba(8, 145, 178, 0.12);
  --halo-2: rgba(200, 28, 129, 0.10);
  --halo-3: rgba(109, 40, 217, 0.12);

  --nav-bg: rgba(245, 247, 252, 0.78);
  --footer-bg: rgba(238, 241, 248, 0.7);
  --surface-1: rgba(15, 23, 42, 0.03);
  --surface-2: rgba(15, 23, 42, 0.04);
  --grid-line: rgba(15, 23, 42, 0.03);
  --shadow-card: 0 18px 44px rgba(31, 41, 84, 0.12);
  --cursor-glow: rgba(109, 40, 217, 0.10);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
  transition: background 0.4s ease, color 0.4s ease;
}

/* 背景径向光晕 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 50% at 15% 0%, var(--halo-1), transparent 60%),
    radial-gradient(55% 45% at 90% 10%, var(--halo-2), transparent 60%),
    radial-gradient(70% 60% at 50% 100%, var(--halo-3), transparent 65%);
  z-index: -3;
  pointer-events: none;
  transition: background 0.4s ease;
}

/* 神经网络 canvas */
#neural-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* 网格叠加 */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 90%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black, transparent 90%);
}

/* 光标跟随光晕 */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cursor-glow), transparent 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s;
  opacity: 0;
  will-change: transform;
}

/* ---------- 通用 ---------- */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: gradflow 6s linear infinite;
}
@keyframes gradflow {
  to { background-position: 200% center; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s, border-color 0.25s;
  position: relative;
}
.btn__arrow { transition: transform 0.25s; }
.btn:hover .btn__arrow { transform: translateX(3px); }

.btn--primary {
  background: var(--grad);
  background-size: 180% auto;
  color: #fff;
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.35);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(225, 29, 143, 0.45);
  background-position: right center;
}

.btn--ghost {
  background: var(--surface-1);
  border-color: var(--line-strong);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 3rem);
  transition: background 0.3s, border-color 0.3s, padding 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}
.nav__logo {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--grad);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.5);
}
.nav__logo-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.nav__name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--text);
}
.nav__name-ai {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: 0.15em;
}

.nav__links {
  display: flex;
  gap: 2rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav__links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--grad);
  transition: width 0.25s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

.nav__cta { font-size: 0.82rem; padding: 0.6em 1.1em; }

.nav__right { display: flex; align-items: center; gap: 0.8rem; }

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
  backdrop-filter: blur(8px);
  color: var(--text-dim);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: color 0.25s, border-color 0.25s, transform 0.25s;
}
.theme-toggle:hover { color: var(--cyan); border-color: var(--cyan); transform: translateY(-1px); }
.theme-toggle__icon {
  position: absolute;
  display: grid;
  place-items: center;
  transition: opacity 0.3s, transform 0.4s;
}
.theme-toggle__icon svg { width: 18px; height: 18px; }
/* 暗色主题：显示太阳（可切到浅色）；浅色主题：显示月亮 */
.theme-toggle__icon--sun { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle__icon--moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
:root[data-theme="light"] .theme-toggle__icon--sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
:root[data-theme="light"] .theme-toggle__icon--moon { opacity: 1; transform: rotate(0) scale(1); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem clamp(1.2rem, 4vw, 3rem) 4rem;
  position: relative;
}
.hero__inner {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}
.hero__badge-pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 1.8s ease-in-out infinite;
}

.hero__title {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1.6rem;
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-dim);
  min-height: 1.8em;
  margin-bottom: 2.6rem;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--cyan);
  margin-left: 3px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 3.5rem;
}

.hero__stats {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 4vw, 2.8rem);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.stat__num {
  font-family: var(--mono);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.stat__num--infinite { font-size: clamp(2rem, 4.5vw, 3rem); }
.stat__label {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-family: var(--mono);
  letter-spacing: 0.03em;
}
.stat__divider { width: 1px; height: 34px; background: var(--line-strong); }

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-faint);
}
.hero__scroll-mouse {
  width: 22px; height: 36px;
  border: 2px solid var(--line-strong);
  border-radius: 12px;
  position: relative;
}
.hero__scroll-mouse::after {
  content: "";
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 7px;
  border-radius: 2px;
  background: var(--cyan);
  animation: scrolldot 1.6s ease-in-out infinite;
}
@keyframes scrolldot {
  0% { opacity: 0; transform: translate(-50%, 0); }
  40% { opacity: 1; }
  80% { opacity: 0; transform: translate(-50%, 12px); }
  100% { opacity: 0; }
}
.hero__scroll-text {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
}

/* ---------- 理念 ---------- */
.philosophy {
  padding: clamp(4rem, 9vw, 8rem) clamp(1.2rem, 4vw, 3rem);
  max-width: var(--maxw);
  margin: 0 auto;
}
.philosophy__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.ethos {
  padding: 2.2rem 1.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
}
.ethos::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}
.ethos:hover { transform: translateY(-5px); border-color: var(--line-strong); }
.ethos:hover::before { transform: scaleX(1); }
.ethos__index {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}
.ethos__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0.7rem 0 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ethos__title span {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--cyan);
  letter-spacing: 0.05em;
}
.ethos__desc { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- 区块标题 ---------- */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3.2rem; }
.section-head__eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
}
.section-head__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.6rem 0 0.9rem;
}
.section-head__sub { color: var(--text-dim); font-size: 1rem; }

/* ---------- 系统矩阵 ---------- */
.systems {
  padding: clamp(3rem, 7vw, 6rem) clamp(1.2rem, 4vw, 3rem);
  max-width: var(--maxw);
  margin: 0 auto;
}
.systems__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.sys-card {
  position: relative;
  padding: 2rem 1.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  transform-style: preserve-3d;
}
/* hover 光晕跟随（由 JS 设置 --mx/--my） */
.sys-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), rgba(124, 58, 237, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.sys-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-card); }
.sys-card:hover::before { opacity: 1; }
.sys-card--live:hover { border-color: rgba(34, 211, 238, 0.4); }

.sys-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sys-card__icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
  color: var(--cyan);
}
.sys-card__icon svg { width: 22px; height: 22px; }

.sys-card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
}
.sys-card__status-dot { width: 7px; height: 7px; border-radius: 50%; }
.sys-card--live .sys-card__status { color: var(--cyan); border-color: rgba(34, 211, 238, 0.35); }
.sys-card--live .sys-card__status-dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 1.8s infinite; }
.sys-card--building .sys-card__status { color: #f0b23a; border-color: rgba(240, 178, 58, 0.3); }
.sys-card--building .sys-card__status-dot { background: #f0b23a; }

.sys-card__name { display: flex; flex-direction: column; gap: 0.15rem; }
.sys-card__name-zh { font-size: 1.3rem; font-weight: 700; }
.sys-card__name-en { font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); letter-spacing: 0.05em; }
.sys-card__desc { color: var(--text-dim); font-size: 0.92rem; flex-grow: 1; }

.sys-card__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sys-card__tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.28rem 0.6rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
}

.sys-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--cyan);
  margin-top: 0.4rem;
  transition: gap 0.25s;
}
.sys-card__link:hover { gap: 0.7rem; }
.sys-card__link--disabled { color: var(--text-faint); cursor: default; pointer-events: none; }

/* ---------- 关于 ---------- */
.about {
  padding: clamp(4rem, 9vw, 8rem) clamp(1.2rem, 4vw, 3rem);
  max-width: var(--maxw);
  margin: 0 auto;
}
.about__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: clamp(2rem, 4vw, 3.4rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}
.about__inner::after {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(225, 29, 143, 0.14), transparent 65%);
  pointer-events: none;
}
.about .section-head__title { margin-top: 0.5rem; text-align: left; }
.about__desc { color: var(--text-dim); font-size: 1rem; margin-top: 1rem; }
.about__desc--dim { color: var(--text-faint); font-size: 0.9rem; font-family: var(--mono); }

.about__stack-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
}
.stack-list { list-style: none; margin-top: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.stack-list li {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.9rem;
}
.stack-list li span {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  min-width: 92px;
  font-weight: 500;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2.6rem clamp(1.2rem, 4vw, 3rem);
  background: var(--footer-bg);
  backdrop-filter: blur(10px);
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.4rem;
}
.footer__brand { display: flex; flex-direction: column; gap: 0.3rem; }
.footer__tagline { color: var(--text-faint); font-size: 0.82rem; }
.footer__beian { display: flex; flex-direction: column; gap: 0.3rem; text-align: center; }
.footer__beian a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--mono);
  transition: color 0.2s;
}
.footer__beian a:hover { color: var(--cyan); }
.footer__beian-note { color: var(--text-faint); font-size: 0.72rem; font-family: var(--mono); }
.footer__copy { color: var(--text-faint); font-size: 0.82rem; font-family: var(--mono); }

/* ---------- 进场动画 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .philosophy__grid { grid-template-columns: 1fr; }
  .about__inner { grid-template-columns: 1fr; gap: 2rem; }
  .about .section-head__title { text-align: left; }
}
@media (max-width: 560px) {
  .hero__stats { gap: 1rem; }
  .stat__divider { display: none; }
  .nav__cta { display: none; }
  .hero__actions { flex-direction: column; width: 100%; }
  .hero__actions .btn { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
