/* ========================================
   百姓网风格 - 家电维修页面样式表
   包含：共用布局 + 列表页样式 + 内容页样式
   ======================================== */

/* ---------- 1. 基础变量和重置 ---------- */
:root {
  --primary: #e60012;
  --primary-dark: #c5000f;
  --orange: #ff6b35;
  --text: #333;
  --text-secondary: #666;
  --text-light: #999;
  --bg: #f5f5f5;
  --bg-white: #fff;
  --border: #e5e5e5;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 4px;
  --max-width: 1200px;
  --gap: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s;
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- 2. 顶部导航栏 ---------- */
.header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo span {
  font-size: 14px;
  opacity: 0.9;
  margin-left: 4px;
  font-weight: normal;
}

/* ===== 新增：顶部分类导航 ===== */
.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 20px;
  flex-shrink: 0;
}

.top-nav a {
  color: #fff;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background 0.2s;
}

.top-nav a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.top-nav a.active {
  background: rgba(255,255,255,0.2);
  font-weight: bold;
}

/* 搜索框 */
.search-box {
  flex: 1;
  max-width: 400px;
  display: flex;
}

.search-box input {
  flex: 1;
  height: 36px;
  border: none;
  padding: 0 12px;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 14px;
  outline: none;
}

.search-box button {
  width: 60px;
  height: 36px;
  border: none;
  background: var(--orange);
  color: #fff;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
}

.search-box button:hover {
  background: #ff5722;
}

/* 顶部右侧按钮 */
.header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-shrink: 0;
}

.btn-publish {
  background: var(--orange);
  color: #fff;
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  white-space: nowrap;
}

.btn-publish:hover {
  background: #ff5722;
  color: #fff;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* ---------- 3. 移动端导航菜单 ---------- */
.mobile-nav {
  display: none;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px var(--gap);
}

.mobile-nav a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  color: var(--text);
  font-size: 14px;
}

.mobile-nav.show {
  display: block;
}

/* ---------- 4. 面包屑导航 ---------- */
.breadcrumb {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px var(--gap);
  font-size: 13px;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .sep {
  margin: 0 6px;
  color: var(--text-light);
}

/* ---------- 5. 主布局 ---------- */
.main-wrap {
  max-width: var(--max-width);
  margin: var(--gap) auto;
  padding: 0 var(--gap);
  display: flex;
  gap: var(--gap);
}

.content-area {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 280px;
  flex-shrink: 0;
}

/* ---------- 6. 卡片基础样式 ---------- */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--gap);
  margin-bottom: var(--gap);
}

.card-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

/* ---------- 7. 页脚 ---------- */
.footer {
  background: #2b2b2b;
  color: #aaa;
  margin-top: 40px;
  padding: 40px 0 20px;
  font-size: 13px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.footer-col h4 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 14px;
}

.footer-col a {
  color: #aaa;
  display: block;
  margin-bottom: 8px;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 20px auto 0;
  padding: 20px var(--gap) 0;
  border-top: 1px solid #444;
  text-align: center;
  color: #777;
  line-height: 2;
}

/* =====================================================
   列表页专用样式
   ===================================================== */

/* ---------- 8. 筛选栏 ---------- */
.filter-bar {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px var(--gap);
  margin-bottom: var(--gap);
}

.filter-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-label {
  color: var(--text-secondary);
  font-size: 13px;
  width: 60px;
  flex-shrink: 0;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.filter-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  background: #f5f5f5;
  color: var(--text);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.filter-tag:hover,
.filter-tag.active {
  background: #fff0f0;
  color: var(--primary);
  border-color: var(--primary);
}

/* ---------- 9. 列表项 ---------- */
.list-container {
  margin-bottom: var(--gap);
}

.list-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.item-img {
  width: 160px;
  height: 120px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
}

.item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.list-item:hover .item-img img {
  transform: scale(1.05);
}

.item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.item-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-title:hover {
  color: var(--primary);
}

.item-desc {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  font-size: 12px;
  color: var(--text-light);
  flex-wrap: wrap;
}

.item-meta .location {
  display: flex;
  align-items: center;
  gap: 4px;
}

.item-price {
  margin-left: auto;
  color: var(--primary);
  font-size: 18px;
  font-weight: bold;
}

.item-price::before {
  content: '¥';
  font-size: 14px;
}

/* ---------- 10. 分页 ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- 11. 侧边栏：热门标签 ---------- */
.hot-tags .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hot-tags .tag {
  padding: 4px 10px;
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.hot-tags .tag:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------- 12. 侧边栏：推荐列表（带图片） ---------- */
.relate-list .relate-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.relate-item:last-child {
  border-bottom: none;
}

.relate-item img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
}

.relate-info {
  flex: 1;
  min-width: 0;
}

.relate-title {
  font-size: 13px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relate-price {
  color: var(--primary);
  font-size: 14px;
  font-weight: bold;
}

/* =====================================================
   新增：侧边栏纯文字标题列表（无图片）
   ===================================================== */
.title-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.title-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  padding-left: 16px;
}

.title-list li:last-child {
  border-bottom: none;
}

/* 前面的小圆点 */
.title-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 17px;
  width: 6px;
  height: 6px;
  background: #ddd;
  border-radius: 50%;
  transition: background 0.2s;
}

