/* ============ 银洲汇合信息供需平台 · 移动端主题 ============ */
:root {
  --primary: #EA580C;
  --primary-light: #F97316;
  --primary-dark: #C2410C;
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --text: #1F2937;
  --muted: #9CA3AF;
  --border: #F3E4D3;
  --supply: #10B981;
  --demand: #EF4444;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; padding: 0; font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; background: #F5F5F5; color: var(--text); }

#app {
  width: 100%; height: 100%; max-width: 480px; margin: 0 auto;
  background: var(--bg); overflow: hidden;
  display: flex; flex-direction: column; position: relative;
}

@media (min-width: 769px) {
  body { display: flex; align-items: center; justify-content: center; min-height: 100%; }
  #app {
    width: 420px; height: 900px; max-width: 420px;
    border-radius: 40px;
    box-shadow: 0 25px 80px rgba(0,0,0,.18);
  }
  /* 管理后台/客服后台在电脑上放宽，表格和聊天更好用 */
  body.admin-mode #app {
    width: min(1100px, 96vw); max-width: 1100px;
    height: min(900px, 94vh);
  }
}

/* 页面容器 */
.page { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 70px; -webkit-overflow-scrolling: touch; }
.page::-webkit-scrollbar { width: 0; }

/* 顶部 */
.top-bar {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 8px rgba(234,88,12,.2);
}
.top-bar .logo { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; }
.top-bar .title { font-size: 17px; font-weight: 700; }
.top-bar .sub { font-size: 11px; opacity: .85; }
.top-bar .back { background: rgba(255,255,255,.2); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; }
.search-bar { display: flex; gap: 8px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.search-bar input { flex: 1; padding: 8px 14px; background: #F5F5F5; border-radius: 20px; border: none; font-size: 14px; outline: none; }
.home-head { flex-shrink: 0; background: #fff; }
.tabs { display: flex; gap: 0; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--border); }
.tab { flex: 1; padding: 12px 0; text-align: center; font-size: 14px; color: var(--muted); cursor: pointer; position: relative; font-weight: 500; }
.tab.active { color: var(--primary); font-weight: 700; }
.tab.active::after { content: ''; position: absolute; bottom: 0; left: 30%; right: 30%; height: 2px; background: var(--primary); border-radius: 2px; }

/* 帖子卡片 */
.post-list { padding: 10px 12px; }
.post-card {
  background: #fff; border-radius: 14px; padding: 12px; margin-bottom: 10px;
  display: flex; gap: 12px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: transform .15s;
}
.post-card:active { transform: scale(.98); }
.post-card .thumb { width: 90px; height: 90px; border-radius: 10px; background: linear-gradient(135deg, #FED7AA, #FDBA74); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 32px; overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .info { flex: 1; min-width: 0; }
.post-card .pt { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .tags { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.tag.supply { background: #DCFCE7; color: #15803D; }
.tag.demand { background: #FEE2E2; color: #B91C1C; }
.tag.cat { background: #FFF3E8; color: var(--primary); }
.top-badge { background: var(--primary); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; margin-right: 4px; }
.real-badge { background: #10B981; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.real-badge.small { font-size: 9px; padding: 1px 4px; }
.post-card .meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* 底部 TabBar */
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 64px;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; z-index: 30; box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.tabbar .item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; font-size: 11px; gap: 2px; position: relative;
}
.tabbar .item .ic { font-size: 22px; line-height: 1; }
.tabbar .item .dot {
  position: absolute; top: 4px; left: 50%; margin-left: 4px;
  min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  border-radius: 8px; background: #EF4444; color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 600;
  box-shadow: 0 0 0 2px #fff;
}
.tabbar .item.active { color: var(--primary); }
.tabbar .item.publish .fab {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 26px; box-shadow: 0 6px 18px rgba(234,88,12,.4);
}

/* 悬浮客服 */
.fab-cs {
  position: fixed; bottom: 84px; right: 16px; width: 50px; height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 4px 14px rgba(234,88,12,.35); z-index: 40; cursor: pointer;
}

/* 详情页 */
.detail-top { position: relative; background: #fff; }
.detail-top .gallery { width: 100%; height: 260px; background: linear-gradient(135deg, #FED7AA, #FDBA74); display: flex; align-items: center; justify-content: center; font-size: 60px; overflow: hidden; position: relative; }
.detail-top .gallery img { width: 100%; height: 100%; object-fit: cover; }
.top-float { position: absolute; top: 12px; right: 12px; background: var(--primary); color: #fff; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.detail-content { padding: 16px; background: #fff; margin-bottom: 10px; }
.detail-content .title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.detail-content .meta-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.detail-content .desc { font-size: 15px; line-height: 1.7; white-space: pre-wrap; color: #374151; }
.publisher-card { background: #fff; padding: 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #FDBA74, #EA580C); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.verified-badge { background: var(--primary); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.fixed-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; background: #fff;
  border-top: 1px solid var(--border); padding: 10px 16px; display: flex; gap: 10px; align-items: center;
}
.btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; font-weight: 600; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; flex: 1; text-align: center; }
.btn-primary:active { background: var(--primary-dark); }
.btn-ghost { background: #FFF3E8; color: var(--primary); }

/* 置顶弹窗 */
.top-options { display: flex; flex-direction: column; gap: 10px; }
.top-option { background: #fafafa; border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; text-align: left; }
.top-option:active { background: #fff3e8; border-color: var(--primary); }
.opt-title { font-weight: 600; font-size: 15px; color: var(--text); }
.opt-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 360px; max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-title { padding: 16px; font-weight: 700; font-size: 16px; border-bottom: 1px solid var(--border); text-align: center; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-btns { padding: 12px 16px; display: flex; gap: 10px; border-top: 1px solid var(--border); }
.modal-btns .btn { flex: 1; }

/* 发布页 */
.publish-body { padding: 16px; }
.switch-row { display: flex; background: #fff; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.switch-item { flex: 1; text-align: center; padding: 10px; border-radius: 10px; font-size: 15px; font-weight: 500; color: var(--muted); cursor: pointer; }
.switch-item.active { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.form-card { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.form-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; background: #FAFAFA; }
.form-input:focus { border-color: var(--primary); background: #fff; }
.form-textarea { min-height: 100px; resize: none; }
.img-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.img-item { aspect-ratio: 1; border-radius: 10px; background: #FAFAFA; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; cursor: pointer; border: 1px dashed var(--border); }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item .del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; background: rgba(0,0,0,.5); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.img-item.add { color: var(--muted); font-size: 24px; }

/* 消息列表 */
.msg-list { background: #fff; }
.msg-item { display: flex; padding: 14px 16px; gap: 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.msg-item:last-child { border-bottom: none; }
.msg-item .info { flex: 1; min-width: 0; }
.msg-item .row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.msg-item .name { font-size: 15px; font-weight: 600; }
.msg-item .name .unread {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  margin-left: 6px; border-radius: 9px; background: #EF4444; color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; vertical-align: middle;
}
.msg-item .time { font-size: 11px; color: var(--muted); }
.msg-item .preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 聊天页 */
.chat-body { flex: 1; overflow-y: auto; padding: 16px; background: #FAFAFA; display: flex; flex-direction: column; gap: 12px; }
.chat-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-row.self { flex-direction: row-reverse; }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg, #FDBA74, #EA580C); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-msg { max-width: 72%; padding: 10px 14px; border-radius: 12px; font-size: 15px; word-break: break-word; line-height: 1.5; }
.chat-row .chat-msg { align-self: auto; }
.chat-msg .sn { font-size: 10px; margin-bottom: 2px; opacity: .7; }
.chat-msg.other { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.chat-msg.self { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input { position: absolute; bottom: 0; left: 0; right: 0; background: #fff; padding: 10px 12px; display: flex; gap: 8px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; padding: 10px 14px; background: #F5F5F5; border-radius: 20px; border: none; font-size: 14px; outline: none; }
.chat-input button { padding: 10px 18px; border-radius: 20px; background: var(--primary); color: #fff; border: none; font-size: 14px; font-weight: 600; }

/* 我的页面 */
.profile-header { background: linear-gradient(135deg, var(--primary), var(--primary-light)); padding: 24px 16px; color: #fff; position: relative; }
.profile-header .top-row { display: flex; align-items: center; gap: 14px; }
.profile-header .avatar-lg { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; border: 2px solid rgba(255,255,255,.5); overflow: hidden; }
.profile-header .avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-header .avatar-wrap { position: relative; flex-shrink: 0; cursor: pointer; }
.profile-header .avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--primary); font-size: 11px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(0,0,0,.08); }
.profile-header .nick { font-size: 18px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.profile-header .stats { display: flex; gap: 20px; margin-top: 14px; font-size: 13px; opacity: .9; }
.profile-header .stats b { font-size: 16px; font-weight: 700; }

.menu-card { background: #fff; margin: 12px; border-radius: 14px; overflow: hidden; }
.menu-item { padding: 14px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 14px; }
.menu-item:last-child { border-bottom: none; }
.menu-item .ic { font-size: 20px; }
.menu-item .arrow { margin-left: auto; color: var(--muted); font-size: 16px; }

/* 登录页 */
.login-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px; }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo .ic { font-size: 56px; margin-bottom: 10px; }
.login-logo-img { width: 72px; height: 72px; margin-bottom: 14px; border-radius: 18px; box-shadow: 0 4px 14px rgba(234,88,12,.25); }
.login-logo .t { font-size: 22px; font-weight: 700; color: var(--primary); }
.login-wrap input { width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; margin-bottom: 14px; outline: none; background: #fff; }
.login-wrap input:focus { border-color: var(--primary); }
.agree-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.4; }
.agree-row input { width: auto; margin: 0; padding: 0; }
.agree-row a { color: var(--primary); text-decoration: underline; cursor: pointer; }
.login-wrap button { width: 100%; padding: 14px; border-radius: 10px; background: var(--primary); color: #fff; border: none; font-size: 16px; font-weight: 600; cursor: pointer; }
.login-wrap .btn-wechat { background: #07C160; margin-top: 12px; }
.login-wrap .hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; }

/* Toast */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.8); color: #fff; padding: 10px 22px; border-radius: 10px; font-size: 14px; z-index: 250; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ic { font-size: 48px; margin-bottom: 10px; opacity: .5; }

/* 券、套餐、订单卡片 */
.coupon-list { padding: 12px; }
.coupon-card { background: linear-gradient(135deg, #FFF3E8, #FFEDD5); border-radius: 14px; padding: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.coupon-card .c-days { font-size: 22px; font-weight: 700; color: var(--primary); }
.coupon-card .c-source { font-size: 12px; color: var(--muted); margin-top: 4px; }
.coupon-card .c-status { font-size: 13px; font-weight: 600; }
.coupon-card .c-status.unused { color: var(--supply); }
.coupon-card .c-status.used { color: var(--muted); }
.coupon-card .c-exp { font-size: 11px; color: var(--muted); margin-top: 4px; }

.invite-card { background: #fff; border-radius: 14px; padding: 20px; text-align: center; }
.invite-title { font-weight: 700; margin-bottom: 10px; }
.invite-link { background: #F5F5F5; padding: 10px; border-radius: 8px; font-size: 12px; color: var(--muted); word-break: break-all; margin-bottom: 10px; }
.invite-hint { font-size: 12px; color: var(--muted); }

.package-card { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
.package-card .pkg-name { font-weight: 700; font-size: 15px; }
.package-card .pkg-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }
.package-card .pkg-price { font-size: 18px; font-weight: 700; color: var(--primary); }

.order-card { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.order-head { display: flex; justify-content: space-between; font-weight: 600; }
.order-price { font-size: 20px; color: var(--primary); font-weight: 700; margin: 8px 0; }
.order-status.pending { color: var(--primary); }
.order-status.approved { color: var(--supply); }
.order-status.rejected { color: var(--demand); }
.order-proof { margin-top: 10px; }
.proof-img { width: 100%; border-radius: 10px; margin-top: 10px; cursor: pointer; }

/* 管理后台 */
.admin-layout { flex: 1; display: flex; width: 100%; height: 100%; }
.admin-sidebar { width: 180px; background: #fff; border-right: 1px solid var(--border); flex-shrink: 0; overflow-y: auto; }
.admin-logo { padding: 16px; font-weight: 700; color: var(--primary); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.admin-logo img { width: 26px; height: 26px; border-radius: 7px; }
.admin-menu { padding: 8px; }
.admin-item { padding: 10px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; margin-bottom: 4px; }
.admin-item.active { background: #FFF3E8; color: var(--primary); font-weight: 600; }
.admin-main { flex: 1; overflow-y: auto; background: var(--bg); }
.admin-topbar { padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--primary); cursor: pointer; }
#adminContent { padding: 16px; }
.admin-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.admin-card { background: #fff; border-radius: 12px; padding: 16px; text-align: center; }
.admin-card .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.admin-table-wrap { background: #fff; border-radius: 12px; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; }
.admin-table th { background: #fafafa; font-weight: 600; }
.admin-table button { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 4px 10px; font-size: 12px; margin-right: 4px; cursor: pointer; }
.admin-form { background: #fff; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.admin-form label { font-size: 13px; color: var(--muted); }
.word-tag { display: inline-flex; align-items: center; background: #FEE2E2; color: #B91C1C; padding: 2px 8px; border-radius: 12px; font-size: 12px; margin: 2px; }
.word-tag span { margin-left: 4px; cursor: pointer; }
