/*!
 * 沐辰个人主页 - 主样式文件 (Muchen Personal Homepage - Main Stylesheet)
 *
 * Copyright (c) 2025 沐辰 (MC)
 *
 * 项目描述：个人主页网站的主要样式文件，包含响应式设计、动画效果和主题样式
 * 作者：沐辰 (MC)
 * 邮箱：mcwlgzs@qq.com
 * 网站：https://mcwl.net
 * GitHub：https://github.com/mcwlgzs/mc-homepage
 *
 * 本文件基于 MIT 许可证开源，详情请查看项目根目录的 LICENSE 文件
 *
 * 特性：
 * - 响应式设计，支持移动端和桌面端
 * - 现代化的渐变和动画效果
 * - 自定义光标和交互效果
 * - 优化的打印样式
 *
 * 最后更新：2025年
 */

/* 全局变量 */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
}

/* 基础样式 */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

body {
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  background-color: #f8fafc;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

/* 粒子背景 */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* 内容卡片 */
.content-card {
  background-color: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.content-card:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* 渐变文本 */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient 8s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 在线状态 */
.online-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--success-color);
  font-size: 0.875rem;
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-color);
  position: relative;
}

.pulse::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--success-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  70% {
    transform: scale(2.5);
    opacity: 0;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* 技能进度条 */
.progress-bg {
  width: 100%;
  height: 8px;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  width: 0;
  transition: width 1s ease-in-out;
}

/* 统计卡片 */
.stat-card {
  background-color: var(--bg-primary);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.1);
}

/* 社交图标卡片 */
.social-icon-card {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
  position: relative;
  transition: all 0.3s ease;
}

.social-icon-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.15);
  color: var(--primary-color);
}

/* 工具提示 */
.tooltip {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--text-primary);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.social-icon-card:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

/* 按钮样式 */
.contact-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.primary-btn {
  background-color: var(--primary-color);
  color: white;
}

.primary-btn:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
}

.secondary-btn {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.secondary-btn:hover {
  background-color: #e5e7eb;
  transform: translateY(-2px);
}

/* 项目卡片 */
.project-card {
  background-color: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.project-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  transition: all 0.3s ease;
}

.project-details {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--bg-primary) 80%, transparent);
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.project-details.show {
  transform: translateY(0);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tech-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--bg-secondary);
  border-radius: 0.375rem;
  color: var(--text-secondary);
}

/* 技术标签云 */
.tech-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.tech-badge:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  border-color: transparent;
}

/* 头像发光效果 */
.glow-effect {
  position: relative;
}

.glow-effect::after {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%;
  z-index: -1;
  opacity: 0.15;
  filter: blur(15px);
}

/* 3D卡片效果 */
.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px);
  transition: transform 0.3s ease;
}

/* 头像容器 */
.avatar-container {
  position: relative;
  transition: all 0.3s ease;
}

/* 淡入动画 */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.fade-in.active {
  opacity: 1;
  transform: translateY(0);
}

/* 鼠标指针样式 */
#cursor {
  width: 20px;
  height: 20px;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.2s ease;
  margin-left: -10px;
  margin-top: -10px;
  backdrop-filter: blur(4px);
}

#cursor.hidden {
  transform: scale(0);
}

#cursor.hover {
  transform: scale(1.5);
  background: rgba(59, 130, 246, 0.3);
}

/* 响应式设计 */
@media (max-width: 640px) {
  .social-icon-card {
    width: 36px;
    height: 36px;
  }

  .contact-btn {
    padding: 0.625rem 1.25rem;
  }

  .skill-tag {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .project-card {
    min-height: 180px;
  }
}

@media (max-width: 480px) {
  .stat-card {
    padding: 0.75rem;
  }

  .content-card {
    padding: 1rem;
  }

  .project-details {
    padding: 1rem;
  }
}

/* 打印样式 */
@media print {
  .particles-container {
    display: none;
  }

  .social-icon-card,
  .contact-btn,
  .skill-tag {
    box-shadow: none;
  }

  .content-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* 技术标签 */
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  background-color: var(--bg-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.skill-tag i {
  font-size: 1rem;
}

.skill-tag.html { color: #e34f26; }
.skill-tag.css { color: #264de4; }
.skill-tag.javascript { color: #f7df1e; }
.skill-tag.typescript { color: #3178c6; }
.skill-tag.react { color: #61dafb; }
.skill-tag.node { color: #339933; }
.skill-tag.python { color: #3776ab; }
.skill-tag.git { color: #f05032; }

.skill-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 技术标签颜色变体 */
.skill-tag.javascript {
  background-color: #fef3c7;
  color: #d97706;
}

.skill-tag.python {
  background-color: #e0f2fe;
  color: #0369a1;
}

.skill-tag.react {
  background-color: #dbeafe;
  color: #2563eb;
}

.skill-tag.node {
  background-color: #dcfce7;
  color: #16a34a;
}

.skill-tag.typescript {
  background-color: #ede9fe;
  color: #6d28d9;
}

.skill-tag.html {
  background-color: #fee2e2;
  color: #dc2626;
}

.skill-tag.css {
  background-color: #e0e7ff;
  color: #4338ca;
}

.skill-tag.git {
  background-color: #fef3c7;
  color: #b45309;
}

/* 主内容区域 */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

/* 页面底部 */
footer {
  margin-top: auto;
  width: 100%;
  flex-shrink: 0;
}

/* ICP备案信息样式 */
.icp-info {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.icp-info a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.3s ease;
}

.icp-info a:hover {
  color: #3b82f6;
}

.icp-info img {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: middle;
}

/* 响应式设计 - ICP信息 */
@media (max-width: 640px) {
  .icp-info {
    flex-direction: column;
    gap: 0.5rem;
  }

  .icp-info span {
    display: none;
  }
}

/* 返回顶部按钮 */
.back-to-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), #2563eb);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-to-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.back-to-top-btn:active {
  transform: translateY(0) scale(0.95);
}

.back-to-top-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* 返回顶部按钮响应式设计 */
@media (max-width: 768px) {
  .back-to-top-btn {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .back-to-top-btn {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
}
