/* ======== 宠物大世界 - 全新视觉主题 ======== */

/* ---- CSS 变量 ---- */
:root {
  --pet-primary: #2d6a4f;
  --pet-primary-light: #40916c;
  --pet-primary-dark: #1b4332;
  --pet-secondary: #e76f51;
  --pet-accent: #f4a261;
  --pet-warm: #e9c46a;
  --pet-bg: #f0f7f4;
  --pet-card-bg: #ffffff;
  --pet-text: #2d2d2d;
  --pet-text-muted: #6b7280;
  --pet-gradient: linear-gradient(135deg, #2d6a4f 0%, #40916c 50%, #52b788 100%);
  --pet-gradient-warm: linear-gradient(135deg, #e76f51 0%, #f4a261 50%, #e9c46a 100%);
  --pet-shadow: 0 4px 20px rgba(45, 106, 79, 0.15);
  --pet-shadow-hover: 0 8px 30px rgba(45, 106, 79, 0.25);
  --pet-radius: 16px;
  --pet-radius-sm: 10px;
  --pet-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- 全局样式 ---- */
body {
  background: var(--pet-bg);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--pet-text);
  scroll-behavior: smooth;
}

/* ---- 导航栏 ---- */
.pet-navbar {
  background: var(--pet-gradient) !important;
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.3);
  padding: 0.6rem 0;
}

.pet-navbar .navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  color: #fff !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pet-navbar .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: var(--pet-transition);
  position: relative;
}

.pet-navbar .nav-link:hover,
.pet-navbar .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,0.15);
}

.pet-navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease;
}

.pet-navbar .nav-link:hover::after,
.pet-navbar .nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

.pet-navbar .btn-outline-light {
  border-color: rgba(255,255,255,0.5);
  border-radius: 20px;
  padding: 0.375rem 1.2rem;
  transition: var(--pet-transition);
}

.pet-navbar .btn-outline-light:hover {
  background: #fff;
  color: var(--pet-primary) !important;
  border-color: #fff;
}

.pet-search-input {
  border-radius: 20px !important;
  border: none !important;
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
  padding-left: 1rem !important;
}

.pet-search-input::placeholder {
  color: rgba(255,255,255,0.6) !important;
}

.pet-search-input:focus {
  background: rgba(255,255,255,0.25) !important;
  box-shadow: none !important;
}

/* ---- 导航栏下拉菜单 ---- */
.pet-navbar .dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  padding: 0.5rem;
  min-width: 180px;
  margin-top: 8px !important;
}

.pet-navbar .dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  color: var(--pet-text);
  transition: var(--pet-transition);
}

.pet-navbar .dropdown-item:hover {
  background: #e8f5e9;
  color: var(--pet-primary);
  padding-left: 1.3rem;
}

.pet-navbar .dropdown-item.active {
  background: var(--pet-gradient);
  color: #fff;
}

.pet-navbar .dropdown-item i {
  margin-right: 8px;
  text-align: center;
}

/* ---- 左侧分类侧边栏 ---- */
.pet-sidebar .card {
  border: none;
  border-radius: var(--pet-radius);
  overflow: hidden;
  box-shadow: var(--pet-shadow);
}

.pet-sidebar .card-header {
  background: var(--pet-gradient) !important;
  border: none;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
}

.pet-sidebar .list-group-item {
  border: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 0.75rem 1.25rem;
  color: var(--pet-text);
  font-weight: 500;
  transition: var(--pet-transition);
  position: relative;
  overflow: hidden;
}

.pet-sidebar .list-group-item:last-child {
  border-bottom: none;
}

.pet-sidebar .list-group-item:hover {
  background: #e8f5e9;
  color: var(--pet-primary);
  padding-left: 1.75rem;
}

.pet-sidebar .list-group-item.active {
  background: var(--pet-gradient) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600;
}

.pet-sidebar .list-group-item i {
  width: 20px;
  margin-right: 8px;
}

.pet-sidebar .loading {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e0e0e0;
  border-top: 3px solid var(--pet-primary);
  border-radius: 50%;
  animation: pet-spin 0.8s linear infinite;
}

/* ---- Hero Banner ---- */
.pet-hero {
  background: var(--pet-gradient) !important;
  border-radius: var(--pet-radius);
  padding: 2.5rem !important;
  position: relative;
  overflow: hidden;
  box-shadow: var(--pet-shadow);
}

