/* ===== 个人云宠 - 主样式表 ===== */

/* --- CSS变量 --- */
:root {
  --primary: #4A90D9;
  --primary-light: #6BA5E7;
  --primary-dark: #3570B0;
  --accent: #F5A623;
  --accent-light: #FFD080;
  --bg-main: #F7F9FC;
  --bg-white: #FFFFFF;
  --bg-card: #FFFFFF;
  --text-primary: #2C3E50;
  --text-secondary: #5D6D7E;
  --text-light: #95A5A6;
  --border: #E8ECF1;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-main);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

/* --- 导航栏 --- */
.navbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.navbar-brand img {
  height: 36px;
  width: 36px;
  border-radius: 8px;
}

.navbar-brand:hover {
  color: var(--primary);
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: 8px;
}

.navbar-nav a {
  display: block;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--primary);
  background: rgba(74, 144, 217, 0.08);
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: var(--transition);
  border-radius: 2px;
}

/* --- 容器 --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* --- Hero区域 --- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #89C4F4 100%);
  color: #fff;
  padding: 80px 0 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

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

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero h1 .accent {
  color: var(--accent-light);
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.92;
  max-width: 560px;
  line-height: 1.9;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.35);
}

.btn-primary:hover {
  background: #E6951A;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.45);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
}

/* --- 通用区块 --- */
.section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

/* --- 特色卡片 --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.feature-icon.blue {
  background: rgba(74, 144, 217, 0.1);
  color: var(--primary);
}

.feature-icon.orange {
  background: rgba(245, 166, 35, 0.1);
  color: var(--accent);
}

.feature-icon.green {
  background: rgba(46, 204, 113, 0.1);
  color: #2ECC71;
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- 博客卡片 --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.blog-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.blog-card-thumb {
  height: 200px;
  background: linear-gradient(135deg, var(--primary-light), #89C4F4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.blog-card-thumb::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.05));
}

.blog-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
  width: fit-content;
}

.tag-care {
  background: rgba(74, 144, 217, 0.1);
  color: var(--primary);
}

.tag-skill {
  background: rgba(245, 166, 35, 0.1);
  color: var(--accent);
}

.tag-share {
  background: rgba(46, 204, 113, 0.1);
  color: #2ECC71;
}

.tag-info {
  background: rgba(155, 89, 182, 0.1);
  color: #9B59B6;
}

.blog-card-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.5;
}

.blog-card-body h3 a {
  color: var(--text-primary);
}

.blog-card-body h3 a:hover {
  color: var(--primary);
}

.blog-card-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-light);
}

/* --- 宠物展示 --- */
.pets-showcase {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.pet-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.pet-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.pet-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--primary-light), #89C4F4);
}

.pet-item h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.pet-item .pet-breed {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.pet-item .pet-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* --- 页面标题横幅 --- */
.page-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 60px 0 50px;
  text-align: center;
}

.page-banner h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.page-banner p {
  opacity: 0.9;
  font-size: 1.05rem;
}

/* --- 博客列表页 --- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.blog-list-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.blog-list-item:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.blog-list-thumb {
  width: 200px;
  min-width: 200px;
  height: 140px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-light), #89C4F4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.blog-list-content {
  flex: 1;
}

.blog-list-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.blog-list-content h3 a {
  color: var(--text-primary);
}

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

.blog-list-content p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.blog-list-meta {
  display: flex;
  gap: 20px;
  font-size: 0.82rem;
  color: var(--text-light);
}

/* --- 分类筛选 --- */
.blog-filter {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- 关于页面 --- */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.about-info-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.about-info-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.info-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- 统计数字 --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.stat-item {
  text-align: center;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

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

/* --- 页脚 --- */
.footer {
  background: var(--text-primary);
  color: rgba(255, 255, 255, 0.7);
  padding: 48px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand img {
  height: 28px;
  width: 28px;
  border-radius: 6px;
}

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 320px;
}

.footer h4 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-icp {
  color: rgba(255, 255, 255, 0.5);
}

.footer-icp a {
  color: rgba(255, 255, 255, 0.6);
}

.footer-icp a:hover {
  color: #fff;
}

/* --- 回到顶部 --- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 14px rgba(74, 144, 217, 0.4);
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
}

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

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(74, 144, 217, 0.5);
}

/* --- 响应式 --- */
@media (max-width: 1024px) {
  .features-grid,
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pets-showcase {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .features-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .pets-showcase {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .blog-list-item {
    flex-direction: column;
  }

  .blog-list-thumb {
    width: 100%;
    min-width: unset;
    height: 160px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .menu-toggle {
    display: block;
  }

  .navbar-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .navbar-nav.open {
    display: flex;
  }

  .section {
    padding: 48px 0;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 48px 0 64px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .pets-showcase {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
