/* =========================================================
   生活分类与同城商城 - 页面专项样式 (style.css)
   ========================================================= */

/* --- 首页 (index.html) 样式 --- */
.hero-classifieds {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 20px;
}

/* 分类侧边栏菜单 */
.cate-sidebar {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cate-sidebar-header {
  background-color: #1e293b;
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cate-menu-item {
  padding: 14px 16px;
  border-bottom: 1px dashed #f1f5f9;
  transition: background-color 0.2s;
}

.cate-menu-item:last-child {
  border-bottom: none;
}

.cate-menu-item:hover {
  background-color: #f8fafc;
}

.cate-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cate-title a {
  color: #1e293b;
}

.cate-title a:hover {
  color: #2563eb;
}

.cate-sub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.cate-sub-links a {
  color: #64748b;
}

.cate-sub-links a:hover {
  color: #2563eb;
}

/* 中间 Banner 轮播区 */
.banner-slider-box {
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.slider-main {
  position: relative;
  height: 280px;
  background-size: cover;
  background-position: center;
  color: #ffffff;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-image: linear-gradient(180deg, rgba(37,99,235,0.22) 0%, rgba(15,23,42,0.88) 100%);
}

.slider-main h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.slider-main p {
  font-size: 14px;
  opacity: 0.9;
}

/* 快速找服务卡片组 */
.quick-services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
  background-color: #ffffff;
}

.service-card-item {
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  background-color: #f8fafc;
  transition: transform 0.2s, border-color 0.2s;
}

.service-card-item:hover {
  transform: translateY(-2px);
  border-color: #2563eb;
  background-color: #ffffff;
}

.service-card-item .icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.service-card-item .title {
  font-weight: 600;
  color: #0f172a;
  font-size: 13px;
}

/* 右侧公告与优质商家推荐 */
.side-widget {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

.widget-title {
  padding: 12px 16px;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.widget-title a {
  font-size: 12px;
  color: #64748b;
  font-weight: normal;
}

.notice-list {
  padding: 12px 16px;
}

.notice-list li {
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dashed #f1f5f9;
  display: flex;
  justify-content: space-between;
}

.notice-list li:last-child {
  border-bottom: none;
}

.notice-list a {
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.notice-list span {
  color: #94a3b8;
  font-size: 11px;
}

/* 四大核心分类卡片 (房屋/二手/招聘/家政) */
.section-block {
  margin-top: 30px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2563eb;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-head .tag-links a {
  color: #64748b;
  margin-left: 14px;
  font-size: 13px;
}

.section-head .tag-links a:hover {
  color: #2563eb;
}

/* 信息卡片列表网格 */
.info-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.info-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.info-card-img {
  height: 160px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.info-card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

.info-card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-card-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.info-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #64748b;
  margin-top: 10px;
}

.info-card-price {
  color: #ff5500;
  font-weight: 700;
  font-size: 16px;
}

/* --- 筛选筛选器 (info-list.html) --- */
.filter-box {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.filter-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px dashed #f1f5f9;
  align-items: flex-start;
  font-size: 13px;
}

.filter-row:last-child {
  border-bottom: none;
}

.filter-label {
  width: 90px;
  color: #64748b;
  font-weight: 600;
  padding-top: 2px;
}

.filter-options {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-item {
  padding: 2px 10px;
  border-radius: 4px;
  color: #334155;
}

.filter-item:hover {
  color: #2563eb;
}

.filter-item.active {
  background-color: #2563eb;
  color: #ffffff !important;
  font-weight: 600;
}

/* 列表展示模式切换 */
.list-toolbar {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.sort-group {
  display: flex;
  gap: 16px;
}

.sort-item {
  color: #64748b;
  cursor: pointer;
}

.sort-item.active {
  color: #2563eb;
  font-weight: 700;
}

/* 信息列表模式 */
.info-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-list-item {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  gap: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.info-list-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-color: #cbd5e1;
}

.info-list-thumb {
  width: 160px;
  height: 110px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.info-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-list-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.info-list-title:hover {
  color: #2563eb;
}

.info-list-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.tag-badge {
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.info-list-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 10px;
}

.info-list-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
}

.info-list-price {
  font-size: 20px;
  font-weight: 700;
  color: #ff5500;
  white-space: nowrap;
}

/* --- 信息详情页 (info-detail.html) --- */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

.detail-main {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px;
}

.detail-header-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.detail-meta-bar {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: #64748b;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 20px;
}

.detail-gallery-wrap {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.main-preview-img {
  width: 420px;
  height: 310px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 1px solid #e2e8f0;
}

.thumb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thumb-item {
  width: 80px;
  height: 60px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: 2px solid transparent;
}

.thumb-item.active {
  border-color: #2563eb;
}

.detail-param-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background-color: #f8fafc;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 24px;
  font-size: 13px;
}

.param-item span {
  color: #64748b;
}

.param-item strong {
  color: #0f172a;
  margin-left: 6px;
}

.detail-content-text {
  font-size: 15px;
  line-height: 1.8;
  color: #334155;
  margin-bottom: 30px;
}

/* 侧栏发布者卡片 */
.publisher-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  position: sticky;
  top: 20px;
}

.publisher-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background-color: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
}

.publisher-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.publisher-badge {
  display: inline-block;
  background-color: #dcfce7;
  color: #15803d;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.phone-box {
  background-color: #fff7ed;
  border: 1px dashed #fdba74;
  padding: 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.phone-num {
  font-size: 20px;
  font-weight: 700;
  color: #ea580c;
  margin-bottom: 8px;
}

/* --- 信息发布页 (info-publish.html) --- */
.publish-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 30px;
  margin-top: 20px;
}

.step-bar {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 20px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #94a3b8;
}

.step-item.active {
  color: #2563eb;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.step-item.active .step-num {
  background-color: #2563eb;
  color: #ffffff;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #2563eb;
}

.upload-box {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  background-color: #f8fafc;
  cursor: pointer;
}

.upload-box:hover {
  border-color: #2563eb;
  background-color: #eff6ff;
}

/* --- 商城 (mall.html, mall-list.html, mall-detail.html) 专项样式 --- */
.mall-banner {
  height: 320px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  margin-top: 20px;
  padding: 40px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-image: linear-gradient(90deg, rgba(225,37,27,0.92) 0%, rgba(127,29,29,0.70) 100%);
}

.mall-banner h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
}

.mall-product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.product-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: #fca5a5;
}

.product-thumb {
  height: 180px;
  background-size: cover;
  background-position: center;
}

.product-info {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
  height: 36px;
  overflow: hidden;
  line-height: 1.4;
}

.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-red {
  color: #e1251b;
  font-size: 18px;
  font-weight: 700;
}

.btn-add-cart {
  background-color: #fef2f2;
  color: #e1251b;
  border: 1px solid #fca5a5;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-add-cart:hover {
  background-color: #e1251b;
  color: #ffffff;
}

/* --- 购物车 (cart.html) --- */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cart-table th, .cart-table td {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}

.cart-table th {
  background-color: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 13px;
}

.quantity-control {
  display: inline-flex;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
}

.quantity-btn {
  width: 28px;
  height: 28px;
  background-color: #f8fafc;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.quantity-input {
  width: 40px;
  height: 28px;
  border: none;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  text-align: center;
  font-size: 13px;
}

.cart-summary-bar {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 24px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- 个人中心 (user-center.html) --- */
.user-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  margin-top: 20px;
}

.user-sidebar {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 0;
}

.user-nav-group {
  margin-bottom: 20px;
}

.user-nav-title {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.user-nav-item {
  display: block;
  padding: 10px 20px;
  color: #334155;
  font-weight: 500;
  font-size: 14px;
}

.user-nav-item:hover, .user-nav-item.active {
  background-color: #eff6ff;
  color: #2563eb;
  border-left: 3px solid #2563eb;
}

.user-content-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px;
}

/* --- 登录注册页 (login.html, register.html) --- */
.auth-wrapper {
  max-width: 420px;
  margin: 60px auto;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.08);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.product-specs span {
  padding: 6px 10px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.detail-text {
  overflow: hidden;
}

.detail-text img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
}

.product-rich-text img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
}

.product-rich-text p {
  margin: 0 0 14px;
}

.mode-life-only .footer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 保持原蓝/红信息密度的窄屏排版：不压缩为竖排文字或 5 列微型商品卡。 */
@media (max-width: 760px) {
  .container { width: calc(100% - 24px); }
  .top-bar { height: auto; min-height: 36px; }
  .top-bar .container, .header-search-wrap .container { flex-wrap: wrap; gap: 10px; }
  .top-bar-left, .top-bar-right { flex-wrap: wrap; gap: 8px; }
  .header-search-wrap { padding: 16px 0; }
  .search-box { order: 3; width: 100%; }
  .main-nav { overflow-x: auto; }
  .main-nav .container { width: max-content; min-width: 100%; }
  .main-nav a, .nav-menu li a { padding: 0 14px; white-space: nowrap; }
  .hero-classifieds { grid-template-columns: 1fr; gap: 14px; }
  .notice-board { display: none; }
  .info-card-grid, .mall-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .info-card-img, .product-thumb { height: 150px; }
  .section-head { flex-wrap: wrap; gap: 8px; }
  .tag-links { line-height: 2; }
  .info-list-item { grid-template-columns: 110px 1fr; gap: 12px; }
  .info-list-thumb { width: 110px; height: 88px; }
  .detail-layout, .user-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .detail-main { min-width: 0; padding: 16px; }
  .detail-meta-bar { flex-wrap: wrap; gap: 8px 14px; }
  .detail-gallery-wrap { display: block; min-width: 0; }
  .main-preview-img { width: 100%; height: 220px; }
  .thumb-list { flex-direction: row; overflow-x: auto; margin-top: 10px; }
  .thumb-item { flex: 0 0 80px; }
  .publisher-card { min-width: 0; }
  .detail-param-grid { grid-template-columns: 1fr; }
  .goods-detail-layout { grid-template-columns: minmax(0, 1fr) !important; gap: 18px !important; padding: 16px !important; }
  #p-main-img { height: 240px !important; }
  .detail-header-title, #p-title, .param-item, #p-service-note { overflow-wrap: anywhere; }
  .goods-detail-actions { flex-wrap: wrap; gap: 10px !important; }
  .goods-detail-actions .btn { flex: 1 1 150px; padding: 12px 16px !important; }
  .user-sidebar { margin-bottom: 16px; }
  .detail-gallery, .detail-info { min-width: 0; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
  .footer-col p, .footer-col a { overflow-wrap: anywhere; }
}