.pet-hero::before {
  content: '🐾🐱🐶🐰🦜🐠🦎🐹';
  position: absolute;
  right: -20px;
  top: -20px;
  font-size: 4rem;
  opacity: 0.15;
  transform: rotate(15deg);
  pointer-events: none;
}

.pet-hero::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  bottom: -60px;
  right: 30%;
  pointer-events: none;
}

.pet-hero h1 {
  font-weight: 800;
  font-size: 2.2rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pet-hero .lead {
  font-size: 1.05rem;
  opacity: 0.9;
  max-width: 600px;
}

/* ---- 宠物卡片 ---- */
.pet-card {
  border: none;
  border-radius: var(--pet-radius);
  overflow: hidden;
  transition: var(--pet-transition);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  background: var(--pet-card-bg);
  height: 100%;
  cursor: pointer;
}

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

.pet-card .card-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.pet-card .card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.pet-card:hover .card-img-wrapper img {
  transform: scale(1.1);
}

.pet-card .card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.pet-card .card-img-placeholder i {
  font-size: 3rem;
  color: var(--pet-primary-light);
  opacity: 0.6;
}

.pet-card .card-body {
  padding: 1.25rem;
}

.pet-card .card-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  color: var(--pet-text);
}

.pet-card .scientific-name {
  font-style: italic;
  color: var(--pet-text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.pet-card .card-text {
  font-size: 0.88rem;
  color: var(--pet-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pet-card .card-footer {
  background: transparent;
  border-top: 1px solid #f0f0f0;
  padding: 0.75rem 1.25rem;
}

.pet-card .view-count {
  font-size: 0.82rem;
  color: var(--pet-text-muted);
}

.pet-view-btn {
  border-radius: 20px;
  padding: 0.25rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--pet-gradient);
  border: none;
  color: #fff;
  transition: var(--pet-transition);
}

.pet-view-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
  color: #fff;
}

/* ---- 详情页 ---- */
.pet-detail-breadcrumb {
  background: transparent;
  padding: 0.75rem 0;
}

.pet-detail-breadcrumb .breadcrumb-item a {
  color: var(--pet-primary);
  text-decoration: none;
  font-weight: 500;
}

.pet-detail-breadcrumb .breadcrumb-item.active {
  color: var(--pet-text-muted);
}

.pet-detail-card {
  border: none;
  border-radius: var(--pet-radius);
  overflow: hidden;
  box-shadow: var(--pet-shadow);
}

.pet-detail-card .detail-header {
  position: relative;
  max-height: 420px;
  overflow: hidden;
}

.pet-detail-card .detail-header img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.pet-detail-card .detail-body {
  padding: 2rem;
}

.pet-detail-card .pet-name {
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--pet-text);
}

.pet-detail-card .scientific-name {
  font-style: italic;
  color: var(--pet-text-muted);
  font-size: 1rem;
}

.pet-detail-card .alias {
  color: var(--pet-text-muted);
  font-size: 0.95rem;
}

.pet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pet-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  background: #f0f7f4;
  color: var(--pet-primary);
}

.pet-tag i {
  font-size: 0.85rem;
}

.pet-section {
  margin-bottom: 1.5rem;
}

.pet-section h4 {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--pet-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pet-section h4 i {
  font-size: 1rem;
}

.pet-section p {
  color: var(--pet-text);
  line-height: 1.7;
  font-size: 0.95rem;
}

.pet-detail-footer {
  border-top: 1px solid #f0f0f0;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--pet-text-muted);
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.pet-like-btn, .pet-collect-btn {
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  transition: var(--pet-transition);
}

.pet-like-btn:hover,
.pet-collect-btn:hover {
  transform: translateY(-2px);
}

/* ---- 分类页标题 ---- */
.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.category-header h3 {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--pet-primary);
}

.category-header .category-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pet-gradient);
  color: #fff;
  font-size: 1.4rem;
}

