/* ===================================
   宠物小站 - 高端大气响应式样式
   =================================== */

:root {
  --primary: #ff8c42;
  --primary-dark: #e67332;
  --primary-light: #ffa566;
  --secondary: #4a7c59;
  --secondary-dark: #3a6345;
  --bg-light: #faf8f5;
  --bg-white: #ffffff;
  --text-dark: #2d3436;
  --text-gray: #636e72;
  --text-light: #b2bec3;
  --border: #e8e4df;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-dark);
  background: var(--bg-light);
}

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

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

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===================================
   Header
   =================================== */
.header {
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
}

.logo-text span {
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  padding: 10px 20px;
  color: var(--text-dark);
  font-weight: 500;
  border-radius: var(--radius-sm);
  position: relative;
}

.nav a:hover,
.nav a.active {
  color: var(--primary);
  background: rgba(255, 140, 66, 0.1);
}

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.mobile-menu-btn span {
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  transition: var(--transition);
}

/* ===================================
   Hero Banner
   =================================== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 80px 0;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></svg>') repeat;
  animation: float 20s linear infinite;
}

@keyframes float {
  from { transform: translate(0, 0); }
  to { transform: translate(50px, 50px); }
}

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

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero p {
  font-size: 20px;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
}

/* ===================================
   Category Nav
   =================================== */
.category-nav {
  background: var(--bg-white);
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.category-list a {
  padding: 10px 24px;
  background: var(--bg-light);
  color: var(--text-dark);
  border-radius: 30px;
  font-weight: 500;
  border: 2px solid transparent;
  transition: var(--transition);
}

.category-list a:hover,
.category-list a.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===================================
   Main Content
   =================================== */
.main {
  padding: 60px 0;
  min-height: 60vh;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}

/* ===================================
   Article Grid
   =================================== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 30px;
}

.article-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

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

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.article-card-category {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 14px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
}

.article-card-body {
  padding: 24px;
}

.article-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-title a {
  color: inherit;
}

.article-card-title a:hover {
  color: var(--primary);
}

.article-card-excerpt {
  color: var(--text-gray);
  font-size: 14px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-light);
}

.article-card-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===================================
   Article List (Sidebar Style)
   =================================== */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.article-list-item {
  display: flex;
  gap: 20px;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.article-list-item-image {
  width: 280px;
  height: 200px;
  flex-shrink: 0;
}

.article-list-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-list-item-body {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-list-item-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.article-list-item-title a {
  color: var(--text-dark);
}

.article-list-item-title a:hover {
  color: var(--primary);
}

.article-list-item-excerpt {
  color: var(--text-gray);
  font-size: 15px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===================================
   Detail Page
   =================================== */
.detail-header {
  margin-bottom: 40px;
}

.detail-category {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 16px;
}

.detail-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 20px;
  color: var(--text-dark);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--text-gray);
  font-size: 14px;
}

.detail-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-cover {
  width: 100%;
  height: 480px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 40px;
}

.detail-content {
  background: var(--bg-white);
  padding: 48px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 17px;
  line-height: 2;
  color: var(--text-dark);
}

.detail-content p {
  margin-bottom: 24px;
}

.detail-content h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 40px 0 20px;
  color: var(--text-dark);
}

.detail-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--text-dark);
}

.detail-content ul,
.detail-content ol {
  margin: 0 0 24px 24px;
}

.detail-content li {
  margin-bottom: 8px;
}

/* ===================================
   Sidebar
   =================================== */
.sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.sidebar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list a {
  color: var(--text-dark);
  font-size: 15px;
  display: block;
  transition: var(--transition);
}

.sidebar-list a:hover {
  color: var(--primary);
  padding-left: 8px;
}

/* ===================================
   Tags
   =================================== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 6px 14px;
  background: var(--bg-light);
  color: var(--text-gray);
  border-radius: 20px;
  font-size: 13px;
  transition: var(--transition);
}

.tag:hover {
  background: var(--primary);
  color: white;
}

/* ===================================
   Pagination
   =================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 60px;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  min-width: 44px;
  height: 44px;
  background: var(--bg-white);
  color: var(--text-dark);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.pagination a:hover,
.pagination span.current {
  background: var(--primary);
  color: white;
}

.pagination span.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===================================
   Footer
   =================================== */
.footer {
  background: var(--text-dark);
  color: white;
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 48px;
  margin-bottom: 48px;
}

.footer-section h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary-light);
}

