/* ===== 积分商城 前端样式（移动端 + 桌面端自适应） ===== */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --primary-soft: rgba(79,70,229,.10);
  --primary-grad: linear-gradient(135deg, #4f46e5, #818cf8);
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-sub: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; } /* 防止 display:flex 等样式覆盖 hidden 导致弹窗常显 */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  display: flex; flex-direction: column;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; font-size: 15px; }

/* ---- 顶栏（仅显示 App 名称，居中） ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--card); box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  height: 56px; display: flex; align-items: center; justify-content: center;
  position: relative;
}
.logo { font-size: 19px; font-weight: 800; color: var(--primary); white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; }
.logo-img { height: 30px; width: auto; max-width: 120px; object-fit: contain; }
.logo-emoji { font-size: 20px; }
#brand-name { overflow: hidden; text-overflow: ellipsis; }
/* 顶栏已不再展示登录状态；以下 .user-* 样式保留供其它位置复用 */
.user-area {
  display: flex; align-items: center; gap: 8px;
}
.user-name { font-size: 14px; color: var(--text-sub); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 160px; }
.user-avatar {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.user-chip .user-name { color: var(--text); font-weight: 600; }

/* ---- 底部导航栏（安全区适配，不被系统导航条遮挡） ---- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--card); border-top: 1px solid var(--border);
  box-shadow: 0 -1px 6px rgba(0,0,0,.05);
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: stretch;
  height: 56px;
}
.bottom-nav .nav-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 0; border-radius: 0; font-size: 11px; line-height: 1;
  color: #9ca3af; text-decoration: none; background: transparent;
  transition: color .15s;
}
.bottom-nav .nav-link.active {
  color: var(--primary); font-weight: 700; background: transparent;
}
.nav-ico { width: 22px; height: 22px; fill: currentColor; }

/* ---- 按钮 ---- */
.btn {
  border: none; border-radius: 10px; font-size: 15px;
  padding: 10px 18px; transition: opacity .15s;
}
.btn:active { opacity: .8; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-sub); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-success { background: #dcfce7; color: var(--success); }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- 视图容器 ---- */
.view {
  max-width: 1200px; margin: 0 auto; padding: 16px; width: 100%; flex: 1;
  /* 为底部导航栏 + 系统安全区预留空间 */
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 16px);
}

/* ---- 广告位轮播 ---- */
.banner-wrap { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.banner-track { display: flex; transition: transform .5s ease; }
.banner-slide { flex: 0 0 100%; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 10/3; }
.banner-dots {
  position: absolute; bottom: 10px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.banner-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); }
.banner-dots i.on { background: #fff; }

/* ---- 分类 + 排序 ---- */
.filter-bar { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; flex: 1; padding-bottom: 2px; }
.cat-tab {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-sub); font-size: 14px; white-space: nowrap;
}
.cat-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.sort-select { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: #fff; color: var(--text-sub); }

/* ---- 商品网格 ---- */
.product-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}
.product-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .15s;
}
.product-card:active { transform: scale(.98); }
.product-card .pc-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f0f0f0; }
.pc-body { padding: 10px 12px 12px; }
.pc-name {
  font-size: 15px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;
}
.pc-meta { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.pc-price { color: var(--danger); font-size: 18px; font-weight: 800; }
.pc-price::before { content: "¥"; font-size: 13px; }
.pc-ratio {
  margin-left: auto; font-size: 12px; color: var(--warn);
  background: #fef3c7; padding: 2px 8px; border-radius: 6px;
}
.pc-term { font-size: 12px; color: var(--text-sub); margin-top: 6px; }

/* ---- 订单 ---- */
.orders-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.orders-head h2 { font-size: 20px; }
.points-card { background: var(--primary-grad); color: #fff; border-radius: var(--radius); padding: 10px 18px; display: flex; flex-direction: column; }
.points-label { font-size: 12px; opacity: .85; }
.points-value { font-size: 24px; font-weight: 800; }
.order-list { display: flex; flex-direction: column; gap: 12px; }
.order-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.oc-top { display: flex; align-items: center; gap: 10px; }
.oc-id { font-size: 12px; color: var(--text-sub); }
.oc-status { margin-left: auto; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.st-pending_review { background: #fef3c7; color: var(--warn); }
.st-second_review { background: #ffedd5; color: #ea580c; }
.st-approved { background: #dcfce7; color: var(--success); }
.st-rejected { background: #fee2e2; color: var(--danger); }
.st-failed { background: #f3f4f6; color: #6b7280; }
.st-completed { background: #dbeafe; color: #2563eb; }
.oc-main { display: flex; gap: 12px; margin-top: 10px; align-items: center; }
.oc-img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #f0f0f0; flex-shrink: 0; }
.oc-info { flex: 1; min-width: 0; }
.oc-name { font-size: 15px; font-weight: 600; }
.oc-line { font-size: 13px; color: var(--text-sub); margin-top: 3px; }
.oc-countdown { font-size: 13px; color: var(--danger); margin-top: 4px; font-variant-numeric: tabular-nums; }
.oc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---- 我的 ---- */
.mine-hero {
  background: var(--primary-grad); color: #fff;
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  box-shadow: 0 4px 14px var(--primary-soft);
}
.mine-user { display: flex; align-items: center; gap: 12px; }
.mine-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800;
  flex-shrink: 0;
}
.mine-userinfo { min-width: 0; }
.mine-phone { font-size: 17px; font-weight: 700; }
.mine-sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.mine-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 16px; background: rgba(255,255,255,.14); border-radius: 10px; padding: 12px 6px;
}
.mine-stat { text-align: center; }
.mine-stat b { display: block; font-size: 17px; font-weight: 800; }
.mine-stat span { font-size: 12px; opacity: .88; }

.mine-tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.mine-tab {
  border: 1px solid var(--border); background: var(--card); color: var(--text-sub);
  border-radius: 999px; padding: 8px 18px; font-size: 14px; white-space: nowrap;
}
.mine-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.mine-h3 { font-size: 15px; margin: 16px 0 10px; }

.earn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.earn-cell {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; display: flex; flex-direction: column; gap: 4px;
}
.earn-cell span { font-size: 12px; color: var(--text-sub); }
.earn-cell b { font-size: 20px; font-weight: 800; color: var(--text); }
.earn-cell.hl { grid-column: span 2; background: var(--primary-soft); }
.earn-cell.hl b { color: var(--primary); }

.earn-list { display: flex; flex-direction: column; gap: 10px; }
.earn-item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
}
.earn-item .ei-info { flex: 1; min-width: 0; }
.earn-item .ei-name { font-size: 14px; font-weight: 600; }
.earn-item .ei-line { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.earn-item .ei-val { font-size: 16px; font-weight: 800; color: var(--warn); white-space: nowrap; }

.redeem-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.redeem-card .form-row label { font-size: 13px; color: var(--text-sub); display: block; margin-bottom: 6px; }
.redeem-card .form-row select,
.redeem-card .form-row textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px 14px; outline: none; background: #fff; font-size: 15px;
  font-family: inherit; resize: vertical;
}
.redeem-card .form-row textarea:focus { border-color: var(--primary); }
.req { color: var(--danger); font-style: normal; }
.upload-box-sm { min-height: 110px; }
.upload-box-sm .upload-icon { font-size: 26px; }
.redeem-list { display: flex; flex-direction: column; gap: 10px; }
.redeem-item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px;
}
.redeem-item .rd-top { display: flex; align-items: center; gap: 8px; }
.redeem-item .rd-id { font-size: 12px; color: var(--text-sub); }
.redeem-item .rd-code { font-size: 12px; color: var(--text-sub); font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; word-break: break-all; }
.redeem-item .rd-status { margin-left: auto; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; flex: 0 0 auto; }
.rd-pending { background: #fef3c7; color: var(--warn); }
.rd-approved { background: #dcfce7; color: var(--success); }
.rd-rejected { background: #fee2e2; color: var(--danger); }
.redeem-item .rd-line { font-size: 13px; color: var(--text-sub); margin-top: 4px; }
.redeem-item .rd-pts { font-size: 15px; font-weight: 800; color: var(--warn); }

/* ---- 空状态 ---- */
.empty { text-align: center; color: var(--text-sub); padding: 60px 0; }
.empty-sub { font-size: 13px; margin-top: 6px; }

/* ---- 弹窗 ---- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17,24,39,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: 16px; position: relative;
  width: 100%; max-width: 440px; padding: 22px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.modal h2 { font-size: 18px; margin-bottom: 14px; }
.modal-close {
  position: absolute; top: 10px; right: 12px; border: none; background: none;
  font-size: 26px; color: #9ca3af; line-height: 1; padding: 4px;
}

/* 商品详情 */
.modal-product { max-width: 860px; }
.pd-layout { display: flex; gap: 22px; }
.pd-img { width: 42%; min-width: 220px; border-radius: 12px; object-fit: cover; aspect-ratio: 1; background: #f0f0f0; }
.pd-info { flex: 1; min-width: 0; }
.pd-price { color: var(--danger); font-size: 28px; font-weight: 800; margin: 8px 0; }
.pd-price::before { content: "¥"; font-size: 17px; }
.pd-ratio {
  display: inline-block; color: var(--warn); background: #fef3c7;
  font-size: 14px; padding: 4px 12px; border-radius: 8px; margin-bottom: 14px;
}
.pd-field label { font-size: 13px; color: var(--text-sub); display: block; margin-bottom: 8px; }
.term-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.term-chip {
  padding: 8px 16px; border-radius: 10px; border: 1.5px solid var(--border);
  background: #fff; font-size: 14px;
}
.term-chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.pd-estimate { font-size: 14px; color: var(--text-sub); background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 14px 0; }
.pd-estimate b { color: var(--warn); }
.pd-desc { font-size: 14px; color: var(--text-sub); line-height: 1.7; margin-bottom: 16px; }

/* 登录 */
.login-tip { font-size: 13px; color: var(--text-sub); margin: -8px 0 14px; }
.form-row { margin-bottom: 12px; }
.form-row input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px 14px; outline: none;
}
.form-row input:focus { border-color: var(--primary); }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; }
.field-error { color: var(--danger); font-size: 13px; margin: -6px 0 10px; min-height: 1em; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 1em; }
.login-links { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; font-size: 13px; }
.login-links a { color: var(--primary); text-decoration: none; }
.login-links a:active { opacity: .7; }
.mine-login-btn { margin-left: auto; white-space: nowrap; }

/* 支付 */
.pay-summary { background: var(--bg); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.8; margin-bottom: 14px; }
.pay-summary b { color: var(--danger); }
.qr-box { text-align: center; margin-bottom: 14px; }
.qr-box img, .qr-box canvas { width: 220px; height: 220px; margin: 0 auto; border-radius: 8px; border: 1px solid var(--border); }
.qr-note { font-size: 12px; color: var(--text-sub); margin-top: 8px; }
.pay-form { margin-bottom: 14px; }
#pay-note { background: #f9fafb; color: var(--text); text-align: center; cursor: default; }
.pay-tip { font-size: 13px; color: var(--text-sub); line-height: 1.8; margin-bottom: 14px; }
.pay-success { font-size: 52px; text-align: center; margin: 10px 0; }
.upload-box {
  border: 2px dashed var(--border); border-radius: 12px; min-height: 160px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
  cursor: pointer; overflow: hidden; background: var(--bg);
}
.upload-placeholder { color: var(--text-sub); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.upload-icon { font-size: 34px; }
.screenshot-preview { max-width: 100%; max-height: 260px; object-fit: contain; }
.modal-pay .btn-ghost { margin-top: 8px; }

/* 订单详情 / 合同 */
.modal-order { max-width: 560px; }
.od-grid { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 14px; margin-bottom: 14px; }
.od-grid dt { color: var(--text-sub); }
.od-grid dd { font-weight: 600; word-break: break-all; }
.contract {
  background: var(--bg); border-radius: 10px; padding: 16px;
  font-size: 13px; line-height: 2; color: #374151;
  max-height: 300px; overflow-y: auto;
}
.contract h3 { text-align: center; font-size: 15px; margin-bottom: 10px; }
.od-shot { margin-top: 12px; }
.od-shot img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%);
  background: rgba(17,24,39,.85); color: #fff; font-size: 14px;
  padding: 10px 20px; border-radius: 999px; z-index: 200;
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.footer { text-align: center; color: #9ca3af; font-size: 12px; padding: 24px 16px 30px; }
.footer span { display: block; }
.footer #brand-slogan:empty { display: none; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .banner-slide img { aspect-ratio: 3/1; }
  .pd-layout { flex-direction: column; }
  .pd-img { width: 100%; min-width: 0; }
  .modal { padding: 18px 16px; border-radius: 14px; }
  .filter-bar { flex-wrap: wrap; }
  .sort-select { order: -1; width: 100%; }
  .earn-grid { grid-template-columns: repeat(2, 1fr); }
  .earn-cell b { font-size: 18px; }
  .mine-hero { padding: 16px; }
  .mine-stat b { font-size: 15px; }
  .mine-tab { padding: 7px 14px; font-size: 13px; }
}
@media (max-width: 360px) {
  .pc-price { font-size: 16px; }
  .pc-ratio { font-size: 11px; padding: 2px 6px; }
}

/* ===== 支付页：可复制的后台填写框 ===== */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; }
.copy-row .btn { flex: none; white-space: nowrap; }
.copy-tip { font-size: 12px; color: var(--text-sub); margin: -6px 0 10px; }

/* ===== 我的YNB：邀请提示 ===== */
.earn-tip { font-size: 12px; color: var(--text-sub); background: var(--primary-soft); border-radius: 8px; padding: 8px 10px; margin-top: 10px; line-height: 1.6; }

/* ===== 我的：邀请页 ===== */
.invite-hero {
  background: var(--primary-grad); color: #fff; border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.12);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.invite-hero-label { font-size: 12px; opacity: .88; }
.invite-code {
  font-size: 30px; font-weight: 800; letter-spacing: 4px; margin: 6px 0 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.invite-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.invite-btns .btn-primary { background: #fff; color: var(--primary); border-color: #fff; }
.invite-btns .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.invite-link {
  margin-top: 10px; font-size: 12px; opacity: .92; word-break: break-all; line-height: 1.5;
  max-width: 100%;
}
.invite-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.invite-stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 8px; text-align: center;
}
.invite-stat b { display: block; font-size: 18px; font-weight: 800; color: var(--primary); }
.invite-stat span { font-size: 12px; color: var(--text-sub); }
.invite-rule {
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px; font-size: 13px; color: var(--text-sub); line-height: 1.9;
}
.invite-rule .ir-title { font-weight: 700; color: var(--text); margin-bottom: 4px; font-size: 14px; }
.invite-rule b { color: var(--primary); }
.invite-bind-card, .invite-bound {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.invite-bind-tip { font-size: 13px; color: var(--text-sub); margin-bottom: 10px; line-height: 1.6; }
.invite-bound { font-size: 13px; color: var(--success); line-height: 1.7; }
.invite-list { display: flex; flex-direction: column; gap: 10px; }
.invite-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ii-name { font-weight: 700; font-size: 14px; }
.ii-line { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.ii-status {
  flex: none; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--bg); color: var(--text-sub); border: 1px solid var(--border);
}
.ii-status.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); font-weight: 700; }

@media (max-width: 768px) {
  .invite-stats { grid-template-columns: repeat(2, 1fr); }
  .invite-code { font-size: 26px; }
}

/* ===== 社区（即时聊天群 + 评论区） ===== */
.comm-hero {
  background: var(--primary-grad); color: #fff; border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 4px 14px var(--primary-soft);
}
.comm-hero-main { display: flex; align-items: center; gap: 12px; }
.comm-hero-emoji {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none;
}
.comm-hero-title { font-size: 18px; font-weight: 800; }
.comm-hero-sub { font-size: 12px; opacity: .9; margin-top: 3px; line-height: 1.5; }

.comm-tab {
  border: 1px solid var(--border); background: var(--card); color: var(--text-sub);
  border-radius: 999px; padding: 8px 18px; font-size: 14px; white-space: nowrap;
}
.comm-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }

/* 入群门槛卡片 */
.gate-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 18px; text-align: center; box-shadow: var(--shadow);
}
.gate-card .gate-emoji { font-size: 40px; margin-bottom: 8px; }
.gate-card h3 { font-size: 17px; margin-bottom: 8px; }
.gate-card p { font-size: 14px; color: var(--text-sub); line-height: 1.9; margin-bottom: 16px; }
.gate-card p b { color: var(--primary); }
.gate-card.invite { border-color: var(--primary); background: var(--primary-soft); }
.gate-progress { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-bottom: 16px; }
.gate-progress i { display: block; height: 100%; background: var(--primary-grad); transition: width .3s; }

/* 聊天室 */
.chat-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 0 2px 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.chat-room-name { font-weight: 700; font-size: 15px; }
.chat-room-hint { font-size: 12px; color: var(--text-sub); margin-left: auto; }
.chat-msgs {
  height: 52vh; min-height: 280px; overflow-y: auto; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-empty { color: var(--text-sub); font-size: 14px; text-align: center; margin: auto; }
.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.cm-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.cm-body { min-width: 0; max-width: 78%; }
.cm-head { display: flex; align-items: baseline; gap: 8px; }
.cm-name { font-size: 12px; color: var(--text-sub); }
.cm-time { font-size: 11px; color: #9ca3af; }
.cm-text {
  background: var(--bg); border-radius: 10px; padding: 8px 12px; font-size: 14px;
  line-height: 1.6; margin-top: 3px; word-break: break-word; white-space: pre-wrap;
}
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg.mine .cm-body { display: flex; flex-direction: column; align-items: flex-end; }
.chat-msg.mine .cm-avatar { background: var(--primary); color: #fff; }
.chat-msg.mine .cm-text { background: var(--primary-soft); }
.chat-input-row { display: flex; gap: 8px; margin-top: 10px; }
.chat-input-row input {
  flex: 1; min-width: 0; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px 14px; outline: none; font-size: 15px;
}
.chat-input-row input:focus { border-color: var(--primary); }

/* 评论区（朋友圈形式） */
.post-compose {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.post-compose textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 14px;
  outline: none; font-family: inherit; font-size: 15px; resize: vertical;
}
.post-compose textarea:focus { border-color: var(--primary); }
.post-compose-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.post-tip { font-size: 12px; color: var(--text-sub); flex: 1; }

.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.post-head { display: flex; align-items: center; gap: 10px; }
.post-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--primary-soft); color: var(--primary); font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.post-meta { min-width: 0; flex: 1; }
.post-author { font-size: 14px; font-weight: 700; }
.post-time { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.post-del {
  border: none; background: none; color: #9ca3af; font-size: 20px; line-height: 1;
  padding: 0 4px; flex: none;
}
.post-del:hover { color: var(--danger); }
.post-content { font-size: 15px; line-height: 1.7; margin: 10px 0 0; word-break: break-word; white-space: pre-wrap; }
.post-replies {
  margin-top: 10px; background: var(--bg); border-radius: 10px; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.reply-item { font-size: 13px; line-height: 1.7; color: var(--text-sub); word-break: break-word; }
.reply-item b { color: var(--primary); }
.reply-item span { color: var(--text); }
.reply-time { font-size: 11px; color: #9ca3af; margin-left: 6px; }
.post-actions { margin-top: 10px; }
.post-reply-btn {
  border: none; background: none; color: var(--primary); font-size: 13px; font-weight: 600;
  padding: 2px 0;
}
.reply-box { display: flex; gap: 8px; margin-top: 8px; }
.reply-box input {
  flex: 1; min-width: 0; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 9px 12px; outline: none; font-size: 14px;
}
.reply-box input:focus { border-color: var(--primary); }

@media (max-width: 768px) {
  .chat-msgs { height: 46vh; }
  .cm-body { max-width: 84%; }
}

/* ===== 社区：图片 / 语音消息 ===== */
.msg-img {
  max-width: 220px; max-height: 240px; border-radius: 10px; margin-top: 4px;
  border: 1px solid var(--border); cursor: zoom-in; object-fit: cover; background: #f0f0f0;
}
.cm-text + .msg-img, .msg-img + .cm-text { margin-top: 6px; }
.msg-text { font-size: 15px; line-height: 1.7; margin-top: 4px; word-break: break-word; white-space: pre-wrap; }

.audio-bubble {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  background: var(--bg); border-radius: 10px; padding: 8px 12px; min-width: 140px;
}
.chat-msg.mine .audio-bubble { background: var(--primary-soft); }
.audio-play {
  width: 28px; height: 28px; border-radius: 50%; border: none; flex: none;
  background: var(--primary); color: #fff; font-size: 11px; display: flex;
  align-items: center; justify-content: center; line-height: 1;
}
.audio-play.playing { opacity: .8; }
.audio-wave { display: flex; align-items: center; gap: 2px; flex: 1; }
.audio-wave i { display: block; width: 3px; border-radius: 2px; background: var(--primary); opacity: .45; }
.audio-wave i:nth-child(1) { height: 8px; }
.audio-wave i:nth-child(2) { height: 14px; }
.audio-wave i:nth-child(3) { height: 20px; }
.audio-wave i:nth-child(4) { height: 12px; }
.audio-wave i:nth-child(5) { height: 7px; }
.audio-dur { font-size: 12px; color: var(--text-sub); flex: none; }
.media-loading { font-size: 12px; color: var(--text-sub); padding: 6px 0; }

/* 撰写媒体预览 */
.chat-media, .compose-media { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.media-chip {
  position: relative; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); padding: 6px; display: flex; align-items: center; gap: 8px;
}
.media-chip img { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; display: block; }
.media-chip.audio { padding: 10px 34px 10px 12px; }
.media-chip .chip-icon { font-size: 18px; }
.media-chip .chip-del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: var(--danger); color: #fff; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.chat-media-btn { padding: 9px 10px; flex: none; font-size: 15px; }
.btn.recording { background: #fee2e2; color: var(--danger); border-color: var(--danger); }

/* 图片放大查看 */
.image-viewer {
  position: fixed; inset: 0; z-index: 300; background: rgba(17,24,39,.88);
  display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.image-viewer img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* 评论区：回复内的图文 */
.reply-text { display: block; }
.reply-item .msg-img { max-width: 150px; max-height: 150px; margin-top: 4px; }
.reply-item .msg-text { display: inline; font-size: 13px; }
@media (max-width: 768px) {
  .msg-img { max-width: 180px; max-height: 200px; }
  .chat-input-row { flex-wrap: wrap; }
  .chat-input-row input { min-width: 120px; }
}

/* ===== App 启动闪屏（图标取自后台「App 图标」设定） ===== */
.app-splash {
  position: fixed; inset: 0; z-index: 400;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--card, #fff);
  transition: opacity .35s ease, visibility .35s ease;
}
.app-splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-icon { width: 96px; height: 96px; border-radius: 24px; object-fit: cover; box-shadow: 0 10px 26px rgba(0, 0, 0, .14); }
.splash-emoji { font-size: 58px; line-height: 1; }
.splash-name { font-size: 20px; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
.splash-loading { display: flex; gap: 6px; margin-top: 2px; }
.splash-loading i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); opacity: .3; animation: splashDot 1.1s infinite; }
.splash-loading i:nth-child(2) { animation-delay: .18s; }
.splash-loading i:nth-child(3) { animation-delay: .36s; }
@keyframes splashDot {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* ===== 聊天群：管理员清屏提示 ===== */
.chat-clear-tip {
  margin: 0 0 10px; padding: 8px 12px; border-radius: 10px;
  background: #fef3c7; border: 1px solid #fde68a; color: #92400e;
  font-size: 12.5px; line-height: 1.65;
}

/* ===== 订单奖励发放状态（以真实发放记录为准） ===== */
.oc-payout { font-size: 12.5px; margin-top: 2px; }
.oc-payout.paid { color: var(--success); font-weight: 700; }
.oc-payout.wait { color: var(--warn); }
.oc-payout.block { color: var(--danger); }
.oc-verify { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
