:root {
  --blue: #4A90D9;
  --blue-light: #6BB6FF;
  --pay: #FF4757;
  --green: #52C41A;
  --text: #1f2933;
  --text-2: #5b6472;
  --text-3: #9aa3af;
  --bg: #f5f6f8;
  --card: #fff;
  --radius: 20rpx;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

/* ========== 整屏容器（正式交付形态） ========== */
/*
 * 手机端：全屏铺满，等同原生 App
 * 桌面端：居中显示一个 390×844 的设备框，模拟移动端观感
 */
body.page-shell {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #e9edf2;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.device {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* 桌面端：加设备边框与阴影；移动端：真全屏 */
@media (min-width: 768px) {
  .device {
    padding: 24px;
    box-sizing: border-box;
  }
  .device-screen {
    width: 390px;
    height: min(844px, calc(100vh - 48px));
    border-radius: 40px;
    border: 10px solid #1c1e22;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
  }
}

/* 移动端：隐藏模拟状态栏（真机自带），保证内容完整显示 */
@media (max-width: 767px) {
  .device-screen .statusbar { display: none; }
}

.statusbar {
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  position: relative;
  z-index: 60;
}
.statusbar.dark { color: var(--text); background: #fff; }
.notch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 28px;
  background: #1c1e22;
  border-radius: 0 0 18px 18px;
}
.navbar {
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #fff;
  border-bottom: 1px solid #f0f2f5;
  position: relative;
  z-index: 50;
}
.navbar.blue { background: var(--blue); border-bottom: none; }
.navbar-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.navbar.blue .navbar-title { color: #fff; }
.nav-back {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; cursor: pointer; border-radius: 50%;
  color: var(--text); user-select: none;
}
.nav-back:hover { background: rgba(0,0,0,.05); }
.navbar.blue .nav-back { color: #fff; }
.nav-right { width: 40px; text-align: right; font-size: 18px; cursor: pointer; color: var(--text2); }

.viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  position: relative;
  scrollbar-width: thin;
}
.viewport::-webkit-scrollbar { width: 4px; }
.viewport::-webkit-scrollbar-thumb { background: rgba(0,0,0,.14); border-radius: 2px; }

/* ========== TabBar ========== */
.tabbar {
  flex-shrink: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid #eef0f3;
  padding: 8px 0 10px;
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; color: var(--text-3); font-size: 10px; gap: 3px;
  user-select: none;
}
.tab-icon {
  width: 42px; height: 26px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  filter: grayscale(1); opacity: .55;
  transition: all .2s;
}
.tab-item.active { color: var(--blue); }
.tab-item.active .tab-icon { filter: none; opacity: 1; background: rgba(74,144,217,.1); transform: scale(1.06); }

/* ========== 通用 ========== */
.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 6px rgba(30,45,70,.05); }
.flex1 { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ellipsis-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tc { text-align: center; }
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt20{margin-top:20px}.mt24{margin-top:24px}
.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}.mb24{margin-bottom:24px}

.btn {
  display: flex; align-items: center; justify-content: center;
  height: 46px; border: none; border-radius: 23px;
  font-size: 15px; font-weight: 600; cursor: pointer; color: #fff;
  font-family: inherit; transition: opacity .15s, transform .1s;
}
.btn:active { opacity: .85; transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue-light)); box-shadow: 0 4px 12px rgba(74,144,217,.28); }
.btn-pay { background: linear-gradient(135deg, #FF6B6B, var(--pay)); box-shadow: 0 4px 12px rgba(255,71,87,.3); }
.btn-success { background: linear-gradient(135deg, #52C41A, #7ED321); }
.btn-ghost { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-plain { background: #f2f4f7; color: #5b6472; }
.btn-sm { height: 32px; font-size: 13px; padding: 0 16px; border-radius: 16px; }
.btn-block { width: 100%; }

.tag {
  display: inline-flex; align-items: center;
  height: 21px; padding: 0 8px; border-radius: 5px;
  font-size: 11px; line-height: 1;
}
.tag-blue { background: rgba(74,144,217,.1); color: var(--blue); }
.tag-green { background: rgba(82,196,26,.12); color: var(--green); }
.tag-orange { background: rgba(250,140,22,.12); color: #FA8C16; }
.tag-red { background: rgba(255,77,79,.1); color: #FF4D4F; }
.tag-gray { background: #f2f4f7; color: #8a929e; }
.tag-official { background: var(--blue); color: #fff; font-size: 10px; height: 17px; padding: 0 6px; }

.section-title {
  display: flex; align-items: center;
  font-size: 16px; font-weight: 600; color: var(--text);
  padding: 16px 16px 9px;
}
.section-title::before {
  content: ''; width: 3px; height: 14px;
  background: var(--blue); border-radius: 2px; margin-right: 7px;
}
.section-title .sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 6px; }

.empty { padding: 60px 20px; text-align: center; color: var(--text-3); }
.empty-icon { font-size: 46px; opacity: .35; display: block; margin-bottom: 10px; }
.empty-text { font-size: 14px; }

.avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.loading-more { padding: 16px 0; text-align: center; font-size: 12px; color: var(--text-3); }
.loadmore-finish { padding: 16px 0; text-align: center; font-size: 12px; color: #c0c6cf; }

/* ========== Toast / Modal ========== */
.toast {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.78); color: #fff;
  padding: 12px 22px; border-radius: 8px;
  font-size: 14px; z-index: 9999; pointer-events: none;
  opacity: 0; transition: opacity .2s; max-width: 260px; text-align: center;
}
.toast.show { opacity: 1; }
.mask {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.dialog {
  background: #fff; border-radius: 14px; width: 300px;
  overflow: hidden; animation: pop .22s;
}
@keyframes pop { from { transform: scale(.9); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.dialog-body { padding: 22px 22px 18px; text-align: center; }
.dialog-title { font-size: 17px; font-weight: 600; margin-bottom: 10px; white-space: pre-line; line-height: 1.4; }
.dialog-text { font-size: 14px; color: var(--text-2); line-height: 1.65; white-space: pre-line; }
.dialog-actions { display: flex; border-top: 1px solid #f0f2f5; }
.dialog-btn {
  flex: 1; padding: 14px; text-align: center; font-size: 16px; cursor: pointer;
  color: var(--text-2); background: #fff; border: none; font-family: inherit;
}
.dialog-btn + .dialog-btn { border-left: 1px solid #f0f2f5; }
.dialog-btn.confirm { color: var(--blue); font-weight: 600; }
.dialog-btn.danger { color: var(--pay); font-weight: 600; }


/* ============================================================
   社区首页（轮播图 + 活动分类 + 活动展示）
   ============================================================ */

/* 顶部品牌栏 */
.home-top {
  background: linear-gradient(135deg, #4A90D9, #6BB6FF);
  padding: 10px 14px 12px;
}

/* ---- 轮播图 ---- */
.swiper {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #eef2f7;
}
.swiper-track {
  display: flex;
  width: 100%;
  transition: transform .38s cubic-bezier(.25, .8, .3, 1);
  will-change: transform;
}
.swiper-slide {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 750 / 320;
  max-height: 220px;
  cursor: pointer;
  background: #dfe6f0;
}
.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.swiper-dots {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.swiper-dots .dot {
  width: 6px; height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .55);
  transition: all .25s;
}
.swiper-dots .dot.on {
  width: 16px;
  background: #fff;
}

/* ---- 分区标题 ---- */
.home-sec { background: #fff; margin-top: 10px; padding: 14px 14px 4px; }
.home-sec-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.home-sec-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  position: relative;
  padding-left: 10px;
}
.home-sec-title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, #4A90D9, #6BB6FF);
}
.home-sec-sub { font-size: 11px; color: #9aa5b1; }

/* ---- 活动分类宫格 ---- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 6px;
  padding-bottom: 12px;
}
.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 10px;
  padding: 4px 2px;
  transition: background .15s;
}
.cat-item:active { background: #f2f6fc; }
.cat-item.on { background: #eaf2fd; }
.cat-ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eaf2fd, #f6faff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.cat-item.on .cat-ico {
  background: linear-gradient(135deg, #4A90D9, #6BB6FF);
  box-shadow: 0 3px 10px rgba(74, 144, 217, .35);
}
.cat-name {
  font-size: 12px;
  color: #47506b;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-item.on .cat-name { color: #4A90D9; font-weight: 600; }

/* ---- 活动卡片列表 ---- */
.act-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
}
.act-card {
  display: flex;
  gap: 11px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: box-shadow .15s;
}
.act-card:active { box-shadow: 0 2px 12px rgba(31, 41, 55, .1); }
.act-cover {
  position: relative;
  width: 108px; height: 108px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.act-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.act-cover-ico { font-size: 34px; }
.act-badge {
  position: absolute;
  left: 0; top: 0;
  font-size: 10px;
  color: #fff;
  padding: 2px 7px;
  border-bottom-right-radius: 8px;
}
.act-badge.off { background: rgba(0, 0, 0, .55); }
.act-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.act-title { font-size: 14.5px; font-weight: 600; color: #1f2937; }
.act-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11px;
  color: #8a94a6;
  margin-top: 6px;
}
.act-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
}
.act-price { font-size: 16px; font-weight: 700; color: #ff5c38; }
.act-price::first-letter { font-size: 11px; }
.act-btn {
  font-size: 11.5px;
  color: #fff;
  background: linear-gradient(135deg, #4A90D9, #6BB6FF);
  border-radius: 13px;
  padding: 5px 13px;
  font-weight: 500;
}
.act-btn.joined { background: #eef0f4; color: #9aa5b1; }
.act-btn.full { background: #eef0f4; color: #9aa5b1; }
.act-bar {
  height: 3px;
  border-radius: 2px;
  background: #eef0f4;
  margin-top: 7px;
  overflow: hidden;
}
.act-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #4A90D9, #6BB6FF);
}

/* ---------- 活动主题标签与筛选条 ---------- */
.act-theme {
  display: inline-block;
  font-size: 10px;
  color: #4A90D9;
  background: #eaf2fd;
  border-radius: 3px;
  padding: 1px 6px;
  margin-right: 4px;
}

.theme-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px 4px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid #f0f2f5;
  -webkit-overflow-scrolling: touch;
}
.theme-bar::-webkit-scrollbar { display: none; }

.theme-chip {
  flex-shrink: 0;
  font-size: 12px;
  color: #47506b;
  background: #f5f6f8;
  border-radius: 14px;
  padding: 5px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.theme-chip.on {
  color: #fff;
  background: linear-gradient(135deg, #4A90D9, #6BB6FF);
  font-weight: 500;
}
