@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');
@property --stop1 { syntax: '<percentage>'; inherits: false; initial-value: 30%; }
@property --stop2 { syntax: '<percentage>'; inherits: false; initial-value: 60%; }
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;padding:24px;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Helvetica Neue",Helvetica,Arial,'Noto Sans SC',sans-serif;background:#f5f5f7;color:#1d1d1f}
a{color:#06c;text-decoration:none}
a:hover{color:#0071e3}
h1,h2,h3,h4{color:#1d1d1f;margin:8px 0 16px}
hr{border:none;height:1px;background:#e5e5ea}

.page{max-width:1100px;margin:0 auto;background:#fff;border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,0.06);padding:24px}
.pageI{max-width:2200px;margin:0 auto;background:#fff;border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,0.06);padding:24px}

button{background:#0071e3;border:0;color:#ffffff;padding:12px 22px;border-radius:12px;box-shadow:0 2px 6px rgba(0,0,0,.08);cursor:pointer}
button:hover{background:#0077ed}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

input,select,textarea{padding:10px 12px;border:1px solid #d2d2d7;border-radius:12px;background:#fff;outline:none}
input:focus,select:focus,textarea:focus{border-color:#0071e3;box-shadow:0 0 0 3px rgba(0,113,227,0.2)}
.date-tip{font-size:12px;color:#999;margin-left:6px}
.input-tip{font-size:12px;color:#ff4d88;margin-left:6px}
input[data-date-ymd]:invalid{border-color:#ff4d88;box-shadow:0 0 0 3px rgba(255,77,136,0.15)}

.form-row{display:flex;align-items:center;gap:12px;margin:8px 0}
.form-row label{min-width:120px;color:#6e6e73}
.form-row input,.form-row select,.form-row textarea{flex:1}
.form-actions{display:flex;justify-content:flex-end;margin-top:12px}

table{width:100%;border-collapse:collapse;background:#fff;border-radius:16px;overflow:hidden}
table th{background:#fff;color:#6e6e73;padding:12px;font-weight:600;border-bottom:1px solid #e5e5ea}
table td{padding:12px;border-bottom:1px solid #e5e5ea}
table tr:hover td{background:#f9f9fb}

img{border-radius:16px;box-shadow:0 4px 12px rgba(0,0,0,0.08)}
.avatar{width:96px;height:96px;border-radius:50%;object-fit:cover;box-shadow:0 6px 12px rgba(122,167,255,0.18)}
.avatar-sm{width:48px;height:48px}

.status-bad{color:#ff4d88;background:#ffe6f2;padding:2px 8px;border-radius:12px}
.status-ok{color:#3aa86b;background:#eaffea;padding:2px 8px;border-radius:12px}

.nav a{display:inline-block;margin:0 6px 6px 0;padding:8px 12px;background:#ffffff;border-radius:16px;box-shadow:0 4px 8px rgba(0,0,0,0.06);transition: all 0.3s ease;}
.nav a:hover {transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.1);}

/* Modern Premium Card Style */
.card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease;
    margin-bottom: 24px;
    position: relative;
    backdrop-filter: blur(20px);
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 113, 227, 0.1);
    z-index: 1;
}

/* Specific tweaks for animal cards - Stronger selectors to override other styles */
#animals-grid .animal-card, .animal-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    text-align: left;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

#animals-grid .animal-card:hover, .animal-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 113, 227, 0.1);
    z-index: 1;
}

.animal-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
}

#animals-grid .animal-card img, .animal-image img {
    width: 100%;
    height: 100%;
    max-height: none; /* Override any max-height limitation */
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 20px 20px 0 0;
    box-shadow: none;
    margin: 0;
}

#animals-grid .animal-card:hover .animal-image img, .animal-card:hover .animal-image img {
    transform: scale(1.08);
}

.animal-info {
    padding: 24px;
    flex: 1;
    background: linear-gradient(to bottom, #ffffff, #fafafa);
}

.animal-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.animal-details {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.animal-details span {
    background: rgba(0, 113, 227, 0.06);
    color: #0071e3;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.animal-health {
    font-size: 0.9rem;
    color: #86868b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.animal-health::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34c759;
}

.animal-actions {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    background: #fafafa;
    border-radius: 0 0 20px 20px;
}

.btn-detail, .btn-adopt {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-detail {
    background: #ffffff;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.btn-detail:hover {
    background: #f5f5f7;
    border-color: #86868b;
}

.btn-adopt {
    background: #0071e3;
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 4px 10px rgba(0, 113, 227, 0.2);
}

.btn-adopt:hover {
    background: #0077ed;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.35);
}

/* Homepage Slider Cards */
#forum-slider .card, #knowledge-slider .card {
    min-width: 280px;
    margin: 10px;
    display: inline-block;
    vertical-align: top;
    white-space: normal;
    border-radius: 20px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

#forum-slider .card:hover, #knowledge-slider .card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 113, 227, 0.1);
    z-index: 1;
}

.navbar{position:sticky;top:0;z-index:1000;background:rgba(245,245,247,.85);backdrop-filter:saturate(180%) blur(10px);display:flex;align-items:center;justify-content:center;height:44px;border-bottom:1px solid #e5e5ea;margin-bottom:16px}
.navbar .links{display:flex;align-items:center;gap:22px}
.navbar .links a{color:#1d1d1f;font-size:13px;padding:6px 8px;border-radius:8px;position:relative}
.navbar .links a:hover{background:#e5e5ea}
.navbar .right{position:absolute;right:16px;display:flex;align-items:center;gap:12px}
.navbar .right a{color:#1d1d1f;font-size:13px}

.nav-avatar{position:relative}
.nav-avatar img{width:32px;height:32px;border-radius:50%;object-fit:cover;box-shadow:0 2px 6px rgba(0,0,0,0.08);cursor:pointer}
.logout-pop{position:absolute;right:0;top:40px;background:#fff;border:1px solid #e5e5ea;border-radius:10px;box-shadow:0 6px 16px rgba(0,0,0,0.12);padding:16px;display:none;flex-direction:column;gap:12px;white-space:nowrap;width:200px;align-items:center;z-index: 10000;}
.logout-pop .big-avatar {width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);}
.logout-pop a{color:#1d1d1f;text-decoration:none;font-size:14px;display:flex;align-items:center;gap:8px;width:100%;padding:8px 12px;border-radius:8px;transition:background 0.2s;}
.logout-pop a:hover{background:#f5f5f7}
.nav-avatar:hover .logout-pop{display:flex}
.nav-avatar.open .logout-pop{display:flex}

.subnav{position:sticky;top:44px;z-index:999;background:#fff;border-bottom:1px solid #e5e5ea;padding:8px 24px;margin-bottom:16px}
.subnav a{display:inline-block;margin:0 6px 6px 0;padding:8px 12px;background:#ffffff;border-radius:18px;box-shadow:0 2px 6px rgba(0,0,0,0.06);color:#0071e3}
.subnav .sep{color:#6e6e73;margin:0 4px}

.slider{overflow:auto;white-space:nowrap;border:1px solid #e5e5ea;border-radius:12px;padding:8px;-ms-overflow-style:none;scrollbar-width:none;margin: auto}
.slider::-webkit-scrollbar{display:none}

/* 首页背景轮播容器 */
#bg-slideshow{position:fixed;inset:0;z-index:-2;background-size:cover;background-position:center;transition:background-image 1s ease}

.pager{display:flex;justify-content:center;gap:12px;margin:16px 0}
.page-btn{min-width:36px;height:36px;line-height:36px;text-align:center;background:#eeeeee;border-radius:8px;color:#6e6e73;cursor:pointer;padding:0 12px;box-shadow:0 2px 6px rgba(0,0,0,0.06)}
.page-btn:hover{background:#e5e5ea}
.page-btn.active{background:#00b7ff;color:#ffffff}
.page-btn.disabled{opacity:.5;pointer-events:none}

/* 导航选中态样式 */
.navbar .links a.active{color:#07c}
.navbar .links a.active::after{content:"";position:absolute;left:50%;transform:translateX(-50%);bottom:-12px;width:36px;height:6px;background:#0ab;border-radius:6px;box-shadow:0 6px 12px rgba(0,113,227,0.28)}

.stats-footer{max-width:1200px;margin:24px auto;padding:12px 24px;display:flex;gap:16px;justify-content:space-between;opacity:.9}
.stats-card{flex:1;min-width:220px;background:#fff;border:1px solid #e5e5ea;border-radius:12px;box-shadow:0 4px 12px rgba(0,0,0,0.06);padding:12px 16px;display:flex;align-items:center;gap:12px}
.stats-icon{font-size:26px;color: #979696
}
.stats-main{font-size:16px;color:#333;font-weight:600}
.stats-sub{font-size:12px;color:#999}

@media (max-width:768px){
  .stats-footer{flex-direction:column;gap:12px;padding:12px}
  .stats-card{min-width:unset}
}

/* Masonry Grid Layout -> CSS Grid Layout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 20px;
  width: 100%;
}
@media (max-width: 1200px) { .grid-container { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .grid-container { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-container { grid-template-columns: 1fr; } }

.grid-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.2s;
  border: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.grid-card img.cover {
  width: 100%;
  display: block;
  object-fit: cover;
  /* Remove max-height to allow variable heights */
}

.grid-card .content-preview {
  padding: 24px;
  font-size: 14px;
  color: #333;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.6;
}

.grid-card .info {
  padding: 16px;
}

.grid-card .title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1d1d1f;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grid-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.grid-card .user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
  text-decoration: none;
}

.grid-card .user img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.action-btn{display:inline-flex;align-items:center;gap:6px}
.action-btn i{transition:transform .2s ease}
.action-btn:hover i{transform:scale(1.3)}
.feed-container{display:grid;grid-template-columns:repeat(4,1fr);gap:20px;margin-top:20px}
@media (max-width:1200px){.feed-container{grid-template-columns:repeat(3,1fr)}}
@media (max-width:900px){.feed-container{grid-template-columns:repeat(2,1fr)}}
@media (max-width:600px){.feed-container{grid-template-columns:1fr}}
.feed-card{width:100%;border-radius:16px;overflow:hidden;background:#fff;box-shadow:0 6px 20px rgba(0,0,0,0.06);border:1px solid #f0f0f0;transition:transform .2s ease,box-shadow .2s ease;display:flex;flex-direction:column}
.feed-card:hover{transform:translateY(-2px);box-shadow:0 12px 30px rgba(0,0,0,0.12)}
.feed-card .cover-wrap{position:relative}
.feed-cover{width:100%;aspect-ratio:3/4;object-fit:cover}
.feed-content{padding:12px 14px}
.feed-title{font-size:14px;font-weight:600;line-height:1.4;color:#1d1d1f;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.feed-meta{display:flex;align-items:center;justify-content:space-between;margin-top:8px}
.feed-user{display:flex;align-items:center;gap:8px;color:#666;text-decoration:none;font-size:12px}
.feed-user img{width:20px;height:20px;border-radius:50%;object-fit:cover}
.feed-like-badge{position:absolute;right:10px;top:10px;background:rgba(0,0,0,0.5);color:#fff;border-radius:12px;padding:4px 8px;font-size:12px;display:flex;align-items:center;gap:6px}
/* XHS top search bar */
.xhs-search{display:flex;align-items:center;background:#f3f3f3;border-radius:9999px;padding:8px 14px;gap:8px}
.xhs-search input{flex:1;border:none;background:transparent;outline:none;color:#333}
.xhs-search input::placeholder{color:#bbb}
.xhs-search button{border:none;background:transparent;color:#666;width:24px;height:24px;display:flex;align-items:center;justify-content:center;cursor:pointer}
.xhs-search button:hover{color:#000}

/* XHS Category Tabs */
.xhs-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  padding: 10px 0;
  margin-bottom: 16px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.xhs-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.xhs-tab-item {
  font-size: 16px;
  color: #999;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  padding: 6px 12px;
  border-radius: 99px;
}
.xhs-tab-item:hover {
  color: #333;
}
.xhs-tab-item.active {
  color: #333;
  font-weight: bold;
  background-color: #f3f3f3;
}
