/* ========================================
   创意活泼风格博客 - 主样式表
   ======================================== */

/* CSS变量 - 创意活泼配色 */
:root {
  --primary-color: #FF6B6B;
  --secondary-color: #4ECDC4;
  --accent-color: #FFE66D;
  --highlight-color: #95E1D3;
  --dark-color: #2C3E50;
  --light-color: #F7F9FC;
  --text-color: #333333;
  --text-light: #666666;
  --gradient-1: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
  --gradient-2: linear-gradient(135deg, #4ECDC4 0%, #95E1D3 100%);
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.8;
  color: var(--text-color);
  background-color: var(--light-color);
  overflow-x: hidden;
}

/* 装饰性背景元素 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: var(--gradient-1);
  opacity: 0.05;
  border-radius: 50%;
  z-index: -1;
  animation: float 20s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: var(--gradient-2);
  opacity: 0.05;
  border-radius: 50%;
  z-index: -1;
  animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(30px, 30px) rotate(10deg); }
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 16px 0;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.navbar.scrolled {
  padding: 12px 0;
  box-shadow: var(--shadow-medium);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  position: relative;
  padding: 8px 0;
  transition: var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--gradient-1);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-color);
  border-radius: 2px;
  transition: var(--transition);
}

/* ========================================
   Hero区域
   ======================================== */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero h1 .highlight {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gradient-1);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.btn-secondary {
  background: white;
  color: var(--text-color);
  border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
  background: var(--secondary-color);
  color: white;
  transform: translateY(-3px);
}

/* ========================================
   搜索框
   ======================================== */
.search-section {
  padding: 40px 0;
}

.search-box {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 18px 60px 18px 24px;
  border: 2px solid transparent;
  border-radius: 50px;
  font-size: 1rem;
  background: white;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: var(--shadow-medium);
}

.search-box button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  background: var(--gradient-1);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.search-box button:hover {
  transform: translateY(-50%) scale(1.05);
}

/* ========================================
   分类标签
   ======================================== */
.categories-section {
  padding: 20px 0 40px;
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.category-tag {
  padding: 10px 24px;
  background: white;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  box-shadow: var(--shadow-soft);
}

.category-tag:hover,
.category-tag.active {
  background: var(--gradient-1);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.category-tag.count {
  background: var(--accent-color);
  color: var(--dark-color);
  font-size: 0.75rem;
  padding: 4px 10px;
  margin-left: 4px;
  border-radius: 20px;
}

/* ========================================
   文章卡片
   ======================================== */
.articles-section {
  padding: 60px 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 40px;
  text-align: center;
}

.section-title span {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
}

.article-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-medium);
}

.article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

.article-card:hover .article-image {
  transform: scale(1.05);
}

.article-image-wrapper {
  overflow: hidden;
  position: relative;
}

.article-category {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--gradient-1);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.article-content {
  padding: 24px;
}

.article-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--dark-color);
  line-height: 1.4;
  transition: var(--transition);
}

.article-card:hover .article-title {
  color: var(--primary-color);
}

.article-excerpt {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.article-date {
  color: var(--text-light);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-read-time {
  color: var(--secondary-color);
  font-size: 0.85rem;
  font-weight: 500;
}

/* 特色文章 */
.featured-article {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.featured-article .article-image-wrapper {
  height: 100%;
}

.featured-article .article-image {
  height: 100%;
  min-height: 300px;
}

/* ========================================
   文章详情页
   ======================================== */
.article-header {
  padding: 120px 0 40px;
  text-align: center;
}

.article-header .article-category {
  position: static;
  display: inline-block;
  margin-bottom: 20px;
}

.article-header h1 {
  font-size: 2.8rem;
  font-weight: 800;
  max-width: 800px;
  margin: 0 auto 24px;
  line-height: 1.3;
}

.article-meta-full {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: var(--text-light);
  font-size: 0.95rem;
}

.article-meta-full span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.article-body img {
  width: 100%;
  border-radius: var(--border-radius);
  margin: 30px 0;
}

.article-body h2 {
  font-size: 1.8rem;
  margin: 40px 0 20px;
  color: var(--dark-color);
}

.article-body h3 {
  font-size: 1.4rem;
  margin: 30px 0 15px;
  color: var(--dark-color);
}

.article-body p {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.article-body blockquote {
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.1) 0%, rgba(149, 225, 211, 0.1) 100%);
  border-left: 4px solid var(--secondary-color);
  padding: 24px 30px;
  margin: 30px 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic;
  font-size: 1.1rem;
}

.article-body ul, .article-body ol {
  margin: 20px 0;
  padding-left: 30px;
}

.article-body li {
  margin-bottom: 10px;
}

.article-body code {
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.9em;
}

.article-body pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 24px;
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin: 24px 0;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* 标签 */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #eee;
}

.article-tags a {
  background: var(--light-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--transition);
}

.article-tags a:hover {
  background: var(--secondary-color);
  color: white;
}

/* 分享按钮 */
.share-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
}

