/* ============================================
   糖心宠物社区与萌宠日记 - 核心样式框架
   设计风格：暖橘+米白温馨宠物风
   ============================================ */

/* CSS 变量定义 */
:root {
  --primary: #FF8A65;
  --primary-dark: #E64A19;
  --secondary: #FFCCBC;
  --bg: #FFF9F5;
  --card: #FFFFFF;
  --accent: #4CAF50;
  --accent-light: #C8E6C9;
  --text: #4E342E;
  --text-light: #795548;
  --text-muted: #A1887F;
  --border: #FFCCBC;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 4px 16px rgba(255,138,101,0.15);
  --shadow-lg: 0 8px 32px rgba(255,138,101,0.2);
  --shadow-sm: 0 2px 8px rgba(255,138,101,0.1);
  --transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  --font-title: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-body: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --header-height: 72px;
}

/* 全局重置 */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

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

ul, ol {
  list-style: none;
}

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

/* ============================================
   头部导航
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 249, 245, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.site-logo .paw-icon {
  font-size: 1.8rem;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-main a {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-main a:hover,
.nav-main a.active {
  background: var(--secondary);
  color: var(--primary-dark);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================
   首屏 Hero
   ============================================ */
.hero-section {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--bg) 100%);
}

.hero-section .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  padding: 4rem 0;
}

.hero-content h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.hero-content .subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero-content .hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================
   按钮系统
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,138,101,0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255,138,101,0.4);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

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

.btn-accent:hover {
  background: #388E3C;
  color: #fff;
}

/* ============================================
   区块标题
   ============================================ */
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.section-title p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0.75rem auto 0;
}

/* ============================================
   卡片系统
   ============================================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

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

.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.card-body {
  padding: 1.25rem;
}

.card-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

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

/* 宠物档案卡片 */
.pet-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.pet-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px) rotate(1deg);
}

.pet-card .pet-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 4px solid var(--secondary);
}

.pet-card .pet-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.pet-card .pet-breed {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.pet-card .pet-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--secondary);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tag-green {
  background: var(--accent-light);
  color: #2E7D32;
}

/* ============================================
   网格布局
   ============================================ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

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

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

/* ============================================
   内容区块
   ============================================ */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--card);
}

/* 领养看板 */
.adoption-board {
  background: linear-gradient(135deg, #FFF3E0 0%, var(--bg) 100%);
  border-radius: var(--radius);
  padding: 2rem;
}

.adoption-item {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem;
  background: var(--card);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.adoption-item:hover {
  box-shadow: var(--shadow);
}

.adoption-item img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

.adoption-item .info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================
   FAQ 手风琴
   ============================================ */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-question {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.faq-question:hover {
  color: var(--primary);
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--primary);
  transition: var(--transition);
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--text-light);
  line-height: 1.8;
}

.faq-item.active .faq-answer {
  padding: 0 1.5rem 1.25rem;
  max-height: 500px;
}

/* ============================================
   页脚
   ============================================ */
.site-footer {
  background: var(--text);
  color: #fff;
  padding: 3rem 0 1.5rem;
}

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

.footer-brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.footer-desc {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  padding: 0.3rem 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--primary);
  padding-left: 4px;
}

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

.footer-bottom a {
  color: rgba(255,255,255,0.7);
}

/* ============================================
   面包屑
   ============================================ */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-light);
}

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

.breadcrumb span {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

/* ============================================
   内页通用
   ============================================ */
.page-header {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--bg) 100%);
  padding: 3rem 0;
  text-align: center;
}

.page-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.page-header p {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

.page-content {
  padding: 3rem 0;
}

.page-content p {
  margin-bottom: 1.25rem;
  line-height: 1.9;
}

.page-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 1rem;
}

.page-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 0.75rem;
}

/* ============================================
   搜索页
   ============================================ */
.search-box {
  max-width: 600px;
  margin: 2rem auto;
  display: flex;
  gap: 0;
}

.search-box input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-box button {
  padding: 1rem 2rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-box button:hover {
  background: var(--primary-dark);
}

.search-results {
  max-width: 800px;
  margin: 0 auto;
}

.search-result-item {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.search-result-item h3 a {
  color: var(--text);
  font-weight: 600;
}

.search-result-item h3 a:hover {
  color: var(--primary);
}

.search-result-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

/* ============================================
   404 页面
   ============================================ */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}

.error-page .error-code {
  font-size: 8rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1;
}

.error-page h1 {
  font-size: 1.8rem;
  color: var(--text);
  margin: 1rem 0;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ============================================
   动画
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pawPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  opacity: 0;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* 爪印装饰 */
.paw-decoration {
  position: absolute;
  font-size: 2rem;
  opacity: 0.1;
  color: var(--primary);
  pointer-events: none;
}

/* ============================================
   响应式断点
   ============================================ */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .nav-main {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .nav-main.active {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

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

  .section {
    padding: 2.5rem 0;
  }

  .section-title h2 {
    font-size: 1.6rem;
  }

  .hero-section {
    min-height: 400px;
  }

  .adoption-item {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

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

  .btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }
}

/* ============================================
   工具类
   ============================================ */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

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

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

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
