/* ===== CSS变量 ===== */
:root {
  --primary-color: #ffb6c1;
  --primary-hover: #ff91a4;
  --background-dark: #fff0f5;
  --background-card: rgba(255, 182, 193, 0.15);
  --text-primary: #4a4a4a;
  --text-secondary: #888888;
  --border-color: rgba(255, 182, 193, 0.3);
  --shadow-color: rgba(255, 105, 180, 0.2);
  --glow-color: rgba(255, 182, 193, 0.4);
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== 基础重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  background: var(--background-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== 背景动画Canvas ===== */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* ===== 顶部背景区域（预留） ===== */
.hero-background {
  position: relative;
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  overflow: hidden;
}

.hero-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.5;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--background-dark) 100%);
}

/* ===== 主容器 ===== */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 40px;
  position: relative;
}

/* ===== 头像区域（预留） ===== */
.avatar-container {
  position: relative;
  margin-top: -75px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--background-card);
  border: 4px solid var(--background-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px var(--shadow-color), 0 0 40px var(--glow-color);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 48px var(--shadow-color), 0 0 60px var(--glow-color);
}

.avatar-placeholder {
  font-size: 50px;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

/* 头像图片样式 */
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar:hover .avatar-placeholder {
  color: var(--primary-color);
}

/* 如果有实际头像图片 */
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== 用户信息区域 ===== */
.profile-section {
  text-align: center;
  margin-bottom: 35px;
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.username {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.bio {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== 链接按钮区域 ===== */
.links-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all var(--transition-medium);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.link-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left var(--transition-slow);
}

.link-button:hover::before {
  left: 100%;
}

.link-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary-color);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 40px var(--shadow-color), 0 0 20px var(--glow-color);
}

.link-button i {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
  transition: transform var(--transition-fast);
}

.link-button:hover i {
  transform: scale(1.2);
}

.link-button span {
  position: relative;
  z-index: 1;
}

/* 特定按钮的颜色 */
.link-button:nth-child(1):hover {
  border-color: #333;
}

.link-button:nth-child(2):hover {
  border-color: #1da1f2;
}

.link-button:nth-child(3):hover {
  border-color: #e4405f;
}

.link-button:nth-child(4):hover {
  border-color: #ea4335;
}

.link-button:nth-child(5):hover {
  border-color: #33b5e5;
}

.link-button:nth-child(6):hover {
  border-color: #7289da;
}

/* ===== 页脚 ===== */
.footer {
  margin-top: 50px;
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  animation: fadeInUp 0.8s ease 0.4s forwards;
  opacity: 0;
}

.footer p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--background-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-medium);
}

.social-icon:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-primary);
  transform: translateY(-5px);
  box-shadow: 0 8px 30px var(--glow-color);
}

.social-icon i {
  font-size: 1.1rem;
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-color);
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-medium);
  z-index: 100;
  box-shadow: 0 4px 20px var(--glow-color);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-5px);
  box-shadow: 0 8px 30px var(--glow-color);
}

/* ===== 加载动画 ===== */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .container {
    padding: 0 16px 30px;
  }

  .hero-background {
    height: 220px;
  }

  .avatar {
    width: 110px;
    height: 110px;
    margin-top: -60px;
  }

  .avatar-placeholder {
    font-size: 42px;
  }

  .username {
    font-size: 1.6rem;
  }

  .bio {
    font-size: 0.9rem;
    padding: 0 10px;
  }

  .links-section {
    gap: 12px;
  }

  .link-button {
    padding: 14px 20px;
    font-size: 0.95rem;
  }

  .link-button i {
    font-size: 1.2rem;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  .social-icons {
    gap: 15px;
  }

  .social-icon {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .hero-background {
    height: 180px;
  }

  .avatar {
    width: 100px;
    height: 100px;
    margin-top: -55px;
  }

  .username {
    font-size: 1.4rem;
  }

  .link-button {
    padding: 12px 16px;
    font-size: 0.9rem;
    gap: 10px;
  }

  .link-button i {
    font-size: 1.1rem;
  }
}

/* ===== 触摸设备优化 ===== */
@media (hover: none) {
  .link-button:hover {
    transform: none;
    box-shadow: none;
  }

  .avatar:hover {
    transform: none;
  }

  .social-icon:hover {
    transform: none;
  }

  .back-to-top:hover {
    transform: none;
  }
}

/* ===== 打印样式 ===== */
@media print {

  .hero-background,
  #bgCanvas,
  .back-to-top,
  .social-icons {
    display: none;
  }

  .container {
    max-width: 100%;
  }

  .link-button {
    border: 1px solid #000;
    color: #000;
  }
}