/* 东少说房·移动经纪人 —— 管理后台样式 */
:root {
  --pri: #ff4a2e;
  --grad: linear-gradient(160deg, #ff7a3c 0%, #ff4a2e 55%, #ff3546 100%);
  --bg: #f5f6f8; --line: #ececec; --sub: #888;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: #222; font-size: 15px; }
button { font-family: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; border: 0; outline: none; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }

/* 登录 */
.login { min-height: 100vh; background: var(--grad); display: flex; flex-direction: column; align-items: center; padding-top: 16vh; }
.login img { width: 84px; height: 84px; border-radius: 22px; border: 3px solid rgba(255,255,255,.85); }
.login h1 { color: #fff; font-size: 23px; margin: 16px 0 4px; letter-spacing: 1px; }
.login p { color: rgba(255,255,255,.85); font-size: 12.5px; margin-bottom: 30px; }
.login .l-box { background: #fff; border-radius: 16px; padding: 22px 20px; width: min(88%, 360px); box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.login .l-box input { width: 100%; height: 46px; background: #f4f5f7; border-radius: 12px; padding: 0 14px; font-size: 16px; margin-bottom: 14px; }
.btn-pri { width: 100%; height: 46px; border-radius: 12px; background: var(--grad); color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.login .l-tip { color: #bbb; font-size: 11px; text-align: center; margin-top: 14px; }

/* 主框架 */
.main { display: none; padding-bottom: calc(64px + var(--safe-b)); }
.main.on { display: block; }
.topbar { background: var(--grad); color: #fff; padding: calc(env(safe-area-inset-top,0px) + 14px) 16px 14px; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 10; }
.topbar .t-sub { font-size: 11px; font-weight: 400; opacity: .85; background: rgba(255,255,255,.2); padding: 3px 9px; border-radius: 999px; }

/* 房源列表 */
.p-add { margin: 14px 12px 4px; height: 46px; border-radius: 12px; background: var(--grad); color: #fff; font-size: 15.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.p-list { padding: 10px 12px 20px; display: flex; flex-direction: column; gap: 10px; }
.p-item { display: flex; gap: 11px; background: #fff; border-radius: 13px; padding: 10px; }
.p-item img { width: 86px; height: 64px; border-radius: 8px; object-fit: cover; flex: none; background: #eee; }
.p-item .pi-info { flex: 1; min-width: 0; }
.p-item .pi-t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-item .pi-s { font-size: 11.5px; color: var(--sub); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-item .pi-p { color: var(--pri); font-size: 15px; font-weight: 800; margin-top: 3px; }
.p-item .pi-acts { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.p-item .pi-btns { display: flex; gap: 6px; }
.p-item .pi-btns button { font-size: 11.5px; padding: 5px 10px; border-radius: 8px; }
.b-edit { background: #eef3ff; color: #4c84ff; } .b-del { background: #fff0ee; color: #ff4a2e; }
.p-type { font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 400; }
.p-type.sale { color: #ff4a2e; background: #fff0ee; } .p-type.rent { color: #4c84ff; background: #eef3ff; }
.empty2 { text-align: center; color: #aaa; font-size: 13px; padding: 50px 0; }

/* 表单弹层 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: none; }
.mask.on { display: block; }
.sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px; background: #fff; border-radius: 18px 18px 0 0; z-index: 60; display: none; max-height: 92vh; overflow-y: auto; }
.sheet.on { display: block; }
.sheet-hd { position: sticky; top: 0; background: #fff; display: flex; align-items: center; padding: 14px 16px 10px; font-size: 16px; font-weight: 700; z-index: 2; border-bottom: 1px solid #f2f2f2; }
.sheet-hd .x { margin-left: auto; color: #999; font-size: 20px; padding: 2px 8px; }
.form { padding: 12px 16px calc(var(--safe-b) + 20px); display: flex; flex-direction: column; gap: 12px; }
.f-item label { font-size: 12.5px; color: #666; display: block; margin-bottom: 5px; }
.f-item label b { color: var(--pri); }
.f-item input[type=text], .f-item input[type=number], .f-item input[type=url], .f-item input[type=password], .f-item textarea, .f-item select { width: 100%; background: #f4f5f7; border-radius: 10px; padding: 10px 12px; font-size: 14.5px; }
.f-item textarea { min-height: 74px; resize: vertical; line-height: 1.6; }
.f-row { display: flex; gap: 8px; }
.f-row .f-item { flex: 1; }
.seg2 { display: flex; background: #f4f5f7; border-radius: 11px; padding: 4px; }
.seg2 button { flex: 1; height: 36px; border-radius: 8px; font-size: 14px; color: #666; font-weight: 600; }
.seg2 button.on { background: #fff; color: var(--pri); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.tag-sel { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-sel button { font-size: 12px; padding: 6px 12px; border-radius: 999px; background: #f4f5f7; color: #666; }
.tag-sel button.on { background: #fff0ee; color: var(--pri); font-weight: 600; }
.up-box { border: 1.5px dashed #ddd; border-radius: 12px; padding: 12px; text-align: center; color: #999; font-size: 13px; }
.up-box:active { background: #fafafa; }
.up-box .u-main { color: #444; font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.up-prog { height: 6px; background: #f0f0f0; border-radius: 4px; overflow: hidden; margin-top: 9px; display: none; }
.up-prog.on { display: block; }
.up-prog i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 4px; transition: width .2s; }
.up-tip { font-size: 11px; color: #b5b5b5; margin-top: 7px; line-height: 1.6; }
.prev-video { width: 100%; max-height: 200px; border-radius: 10px; margin-top: 9px; background: #000; display: none; }
.prev-video.on { display: block; }
.prev-cover { width: 200px; border-radius: 10px; margin-top: 9px; display: none; }
.prev-cover.on { display: block; }
.f-save { height: 47px; border-radius: 12px; background: var(--grad); color: #fff; font-size: 16px; font-weight: 700; margin-top: 4px; }

/* 聊天管理 */
.chat-list2 { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.conv { display: flex; gap: 11px; background: #fff; border-radius: 13px; padding: 12px; align-items: center; }
.conv img { width: 44px; height: 44px; border-radius: 50%; }
.conv .cv-info { flex: 1; min-width: 0; }
.conv .cv-t { display: flex; justify-content: space-between; font-size: 14.5px; font-weight: 600; }
.conv .cv-t .tm { font-size: 11px; color: #bbb; font-weight: 400; }
.conv .cv-m { font-size: 12.5px; color: #999; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .cv-badge { min-width: 18px; height: 18px; background: #ff3b30; color: #fff; border-radius: 999px; font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0 5px; font-weight: 700; }

/* 会话视图 */
.conv-view { position: fixed; inset: 0; background: #f0f1f4; z-index: 70; display: none; flex-direction: column; max-width: 560px; margin: 0 auto; }
.conv-view.on { display: flex; }
.cv-hd { background: var(--grad); color: #fff; padding: calc(env(safe-area-inset-top,0px) + 11px) 12px 11px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.cv-hd .bk { font-size: 24px; padding: 0 8px; font-weight: 400; }
.cv-list { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.msg2 { display: flex; gap: 9px; max-width: 84%; }
.msg2 .m-ava { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.msg2 .m-body { display: flex; flex-direction: column; gap: 3px; }
.msg2 .m-name { font-size: 10.5px; color: #a5a5a5; }
.msg2 .bubble { padding: 9px 12px; border-radius: 4px 12px 12px 12px; background: #fff; font-size: 14.5px; line-height: 1.55; word-break: break-all; white-space: pre-wrap; }
.msg2.me { align-self: flex-end; flex-direction: row-reverse; }
.msg2.me .bubble { background: var(--grad); color: #fff; border-radius: 12px 4px 12px 12px; }
.msg2.me .m-name { text-align: right; }
.m-time2 { align-self: center; font-size: 10.5px; color: #b3b3b3; }
.cv-input { display: flex; gap: 9px; background: #fff; padding: 8px 10px calc(var(--safe-b) + 8px); }
.cv-input input { flex: 1; height: 40px; background: #f4f5f7; border-radius: 999px; padding: 0 15px; font-size: 14.5px; }
.cv-send { width: 66px; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 700; font-size: 14px; }

/* 设置 */
.set-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.card2 { background: #fff; border-radius: 14px; padding: 15px; }
.card2 h3 { font-size: 14.5px; margin-bottom: 11px; display: flex; align-items: center; gap: 6px; }
.card2 h3::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--pri); }
.card2 .f-item { margin-bottom: 11px; }
.card2 .f-item:last-child { margin-bottom: 0; }

/* 底部 tab */
.adm-tab { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px; background: #fff; border-top: 1px solid #eee; display: none; z-index: 40; padding-bottom: var(--safe-b); }
.adm-tab.on { display: flex; }
.adm-tab button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 10.5px; color: #999; position: relative; }
.adm-tab button.on { color: var(--pri); font-weight: 700; }
.adm-tab .bdg { position: absolute; top: 3px; right: calc(50% - 20px); min-width: 16px; height: 16px; background: #ff3b30; color: #fff; border-radius: 999px; font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: 700; }
#toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: rgba(17,17,17,.85); color: #fff; font-size: 13px; padding: 9px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; }
#toast.show { opacity: 1; }
.spin2 { width: 26px; height: 26px; border: 3px solid #eee; border-top-color: var(--pri); border-radius: 50%; margin: 40px auto; animation: sp2 .8s linear infinite; }
@keyframes sp2 { to { transform: rotate(360deg); } }
