/* ===== PetLogic 寵物知識百科 Theme ===== */
:root {
  --primary: #2a9d8f;
  --primary-dark: #21867a;
  --primary-light: #e6f5f3;
  --secondary: #e76f51;
  --accent: #f4a261;
  --bg: #f8faf9;
  --bg-card: #ffffff;
  --text: #264653;
  --text-light: #6b7c85;
  --border: #e0e8e6;
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.10);
  --radius: 16px;
  --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

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

/* ===== Header ===== */
.site-header {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  padding: 22px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
  min-height: 90px;
  display: flex;
  align-items: center;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  position: relative;
  z-index: 1;
}
.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.site-logo .paw { font-size: 1.7rem; }
.site-nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.site-nav a {
  color: rgba(255,255,255,0.95);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.site-nav a:hover { color: white; transform: translateY(-1px); }

/* 簡易header（文章頁/blog頁使用） */
.site-header .logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.site-header .logo img { height: 32px; border-radius: 6px; }
.site-header .nav-links { display: flex; gap: 18px; align-items: center; }
.site-header .nav-links a {
  color: rgba(255,255,255,0.95);
  font-weight: 500;
  font-size: 0.92rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: all 0.2s;
}
.site-header .nav-links a:hover { color: white; }

/* Dropdown */
.dropdown { position: relative; }
.dropbtn {
  background: none; border: none; color: rgba(255,255,255,0.92);
  font-size: 0.95rem; font-weight: 500; cursor: pointer;
  font-family: inherit; display: flex; align-items: center; gap: 4px;
}
.dropbtn:hover { color: white; }
.dropdown-content {
  display: none; position: absolute; top: 100%; right: 0;
  background: white; min-width: 320px; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15); z-index: 200;
  padding: 16px; margin-top: 8px;
}
.dropdown-content.show { display: block; }
.dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px;
  font-size: 0.85rem; color: var(--text-light);
}
.dropdown-header .view-all { color: var(--primary); font-weight: 600; font-size: 0.85rem; }
.dropdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dropdown-item {
  display: block; padding: 10px 12px; border-radius: 8px;
  transition: background 0.2s;
}
.dropdown-item:hover { background: var(--primary-light); }
.dropdown-item .di-name { display: block; font-weight: 600; color: var(--text); font-size: 0.9rem; }
.dropdown-item .di-desc { display: block; font-size: 0.78rem; color: var(--text-light); margin-top: 2px; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, #d4ebe7 100%);
  padding: 60px 24px;
  text-align: center;
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  color: #000000;
  margin-bottom: 12px;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto;
}
.hero-stats {
  display: flex; justify-content: center; gap: 40px; margin-top: 32px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.hero-stat .label { font-size: 0.85rem; color: var(--text-light); }

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #000000;
}
.section-subtitle {
  color: var(--text-light);
  margin-bottom: 28px;
  font-size: 0.95rem;
}

/* ===== Category Grid ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.category-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  border-left: 4px solid var(--primary);
  display: block;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.category-card .cat-icon { font-size: 2rem; margin-bottom: 12px; }
.category-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; color: #000000; }
.category-card p { font-size: 0.88rem; color: var(--text-light); line-height: 1.6; }
.category-card .cat-count {
  display: inline-block; margin-top: 10px; font-size: 0.78rem;
  background: var(--primary-light); color: var(--primary);
  padding: 3px 10px; border-radius: 12px; font-weight: 600;
}

/* ===== Category Filter ===== */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
  justify-content: center;
}
.cat-btn {
  padding: 8px 20px;
  border: 2px solid var(--border);
  border-radius: 30px;
  background: white;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.cat-btn:hover, .cat-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== Post Grid ===== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 3px solid transparent;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}
.post-card-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--primary-light);
}
.post-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-card-cat {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
  align-self: flex-start;
}
.post-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #000000;
  margin-bottom: 8px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.post-card-meta {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #aaa;
  display: flex;
  justify-content: space-between;
}

/* ===== Single Post ===== */
.post-header {
  text-align: center;
  margin-bottom: 36px;
}
.post-category {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.post-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 16px;
  color: #000000;
}
.post-meta {
  color: var(--text-light);
  font-size: 0.9rem;
}
.post-meta span { margin: 0 6px; }