.title-list li:hover::before {
  background: var(--primary);
}

.title-list li a {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-list li a:hover {
  color: var(--primary);
}

/* 带序号版本（可选） */
.title-list.numbered li {
  padding-left: 24px;
}

.title-list.numbered li::before {
  content: attr(data-num);
  position: absolute;
  left: 0;
  top: 10px;
  width: 18px;
  height: 18px;
  background: #f0f0f0;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.title-list.numbered li:hover::before {
  background: var(--primary);
  color: #fff;
}

/* =====================================================
   内容页（详情页）专用样式
   ===================================================== */

/* ---------- 13. 详情头部 ---------- */
.detail-header {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--gap);
  margin-bottom: var(--gap);
}

.detail-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 12px;
  line-height: 1.4;
}

.detail-meta-top {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.detail-price {
  color: var(--primary);
  font-size: 28px;
  font-weight: bold;
}

.detail-price::before {
  content: '¥';
  font-size: 20px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  color: var(--text);
}

.action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.action-btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.action-btn.primary:hover {
  background: var(--primary-dark);
}

.action-btn.active {
  background: #fff0f0;
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- 14. 详情内容区 ---------- */
.detail-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--gap);
  margin-bottom: var(--gap);
}

.section-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 16px;
  padding-left: 10px;
  border-left: 4px solid var(--primary);
}

/* 基本信息网格 */
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  font-size: 14px;
}

.info-row {
  display: flex;
  gap: 8px;
}

.info-label {
  color: var(--text-secondary);
  width: 70px;
  flex-shrink: 0;
}

.info-value {
  color: var(--text);
  flex: 1;
  word-break: break-all;
}

.info-value a {
  color: #0066cc;
}

/* 查看完整号码按钮 */
.btn-show-phone {
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text);
}

.btn-show-phone:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 联系框 */
.contact-box {
  background: #fff8f8;
  border: 1px solid #ffe0e0;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-phone {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary);
}

.contact-btns {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.btn-wx {
  background: #07c160;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.btn-wx:hover {
  background: #06ad56;
}

.btn-msg {
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.btn-msg:hover {
  background: var(--primary-dark);
}

/* ---------- 15. 服务简介正文 ---------- */
.service-content {
  line-height: 1.8;
  color: var(--text);
  font-size: 14px;
}

.service-content p {
  margin-bottom: 12px;
}

/* ---------- 16. 侧边栏：发布者卡片 ---------- */
.user-card {
  text-align: center;
  padding: 24px var(--gap);
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: #f0f0f0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.user-id {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.user-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  background: #f0f0f0;
  color: var(--text-secondary);
}

.badge.vip {
  background: #fff5e6;
  color: #ff9500;
}

.user-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.stat-item .num {
  font-size: 16px;
  font-weight: bold;
  color: var(--text);
}

.stat-item .label {
  font-size: 12px;
  color: var(--text-light);
}

/* ---------- 17. 底部推荐区 ---------- */
.recommend-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--gap);
  margin-bottom: var(--gap);
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.rec-item {
  text-align: center;
  cursor: pointer;
}

.rec-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: #f0f0f0;
}

.rec-item .title {
  font-size: 13px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-item .price {
  color: var(--primary);
  font-weight: bold;
}

/* =====================================================
   响应式设计
   ===================================================== */
@media (max-width: 768px) {
  .header-inner {
    height: 50px;
  }
  
  /* 小屏幕隐藏顶部导航，只保留Logo和搜索 */
  .top-nav {
    display: none;
  }
  
  .search-box {
    margin: 0 10px;
    max-width: none;
  }
  
  .search-box input {
    height: 32px;
    font-size: 13px;
  }
  
  .search-box button {
    height: 32px;
    width: 50px;
  }
  
  .btn-publish {
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .main-wrap {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
  }
  
  .list-item {
    flex-direction: column;
  }
  
  .item-img {
    width: 100%;
    height: 180px;
  }
  
  .item-meta {
    gap: 8px;
  }
  
  .item-price {
    margin-left: 0;
    width: 100%;
    margin-top: 4px;
  }
  
  .detail-title {
    font-size: 18px;
  }
  
  .detail-price {
    font-size: 24px;
  }
  
  .detail-info-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-btns {
    margin-left: 0;
    width: 100%;
  }
  
  .contact-box {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .rec-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .rec-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-inner {
    grid-template-columns: 1fr;
  }
  
  .filter-label {
    width: 100%;
    margin-bottom: 4px;
  }
  
  .filter-row {
    flex-direction: column;
    align-items: flex-start;
  }
}