.footer-section p {
  color: var(--text-light);
  line-height: 1.8;
}

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

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

.footer-links a {
  color: var(--text-light);
  transition: var(--transition);
}

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

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: var(--text-light);
  font-size: 14px;
}

/* ===================================
   Empty State
   =================================== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-gray);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--text-dark);
}

/* ===================================
   Loading
   =================================== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 1199px) {
  .container {
    max-width: 960px;
  }
  
  .hero h1 {
    font-size: 40px;
  }
  
  .article-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  
  .detail-cover {
    height: 400px;
  }
}

@media (max-width: 991px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    flex-direction: column;
    padding: 20px;
    box-shadow: var(--shadow);
  }
  
  .nav.active {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .article-list-item {
    flex-direction: column;
  }
  
  .article-list-item-image {
    width: 100%;
    height: 240px;
  }
  
  .detail-content {
    padding: 32px 24px;
  }
  
  .detail-title {
    font-size: 28px;
  }
}

@media (max-width: 767px) {
  .container {
    max-width: 100%;
  }
  
  .header-inner {
    height: 64px;
  }
  
  .logo-text {
    font-size: 20px;
  }
  
  .logo-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .hero {
    padding: 60px 0;
  }
  
  .hero h1 {
    font-size: 32px;
  }
  
  .hero p {
    font-size: 16px;
  }
  
  .category-list {
    gap: 8px;
  }
  
  .category-list a {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .main {
    padding: 40px 0;
  }
  
  .section-title h2 {
    font-size: 24px;
  }
  
  .article-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .article-card-image {
    height: 200px;
  }
  
  .article-card-body {
    padding: 20px;
  }
  
  .article-card-title {
    font-size: 18px;
  }
  
  .detail-cover {
    height: 280px;
  }
  
  .detail-content {
    padding: 24px 16px;
    font-size: 16px;
  }
  
  .detail-title {
    font-size: 24px;
  }
  
  .footer-inner {
    gap: 32px;
  }
  
  .pagination a,
  .pagination span {
    padding: 0 12px;
    min-width: 36px;
    height: 40px;
    font-size: 14px;
  }
}

/* ===================================
   Animations
   =================================== */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ===================================
   Article Layout
   =================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

.article-detail {
  min-width: 0;
}

.detail-excerpt {
  background: var(--bg-light);
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  margin-bottom: 32px;
  font-size: 15px;
  color: var(--text-gray);
  line-height: 1.8;
  border-left: 4px solid var(--primary);
}

.related-articles {
  margin-top: 60px;
}

.related-articles .section-title {
  margin-bottom: 24px;
}

/* ===================================
   Page Header
   =================================== */
.page-header {
  background: var(--bg-white);
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  padding: 12px 0;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

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

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

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

.breadcrumb .container {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===================================
   Sidebar Widgets
   =================================== */
.sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list a {
  color: var(--text-dark);
  font-size: 15px;
  display: block;
  transition: var(--transition);
}

.sidebar-list a:hover {
  color: var(--primary);
  padding-left: 6px;
}

/* ===================================
   Category Header
   =================================== */
.category-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 60px 0;
  text-align: center;
  color: white;
}

.category-header h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
}

.category-header p {
  font-size: 18px;
  opacity: 0.9;
}

/* ===================================
   Responsive Adjustments
   =================================== */
@media (max-width: 991px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
  }
  
  .detail-title {
    font-size: 28px;
  }
  
  .detail-content {
    padding: 32px 24px;
  }
}

@media (max-width: 767px) {
  .detail-title {
    font-size: 24px;
  }
  
  .detail-cover {
    height: 280px;
  }
  
  .detail-content {
    padding: 24px 16px;
  }
  
  .detail-meta {
    gap: 12px;
  }
}

/* ===================================
   Reading Progress Bar
   =================================== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  z-index: 10000;
  transition: width 0.1s ease;
}

/* ===================================
   Article Tags
   =================================== */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.article-tags .tag {
  padding: 6px 14px;
  background: var(--bg-light);
  color: var(--text-gray);
  border-radius: 20px;
  font-size: 13px;
  transition: var(--transition);
}

.article-tags .tag:hover {
  background: var(--primary);
  color: white;
}

/* ===================================
   Share Buttons
   =================================== */
.share-buttons {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding: 20px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
}

.share-btn {
  padding: 8px 16px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.share-btn:hover {
  background: var(--primary);
  color: white;
}

/* ===================================
   Back to Top Button
   =================================== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 140, 66, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 9999;
}

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

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