/* ========================================
   首页样式 - 1:1还原小程序
   设计基准：375px宽 = 750rpx
   ======================================== */

/* ========== 页面容器 ========== */
.page-home {}

/* ========== 悬浮搜索栏（上滑吸顶态）========== */
.floating-search {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 12px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 6px;
  background: #fff; border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  transform: translateY(-120%); opacity: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
  pointer-events: none;
}
.floating-search.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.floating-search-bar { display: flex; align-items: center; min-height: 40px; }
.floating-search-box {
  flex: 1; display: flex; align-items: center;
  background: #f5f7f8; border-radius: 20px;
  padding: 8px 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.floating-search-box .district-pill { background: #f0faf8; }
.floating-search-box .search-icon { width: 16px; height: 16px; margin-right: 8px; opacity: .5; flex-shrink: 0; }
.floating-search-box .search-input { flex: 1; font-size: 13px; color: #333; height: 36px; border: none; outline: none; background: transparent; }
.floating-search .search-btn { color: #1DB9A6; font-size: 14px; font-weight: 700; margin-left: 12px; white-space: nowrap; flex-shrink: 0; cursor: pointer; }

/* 悬浮态区县选择面板 */
.floating-district-panel {
  background: #fff; border-radius: 0 0 16px 16px;
  max-height: 0; opacity: 0; transform: scaleY(0); transform-origin: top;
  transition: all .25s ease; padding: 0 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,.1);
}
.floating-district-panel.open { max-height: 200px; opacity: 1; transform: scaleY(1); padding: 8px 12px; }
.floating-district-panel .district-options { display: inline-flex; gap: 16px; white-space: nowrap; }
.floating-district-panel .district-option { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; cursor: pointer; }
.floating-district-panel .option-name { font-size: 13px; color: #1DB9A6; }
.floating-district-panel .option-hint { font-size: 10px; color: rgba(29,185,166,.5); }
.floating-district-panel .district-option.active .option-name { color: #fff; font-weight: 700; background: #1DB9A6; padding: 2px 10px; border-radius: 12px; }
.floating-district-panel .district-option.active .option-hint { display: none; }

/* ========== 头部渐变区域 ========== */
.header-gradient {
  background: linear-gradient(180deg, #1DB9A6 0%, #2DD4BF 40%, #f0faf8 100%);
  padding: 0 12px;
}

/* ========== 搜索栏 ========== */
.search-bar { display: flex; align-items: center; padding: 12px 0 0; margin-bottom: -2px; min-height: 48px; }
.search-box {
  flex: 1; display: flex; align-items: center;
  background: #fff; border-radius: 12px;
  padding: 9px 14px; box-shadow: 0 2px 8px rgba(29,185,166,.25);
}
.district-pill {
  display: inline-flex; align-items: center;
  background: #f0faf8; border-radius: 10px;
  padding: 0 8px; height: 24px; margin-right: 8px; flex-shrink: 0;
  border: 1px solid rgba(29,185,166,.25); cursor: pointer; font-size: 12px; color: #1DB9A6;
}
.district-pill-text { font-size: 12px; color: #1DB9A6; white-space: nowrap; }
.district-pill-text.active { font-weight: 600; }
.district-arrow {
  display: inline-block; margin-left: 3px; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid #1DB9A6; transition: transform .2s;
}
.district-arrow.open { transform: rotate(180deg); }
.search-box .search-icon { width: 16px; height: 16px; margin-right: 8px; opacity: .5; flex-shrink: 0; }
.search-box .search-input { flex: 1; font-size: 13px; color: #333; height: 21px; border: none; outline: none; background: transparent; }
.search-box .search-input::placeholder { color: rgba(153,153,153,.75); }
.search-btn { color: #fff; font-size: 14px; font-weight: 700; margin-left: 12px; white-space: nowrap; flex-shrink: 0; cursor: pointer; padding: 4px; }

/* ========== 区县选择面板 ========== */
.district-panel { position: relative; z-index: 10;
  background: linear-gradient(135deg, #1AB89C, #22C4AD);
  border-radius: 0 0 16px 16px; overflow: hidden;
  max-height: 0; opacity: 0; transition: max-height .25s ease, opacity .2s ease;
  padding: 0 12px; margin-top: -5px;
  box-shadow: 0 3px 10px rgba(29,185,166,.3);
}
.district-panel.open { max-height: 100px; opacity: 1; padding: 8px 12px; margin-top: 3px; }
.district-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.district-scroll::-webkit-scrollbar { display: none; }
.district-options { display: inline-flex; gap: 16px; white-space: nowrap; }
.district-option { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; cursor: pointer; }
.district-option .option-name { font-size: 13px; color: rgba(255,255,255,.75); }
.district-option .option-hint { font-size: 10px; color: rgba(255,255,255,.55); }
.district-option.active { position: relative; }
.district-option.active .option-name { color: #fff; font-weight: 700; }
.district-option.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 80%; height: 2px; background: #fff; border-radius: 1px;
}

/* ========== 8宫格分类轮播（CSS snap 滑动翻页）========== */
.category-swiper-wrapper {
  overflow: hidden; margin-bottom: 4px; position: relative;
}
.category-swiper {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  scroll-behavior: smooth;
}
.category-swiper::-webkit-scrollbar { display: none; }
.category-swiper-item {
  flex: 0 0 100%; scroll-snap-align: start;
  height: 90px; display: flex; align-items: center; justify-content: center;
}
.category-grid-4 {
  display: flex; justify-content: space-around; align-items: center;
  width: 100%; max-width: 400px; padding: 6px 4px;
}

/* 分页指示器 */
.category-indicator {
  display: flex; justify-content: center; gap: 6px; padding: 4px 0 8px;
}
.category-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(29,185,166,.3); transition: all .2s;
}
.category-dot.active { background: #1DB9A6; width: 18px; border-radius: 3px; }
.cat-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 2px; cursor: pointer; transition: all .15s;
}
.cat-item:active { opacity: .75; transform: scale(.95); }
.cat-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px; position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.cat-text { font-size: 12px; font-weight: 700; color: #fff; line-height: 1; }

/* 分类图标颜色（与小程序一致） */
.cat-icon.job        { background: #1DB9A6; }
.cat-icon.house      { background: #28C9B3; }
.cat-icon.secondhand { background: #5BAE7A; }
.cat-icon.service    { background: #8B5CF6; }
.cat-icon.ad         { background: #1DB9A6; }
.cat-icon.car        { background: #3B82F6; }
.cat-icon.business   { background: #EC4899; }
.cat-icon.find       { background: #10B981; }

.badge {
  position: absolute; top: -5px; right: -5px;
  background: linear-gradient(135deg, #1DB9A6, #28C9B3);
  color: #fff; font-size: 9px; padding: 1px 5px;
  border-radius: 6px 6px 6px 0; font-weight: 600; z-index: 2;
}
.badge.new { background: linear-gradient(135deg, #5BAE7A, #4A9E6A); }
.cat-name { font-size: 11px; color: #2D3A3A; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 分类轮播指示器 */
.category-indicator { display: flex; justify-content: center; gap: 6px; padding: 0 0 6px; }
.category-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.15); transition: all .2s; }
.category-dot.active { background: #1DB9A6; width: 18px; border-radius: 3px; }

/* ========== Tab栏 + 广告位 吸顶容器 ========== */
.sticky-anchor { position: sticky; top: 0; z-index: 10; background: #f0faf8; padding: 0 12px; }
.sticky-anchor.float-under { top: 50px; z-index: 99; }

/* Tab栏 */
.tab-bar {
  white-space: nowrap; background: #fff; border-radius: 10px 10px 0 0;
  padding-top: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-item {
  display: inline-block; padding: 7px 14px; font-size: 15px;
  color: #555; cursor: pointer; position: relative; z-index: 6;
  transition: color .2s, opacity .15s; min-height: 28px; white-space: nowrap;
}
.tab-item:active { opacity: 0.6; }
.tab-item.active { color: #1DB9A6; font-weight: 700; }
.tab-item.active::after {
  content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 3px; background: #1DB9A6; border-radius: 2px;
}

/* ========== 求职招聘子筛选栏 ========== */
.job-filter-bar { display: none; text-align: center; padding: 8px 0 4px; background: #fff; }
.job-filter-bar.show { display: block; }
.job-filter-btn {
  display: inline-block; padding: 4px 18px; margin: 0 6px; font-size: 13px;
  border-radius: 16px; background: #f0f0f0; color: #666; cursor: pointer;
  transition: all .2s;
}
.job-filter-btn.active { background: #1DB9A6; color: #fff; }
.job-filter-btn:active { opacity: 0.7; }

/* ========== 信息列表 ========== */
.info-list {
  background: transparent; border-radius: 0 0 10px 10px;
  padding: 5px 0 env(safe-area-inset-bottom);
}

/* 信息卡片 */
.info-item {
  background: #fff; margin-bottom: 3px; padding: 10px 14px;
  border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
  display: flex; gap: 2px; min-height: 50px; cursor: pointer;
  transition: transform .15s; position: relative; overflow: hidden;
}
.info-item:active { transform: scale(.985); opacity: .92; }
.info-item.is-super-top {
  background: linear-gradient(135deg, #E8FCF9, #DFFBF7);
  border: 2px solid transparent;
  background-image: linear-gradient(#E8FCF9, #DFFBF7), linear-gradient(135deg, #2EF0CC, #14B89F);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 2px 9px rgba(46,240,204,.15);
}
.info-item.is-super-top::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,235,170,.2), transparent);
  animation: super-shimmer 2s ease-in-out infinite;
}
.info-item.is-top {
  background: linear-gradient(135deg, #EDF9F7, #EAF7F4);
  border: 1px solid #A8DDD2; box-shadow: 0 2px 9px rgba(29,185,166,.12);
}

@keyframes super-shimmer {
  0% { left: -100%; } 100% { left: 200%; }
}

/* ========== 信息卡片 - 内容区 ========== */
.info-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

/* 标题行 */
.title-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.category-tag {
  font-size: 9px; padding: 1px 7px; border-radius: 3px;
  font-weight: 600; flex-shrink: 0; white-space: nowrap; color: #fff; line-height: 1.6;
}
.title {
  flex: 1; font-size: 14px; color: #2D3A3A; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.title.title-top { font-weight: 700; }
.title.title-super { color: #0A9585; font-weight: 800; }

/* 置顶标签 */
.top-badge {
  font-size: 9px; font-weight: 600; padding: 1px 7px; border-radius: 3px;
  color: #fff; white-space: nowrap; flex-shrink: 0;
}
.top-badge.super { background: linear-gradient(135deg, #1DB9A6, #28C9B3); }
.top-badge.normal { background: linear-gradient(135deg, #666, #888); }

/* 图片标识 */
.image-icon {
  width: 14px; height: 14px; flex-shrink: 0; border-radius: 2px;
  background: #E8F8F5; position: relative; margin-left: 2px;
}
.image-icon::before {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 8px; height: 7px; border: 1px solid #1DB9A6; border-radius: 2px;
}
.image-icon::after {
  content: ''; position: absolute; top: 3px; right: 3px;
  width: 3px; height: 3px; background: #1DB9A6; border-radius: 50%;
}

/* 商家认证图标 */
.merchant-badge-icon { width: 16px; flex-shrink: 0; }

/* 核心信息行 */
.core-info-row { display: inline-flex; align-items: center; gap: 3px; overflow: hidden; margin-top: 1px; white-space: nowrap; }
.time-in-core { font-size: 10px; color: #999; flex-shrink: 0; }
.core-info-item { font-size: 10px; color: #555; font-weight: 500; white-space: nowrap; }
.core-info-item:first-child { color: #333; font-weight: 700; font-size: 11px; }
.core-divider { font-size: 9px; color: #ccc; margin: 0 -1px; }
.core-address { display: inline-block; font-size: 10px; color: var(--text-secondary, #5A6B6B); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* ========== 车辆交易卡片（左图右文）========== */
.info-item.car-card { align-items: stretch; padding: 8px 14px; gap: 8px; }
.car-thumb {
  width: 90px; height: 70px; flex-shrink: 0; position: relative;
  border-radius: 5px; overflow: hidden; background: #f5f7f8;
}
.car-thumb-img { width: 100%; height: 100%; object-fit: cover; }
.car-thumb-count {
  position: absolute; bottom: 2px; right: 2px; background: rgba(0,0,0,.55);
  color: #fff; font-size: 9px; padding: 1px 5px; border-radius: 4px;
}
.car-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.car-title-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.car-cat-tag { font-size: 9px; padding: 1px 6px; border-radius: 3px; font-weight: 600; flex-shrink: 0; white-space: nowrap; color: #fff; }
.car-title {
  flex: 1; font-size: 14px; color: #2D3A3A; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.car-title.title-top { font-weight: 700; }
.car-title.title-super { color: #0A9585; font-weight: 800; }
.car-attrs { display: flex; align-items: center; gap: 0; overflow: hidden; white-space: nowrap; }
.car-attr { font-size: 11px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-attr-sep { font-size: 9px; color: #ccc; margin: 0 3px; flex-shrink: 0; }
.car-footer { display: flex; align-items: center; gap: 6px; }
.car-address { font-size: 10px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.car-time { font-size: 10px; color: #999; flex-shrink: 0; }

/* ========== 空状态 ========== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 50px 20px; min-height: 200px;
}
.empty-text { font-size: 14px; color: #999; }

/* ========== 加载区域 ========== */
.load-more-area { display: flex; align-items: center; justify-content: center; padding: 12px 0 20px; gap: 6px; }
.load-more-text { font-size: 12px; color: #999; }
.load-more-done { color: #bbb; }
.loading-spinner-sm { width: 16px; height: 16px; border: 2px solid #E8F8F5; border-top-color: #1DB9A6; border-radius: 50%; animation: spin .8s linear infinite; }

/* ========== 回到顶部 ========== */
.back-to-top {
  position: fixed; right: 16px; bottom: 120px; z-index: 99;
  opacity: 0; transform: translateY(15px) scale(.6);
  transition: all .3s ease; pointer-events: none;
}
.back-to-top.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-top-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,.12); border: 1px solid rgba(29,185,166,.25);
  cursor: pointer; transition: all .2s;
}
.back-top-btn:active { transform: scale(.9); box-shadow: 0 1px 5px rgba(0,0,0,.08); }
.back-top-arrow { font-size: 18px; color: #1DB9A6; font-weight: 800; line-height: 1; }

/* ========== 骨架屏 ========== */
.skeleton-list { padding: 5px 0; }
.skeleton-card {
  background: #fff; margin-bottom: 3px; padding: 10px 14px;
  border-radius: 8px; display: flex; gap: 10px; min-height: 50px;
}
.skeleton-thumb { width: 90px; height: 70px; border-radius: 5px; }
.skeleton-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skeleton-title { height: 14px; width: 65%; }
.skeleton-text { height: 10px; width: 45%; }
.skeleton-text-sm { height: 10px; width: 30%; }

/* ========== 网络错误 ========== */
.network-error { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 20px; }
.network-error-icon { font-size: 36px; margin-bottom: 12px; }
.network-error-text { font-size: 14px; color: #666; margin-bottom: 16px; }
.network-error-btn {
  background: #1DB9A6; color: #fff; padding: 8px 24px; border-radius: 20px;
  font-size: 14px; font-weight: 500; cursor: pointer; border: none;
}

/* ========== 底部操作栏 ========== */
.home-action-bar { display: flex; justify-content: center; gap: 20px; padding: 10px 12px; }
.action-btn-icon {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 20px; background: #fff; border-radius: 20px;
  box-shadow: 0 2px 8px rgba(29,185,166,.08);
  font-size: 14px; font-weight: 500; color: #1DB9A6; cursor: pointer;
  transition: background .15s;
}
.action-btn-icon:active { background: #E8F8F5; }
