/* ===== 种草集 全局样式 ===== */
:root {
  --primary: #FF6B35;
  --primary-light: #FF8C5E;
  --primary-dark: #E55A28;
  --primary-bg: #FFF5F0;
  --secondary: #FFB347;
  --accent: #FF4757;
  --success: #2ED573;
  --text-primary: #1A1A2E;
  --text-secondary: #666680;
  --text-muted: #9999AA;
  --bg-white: #FFFFFF;
  --bg-light: #F8F9FF;
  --bg-gray: #F0F0F5;
  --border: #EEEEF5;
  --shadow-sm: 0 2px 8px rgba(255,107,53,0.08);
  --shadow-md: 0 4px 20px rgba(255,107,53,0.12);
  --shadow-lg: 0 8px 40px rgba(255,107,53,0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --nav-height: 60px;
  --tab-height: 64px;
  --font: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: var(--font);
  background: var(--bg-light);
  color: var(--text-primary);
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== 顶部导航 ===== */
.top-nav {
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: var(--nav-height);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 100;
  box-shadow: 0 1px 12px rgba(0,0,0,0.04);
}
.nav-logo {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}
.nav-logo span { font-size: 13px; font-weight: 500; margin-left: 4px; }
.nav-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  transition: all 0.2s;
}
.nav-icon-btn:active { background: var(--primary-bg); color: var(--primary); transform: scale(0.92); }
.nav-actions { display: flex; gap: 8px; align-items: center; }

/* ===== 底部标签栏 ===== */
.bottom-tabs {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: var(--tab-height);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  transition: all 0.2s;
  padding: 6px 0;
}
.tab-item.active { color: var(--primary); }
.tab-item .tab-icon { font-size: 22px; line-height: 1; }
.tab-item.publish-btn { flex: 0 0 72px; }
.tab-item.publish-btn .tab-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(255,107,53,0.4);
  transform: translateY(-4px);
  transition: all 0.2s;
}
.tab-item.publish-btn:active .tab-icon { transform: translateY(-4px) scale(0.92); }
.tab-item.publish-btn span { color: var(--text-muted); }

/* ===== 页面内容区 ===== */
.page-content {
  padding-top: calc(var(--nav-height) + 12px);
  padding-bottom: calc(var(--tab-height) + 16px);
  min-height: 100vh;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ===== 种草卡片 ===== */
.grass-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  transition: transform 0.2s;
}
.grass-card:active { transform: scale(0.98); }
.grass-card-header {
  display: flex;
  align-items: center;
  padding: 12px 14px 8px;
  gap: 10px;
}
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-bg), #FFE8D6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.avatar.sz-sm { width: 30px; height: 30px; font-size: 14px; }
.avatar.sz-lg { width: 70px; height: 70px; font-size: 32px; }
.user-info { flex: 1; min-width: 0; }
.username { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.post-time { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid rgba(255,107,53,0.15);
}
.grass-card-img {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(135deg, #FFE8D6 0%, #FFD6BD 50%, #FFBDA3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.grass-card-body { padding: 12px 14px; }
.grass-title { font-size: 16px; font-weight: 700; color: var(--text-primary); line-height: 1.4; margin-bottom: 6px; }
.grass-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 10px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.grass-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  background: var(--bg-gray);
  color: var(--text-secondary);
}
.star-row { display: flex; align-items: center; gap: 4px; }
.star { color: #FFB347; font-size: 15px; }
.star.empty { color: #E0E0E0; }
.score-text { font-size: 13px; font-weight: 700; color: var(--primary); margin-left: 4px; }
.grass-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 20px;
  transition: all 0.2s;
  border: none;
  background: none;
}
.action-btn:active { background: var(--bg-gray); }
.action-btn.liked { color: var(--accent); }
.action-btn .icon { font-size: 16px; }

/* ===== 分类标签栏 ===== */
.category-scroll {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 0 16px 12px;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-white);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.cat-chip.active, .cat-chip:active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}

/* ===== section标题 ===== */
.section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title::before {
  content: '';
  display: block;
  width: 4px; height: 18px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--secondary));
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
}
.see-all {
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
}

/* ===== 搜索框 ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border-radius: 24px;
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  flex: 1;
}
.search-bar input {
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
  font-family: var(--font);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 16px; }

/* ===== 瀑布流 ===== */
.waterfall {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px;
}
.waterfall-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s;
}
.waterfall-card:active { transform: scale(0.96); }
.waterfall-img {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #FFE8D6, #FFBDA3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
}
.waterfall-body { padding: 10px; }
.waterfall-title { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.waterfall-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.waterfall-user { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-secondary); }
.waterfall-like { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-muted); }

/* ===== 榜单 ===== */
.rank-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin: 0 12px 12px;
}
.rank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.rank-title { font-size: 15px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.rank-filter { display: flex; gap: 6px; }
.rank-filter-btn {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-family: var(--font);
}
.rank-filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.rank-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.rank-item:last-child { border-bottom: none; }
.rank-item:active { background: var(--primary-bg); }
.rank-no {
  width: 24px; height: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--bg-gray);
  color: var(--text-secondary);
}
.rank-no.top1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: white; }
.rank-no.top2 { background: linear-gradient(135deg, #C0C0C0, #888); color: white; }
.rank-no.top3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: white; }
.rank-cat-emoji { font-size: 22px; }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.rank-count { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.rank-bar-wrap { width: 70px; }
.rank-bar { height: 5px; border-radius: 3px; background: var(--bg-gray); overflow: hidden; }
.rank-bar-inner { height: 100%; border-radius: 3px; background: linear-gradient(to right, var(--primary), var(--secondary)); }
.rank-percent { font-size: 10px; color: var(--primary); margin-top: 3px; text-align: right; font-weight: 600; }

/* ===== 通用工具类 ===== */
.p-h { padding: 0 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
}

/* ===== 空状态 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 30px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.7; }
.empty-state .empty-text { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.empty-state .empty-sub { font-size: 13px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 24px;
  transition: all 0.2s;
  font-family: var(--font);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 16px rgba(255,107,53,0.35);
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-outline {
  background: none;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-full { width: 100%; border-radius: var(--radius-md); }

/* ===== 浮动动效 ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.4s ease both; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }

/* ===== 分割线 ===== */
.divider {
  height: 8px;
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.divider-thin { height: 1px; background: var(--border); }

/* ===== 消息提示 ===== */
.toast {
  position: fixed;
  bottom: calc(var(--tab-height) + 20px);
  left: 50%; transform: translateX(-50%);
  background: rgba(26,26,46,0.88);
  color: white;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.toast.show { opacity: 1; }
