/* =========================================================
   Charles · 个人数字名片  —  样式表
   主题色 / 间距等可在 :root 变量中统一调整
   ========================================================= */

:root {
  /* 主色与背景 */
  --bg:            #05060a;
  --bg-soft:       #0a0c14;
  --text:          #e8ecf5;
  --text-dim:      #9aa3b8;
  --text-faint:    #5c6480;

  /* 强调渐变（蓝紫 + 青色光效） */
  --accent-1:      #6d5dfc;   /* 紫 */
  --accent-2:      #34d3ff;   /* 青 */
  --accent-3:      #b06bff;   /* 品红紫 */
  --grad:          linear-gradient(120deg, var(--accent-1), var(--accent-2));
  --grad-soft:     linear-gradient(120deg, rgba(109,93,252,.5), rgba(52,211,255,.5));

  /* 玻璃卡片 */
  --glass-bg:      rgba(18, 21, 34, 0.55);
  --glass-border:  rgba(255, 255, 255, 0.10);

  /* 圆角与阴影 */
  --radius:        22px;
  --shadow:        0 30px 70px -20px rgba(0, 0, 0, 0.65);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC',
          'Microsoft YaHei', sans-serif;
}

/* ---------------- 基础重置 ---------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;              /* 由 JS 整屏翻页接管滚动 */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { text-decoration: none; color: inherit; }

img { display: block; max-width: 100%; }

/* ============ 页面加载淡入 ============ */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.9s ease;
}
body.loaded .page-loader { opacity: 0; }

/* ============ 鼠标跟随光点（桌面端） ============ */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52,211,255,.9), rgba(109,93,252,.35) 60%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9000;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .3s ease, width .2s ease, height .2s ease;
  will-change: transform;
}
.cursor-glow.active { opacity: 1; }
.cursor-glow.grow { width: 54px; height: 54px; }

/* 触摸设备 / 无鼠标时隐藏 */
@media (hover: none), (pointer: coarse) {
  .cursor-glow { display: none; }
}

/* =========================================================
   整屏翻页系统（强吸附丝滑翻页）
   .fullpage 垂直平移，每个 .page 占满一屏；
   翻页时离场页内容下移淡出、入场页内容上滑淡入
   ========================================================= */
.fullpage {
  position: relative;
  z-index: 1;                                            /* 浮在固定背景之上 */
  height: 100svh;
  transition: transform 1s cubic-bezier(.86, 0, .07, 1);  /* 丝滑缓动 */
  will-change: transform;
}
.page {
  position: relative;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}

/* 每屏内容容器：默认下移+淡出，激活时归位 */
.page__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  opacity: 0;
  transform: translateY(48px);
  transition: opacity .9s ease, transform 1s cubic-bezier(.2,.8,.2,1);
  transition-delay: 0s;
}
.page.is-active .page__inner {
  opacity: 1;
  transform: none;
  transition-delay: .35s;       /* 等翻页动作过半再浮现，更有层次 */
}
/* 已翻过去（在上方）的页，内容上移淡出 */
.page.is-past .page__inner {
  opacity: 0;
  transform: translateY(-48px);
}

/* =========================================================
   全局连续背景（固定全屏，不随翻页移动 → 背景无缝连续）
   ========================================================= */
.bg-fixed {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(109,93,252,.22), transparent 60%),
    radial-gradient(900px 500px at 20% 110%, rgba(52,211,255,.18), transparent 60%),
    var(--bg);
}

/* =========================================================
   第一屏 HERO
   ========================================================= */
.hero { background: transparent; }

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* 光晕渐变层（缓慢呼吸 + 漂移） */
.hero-aura {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 40% at 30% 35%, rgba(176,107,255,.30), transparent 60%),
    radial-gradient(45% 45% at 75% 60%, rgba(52,211,255,.22), transparent 60%);
  filter: blur(20px);
  animation: auraFloat 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes auraFloat {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
  100% { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

/* 网格叠加层（科技感） */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 75%);
  pointer-events: none;
}

.hero-content {
  text-align: center;
  padding: 0 24px;
}

.hero-eyebrow {
  margin: 0 0 18px;
  font-size: clamp(.7rem, 1.4vw, .82rem);
  letter-spacing: .42em;
  font-weight: 500;
  color: var(--text-faint);
  text-indent: .42em;
}

.hero-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.gradient-text {
  /* 静态渐变色（不再横向流动） */
  background: linear-gradient(120deg, var(--accent-2), var(--accent-3) 50%, var(--accent-1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* 缓慢呼吸的光晕（仅辉光强弱变化，不位移、不变色循环） */
  animation: glowPulse 5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(52, 211, 255, .25)); }
  50%      { filter: drop-shadow(0 0 26px rgba(109, 93, 252, .55)); }
}

