/* ============================================================
   home-cat.css — 首页 + 猫咪档案/列表/详情/讨论 模块样式
   风格：白色背景 + 卡片式设计，蓝色 + 紫色渐变主题
   依赖 style.css 中的 CSS 变量与基础类（.modal / .btn / .empty-state 等）
   ============================================================ */

/* ---------- 首页 Hero（优化版：保留蓝紫渐变，强化层次） ---------- */
.hero-section {
  position: relative;
  overflow: hidden;
}
.hero-section .hero-content {
  position: relative;
  z-index: 1;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -120px;
  left: 30%;
  width: 360px;
  height: 360px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}
.hero-stats-row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.hero-stat-chip {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  color: #fff;
}
.hero-stat-chip b {
  font-size: 16px;
  margin-right: 4px;
}

/* 首页猫咪预览网格：桌面多列，手机 2 列 */
.cat-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 900px) {
  .cat-preview-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .cat-preview-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-preview-image { height: 120px; }
}

/* ---------- 猫咪列表页（档案页） ---------- */
.cats-page-header {
  padding: 8px 0 16px;
}
.cats-page-header .page-subtitle {
  color: var(--purple-color);
  letter-spacing: 2px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.cats-page-header .page-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 搜索栏 */
.cats-search-bar {
  margin-bottom: 14px;
}
.cats-search-bar .search-box {
  padding: 0 16px;
  height: 46px;
}

/* 筛选标签 */
.cat-filter-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.cat-filter-row::-webkit-scrollbar { display: none; }
.cat-filter-chip {
  flex-shrink: 0;
  padding: 7px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  user-select: none;
}
.cat-filter-chip:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.cat-filter-chip.active {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-dark);
  font-weight: 600;
}
.cat-filter-divider {
  flex-shrink: 0;
  width: 1px;
  background: var(--border-color);
  margin: 2px 4px;
}

/* 在档猫咪统计条 */
.cat-count-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.cat-count-strip .strip-icon {
  font-size: 20px;
}
.cat-count-strip .strip-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.cat-count-strip .strip-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

/* 瀑布流 */
.cat-waterfall {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.cat-waterfall-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 新版猫咪卡片 */
.cat-card-new {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.cat-card-new:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
/* 置顶拐角角标 */
.cat-top-corner {
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  z-index: 5;
  pointer-events: none;
}
.cat-top-corner::after {
  content: '置顶';
  position: absolute;
  top: 6px;
  left: 6px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  transform: rotate(-45deg);
}

.cat-card-new .card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 8px;
}
.cat-card-new .card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.cat-card-new .card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cat-card-new .card-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-card-new .card-img-wrap {
  width: 100%;
  background: var(--bg-primary);
  overflow: hidden;
}
.cat-card-new .card-img {
  width: 100%;
  display: block;
  min-height: 160px;
  object-fit: cover;
}
.cat-card-new .card-img-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  gap: 6px;
}
.cat-card-new .card-img-placeholder .ph-emoji { font-size: 40px; opacity: 0.4; }

