/* 婚恋交友平台 全局样式（用户端移动优先 + 后台桌面） */
:root {
  --primary: #e8447a; --primary-dark: #d13769; --primary-bg: #fdeef4;
  --bg: #f7f5f6; --card: #ffffff; --text: #333; --muted: #999;
  --border: #eee; --danger: #e74c3c; --ok: #27ae60; --warn: #f39c12;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== 用户端布局 ===== */
.container { max-width: 520px; margin: 0 auto; padding: 0 14px 80px; min-height: 100vh; }
.nav { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 520px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.nav-logo { font-weight: 700; color: var(--primary); font-size: 18px; }
.nav-links { display: flex; gap: 10px; font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { color: #666; white-space: nowrap; }
.nav-links a.active { color: var(--primary); font-weight: 600; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0; line-height: 1.8; }

.card { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.section-title { margin: 16px 0 10px; font-size: 17px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.section-title a { font-size: 13px; color: var(--muted); font-weight: 400; }

.btn { display: inline-block; border: none; border-radius: 8px; padding: 10px 18px; font-size: 15px; cursor: pointer; text-align: center; transition: opacity .15s; line-height: 1.4; }
.btn:active { opacity: .8; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost { background: #f2f2f2; color: #666; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.alert { border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.alert-error { background: #fdecea; color: var(--danger); }
.alert-ok { background: #e8f8f0; color: var(--ok); }
.alert-warn { background: #fef5e7; color: #b9770e; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 5px; }
.input, .select, textarea.input { width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; font-size: 15px; background: #fff; outline: none; }
.input:focus, .select:focus { border-color: var(--primary); }
.input-sm { padding: 6px 8px; font-size: 13px; width: auto; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }

/* 快捷筛选 */
.filter-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { border: 1px solid #e5c8d4; color: #b3547d; background: #fff; border-radius: 20px; padding: 5px 14px; font-size: 13px; cursor: pointer; display: inline-block; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-label { font-size: 12px; color: var(--muted); margin: 8px 0 6px; }

/* 资料卡片 */
.grid-profiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.p-card .ph { position: relative; }
.p-card .ph img { width: 100%; height: 200px; object-fit: cover; }
.p-card .ph .gtag { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; border-radius: 10px; padding: 2px 8px; }
.p-card .info { padding: 10px; }
.p-card .name { font-weight: 700; font-size: 15px; }
.p-card .meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.6; }
.p-card .tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.p-card .tags span { background: var(--primary-bg); color: var(--primary); border-radius: 4px; font-size: 11px; padding: 1px 6px; }

/* 详情页 */
.detail-photo { position: relative; border-radius: 14px; overflow: hidden; margin-bottom: 12px; background: #f3f3f3; }
.detail-photo img { width: 100%; max-height: 420px; object-fit: cover; }
/* 详情页：顶部图片轮播（主照片 + 网友分享图） */
.detail-photo .carousel-track { display: flex; transition: transform .3s ease; }
.detail-photo .carousel-track img { flex: 0 0 100%; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; padding: 0; border: none; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; }
.carousel-btn:active { opacity: .7; }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.carousel-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.65); cursor: pointer; }
.carousel-dot.active { background: #fff; width: 18px; border-radius: 4px; }
.carousel-counter { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.4); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; z-index: 2; }
/* 详情页：同城推荐 */
.rec-col { width: 300px; flex-shrink: 0; }
.rec-item { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed #f0e0e8; text-decoration: none; color: inherit; }
.rec-item:last-child { border-bottom: none; }
.rec-item img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
@media (max-width: 760px) { .rec-col { width: 100%; } }
.kv { display: flex; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { width: 88px; color: var(--muted); flex-shrink: 0; }
.kv .v { flex: 1; }

/* 联系方式 */
.locked-box { background: linear-gradient(135deg, #fdeef4, #fff5f9); border: 1px dashed #e8a4c0; border-radius: 12px; padding: 18px 14px; text-align: center; }
.locked-box .lock-ico { font-size: 30px; }
.locked-box p { color: #8a5468; font-size: 13px; margin: 8px 0 12px; }
.locked-mask { filter: blur(6px); user-select: none; }
.contact-box { background: #fff; border-radius: 12px; padding: 14px; border: 1px solid var(--ok); }
.contact-box .kv .v { font-weight: 700; color: var(--ok); }

/* 会员购买 */
.plan-card { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 12px; padding: 16px 14px; margin-bottom: 10px; border: 1px solid var(--border); }
.plan-card.off { opacity: .55; }
.plan-card .pname { font-weight: 700; }
.plan-card .pdesc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.plan-card .price { color: var(--primary); font-size: 20px; font-weight: 800; }
.plan-card .price small { font-size: 12px; font-weight: 400; color: var(--muted); }
.member-strip { background: linear-gradient(120deg, var(--primary), #f0709e); color: #fff; border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.member-strip .t { font-size: 13px; opacity: .9; }
.member-strip .v { font-size: 18px; font-weight: 800; margin-top: 4px; }

/* 商城 */
.grid-goods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.g-card img { width: 100%; height: 150px; object-fit: cover; }
.g-card .info { padding: 10px; }
.g-card .gname { font-size: 14px; font-weight: 600; }
.g-card .gprice { color: var(--primary); font-weight: 800; margin-top: 4px; }

/* 收银台 */
.cashier-amount { text-align: center; padding: 26px 0 10px; }
.cashier-amount .amt { font-size: 40px; font-weight: 800; color: var(--text); }
.cashier-amount .amt em { font-style: normal; font-size: 20px; }
.pay-channel { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 12px; padding: 16px 14px; margin-bottom: 10px; border: 2px solid transparent; cursor: pointer; }
.pay-channel.sel { border-color: var(--primary); background: var(--primary-bg); }
.pay-channel .ico { width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; margin-right: 10px; }
.pay-channel .ico.ali { background: #1677ff; }
.pay-channel .ico.wx { background: #07c160; }

/* 表格（后台） */
.table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 9px 10px; text-align: left; white-space: nowrap; }
.table th { background: #fafafa; color: #666; font-weight: 600; }
.table tr:hover td { background: #fdf7fa; }

/* ===== 后台布局 ===== */
.admin-wrap { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #2d2430; color: #cfc4d6; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar .logo { padding: 18px 16px; color: #fff; font-weight: 700; border-bottom: 1px solid #453a4b; }
.sidebar .group { font-size: 11px; color: #8d7f96; padding: 12px 16px 4px; }
.sidebar a { display: block; padding: 10px 16px; color: #cfc4d6; font-size: 14px; }
.sidebar a:hover, .sidebar a.active { background: var(--primary); color: #fff; }
.main { flex: 1; padding: 18px 22px; background: var(--bg); min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.topbar h1 { font-size: 20px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 12px; padding: 14px 16px; }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--primary); }
.stat-card .lbl { font-size: 13px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; border-radius: 4px; font-size: 12px; padding: 2px 8px; }
.badge.gray { background: #f0f0f0; color: #666; }
.badge.green { background: #e8f8f0; color: var(--ok); }
.badge.red { background: #fdecea; color: var(--danger); }
.badge.orange { background: #fef5e7; color: #b9770e; }
.badge.blue { background: #e8f1fd; color: #1677ff; }
.badge.pink { background: var(--primary-bg); color: var(--primary); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.pager { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.pager a, .pager span { padding: 6px 12px; background: #fff; border-radius: 6px; font-size: 13px; border: 1px solid var(--border); }
.pager span.cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 菜单（用户端“我的”） */
.menu-list { background: #fff; border-radius: 12px; overflow: hidden; }
.menu-list a { display: flex; justify-content: space-between; align-items: center; padding: 15px 14px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 15px; }
.menu-list a:last-child { border-bottom: none; }
.menu-list .arrow { color: #ccc; }

@media (max-width: 760px) {
  .admin-wrap { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; }
  .sidebar .logo { border: none; padding: 12px 16px; white-space: nowrap; }
  .sidebar .group { display: none; }
  .sidebar a { white-space: nowrap; }
  .main { padding: 12px; }
  .table-wrap { overflow-x: auto; }
  .grid-profiles, .grid-goods { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 761px) {
  .container { max-width: 760px; }
  .grid-profiles { grid-template-columns: repeat(3, 1fr); }
  .grid-goods { grid-template-columns: repeat(4, 1fr); }
}
