/* 牵手相亲 移动端 H5 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --primary: #ff4d6d;
  --grad: linear-gradient(135deg, #ff5f6d, #ff4d6d 55%, #ff8a5c);
  --bg: #f4f5f7;
  --card: #fff;
  --text: #333;
  --text-2: #888;
  --radius: 14px;
}

html, body {
  background: #eceff3;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 24px rgba(0,0,0,.08);
}

/* ===== 页面切换 ===== */
.page { display: none; padding-bottom: 72px; }
.page.active { display: block; }

.page-title {
  padding: 18px 16px 10px;
  background: var(--grad);
  color: #fff;
  border-radius: 0 0 18px 18px;
}
.page-title h2 { font-size: 20px; }
.page-title span { font-size: 12px; opacity: .9; }

/* ===== 首页 hero (logo + 品牌徽章) ===== */
.hero {
  background: var(--grad);
  color: #fff;
  text-align: center;
  padding: 26px 18px 28px;
  border-radius: 0 0 22px 22px;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.hero::before { width: 170px; height: 170px; top: -70px; right: -45px; }
.hero::after  { width: 100px; height: 100px; bottom: -40px; left: 20px; background: rgba(255,255,255,.07); }
.logo {
  font-size: 38px;
  letter-spacing: 6px;
  margin-bottom: 12px;
  font-family: "STKaiti", "KaiTi", "STZhongsong", "SimSun", serif;
  font-weight: 600;
  background: linear-gradient(90deg, #fff 0%, #ffe0b8 25%, #fff 50%, #ffc9d9 75%, #fff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: logoFlow 5s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(255,255,255,.18));
  position: relative; z-index: 1;
}
.logo .logo-heart {
  -webkit-text-fill-color: initial;
  margin-right: 4px;
}
@keyframes logoFlow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}
.brand-chips {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 12px; flex-wrap: wrap; position: relative; z-index: 1;
}
.brand-chips span {
  font-size: 11px; color: #fff; letter-spacing: .5px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 20px; padding: 4px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ===== 优质会员 (四图推荐) ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gallery-item {
  position: relative; border-radius: 12px; overflow: hidden;
  aspect-ratio: 3 / 4;
  box-shadow: 0 4px 12px rgba(255,77,109,.14);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.gallery-item:active img { transform: scale(1.06); }
.gallery-item em {
  position: absolute; left: 8px; bottom: 8px;
  font-style: normal; font-size: 12px; color: #fff;
  background: rgba(0,0,0,.5); padding: 3px 9px; border-radius: 12px;
  letter-spacing: .5px;
}

/* ===== 平台数据 ===== */
.stats {
  display: flex;
  margin: -14px 14px 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(255,77,109,.12);
  padding: 14px 0;
  position: relative;
}
.stat { flex: 1; text-align: center; border-right: 1px solid #f0f0f0; }
.stat:last-child { border-right: none; }
.stat b { display: block; font-size: 20px; color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--text-2); }

/* ===== 通用卡片 ===== */
.card {
  background: var(--card);
  margin: 12px 14px;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-head h2 { font-size: 16px; }
.tag {
  font-size: 11px;
  color: var(--primary);
  background: #fff0f3;
  padding: 3px 9px;
  border-radius: 20px;
}
.card-head select {
  border: 1px solid #ffd0d9;
  background: #fff5f7;
  color: var(--primary);
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 8px;
  outline: none;
}

/* ===== 认证章 / 状态 ===== */
.verified {
  display: inline-block;
  font-style: normal;
  font-size: 11px;
  color: #0a84ff;
  background: #eaf3ff;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: 1px;
}
.live { color: #22c55e; margin-right: 5px; }

/* ===== 同城匹配 ===== */
.match-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  background: #fff8f9;
  border: 1px dashed #ffc9d3;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.match-banner b { color: var(--primary); }

.profile-list { display: flex; flex-direction: column; gap: 10px; }
.profile-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #f3f3f3;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.profile-item:active { background: #fafafa; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .dot {
  position: absolute; right: 1px; bottom: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid #fff;
}
.avatar .dot.online { background: #22c55e; }

.profile-item .info { flex: 1; min-width: 0; }
.profile-item .info .name { font-weight: 600; font-size: 15px; }
.profile-item .info .name em { font-style: normal; color: var(--text-2); font-size: 13px; margin-left: 4px; font-weight: 400; }
.profile-item .info .desc { font-size: 12px; color: var(--text-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-item .info .meta { font-size: 11px; color: #aaa; margin-top: 2px; }
.profile-item .act {
  flex-shrink: 0;
  font-size: 12px;
  color: #fff;
  background: var(--grad);
  padding: 6px 12px;
  border-radius: 18px;
}

/* ===== 婚姻匹配 ===== */
.marital-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.marital-item {
  text-align: center;
  border: 1px solid #f3f3f3;
  border-radius: 12px;
  padding: 10px 4px;
}
.m-avatar {
  width: 44px; height: 44px; margin: 0 auto 6px;
  border-radius: 50%;
  overflow: hidden;
}
.m-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.marital-item .m-name { font-size: 13px; font-weight: 600; }
.marital-item .m-info { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* ===== 红娘 ===== */
.matchmaker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.matchmaker-item { text-align: center; position: relative; }
.matchmaker-item .m-avatar {
  width: 52px; height: 52px; margin: 0 auto 6px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.matchmaker-item .m-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.matchmaker-item.online .m-avatar::after {
  content: ""; position: absolute;
  width: 12px; height: 12px; background: #22c55e;
  border: 2px solid #fff; border-radius: 50%;
  margin: 40px 0 0 40px;
}
.matchmaker-item .m-name { font-size: 12px; font-weight: 600; }
.matchmaker-item .m-title { font-size: 10px; color: var(--text-2); margin-top: 2px; }

/* ===== 关于我们 ===== */
.about p { font-size: 13px; line-height: 1.9; color: #d63031; }
.about p + p { margin-top: 8px; }

/* ===== 动态社区 ===== */
#feed-list { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 12px; }
.feed-item { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.feed-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.avatar.sm { width: 40px; height: 40px; }
.feed-head .u-name { font-size: 14px; font-weight: 600; }
.feed-head .u-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.feed-photo { width: 100%; height: 210px; background: #f2f2f3; }
.feed-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-body { padding: 12px 14px; font-size: 13px; line-height: 1.7; }
.feed-actions { display: flex; gap: 18px; padding: 0 14px 14px; font-size: 12px; color: var(--text-2); }
.like-btn { cursor: pointer; }
.like-btn.liked { color: var(--primary); }

/* ===== 服务优势 (广播轮播, 一次一条) ===== */
.advantages-broadcast { overflow: hidden; }
.adv {
  display: flex; gap: 10px; align-items: flex-start;
  transition: opacity .25s ease, transform .25s ease;
}
.adv.fade-out { opacity: 0; transform: translateY(-8px); }
.adv-ico {
  width: 34px; height: 34px; border-radius: 10px;
  background: #fff0f3; display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.adv b { font-size: 14px; }
.adv p { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.6; }

/* ===== 我的 / 表单 ===== */
.form-card h3 { font-size: 15px; margin-bottom: 12px; color: var(--primary); }
.form-card label { display: block; font-size: 13px; margin-bottom: 10px; color: var(--text-2); }
.form-card label em { color: var(--primary); font-style: normal; }
.form-card input, .form-card select, .form-card textarea {
  width: 100%;
  margin-top: 5px;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fafafa;
  outline: none;
  font-family: inherit;
  color: var(--text);
}
.form-card input:focus, .form-card textarea:focus { border-color: var(--primary); background: #fff; }
.form-card select { appearance: none; -webkit-appearance: none; }
.btn-primary {
  width: 100%;
  border: none;
  background: var(--grad);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 13px;
  border-radius: 12px;
  margin-top: 6px;
  box-shadow: 0 4px 12px rgba(255,77,109,.3);
}
.btn-primary:active { transform: scale(.98); }
.btn-ghost {
  width: 100%;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  font-size: 15px;
  padding: 11px;
  border-radius: 12px;
  margin-top: 10px;
}
.privacy { text-align: center; font-size: 11px; color: var(--text-2); margin-top: 10px; }
.toast {
  margin-top: 12px;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  text-align: center;
  display: none;
}
.toast.ok { display: block; background: #ecfdf5; color: #15803d; }
.toast.err { display: block; background: #fef2f2; color: #b91c1c; }

/* ===== 会员详情弹层 ===== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%; max-width: 480px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  max-height: 88vh;
  overflow-y: auto;
  animation: slideUp .28s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-photo {
  width: 100%; height: 300px;
  background-size: cover; background-position: center;
  position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.4); color: #fff;
  font-size: 20px; line-height: 30px; cursor: pointer;
}
.modal-body { padding: 16px 16px 22px; }
.m-row { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; }
.m-row em { font-style: normal; color: var(--text-2); font-size: 14px; font-weight: 400; }
.m-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.m-tags span {
  font-size: 11px; color: #555; background: #f5f5f6;
  border-radius: 6px; padding: 3px 8px;
}
.m-desc { font-size: 14px; line-height: 1.8; color: #555; margin-top: 12px; }
.m-want { font-size: 13px; line-height: 1.8; color: var(--text-2); margin-top: 8px; background: #fff8f9; border-radius: 10px; padding: 10px; }
.m-want b { color: var(--primary); }

/* ===== 全局 toast ===== */
.toast-global {
  position: fixed;
  left: 50%; top: 18%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(0,0,0,.82);
  color: #fff;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 22px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  white-space: nowrap;
  max-width: 86vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-global.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-global.ok { background: rgba(21,128,61,.92); }
.toast-global.err { background: rgba(185,28,28,.92); }

/* ===== 底部导航 ===== */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  display: flex;
  border-top: 1px solid #f0f0f0;
  padding: 6px 0 env(safe-area-inset-bottom);
  z-index: 100;
}
.tab {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-2);
  font-size: 10px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tab .ico { font-size: 20px; }
.tab.active { color: var(--primary); }
