/* =========================================================
   设计令牌（双主题 · 专业版 B）
   配色降饱和、统一圆角/间距/阴影系统、暗色质感重调
   ========================================================= */
:root,
[data-theme="light"] {
  --bg: #eef1f6;
  --bg-grad-1: #ffffff;
  --bg-grad-2: #e8ecf5;

  /* 卡片：多层阴影 + 顶部高光描边 */
  --card-bg: rgba(255, 255, 255, 0.86);
  --card-border: rgba(15, 20, 40, 0.08);
  --card-highlight: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0) 40%);
  --shadow-sm: 0 1px 2px rgba(20,26,54,0.06), 0 2px 8px rgba(20,26,54,0.05);
  --shadow-md: 0 4px 12px -2px rgba(20,26,54,0.10), 0 12px 30px -8px rgba(20,26,54,0.12);
  --shadow-lg: 0 8px 20px -4px rgba(20,26,54,0.12), 0 30px 60px -16px rgba(20,26,54,0.18);

  --text: #0f1117;
  --text-2: #5a6478;
  --text-3: #8a93a8;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --accent-grad: linear-gradient(135deg, #4f46e5, #7c3aed);
  --link-bg: #ffffff;
  --link-border: rgba(15, 20, 40, 0.07);
  --link-hover-bg: #f4f5fb;
  --icon: #1c2438;
  --orb-opacity: 0.18;   /* 背景光晕大幅降 opacity，只留一层氛围 */
  --name-grad: linear-gradient(135deg, #1e1b4b, #4f46e5 55%, #7c3aed);
  --noise-opacity: 0.03;  /* 噪点纹理：浅色主题更淡 */
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-grad-1: #161b26;
  --bg-grad-2: #0b0e14;

  --card-bg: rgba(26, 32, 44, 0.82);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-highlight: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0) 42%);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.40), 0 12px 30px -8px rgba(0,0,0,0.45);
  --shadow-lg: 0 8px 20px -4px rgba(0,0,0,0.45), 0 30px 60px -16px rgba(0,0,0,0.60);

  --text: #f5f7ff;
  --text-2: #aab3c9;
  --text-3: #747d92;
  --accent: #8b95f9;
  --accent-2: #c391f4;
  --accent-soft: rgba(139, 149, 249, 0.18);
  --accent-grad: linear-gradient(135deg, #6366f1, #a855f7);
  --link-bg: rgba(255, 255, 255, 0.05);
  --link-border: rgba(255, 255, 255, 0.09);
  --link-hover-bg: rgba(255, 255, 255, 0.09);
  --icon: #d3daf0;
  --orb-opacity: 0.14;
  --name-grad: linear-gradient(135deg, #eef2ff, #8b95f9 55%, #c391f4);
  --noise-opacity: 0.045;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ============ 背景：只保留一层柔和光晕（降饱和、低 opacity） ============ */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--bg-grad-1), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: var(--orb-opacity);
  animation: float 18s ease-in-out infinite;
}
/* 降饱和 + 单色化，退为背景氛围层，不与 logo 墙抢焦点 */
.orb-1 { width: 48vmin; height: 48vmin; left: -10vmin; top: 4vmin; background: #6366f1; }
.orb-2 { width: 40vmin; height: 40vmin; right: -8vmin; top: 32vmin; background: #a78bfa; animation-delay: -5s; }
.orb-3 { width: 44vmin; height: 44vmin; left: 24vmin; bottom: -12vmin; background: #818cf8; animation-delay: -9s; }
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3vmin) scale(1.05); }
}

/* ============ 环绕卡片外围的 logo 墙 ============ */
.float-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;   /* logo 在背景层、卡片之下，做背景装饰 */
}
.float-logo {
  position: absolute;
  object-fit: contain;
  opacity: 0.5;
  will-change: transform;
  /* 定位 = 基准位置 + 鼠标视差偏移（变量由 app.js 设置） */
  left: calc(var(--base-x, 0px) + var(--par-x, 0px));
  top: calc(var(--base-y, 0px) + var(--par-y, 0px));
}
@keyframes floatDrift {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  50%      { transform: translateY(-3.5vmin) rotate(2deg) scale(1.04); }
}

/* ============ 布局（间距统一 8px 倍数） ============ */
.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(56px, 12vh) 20px 32px;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px 28px;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: background 0.4s ease, border 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}
/* 卡片顶部高光描边（立体感） */
.card-toplight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--card-highlight);
  pointer-events: none;
  z-index: 0;
}
/* 卡片噪点纹理：消塑料感（SVG feTurbulence 噪声） */
.card-noise {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: var(--noise-opacity, 0.03);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.card > *:not(.card-toplight):not(.card-noise) { position: relative; z-index: 1; }
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 头部 ============ */
.head { text-align: center; }
.avatar {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--accent-grad);
  padding: 3px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.avatar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 1px;
}
.avatar-img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: cover;
  border-radius: 50%;
}
/* 名字做主视觉锚点：大字号 + 渐变文字 */
.name {
  margin: 12px 0 4px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--name-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.bio {
  margin: 12px 0 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* 社交图标 */
.socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.social {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--icon);
  background: var(--link-bg);
  border: 1px solid var(--link-border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s, background 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.social:hover {
  transform: translateY(-4px) scale(1.06);
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

/* 分隔线（视觉分组） */
.divider {
  height: 1px;
  background: var(--link-border);
  margin: 24px 0;
  border: 0;
}

/* 链接卡片 */
.links {
  margin-top: 0;
  display: grid;
  gap: 12px;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  background: var(--link-bg);
  border: 1px solid var(--link-border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.link-card:hover {
  transform: translateY(-3px);
  background: var(--link-hover-bg);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.lc-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  transition: transform 0.3s ease;
}
.link-card:hover .lc-icon { transform: scale(1.08); }
.lc-text { flex: 1 1 auto; min-width: 0; }
.lc-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-arrow {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 1.05rem;
  transition: transform 0.25s, color 0.25s;
}
.link-card:hover .lc-arrow {
  transform: translateX(5px);
  color: var(--accent);
}

/* 主题切换 */
.theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--link-border);
  background: var(--link-bg);
  color: var(--icon);
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.tt-icon {
  position: absolute;
  font-size: 1.05rem;
  transition: transform 0.4s ease, opacity 0.3s;
}
.tt-moon { opacity: 0; transform: translateY(120%); }
[data-theme="dark"] .tt-sun { opacity: 0; transform: translateY(120%); }
[data-theme="dark"] .tt-moon { opacity: 1; transform: translateY(0); }

/* 页脚 */
.foot {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: center;
}

/* 响应式 */
@media (max-width: 520px) {
  .card { border-radius: 24px; padding: 24px 20px 22px; }
  .page { padding: 40px 14px 24px; }
  .name { font-size: 1.7rem; }
}

/* 减少动效（保留结构，只关浮动） */
@media (prefers-reduced-motion: reduce) {
  .float-logo, .orb, .card, .social, .link-card { animation: none !important; }
}

/* 入场分层动画（社交图标/链接卡逐个淡入） */
@keyframes itemIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