.post-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.post-gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
  background: var(--primary-light);
}
.post-gallery img:hover { transform: scale(1.02); }

.post-content {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 2;
}
.post-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 36px 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
  color: #000000;
}
.post-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: #000000;
}
.post-content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 10px;
  color: #000000;
}
.post-content p {
  margin-bottom: 18px;
  color: #3a4a52;
}
.post-content ul, .post-content ol {
  margin: 16px 0 16px 24px;
}
.post-content li { margin-bottom: 8px; }
.post-content blockquote {
  border-left: 4px solid var(--accent);
  background: #fffbf0;
  padding: 16px 24px;
  margin: 24px 0;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--text-light);
}
.post-content strong { color: var(--primary-dark); font-weight: 600; }
.post-content img {
  border-radius: 12px;
  margin: 24px auto;
  box-shadow: var(--shadow);
}

/* Highlight box */
.highlight-box {
  background: var(--primary-light);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
  border-left: 4px solid var(--primary);
}
.highlight-box h4 {
  color: var(--primary-dark);
  margin-bottom: 8px;
  margin-top: 0;
}
.highlight-box p { margin-bottom: 0; color: var(--text); }

/* Warning box */
.warning-box {
  background: #fff5f0;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
  border-left: 4px solid var(--secondary);
}
.warning-box h4 { color: var(--secondary); margin-bottom: 8px; margin-top: 0; }
.warning-box p { margin-bottom: 0; }

/* Related reading */
.related-reading {
  background: #f0f7f6;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 28px 0;
}
.related-reading h3 { font-size: 1.1rem; margin-bottom: 12px; color: var(--primary-dark); }
.related-reading ul { margin-left: 20px; }
.related-reading li { margin-bottom: 6px; }

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 40px 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-nav a {
  flex: 1;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}
.post-nav a:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.post-nav .nav-label { font-size: 0.8rem; color: var(--text-light); margin-bottom: 4px; }
.post-nav .nav-title { font-weight: 600; color: var(--text); font-size: 0.95rem; }
.post-nav .next { text-align: right; }
.post-nav .prev { text-align: left; }
.post-nav div:empty { display: none; }

/* Related section */
.related-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
}
.related-section h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.8);
  padding: 40px 0 24px;
  margin-top: 60px;
}
/* 動畫GIF底圖footer */
.footer-animated {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 0;
  overflow: hidden;
}
.footer-animated .footer-overlay {
  background: linear-gradient(180deg, rgba(15,15,25,0.75) 0%, rgba(15,15,25,0.92) 100%);
  padding: 36px 0 22px;
  width: 100%;
}
.footer-animated .container {
  text-align: center;
}
.footer-animated p {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.5px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand h3 { color: white; font-size: 1.3rem; margin-bottom: 10px; }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; }
.footer-col h4 { color: white; font-size: 0.95rem; margin-bottom: 14px; }
.footer-col a {
  display: block; color: rgba(255,255,255,0.7);
  font-size: 0.88rem; padding: 4px 0; transition: color 0.2s;
}
.footer-col a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 20px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}
.footer-links {
  display: flex; justify-content: center; gap: 20px; margin-bottom: 12px; flex-wrap: wrap;
}
.footer-links a { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.footer-links a:hover { color: white; }

/* ===== 404 Page ===== */
.error-page {
  text-align: center;
  padding: 80px 24px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.error-page .error-code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.error-page h1 { font-size: 1.8rem; margin: 16px 0; }
.error-page p { color: var(--text-light); margin-bottom: 24px; max-width: 480px; }
.error-page .btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 12px 32px;
  border-radius: 30px;
  font-weight: 600;
  transition: background 0.2s;
}
.error-page .btn:hover { background: var(--primary-dark); color: white; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { gap: 24px; }
  .hero-stat .num { font-size: 1.5rem; }
  .post-title { font-size: 1.6rem; }
  .post-gallery { grid-template-columns: 1fr; }
  .post-gallery img { height: 200px; }
  .post-nav { flex-direction: column; }
  .post-nav .next { text-align: left; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; }
  .dropdown-grid { grid-template-columns: 1fr; }
  .dropdown-content { min-width: 280px; right: -20px; }
  .site-nav { gap: 14px; }
  .site-nav a, .dropbtn { font-size: 0.88rem; }
}

@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
}