.hero-subtitle {
  margin: 22px auto 0;
  max-width: 540px;
  font-size: clamp(.95rem, 2.4vw, 1.15rem);
  font-weight: 300;
  color: var(--text-dim);
}

/* 向下滚动提示 */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  font: inherit;
  animation: floatY 2.4s ease-in-out infinite;
}
.scroll-hint__text {
  font-size: .68rem;
  letter-spacing: .35em;
  text-indent: .35em;
  text-transform: uppercase;
}
.scroll-hint__mouse {
  width: 24px; height: 38px;
  border: 1.5px solid rgba(255,255,255,.28);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.scroll-hint__wheel {
  width: 3px; height: 7px;
  border-radius: 3px;
  background: var(--accent-2);
  animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel {
  0%   { opacity: 0; transform: translateY(-4px); }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(10px); }
}
@keyframes floatY {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(8px); }
}

/* =========================================================
   第二屏 PROFILE
   ========================================================= */
.profile { background: transparent; }
.profile__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  max-height: 100svh;
  overflow-y: auto;
  scrollbar-width: none;        /* Firefox 隐藏滚动条 */
}
.profile__inner::-webkit-scrollbar { display: none; }
.profile-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(700px, 92vw);
  height: 480px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(52,211,255,.14), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
}

/* 玻璃卡片 */
.card {
  position: relative;
  z-index: 2;
  width: min(440px, 92vw);
  padding: 46px 34px 40px;
  text-align: center;
  border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
}
/* 渐变边框 */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(109,93,252,.7), rgba(52,211,255,.5), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
/* hover 时跟随鼠标的高光 */
.card__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.12), transparent 65%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.card:hover .card__shine { opacity: 1; }
.card:hover {
  box-shadow: 0 40px 90px -25px rgba(52,211,255,.28), var(--shadow);
}

/* 头像 */
.avatar-ring {
  width: 150px; height: 150px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(from 0deg, var(--accent-2), var(--accent-1), var(--accent-3), var(--accent-2));
  padding: 3px;
  animation: spin 8s linear infinite;
  box-shadow: 0 0 30px rgba(109,93,252,.35);
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
  border: 4px solid var(--bg-soft);
  animation: spin 8s linear infinite reverse; /* 反向旋转抵消，让图保持正立 */
}

.card__name {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card__bio {
  margin: 10px auto 28px;
  max-width: 320px;
  font-size: .95rem;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.6;
}

/* 社交按钮 */
.socials {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.socials .social:last-child:nth-child(odd) {
  grid-column: 1 / -1;   /* 奇数项时最后一个占满整行 */
}
.social {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, background .25s ease;
  will-change: transform;
}
.social svg {
  width: 20px; height: 20px;
  color: var(--accent, var(--text));
  transition: transform .25s ease, filter .25s ease;
}
.social::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
              color-mix(in srgb, var(--accent, #fff) 22%, transparent),
              transparent 70%);
  opacity: 0;
  transition: opacity .3s ease;
}
.social:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent, #fff) 55%, transparent);
  box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--accent, #fff) 45%, transparent);
}
.social:hover::after { opacity: 1; }
.social:hover svg {
  transform: scale(1.18);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent, #fff) 80%, transparent));
}
/* LinuxDO 彩色 logo：保留自身配色，悬停用中性辉光 */
.social__logo { border-radius: 50%; }
.social:hover .social__logo {
  filter: drop-shadow(0 0 9px rgba(255,176,3,.7));
}
.social:active { transform: translateY(-1px) scale(.99); }

/* 页脚 */
.footer {
  position: relative;
  z-index: 2;
  margin-top: 56px;
  text-align: center;
  color: var(--text-faint);
  font-size: .8rem;
  line-height: 1.9;
}
.footer__icp a { color: var(--text-faint); transition: color .25s ease; }
.footer__icp a:hover { color: var(--text-dim); }

/* =========================================================
   内容浮现细节（配合翻页 .is-active）
   ========================================================= */
/* hero 文案错峰淡入（容器激活后整体浮现，子元素再各自延迟） */
.page.is-active .hero-eyebrow  { animation: fadeUp .8s ease .45s both; }
.page.is-active .hero-title    { animation: fadeUp .8s ease .58s both; }
.page.is-active .hero-subtitle { animation: fadeUp .8s ease .72s both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* 离开第一屏时隐藏滚动提示 */
.scroll-hint {
  transition: opacity .4s ease;
}
.page:not(.is-active) .scroll-hint {
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 480px) {
  .card { padding: 38px 22px 32px; }
  .avatar-ring { width: 124px; height: 124px; }
  .socials { grid-template-columns: 1fr; }
  .socials .social:last-child:nth-child(odd) { grid-column: auto; }
}

/* 尊重「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .page__inner { opacity: 1; transform: none; }
}