.cat-card-new .card-foot {
  padding: 10px 14px 14px;
}
.cat-card-new .foot-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.cat-card-new .foot-breed {
  color: var(--text-secondary);
  font-weight: 500;
}
.cat-card-new .foot-gender-male { color: var(--primary-color); font-weight: 700; }
.cat-card-new .foot-gender-female { color: #ec4899; font-weight: 700; }
.cat-card-new .foot-neutered-yes { color: var(--success-color); font-weight: 500; }
.cat-card-new .foot-neutered-no { color: #f59e0b; font-weight: 500; }
.cat-card-new .foot-health {
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.cat-card-new .foot-health.healthy { background: #d1fae5; color: var(--success-color); }
.cat-card-new .foot-health.good { background: #dbeafe; color: var(--primary-color); }
.cat-card-new .foot-health.normal { background: #fef3c7; color: var(--warning-color); }
.cat-card-new .foot-health.need-treatment { background: #fee2e2; color: var(--danger-color); }

/* 骨架屏 */
.cat-skeleton {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.cat-skeleton-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.skeleton-block {
  background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 50%, #eef2f7 75%);
  background-size: 200% 100%;
  animation: catShine 1.4s infinite;
}
.skeleton-img { width: 100%; height: 180px; }
.skeleton-line { height: 14px; border-radius: 6px; margin: 12px 14px 8px; }
.skeleton-line.short { width: 50%; margin-bottom: 16px; }
@keyframes catShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- 猫咪详情页 增强 ---------- */
.detail-image-wrap .detail-image { display: block; }
/* 详情内联编辑表单（web 端使用弹窗，此处预留） */

/* 动态/评论底部发布栏：web 端固定在卡片内，不悬浮 */
.bottom-publish-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  border-radius: 0;
  margin: 16px -24px -24px;
  padding: 12px 24px;
}
.dynamic-content, .comment-content { padding-bottom: 0; }

/* 详情页返回按钮 */
.back-btn { font-size: 14px; }

/* ---------- 编辑/添加猫咪弹窗：多图上传 ---------- */
.edit-cat-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.edit-cat-image-item {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-primary);
}
.edit-cat-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.edit-cat-image-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.edit-cat-add-btn {
  width: 88px;
  height: 88px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  gap: 2px;
  transition: all 0.2s;
}
.edit-cat-add-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.edit-cat-add-btn .plus { font-size: 26px; line-height: 1; }
.edit-cat-add-btn .txt { font-size: 11px; }
.edit-cat-image-tip {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ---------- 猫咪讨论页（独立页） ---------- */
.cat-discuss-page {
  max-width: 860px;
  margin: 0 auto;
}
.cat-discuss-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.cat-discuss-header .cdh-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.cat-discuss-header .cdh-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.cat-discuss-header .cdh-desc {
  font-size: 12px;
  color: var(--text-muted);
}
.cat-discuss-header .cdh-count {
  margin-left: auto;
  font-size: 12px;
  background: var(--purple-light);
  color: var(--purple-color);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.discussion-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.discussion-card .disc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.discussion-card .disc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  flex-shrink: 0;
}
.discussion-card .disc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.discussion-card .disc-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.discussion-card .disc-admin-badge {
  font-size: 10px;
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.discussion-card .disc-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.discussion-card .disc-content {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.discussion-card .disc-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.discussion-card .disc-images img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.discussion-card .disc-actions {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}
.discussion-card .disc-action {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.discussion-card .disc-action:hover { color: var(--primary-color); }
.discussion-card .disc-action.danger:hover { color: var(--danger-color); }

/* 回复列表 */
.reply-list {
  margin-top: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reply-item .reply-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reply-item .reply-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.reply-item .reply-time { font-size: 11px; color: var(--text-muted); }
.reply-item .reply-content {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
  margin-top: 4px;
}
.reply-item .reply-images {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.reply-item .reply-images img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}
.reply-item .reply-del {
  font-size: 12px;
  color: var(--danger-color);
  cursor: pointer;
  margin-left: auto;
}

/* 回复输入框（内嵌） */
.reply-inline-form {
  margin-top: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
}
.reply-inline-form textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: vertical;
  font-size: 13px;
  font-family: inherit;
  min-height: 60px;
  background: transparent;
}
.reply-inline-form .ri-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* 讨论页悬浮发布按钮 */
.cat-discuss-fab {
  position: fixed;
  right: 28px;
  bottom: 90px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  border: none;
}
.cat-discuss-fab:hover { transform: scale(1.08); }

/* 讨论/发布 底部弹层（动态注入） */
.cd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cd-overlay-middle { align-items: center; }
.cd-sheet {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.cd-overlay-middle .cd-sheet { border-radius: 20px; margin: 20px; }
.cd-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.cd-sheet-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.cd-sheet-close {
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.cd-sheet-body {
  padding: 16px 20px;
  overflow-y: auto;
}
.cd-sheet-foot {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
}
.cd-sheet textarea.cd-textarea {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}
.cd-sheet textarea.cd-textarea:focus { border-color: var(--primary-color); }

/* 响应式：手机端 */
@media (max-width: 640px) {
  .cat-waterfall { gap: 10px; }
  .cat-card-new .card-img { min-height: 130px; }
  .cat-card-new .card-img-placeholder { height: 140px; }
  .detail-header { padding: 16px; }
  .detail-tabs { padding: 0 12px; }
  .tab-content { padding: 16px; }
  .bottom-publish-bar { margin: 16px -16px -16px; padding: 10px 16px; }
}