.share-section span {
  font-weight: 600;
  color: var(--text-color);
}

.share-buttons {
  display: flex;
  gap: 12px;
}

.share-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: var(--transition);
  font-size: 1.1rem;
}

.share-btn:hover {
  transform: translateY(-3px);
}

.share-btn.weibo { background: #E6162D; }
.share-btn.wechat { background: #07C160; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.facebook { background: #4267B2; }

/* ========================================
   关于页面
   ======================================== */
.about-hero {
  padding: 140px 0 80px;
  text-align: center;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 30px;
}

.avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid white;
  box-shadow: var(--shadow-medium);
}

.avatar-decoration {
  position: absolute;
  width: 220px;
  height: 220px;
  border: 3px dashed var(--secondary-color);
  border-radius: 50%;
  top: -20px;
  left: -20px;
  animation: spin 20s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.about-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--dark-color);
}

.about-content p {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

/* 技能展示 */
.skills-section {
  padding: 60px 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.skill-card {
  background: white;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  text-align: center;
  transition: var(--transition);
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.skill-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.skill-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--dark-color);
}

.skill-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* 社交链接 */
.social-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.social-link {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text-color);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.social-link:hover {
  background: var(--gradient-1);
  color: white;
  transform: translateY(-3px);
}

/* ========================================
   订阅区域
   ======================================== */
.subscribe-section {
  padding: 80px 0;
  background: var(--gradient-2);
  margin: 60px 0;
}

.subscribe-box {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 0 24px;
}

.subscribe-box h2 {
  font-size: 2rem;
  color: white;
  margin-bottom: 16px;
}

.subscribe-box p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 30px;
}

.subscribe-form {
  display: flex;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.subscribe-form input {
  flex: 1;
  padding: 16px 24px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  outline: none;
}

.subscribe-form button {
  padding: 16px 32px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.subscribe-form button:hover {
  background: #ff5252;
  transform: scale(1.05);
}

/* ========================================
   页脚
   ======================================== */
.footer {
  background: var(--dark-color);
  color: white;
  padding: 60px 0 30px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--accent-color);
}

.footer-section p {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 12px;
}

.footer-section ul a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition);
}

.footer-section ul a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 992px) {
  .featured-article {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    box-shadow: var(--shadow-medium);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .articles-grid {
    grid-template-columns: 1fr;
  }
  
  .subscribe-form {
    flex-direction: column;
  }
  
  .article-header h1 {
    font-size: 2rem;
  }
  
  .article-meta-full {
    flex-direction: column;
    gap: 12px;
  }
  
  .share-section {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================
   动画效果
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }
.fade-in:nth-child(6) { animation-delay: 0.6s; }

/* 页面加载动画 */
.page-transition {
  animation: pageSlide 0.5s ease;
}

@keyframes pageSlide {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--gradient-1);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-medium);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
}

/* 搜索结果样式 */
.search-results {
  padding: 20px 0;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.no-results h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text-color);
}

/* 加载动画 */
.loading {
  display: flex;
  justify-content: center;
  padding: 40px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--light-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}