/* 防水信息网 前端样式：移动优先，兼顾 PC（响应式） */
:root {
  --primary: #0b6efd;
  --primary-dark: #0957c8;
  --primary-light: #e8f1ff;
  --accent: #ff8c00;
  --text: #1f2937;
  --text-sub: #6b7280;
  --bg: #f4f7fb;
  --card: #ffffff;
  --border: #e5e9f0;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(11, 110, 253, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.hidden { display: none !important; }

/* ===== 顶部 ===== */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 60%, #60a5fa 100%);
  color: #fff;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(9, 87, 200, 0.25);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; background: #fff; border-radius: 50%; padding: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.1); flex-shrink: 0; }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.title-box h1 { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.title-box p { font-size: 12px; opacity: 0.9; letter-spacing: 0.5px; }

/* ===== 主体 ===== */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 14px 30px;
}
.view { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== 首页 hero ===== */
.hero {
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}
.hero h2 { color: var(--primary-dark); font-size: 20px; margin-bottom: 4px; }
.hero p { color: var(--text-sub); font-size: 13px; }

/* ===== 九宫格 ===== */
.grid9 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.grid9 .cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 8px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.grid9 .cell:active { transform: scale(0.96); }
.grid9 .cell:hover { box-shadow: 0 4px 16px rgba(11, 110, 253, 0.16); }
.grid9 .cell .cell-icon {
  display: block;
  width: 52px;
  height: 52px;
  margin: 0 auto 8px;
  border-radius: 14px;
  background: var(--primary-light);
  font-size: 28px;
  line-height: 52px;
  color: var(--primary);
}
.grid9 .cell .cell-name { font-size: 14px; font-weight: 600; color: var(--text); }
.grid9 .cell .cell-summary {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 优量汇广告位占位 ===== */
.ad-placeholder {
  border: 1.5px dashed #c3cbd8;
  border-radius: 10px;
  background: #fafbfd;
  color: #9aa3b2;
  font-size: 12px;
  text-align: center;
  padding: 26px 12px;
  margin: 14px 0;
  letter-spacing: 0.5px;
}

/* ===== 平台服务说明 ===== */
.tip-box {
  background: #fff;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.tip-box h3 { font-size: 15px; color: var(--primary-dark); margin-bottom: 6px; }
.tip-box p { font-size: 13px; color: var(--text-sub); }

/* ===== 列表页 ===== */
.list-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.list-head h2 { font-size: 18px; color: var(--primary-dark); }
.back-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
}
.back-btn:active { background: var(--primary-light); }

.card-list { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform 0.15s ease;
}
.card:active { transform: scale(0.98); }
.card .cover {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .info { flex: 1; min-width: 0; }
.card .info .t { font-size: 15px; font-weight: 600; color: var(--text); }
.card .info .s {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .info .meta { font-size: 11px; color: #9aa3b2; margin-top: 6px; }

.empty {
  text-align: center;
  color: var(--text-sub);
  padding: 40px 0;
  font-size: 14px;
}

/* ===== 详情页 ===== */
.detail-article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
}
.detail-article h2 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.d-meta { font-size: 12px; color: #9aa3b2; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.d-content { font-size: 15px; color: #374151; word-break: break-word; }
.d-content p { margin: 8px 0; }
.d-content img { max-width: 100%; border-radius: 8px; }

/* ===== 底部 ===== */
.site-footer {
  text-align: center;
  color: #9aa3b2;
  font-size: 12px;
  padding: 20px 14px 30px;
}
.site-footer p { margin: 4px 0; }

/* ===== PC 端适配 ===== */
@media (min-width: 768px) {
  .site-header { padding: 16px 24px; }
  .page { padding: 22px 24px 40px; }
  .hero { padding: 22px; }
  .hero h2 { font-size: 24px; }
  .grid9 { gap: 16px; }
  .grid9 .cell { padding: 22px 12px 16px; }
  .grid9 .cell .cell-icon { width: 60px; height: 60px; line-height: 60px; font-size: 32px; }
  .grid9 .cell .cell-name { font-size: 15px; }
  .card { padding: 16px; }
  .card .cover { width: 90px; height: 90px; }
}

/* ===== 区域选择页（搜索 + 热门 + 按省分组标签） ===== */
.city-search { margin-bottom: 12px; }
.city-search input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: #fff; outline: none; box-shadow: var(--shadow);
}
.city-search input:focus { border-color: var(--primary); }
.hot-cities {
  display: flex; align-items: flex-start; gap: 8px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.hot-label { font-size: 13px; color: var(--text-sub); flex-shrink: 0; margin-top: 4px; }
.prov-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.city-tag {
  display: inline-block; padding: 6px 14px; border-radius: 16px; font-size: 13px;
  background: #f1f5f9; color: var(--text); cursor: pointer; border: 1px solid transparent;
  user-select: none;
}
.city-tag:active { background: var(--primary-light); color: var(--primary); }
.city-tag.hot { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.all-cities { display: flex; flex-direction: column; gap: 12px; }
.prov-group {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; box-shadow: var(--shadow);
}
.prov-name { font-size: 13px; color: var(--primary-dark); font-weight: 600; margin-bottom: 8px; }

/* ===== 服务商/工程师卡片字段 ===== */
.card .info .field { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.card .info .field b { color: #374151; font-weight: 500; }
.avatar {
  width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--primary); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 详情字段 ===== */
.detail-fields { display: flex; flex-direction: column; gap: 10px; }
.detail-fields .df { display: flex; gap: 8px; font-size: 14px; }
.detail-fields .df .k { color: var(--text-sub); flex-shrink: 0; min-width: 84px; }
.detail-fields .df .v { color: var(--text); word-break: break-word; }
.detail-avatar {
  width: 84px; height: 84px; border-radius: 50%; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  overflow: hidden; margin-bottom: 12px;
}
.detail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: 20px; color: var(--text); margin-bottom: 12px; }

/* ===== 首页 banner 轮播 ===== */
.banner-slider {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.banner-slider .slides { display: flex; transition: transform 0.45s ease; }
.banner-slider .slide { min-width: 100%; height: 140px; position: relative; cursor: pointer; }
.banner-slider .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-slider .slide-ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #60a5fa); color: #fff; font-size: 16px;
}
.banner-slider .dots {
  position: absolute; bottom: 8px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.banner-slider .dot {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.55);
  cursor: pointer; transition: background 0.2s;
}
.banner-slider .dot.active { background: #fff; }
@media (min-width: 768px) {
  .banner-slider .slide { height: 220px; }
  .banner-slider .dot { width: 9px; height: 9px; }
}