.category-header .category-desc {
  color: var(--pet-text-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

/* ---- 搜索结果 ---- */
.search-box {
  background: var(--pet-card-bg);
  border-radius: var(--pet-radius);
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
}

.search-box .search-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box .search-form input {
  flex: 1;
  min-width: 200px;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  padding: 0.6rem 1rem;
  transition: var(--pet-transition);
}

.search-box .search-form input:focus {
  border-color: var(--pet-primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
  outline: none;
}

.search-box .search-btn {
  border-radius: 12px;
  padding: 0.6rem 1.5rem;
  background: var(--pet-gradient);
  border: none;
  font-weight: 600;
  transition: var(--pet-transition);
}

.search-box .search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
}

/* ---- 分页 ---- */
.pet-pagination {
  margin-top: 2rem;
}

.pet-pagination .page-link {
  border: none;
  margin: 0 3px;
  border-radius: 10px;
  color: var(--pet-primary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: var(--pet-transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pet-pagination .page-link:hover {
  background: #e8f5e9;
  color: var(--pet-primary-dark);
  transform: translateY(-1px);
}

.pet-pagination .page-item.active .page-link {
  background: var(--pet-gradient);
  border: none;
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
}

.pet-pagination .page-item.disabled .page-link {
  background: #f5f5f5;
  color: #ccc;
}

/* ---- 空状态 ---- */
.pet-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.pet-empty .empty-icon {
  font-size: 5rem;
  color: var(--pet-primary-light);
  opacity: 0.3;
  margin-bottom: 1rem;
  display: block;
}

.pet-empty h5 {
  color: var(--pet-text-muted);
  font-weight: 600;
}

.pet-empty p {
  color: #9ca3af;
  font-size: 0.9rem;
}

/* ---- 页脚 ---- */
.pet-footer {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%) !important;
  position: relative;
  overflow: hidden;
}

.pet-footer::before {
  content: '🐾🐱🐶🐰🦜🐠';
  position: absolute;
  left: 0;
  top: 0;
  font-size: 3rem;
  opacity: 0.06;
  transform: rotate(-10deg);
  pointer-events: none;
}

.pet-footer h5, .pet-footer h6 {
  font-weight: 700;
}

.pet-footer a {
  transition: var(--pet-transition);
}

.pet-footer a:hover {
  color: var(--pet-accent) !important;
  padding-left: 4px;
}

/* ---- 动画 ---- */
@keyframes pet-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pet-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.pet-animate-in {
  animation: pet-fade-in 0.5s ease forwards;
}

/* ---- 响应式 ---- */
@media (max-width: 991px) {
  .pet-hero h1 {
    font-size: 1.8rem;
  }
}

@media (max-width: 767px) {
  .pet-sidebar {
    margin-bottom: 1rem;
  }
  
  .pet-hero {
    padding: 1.5rem !important;
  }
  
  .pet-hero h1 {
    font-size: 1.5rem;
  }
  
  .pet-detail-card .detail-body {
    padding: 1.25rem;
  }
  
  .pet-detail-footer {
    flex-direction: column;
  }
  
  .detail-actions {
    width: 100%;
  }
  
  .detail-actions button {
    flex: 1;
  }
  
  .search-box .search-form {
    flex-direction: column;
  }
  
  .search-box .search-form input {
    min-width: auto;
  }
}

/* ---- 广告位样式 ---- */
.ad-slot {
  min-height: 90px;
  margin: 1.5rem 0;
  text-align: center;
  overflow: hidden;
  border-radius: var(--pet-radius-sm);
  background: transparent;
  transition: min-height 0.3s ease;
}

/* 广告加载中占位 */
.ad-slot .ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 90px;
  border: 1px dashed #d4edda;
  border-radius: var(--pet-radius-sm);
  background: #f0f7f4;
  color: var(--pet-text-muted);
  font-size: 0.8rem;
}

.ad-slot .ad-label {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--pet-primary-light);
  color: #fff;
  font-size: 0.7rem;
}

/* 响应式广告高度 */
@media (max-width: 767px) {
  .ad-slot { min-height: 60px; }
  .ad-slot .ad-placeholder { min-height: 60px; }
}

/* 详情页内嵌广告 - 更紧凑 */
.ad-slot-inline {
  margin: 1rem 0;
  min-height: 60px;
}

/* ---- 分类徽章颜色 ---- */
.pet-tag-origin { background: #fff3e0; color: #e65100; }
.pet-tag-size { background: #e3f2fd; color: #1565c0; }
.pet-tag-lifespan { background: #e8f5e9; color: #2e7d32; }
