/* ============================================================
   商会 APP 壳页样式 v1.11.0（移动优先）
   配色：商会红 #7A1F2D 主题 + 浅灰背景
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #EDEEF2;
    color: #222;
    overflow: hidden;
}

/* ---------- 通用 ---------- */
.page { position: absolute; inset: 0; display: flex; flex-direction: column; background: #EDEEF2; }
.page-overlay { z-index: 100; box-shadow: -4px 0 20px rgba(0,0,0,.15); }

/* V1.2.9.8 去掉 PC 端"窗口化"外框：原 v0.2.3.5 规则宽屏(≥760px)时 .page 限宽 1100px
   居中并加 36px 深色阴影，在 PC 客户端原生窗口内又套一圈阴影边框（用户反馈不美观）。
   删除后 .page 默认 absolute+inset:0 铺满整个窗口，与微信桌面端、内嵌 chat.html 的
   满宽风格一致 */
.list { background: #fff; border-radius: 10px; margin: 10px; overflow: hidden; }
.empty { text-align: center; color: #8E99A4; font-size: 13px; padding: 48px 20px; }
.toast {
    position: fixed; left: 50%; bottom: 20%; transform: translateX(-50%);
    background: rgba(0,0,0,.75); color: #fff; padding: 10px 18px; border-radius: 8px;
    font-size: 14px; max-width: 80%; text-align: center; z-index: 999; display: none;
}

/* ---------- 登录页 ---------- */
.login-hero {
    background: linear-gradient(160deg, #7A1F2D 0%, #A83246 100%);
    color: #fff; text-align: center; padding: 70px 20px 50px;
    border-radius: 0 0 30px 30px;
}
.login-logo {
    width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 22px; overflow: hidden;
}
.login-hero h1 { font-size: 24px; letter-spacing: 2px; }
.login-hero p { opacity: .85; font-size: 13px; margin-top: 6px; }
.login-form { padding: 30px 24px; }
.form-item { margin-bottom: 16px; }
.form-item input {
    width: 100%; height: 48px; border: 1px solid #E3E6EB; border-radius: 10px;
    padding: 0 14px; font-size: 16px; background: #fff; outline: none;
}
.form-item input:focus { border-color: #7A1F2D; }
.login-tip { min-height: 20px; color: #D24545; font-size: 13px; margin-bottom: 8px; }
.btn-primary {
    width: 100%; height: 48px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, #7A1F2D, #A83246); color: #fff;
    font-size: 17px; letter-spacing: 6px; cursor: pointer;
}
.btn-primary:disabled { opacity: .6; }

/* ---------- 顶栏 ---------- */
.topbar {
    height: 48px; background: #7A1F2D; color: #fff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 500;
}
.tab-pages { flex: 1; position: relative; overflow: hidden; }
/* V1.2.9.7 加不透明背景（纵深防御）：多个 tab-page 绝对定位同层叠放，
   背景不透明可确保即使异常出现两个可见 tab 也不会互相透出内容 */
.tab-page { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #EDEEF2; }

/* ---------- 微信桌面风格：左侧竖排导航栏 ---------- */
.main-shell { flex: 1; display: flex; min-height: 0; }
/* V1.2.8.1 修复：main-content 必须是 flex 列容器，tab-pages 的 flex:1 才能撑满高度（否则 iframe 高度为0导致白屏） */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.side-rail {
    width: 64px; flex-shrink: 0; background: #F7F8FA;
    border-right: 1px solid #E8EAEE;
    display: flex; flex-direction: column; align-items: center;
    padding: 14px 0 10px;
}
.rail-avatar {
    width: 40px; height: 40px; border-radius: 10px; overflow: hidden;
    background: linear-gradient(135deg, #7A1F2D, #A83246); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 600; margin-bottom: 16px; flex-shrink: 0;
}
.rail-nav { display: flex; flex-direction: column; gap: 6px; width: 100%; align-items: center; }
.rail-item {
    width: 44px; height: 44px; border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0;
}
.rail-item:hover { background: #ECEEF2; }
.rail-item.active { background: #7A1F2D; }
.rail-item.active:hover { background: #7A1F2D; }
.rail-icon { font-size: 21px; line-height: 1; }
.rail-item.active .rail-icon { filter: grayscale(1) brightness(3); }
.rail-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    background: #E34D4D; color: #fff; font-size: 10px; line-height: 16px; text-align: center;
}
.rail-spacer { flex: 1; }

/* ---------- V1.2.9.4 手机端：底部导航栏（微信手机端风格） ----------
   手机上左侧竖排导航挤压聊天区宽度（旧观感怪异），改为底部横排 tab：
   图标 + 文字小标签（取自 title 属性），微信手机端样式
   V1.2.9.7 断点 759→560：与 chat.html 内嵌断点(560px)对齐。此前旧壳(v2.0.0)窗口
   缩到 560-759 区间时壳层误入手机布局而聊天区仍是桌面三列，两端观感错乱；
   对齐后只有真正手机宽度(<560)才启用底部导航，窄 PC 窗口保持桌面侧边栏 */
@media (max-width: 560px) {
    .main-shell { flex-direction: column-reverse; }
    .side-rail {
        width: 100%; height: 56px; flex-shrink: 0;
        flex-direction: row; align-items: center;
        padding: 3px 4px 2px;
        border-right: none; border-top: 1px solid #E8EAEE;
        background: #FDFDFE;
    }
    /* V1.3.1.7 手机端隐藏头像和退出按钮：底部导航空间有限，
       头像与"我的"tab功能重复（个人中心），退出登录已在"我的"页面中，
       隐藏后底部仅剩7个导航项，避免拥挤重叠 */
    .rail-avatar { display: none; }
    #railLogout { display: none; }
    .rail-nav { flex-direction: row; gap: 0; width: 100%; flex: 1; justify-content: space-around; align-items: stretch; }
    .rail-item {
        width: auto; height: auto; flex: 1; min-width: 0; max-width: 56px;
        flex-direction: column; border-radius: 8px; padding: 2px 0;
    }
    .rail-icon { font-size: 19px; }
    .rail-item::after {
        content: attr(title); display: block;
        font-size: 9px; color: #888; line-height: 1.4; margin-top: 1px;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
    }
    .rail-item.active::after { color: #7A1F2D; }
    .rail-item.active { background: transparent; }
    .rail-item.active .rail-icon { filter: none; }
    .rail-badge { top: 0; right: 14%; }
    .rail-spacer { display: none; }
    /* 手机消息 tab：chat.html 自带完整界面（列表头/聊天头），隐藏壳层"消息"标题栏避免双层导航 */
    html.shell-msg-tab .topbar { display: none; }
    /* 底部导航下的 toast 位置上移，不被遮挡 */
    .toast { bottom: 72px; }
}

/* ---------- 列表 cell ---------- */
.search-bar { padding: 10px 10px 0; }
.search-bar input {
    width: 100%; height: 36px; border: none; border-radius: 18px; background: #E3E5EA;
    padding: 0 14px; font-size: 14px; outline: none;
}
.cell { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid #F0F1F4; cursor: pointer; }
.cell:last-child { border-bottom: none; }
.cell:active { background: #F5F6F8; }
.cell-icon {
    width: 38px; height: 38px; border-radius: 9px; background: #F0F1F4;
    display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0;
}
.cell-icon.icon-blue { background: #E8F0FE; }
.cell-text { flex: 1; margin-left: 12px; font-size: 15px; }
.cell-arrow { color: #C4C9D0; font-size: 18px; }
.cell-sub { font-size: 12px; color: #8E99A4; margin-top: 2px; }

/* ---------- 会话/通讯录条目 ---------- */
.session-item { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid #F0F1F4; cursor: pointer; }
.session-item:active { background: #F5F6F8; }
.avatar {
    width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #7A1F2D, #A83246); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; font-weight: 600;
}
.avatar.avatar-blue { background: linear-gradient(135deg, #3567B0, #4E86D2); }
.avatar.avatar-green { background: linear-gradient(135deg, #2E8B57, #43B57C); }
.avatar.avatar-lg { width: 60px; height: 60px; font-size: 26px; border-radius: 13px; }
.avatar.avatar-sm { width: 34px; height: 34px; font-size: 14px; border-radius: 8px; }
.session-info { flex: 1; margin-left: 12px; min-width: 0; }
.session-top { display: flex; align-items: baseline; }
.session-name { font-size: 16px; color: #1A1A1A; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-time { font-size: 11px; color: #A6ADB8; margin-left: 8px; flex-shrink: 0; }
.session-preview { font-size: 13px; color: #8E99A4; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-unread {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: #E34D4D; color: #fff; font-size: 11px; line-height: 18px;
    text-align: center; margin-left: 8px; flex-shrink: 0;
}
.list-section-label {
    padding: 10px 14px 4px; font-size: 12px; color: #8E99A4;
    background: transparent; list-style: none;
}

/* ---------- 聊天页 ---------- */
.chat-topbar {
    height: 48px; background: #7A1F2D; color: #fff; flex-shrink: 0;
    display: flex; align-items: center; padding: 0 6px; position: relative; z-index: 5;
}
.chat-topbar-title { flex: 1; text-align: center; font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.icon-btn {
    width: 40px; height: 40px; border: none; background: none; color: #fff;
    font-size: 24px; cursor: pointer; flex-shrink: 0; border-radius: 50%;
}
.icon-btn:active { background: rgba(255,255,255,.15); }
.chat-menu {
    position: absolute; top: 46px; right: 8px; background: #fff; border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,.18); min-width: 130px; overflow: hidden; z-index: 20;
}
.chat-menu div { padding: 13px 18px; font-size: 14px; color: #333; border-bottom: 1px solid #F0F1F4; cursor: pointer; }
.chat-menu div:last-child { border-bottom: none; }
.chat-menu div:active { background: #F5F6F8; }
.notice-bar {
    flex-shrink: 0; background: #FDF6E7; color: #8A6A2F; font-size: 12px;
    padding: 8px 12px; border-bottom: 1px solid #F5E8C8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-messages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 10px; }
.msg-row { display: flex; margin-bottom: 14px; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-avatar {
    width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, #3567B0, #4E86D2);
}
.msg-row.mine .msg-avatar { background: linear-gradient(135deg, #7A1F2D, #A83246); }
.msg-body { max-width: 74%; margin: 0 8px; }
.msg-sender { font-size: 11px; color: #8E99A4; margin-bottom: 3px; }
.msg-row.mine .msg-sender { text-align: right; }
.msg-bubble {
    padding: 9px 12px; border-radius: 4px 14px 14px 14px; background: #fff;
    font-size: 15px; line-height: 1.45; word-break: break-word; white-space: pre-wrap;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.msg-row.mine .msg-bubble { background: #A83246; color: #fff; border-radius: 14px 4px 14px 14px; }
.msg-bubble.sysmsg {
    background: transparent; box-shadow: none; color: #A6ADB8; font-size: 12px;
    text-align: center; padding: 2px 0; border-radius: 0;
}
.msg-bubble.noticemsg {
    background: #FDF6E7; color: #8A6A2F; border: 1px solid #F5E8C8;
    border-radius: 10px; font-size: 13px;
}
.msg-time { font-size: 10px; color: #B6BCC6; margin-top: 3px; }
.msg-row.mine .msg-time { text-align: right; }
.chat-inputbar {
    flex-shrink: 0; background: #F5F6F8; border-top: 1px solid #E8EAEE;
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.chat-inputbar input {
    flex: 1; height: 40px; border: none; border-radius: 20px; background: #fff;
    padding: 0 14px; font-size: 15px; outline: none;
}
.send-btn {
    height: 40px; padding: 0 18px; border: none; border-radius: 20px;
    background: linear-gradient(135deg, #7A1F2D, #A83246); color: #fff;
    font-size: 15px; cursor: pointer; flex-shrink: 0;
}
.send-btn:disabled { opacity: .5; }

/* ---------- 选人页 ---------- */
.pick-ok {
    height: 32px; padding: 0 14px; border: none; border-radius: 16px;
    background: rgba(255,255,255,.25); color: #fff; font-size: 13px; cursor: pointer; flex-shrink: 0;
}
.pick-ok:disabled { opacity: .4; }
.pick-item { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid #F0F1F4; cursor: pointer; }
.pick-item:active { background: #F5F6F8; }
.pick-check {
    width: 22px; height: 22px; border: 1.5px solid #C4C9D0; border-radius: 50%;
    margin-right: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px;
}
.pick-item.checked .pick-check { background: #7A1F2D; border-color: #7A1F2D; }
.pick-check::after { content: ''; }
.pick-item.checked .pick-check::after { content: '✓'; }

/* ---------- 群资料页 ---------- */
.gi-grid { display: flex; flex-wrap: wrap; padding: 14px 8px 6px; }
.gi-member {
    width: 20%; display: flex; flex-direction: column; align-items: center;
    margin-bottom: 10px; cursor: pointer;
}
.gi-name { font-size: 11px; color: #7A8290; margin-top: 4px; max-width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gi-row { padding: 13px 14px; border-bottom: 1px solid #F0F1F4; font-size: 14px; }
.gi-row .gi-label { color: #8E99A4; font-size: 12px; margin-bottom: 4px; }
.gi-danger { color: #D24545; text-align: center; cursor: pointer; }

/* ---------- 商机卡片 ---------- */
.biz-card { padding: 14px; border-bottom: 1px solid #F0F1F4; cursor: pointer; }
.biz-card:active { background: #F8F9FB; }
.biz-title { font-size: 15px; font-weight: 600; color: #1A1A1A; margin-bottom: 6px; }
.biz-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.biz-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #F3E9EA; color: #7A1F2D; }
.biz-tag.tag-gray { background: #F0F1F4; color: #7A8290; }
/* V1.2.8.8 商城/租售/活动标签色 */
.biz-tag.tag-gold { background: #FDF3E1; color: #A66A00; }
.biz-tag.tag-green { background: #E8F6EC; color: #2E8B4F; }
.biz-content { font-size: 13px; color: #666; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.biz-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: #A6ADB8; }

/* ---------- 我的页 ---------- */
.me-head {
    background: linear-gradient(160deg, #7A1F2D 0%, #A83246 100%);
    padding: 30px 20px 24px; display: flex; align-items: center; color: #fff;
}
.me-info { margin-left: 14px; }
#meName { font-size: 19px; font-weight: 600; }
#meRole { font-size: 13px; opacity: .85; margin-top: 4px; }
.me-points { background: #fff; border-radius: 10px; margin: -14px 10px 10px; padding: 14px; display: flex; }
.me-points-item { flex: 1; text-align: center; }
.me-points-num { font-size: 20px; font-weight: 700; color: #7A1F2D; }
.me-points-label { font-size: 11px; color: #8E99A4; margin-top: 2px; }

/* ---------- V1.3.7.1 积分明细页 ---------- */
.pts-sum { display: flex; gap: 10px; }
.pts-card { flex: 1; background: #fff; border-radius: 10px; padding: 12px 6px; text-align: center; }
.pts-card.pts-cur { background: #FFFBF0; border: 1px solid #F5E3C0; }
.pts-num { font-size: 20px; font-weight: 700; color: #C9A84C; }
.pts-label { font-size: 11px; color: #8E99A4; margin-top: 2px; }
.pts-expire { margin-top: 10px; font-size: 12px; color: #E67E22; background: #FFF7E8; border: 1px solid #FFE3B3; border-radius: 8px; padding: 8px 12px; }
.pts-list-title { margin: 14px 2px 8px; font-size: 13px; font-weight: 600; color: #333; }
.pts-row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 10px; padding: 11px 14px; margin-bottom: 8px; }
.pts-row-main { flex: 1; min-width: 0; }
.pts-row-desc { font-size: 13px; color: #333; line-height: 1.4; word-break: break-all; }
.pts-row-time { font-size: 11px; color: #A6ADB8; margin-top: 3px; }
.pts-row-amt { font-size: 16px; font-weight: 700; flex-shrink: 0; }
.pts-row-amt.in { color: #43A047; }
.pts-row-amt.out { color: #E53935; }

/* ---------- V1.3.7.1 引用回复（聊天页） ---------- */
.msg-quote { background: rgba(0,0,0,.06); border-left: 3px solid #B2B2B2; border-radius: 4px; padding: 5px 8px; margin: 0 0 5px; font-size: 12px; color: #666; line-height: 1.5; word-break: break-all; }
.msg-row.mine .msg-quote { border-left-color: #9EDA74; }
.msg-quote .q-sender { color: #576B95; }
.app-quote-bar { display: flex; align-items: flex-start; gap: 6px; margin: 0 10px; padding: 6px 10px; background: #F5F5F5; border-left: 3px solid #B2B2B2; font-size: 12px; color: #666; line-height: 1.5; border-radius: 4px; }
.app-quote-bar .q-text { flex: 1; min-width: 0; overflow: hidden; }
.app-quote-bar .q-cancel { border: none; background: none; font-size: 16px; color: #999; cursor: pointer; padding: 0 4px; line-height: 1; flex-shrink: 0; }
.app-msg-menu { position: fixed; z-index: 9999; background: #4C4C4C; border-radius: 6px; padding: 4px 0; box-shadow: 0 4px 16px rgba(0,0,0,.3); min-width: 110px; }
.app-msg-menu .mi { padding: 9px 18px; font-size: 13px; color: #FFF; cursor: pointer; white-space: nowrap; }
.app-msg-menu .mi:active { background: rgba(255,255,255,.12); }

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
    display: flex; align-items: center; justify-content: center;
}
.modal { width: 84%; max-width: 360px; background: #fff; border-radius: 14px; overflow: hidden; }
.modal-title { padding: 20px 20px 6px; text-align: center; font-size: 16px; font-weight: 600; }
.modal-body { padding: 10px 20px 16px; max-height: 56vh; overflow-y: auto; }
.modal-input {
    width: 100%; height: 42px; border: 1px solid #E3E6EB; border-radius: 9px;
    padding: 0 12px; font-size: 15px; outline: none; margin-bottom: 12px;
}
.modal-tip { font-size: 12px; color: #8E99A4; }
.modal-btns { display: flex; border-top: 1px solid #F0F1F4; }
.modal-btns button { flex: 1; height: 46px; border: none; background: none; font-size: 16px; cursor: pointer; }
.modal-btns button:active { background: #F5F6F8; }
.modal-btns .btn-main { color: #7A1F2D; font-weight: 600; }
.modal-btns button + button { border-left: 1px solid #F0F1F4; }

/* ---------- v2.1.3 PC端三栏聊天布局（V1.2.9.7 清理修复） ----------
   V1.2.9.7 修复 PC 端 tab 信息重叠：删除 #tab-message { display:flex !important }
   遗留规则——CSS !important 压过 switchTab 设置的内联 display:none，导致宽屏(≥760px)
   下从消息 tab 切到商机/出租出售/活动等时聊天 iframe 不消失、与其他 tab 内容叠影。
   chat-inline-* 规则对应元素在 V1.2.7.9（消息 tab 改内嵌 chat.html iframe）时已从
   index.html 移除，属死规则，一并清理。
   保留 #page-chat 宽屏隐藏：聊天已内嵌消息 tab，覆盖层不应在 PC 弹出 */
@media (min-width: 760px) {
    #page-main .main-shell .main-content {
        position: relative;
    }
    /* PC端隐藏page-chat覆盖层（聊天内容内嵌到消息tab） */
    #page-chat { display: none !important; }
}
/* 手机端保持覆盖式不变 */

/* ---------- V1.3.1.7 手机端下拉刷新 ---------- */
.pull-refresh-indicator {
    position: absolute; top: -50px; left: 0; right: 0; height: 50px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: #8E99A4; transition: top .2s ease; z-index: 10;
    pointer-events: none;
}
.pull-refresh-indicator.show { top: 0; }
.pull-refresh-icon { margin-right: 6px; transition: transform .3s; }
.pull-refresh-icon.spinning { animation: pull-spin .8s linear infinite; }
@keyframes pull-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* V1.3.8.1 ÍøÉÏÉ̳ǷÖÀàɸѡ tab£¨Óë΢Ðŷç¸ñһÖ£© */
.mall-tab { display:inline-block; padding:5px 12px; border-radius:14px; background:#F0F1F3; color:#555; font-size:12px; cursor:pointer; white-space:nowrap; }
.mall-tab.active { background:#1A73E8; color:#FFF; font-weight:600; }
