/* =========================================================
   八角塘村 — 城乡户邻生活网  移动端样式
   ========================================================= */
:root {
  --red: #c8102e;            /* 板块主色 */
  --red-dark: #a50d26;       /* 板块渐变深色 */
  --yellow: #ffd21f;         /* 标题/链接文字 */
  --bg: #101010;             /* 页面背景（板块间隙） */
  --gray-text: #666;         /* 顶部标题 */
  --footer-text: #d9d9d9;    /* 版权文字 */
}

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

html, body {
  width: 100%;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Helvetica Neue", Arial, sans-serif;
  color: #333;
}

a { text-decoration: none; color: inherit; }

/* ===================== 顶部导航 ===================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  height: 52px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.menu-btn {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background: #555;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-title {
  flex: 1;
  text-align: center;
  font-size: 19px;
  font-weight: 500;
  color: var(--gray-text);
  padding-right: 52px; /* 抵消左侧按钮宽度，保证视觉居中 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================== 侧边抽屉菜单 ===================== */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.drawer-mask.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 51;
  width: 78%;
  max-width: 300px;
  background: #fff;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 18px 20px;
  background: var(--red);
}
.drawer-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}
.drawer-name {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}
.drawer-list { list-style: none; }
.drawer-list li a {
  display: block;
  padding: 15px 18px;
  font-size: 16px;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s ease;
}
.drawer-list li a:active { background: #f5f5f5; color: var(--red); }

/* ===================== 轮播图 ===================== */
.banner {
  position: relative;
  padding: 10px 10px 0; /* 左右留白，模拟截图中的白边 */
  background: var(--bg);
}
.banner-track {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 8; /* 轮播宽高比，可按需修改 */
  background: #ddd;
}
.banner-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.banner-item.active { opacity: 1; }
.banner-item img, .banner-item .placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.banner-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease, width 0.3s ease;
}
.banner-dots .dot.active { background: #fff; width: 20px; border-radius: 5px; }

/* ===================== 红色板块 ===================== */
.sections {
  padding: 10px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px; /* 板块之间的黑色间隙 */
}
.section-card {
  display: block;
  background: linear-gradient(160deg, var(--red), var(--red-dark));
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 14px 12px;
}
.section-head .sec-title {
  color: var(--yellow);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}
.section-head .sec-sep {
  color: var(--yellow);
  font-size: 16px;
  opacity: 0.85;
}
.section-head .sec-link {
  color: var(--yellow);
  font-size: 17px;
  font-weight: 600;
}
.section-head .sec-link::before { content: "点我查看详情"; }

.section-body {
  margin: 0 10px 10px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: #fff;
}
.section-body img, .section-body .placeholder {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* 图片加载失败时显示占位文字 */
.section-body .placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  background: linear-gradient(135deg, #e0524a, #c8102e);
}

/* ===================== 底部版权 ===================== */
.footer {
  margin-top: 10px;
  padding: 18px 16px;
  text-align: center;
  color: var(--footer-text);
  font-size: 13px;
  background: #1a1a1a;
  letter-spacing: 0.5px;
}
