/* ============================================================
   8宠之家 · 人宠生活指南 — 设计系统 v1.0
   混搭方案：日系温暖风(A)打底 + 暗色杂志风(C)评分武器化
   ============================================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
  --cream: #FFFAF5;
  --cream-warm: #FEF8F2;
  --white: #FFFFFF;
  --terracotta: #D27D56;
  --terracotta-hover: #B55C3A;
  --terracotta-light: rgba(210,125,86,0.08);
  --terracotta-glow: rgba(210,125,86,0.3);
  --brown: #4B3A32;
  --brown-light: #6B5A52;
  --warm-gray: #F3EBE4;
  --warm-gray-dark: #CBBDB2;
  --muted: #A38B7E;
  --text: #4B3A32;
  --text-light: #6B5A52;
  --text-muted: #A38B7E;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(75,58,50,0.06);
  --shadow-md: 0 4px 12px rgba(75,58,50,0.08);
  --shadow-lg: 0 8px 24px rgba(75,58,50,0.10);
  --font-heading: Georgia, 'Noto Serif SC', 'Source Han Serif SC', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --max-width: 1200px;
  --content-width: 680px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.7;
  min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.3; color: var(--brown); }
h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
a { color: var(--terracotta); text-decoration: none; transition: color 0.2s, border-color 0.2s; }
a:hover { color: var(--terracotta-hover); text-decoration: underline; }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.content-narrow { max-width: var(--content-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section-title {
  font-size: 1.5rem;
  color: var(--brown);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--warm-gray);
}

/* --- Header / Navigation --- */
.site-header {
  background: rgba(255,250,245,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--warm-gray);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--brown);
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-logo:hover { text-decoration: none; color: var(--terracotta); }
.site-logo .logo-icon { font-size: 1.5rem; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  color: var(--text-light);
  font-size: 0.9rem;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--terracotta);
  border-bottom-color: var(--terracotta);
  text-decoration: none;
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -12px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--warm-gray);
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  border-bottom: none !important;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}
.nav-dropdown-menu a:hover { background: var(--cream-warm); }

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--brown);
  padding: 4px;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cream-warm) 0%, #FDF0E6 50%, #FCE8D8 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 40px 24px;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero p {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.6;
}
.hero .hero-pets {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}
.hero .pet-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--white);
  background: var(--warm-gray);
  margin-left: -10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.hero .pet-avatar:first-child { margin-left: 0; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--terracotta);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--terracotta-hover);
  box-shadow: 0 4px 16px var(--terracotta-glow);
  text-decoration: none;
}
.btn-outline {
  border: 1.5px solid var(--terracotta);
  color: var(--terracotta);
  background: transparent;
}
.btn-outline:hover {
  background: var(--terracotta-light);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text-light);
}
.btn-ghost:hover { color: var(--terracotta); background: var(--terracotta-light); }

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--warm-gray);
  display: block;
}
.card-body { padding: 20px; }
.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.4;
}
.card-title a { color: var(--brown); }
.card-title a:hover { color: var(--terracotta); text-decoration: none; }
.card-text {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 12px;
}

/* --- Rating Circle (方案C weaponized) --- */
.rating-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--white);
  font-weight: 700;
  position: relative;
}
.rating-circle--lg { width: 72px; height: 72px; font-size: 1.5rem; }
.rating-circle--md { width: 48px; height: 48px; font-size: 1.1rem; }
.rating-circle--sm { width: 36px; height: 36px; font-size: 0.85rem; }

