/* ===========================================
   个人博客模板 - Blog Theme
   简洁美观的单页博客样式
   =========================================== */

/* 基础变量 */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary-color: #64748b;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --bg-color: #ffffff;
  --bg-light: #f8fafc;
  --bg-dark: #0f172a;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --transition: all 0.3s ease;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* ===========================================
   导航栏样式
   =========================================== */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  z-index: 1000;
}

.header .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.header .logo:hover {
  color: var(--primary-color);
}

.header .logo-img {
  height: 40px;
  width: auto;
}

.navbar ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.navbar a {
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.navbar a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

.navbar a:hover,
.navbar a.active {
  color: var(--primary-color);
}

.navbar a:hover::after,
.navbar a.active::after {
  width: 100%;
}

.mobile-nav-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

/* ===========================================
   Hero 区域样式
   =========================================== */
.hero {
  padding: 6rem 0;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-color) 100%);
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 2rem;
  margin-bottom: 1.5rem;
}

.hero-tag .tag-dot {
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero-tag .tag-text {
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.9rem;
}

.hero-headline {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.hero-text {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--primary-color);
  color: white;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: var(--transition);
}

.cta-button:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color);
  font-weight: 600;
  padding: 1rem 1.5rem;
}

.cta-link:hover {
  color: var(--primary-color);
}

.hero-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-color);
  box-shadow: var(--shadow-lg);
}

.avatar-placeholder {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 8rem;
  box-shadow: var(--shadow-lg);
}

/* ===========================================
   关于区域样式
   =========================================== */
.about {
  padding: 6rem 0;
  background: var(--bg-color);
}

.section-subtitle {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  border-radius: 2rem;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.about-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.about-content .lead-text {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 1rem;
  font-weight: 500;
}

.about-content .description {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-light);
  border-radius: 0.5rem;
  transition: var(--transition);
}

.feature-card:hover {
  background: rgba(37, 99, 235, 0.1);
  transform: translateX(5px);
}

.feature-card i {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stat-card {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  transition: var(--transition);
}

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

.stat-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-color);
}

.stat-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===========================================
   文章区域样式
   =========================================== */
.articles {
  padding: 6rem 0;
  background: var(--bg-light);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.section-title p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.article-card {
  background: var(--bg-color);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  height: 100%;
}

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

.article-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

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

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

.image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.article-date {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-color);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.article-content {
  padding: 1.5rem;
}

.article-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.article-content h3 a {
  color: var(--text-color);
}

.article-content h3 a:hover {
  color: var(--primary-color);
}

.article-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.read-more a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  font-weight: 500;
}

.read-more a:hover {
  gap: 0.75rem;
}

/* ===========================================
   联系区域样式
   =========================================== */
.contact {
  padding: 6rem 0;
  background: var(--bg-color);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-item {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: 1rem;
  transition: var(--transition);
}

.info-item:hover {
  background: rgba(37, 99, 235, 0.1);
  transform: translateX(5px);
}

.info-item i {
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.info-item h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-color);
}

.info-item p {
  color: var(--text-muted);
  margin: 0;
}

.contact-form {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 1rem;
}

.contact-form .form-control {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: var(--transition);
}

.contact-form .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form .btn-primary {
  padding: 1rem 2rem;
  font-weight: 600;
}

/* ===========================================
   页脚样式
   =========================================== */
.footer {
  background: var(--bg-dark);
  color: white;
  padding: 4rem 0 0;
}

.footer-about .footer-logo {
  height: 40px;
  margin-bottom: 1rem;
}

.footer-about .footer-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-about p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

.footer-links h4,
.footer-contact h4,
.footer-subscribe h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.footer-links ul,
.footer-contact ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li,
.footer-contact li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer-links a:hover {
  color: white;
  padding-left: 5px;
}

.footer-contact li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-contact i {
  color: var(--primary-color);
}

.footer-subscribe p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
}

.subscribe-form {
  display: flex;
  gap: 0.5rem;
}

.subscribe-form .form-control {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
}

.subscribe-form .btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
}

.footer-bottom {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-bottom a {
  color: var(--primary-color);
}

/* ===========================================
   消息弹窗样式
   =========================================== */
.message-box {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.message-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-color);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary-color);
}

.message-text {
  color: var(--text-color);
  font-weight: 500;
}

.message-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.message-close:hover {
  color: var(--text-color);
}

/* ===========================================
   响应式样式
   =========================================== */
@media (max-width: 992px) {
  .hero-headline {
    font-size: 2.5rem;
  }
  
  .avatar-img,
  .avatar-placeholder {
    width: 200px;
    height: 200px;
    font-size: 5rem;
  }
  
  .mobile-nav-toggle {
    display: block;
  }
  
  .navbar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
  }
  
  .navbar.active {
    display: block;
  }
  
  .navbar ul {
    flex-direction: column;
    gap: 0;
  }
  
  .navbar li {
    border-bottom: 1px solid var(--border-color);
  }
  
  .navbar a {
    display: block;
    padding: 1rem;
  }
  
  .navbar a::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 4rem 0;
    text-align: center;
  }
  
  .hero-headline {
    font-size: 2rem;
  }
  
  .hero-text {
    max-width: 100%;
  }
  
  .hero-cta {
    justify-content: center;
    flex-direction: column;
  }
  
  .hero-avatar {
    margin-top: 2rem;
  }
  
  .avatar-img,
  .avatar-placeholder {
    width: 150px;
    height: 150px;
    font-size: 4rem;
  }
  
  .about-content h2,
  .section-title h2 {
    font-size: 2rem;
  }
  
  .about-stats {
    grid-template-columns: 1fr;
  }
  
  .stat-card {
    padding: 1.5rem;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .contact-info {
    margin-bottom: 2rem;
  }
  
  .subscribe-form {
    flex-direction: column;
  }
  
  .footer-bottom {
    text-align: center;
  }
  
  .footer-bottom .col-md-6 {
    text-align: center !important;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 576px) {
  .hero-headline {
    font-size: 1.75rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .article-image {
    height: 180px;
  }
}