.rating-high { color: var(--terracotta); border: 3px solid var(--terracotta); }
.rating-mid { color: #A38B7E; border: 3px solid #CBBDB2; }
.rating-low { color: var(--muted); border: 3px solid var(--warm-gray); }

/* Rating on card image */
.card-rating {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

/* --- Product Card (with CTA) --- */
.product-card { position: relative; }
.product-card .card-img-wrap { position: relative; overflow: hidden; }
.product-card .card-rating {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.product-card .card-cta {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: center;
  background: var(--terracotta);
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  cursor: pointer;
  transition: background 0.2s;
}
.product-card .card-cta:hover {
  background: var(--terracotta-hover);
  text-decoration: none;
}
.product-card .card-cta-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}

/* --- Grid layouts --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* --- Horizontal scroll --- */
.h-scroll {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding: 4px 24px 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll .h-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
}

/* --- Icon grid --- */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: var(--white);
  border-radius: var(--radius-xl);
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.icon-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--cream-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.icon-label {
  font-weight: 600;
  color: var(--brown);
  font-size: 1rem;
}

/* --- Family entrance --- */
.family-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.family-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--warm-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}
.family-card:hover { transform: scale(1.02); }
.family-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(75,58,50,0.7) 0%, rgba(75,58,50,0.1) 60%);
  z-index: 1;
}
.family-card-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
}
.family-card-content h3 { color: var(--white); font-size: 1.75rem; margin-bottom: 8px; }
.family-card-content p { color: rgba(255,255,255,0.8); font-size: 0.95rem; }

/* --- Article page --- */
.article-header {
  padding: 48px 0 32px;
  text-align: center;
}
.article-header h1 { max-width: 720px; margin: 0 auto; }
.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 16px;
}
.article-featured-img {
  max-width: var(--max-width);
  margin: 0 auto 48px;
  padding: 0 24px;
}
.article-featured-img img {
  width: 100%;
  border-radius: var(--radius-lg);
  aspect-ratio: 16/9;
  object-fit: cover;
}
.article-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--brown);
}
.article-body p { margin-bottom: 1.5em; }
.article-body h2 {
  font-size: 1.5rem;
  margin: 2em 0 0.8em;
}
.article-body h3 {
  font-size: 1.2rem;
  margin: 1.5em 0 0.6em;
}

/* --- Recommendation card in article --- */
.rec-card {
  background: var(--cream-warm);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 32px 0;
  border: 1px solid var(--warm-gray);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.rec-card-img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--warm-gray);
  flex-shrink: 0;
}
.rec-card-info { flex: 1; }
.rec-card-info h4 { font-size: 1.1rem; margin-bottom: 8px; }
.rec-card-info p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 12px; }
.rec-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--terracotta);
  color: var(--white);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.rec-card-cta:hover { background: var(--terracotta-hover); text-decoration: none; color: var(--white); }
.rec-card-cta-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 4px;
}

/* --- Tags / Pills --- */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  background: var(--warm-gray);
  color: var(--text-light);
}
.tag-active { background: var(--terracotta); color: var(--white); }

/* --- Footer --- */
.site-footer {
  background: var(--brown);
  color: rgba(255,255,255,0.7);
  padding: 48px 24px 32px;
  margin-top: 80px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.footer-brand h3 { color: var(--white); font-size: 1.25rem; margin-bottom: 12px; }
.footer-brand p { font-size: 0.9rem; line-height: 1.6; }
.footer-links h4, .footer-social h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 16px; }
.footer-links ul, .footer-social ul { list-style: none; }
.footer-links a, .footer-social a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  line-height: 2;
  transition: color 0.2s;
}
.footer-links a:hover, .footer-social a:hover { color: var(--terracotta); text-decoration: none; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
}
.footer-bottom a { color: rgba(255,255,255,0.5); }
.footer-bottom a:hover { color: var(--terracotta); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero { min-height: 60vh; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .icon-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .family-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .site-header .nav-links { display: none; }
  .menu-toggle { display: block; }
  .section { padding: 40px 0; }
  .rec-card { flex-direction: column; }
  .rec-card-img { width: 100%; height: 180px; }

  /* Mobile nav open */
  .nav-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 16px 24px;
    gap: 8px;
    border-bottom: 1px solid var(--warm-gray);
    box-shadow: var(--shadow-md);
  }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 4px 0 4px 16px;
  }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  .h-scroll .h-card { flex: 0 0 240px; }
  .container, .content-narrow { padding: 0 16px; }
}
