/* ============ 基础 ============ */
* { 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", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f2f5f9;
  color: #1e293b;
  font-size: 14px;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; outline: none; }

.view { display: none; padding-bottom: var(--beian-h); }
.view.active { display: block; }
/* 登录页全屏渐变，不留底部安全区空白 */
#view-login { padding-bottom: 0; }

:root {
  --primary: #4f6ef7;
  --primary-dark: #3b5bdb;
  --primary-soft: rgba(79, 110, 247, .12);
  --ww-green: #07c160;
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --bg: #f2f5f9;
  --card: #ffffff;
  --line: #eef2f7;
  --border: #e2e8f0;
  --status-our: #fcc419;    /* 黄 */
  --status-other: #ff6b6b;  /* 红 */
  --status-done: #40c057;   /* 绿 */
  --danger: #e03131;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .06);
  /* 底部留白高度：iOS 全面屏安全区（备案条已移除，备案号改由主页展示） */
  --beian-h: env(safe-area-inset-bottom, 0px);
}

/* ============ 登录页 ============ */
#view-login {
  background: linear-gradient(160deg, #3b5bdb 0%, #5f3dc4 55%, #9c36b5 100%);
}
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 22px 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 24px;
  padding: 32px 24px 26px;
  color: var(--text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #7048e8);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  box-shadow: 0 8px 20px rgba(79, 110, 247, .4);
}
.login-title { font-size: 21px; font-weight: 800; letter-spacing: 1px; }
.login-sub { font-size: 13px; color: var(--text-2); margin: 8px 0 24px; }
.ww-btn {
  width: 100%; height: 48px;
  border-radius: 12px;
  background: var(--ww-green);
  color: #fff;
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 20px rgba(7, 193, 96, .32);
  transition: transform .12s, opacity .2s;
}
.ww-btn:active { transform: scale(.97); opacity: .9; }
.divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-3); font-size: 12px;
  margin: 20px 0 14px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.dev-tip { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.dev-users { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dev-user {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 13px; color: var(--text);
  transition: all .15s;
}
.dev-user:active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.admin-login-link {
  margin-top: 18px;
  font-size: 13px; color: var(--text-3);
  text-decoration: underline;
  cursor: pointer;
}
.admin-login { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.admin-login input {
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
}
.admin-login input:focus { border-color: var(--primary); }
.login-foot { color: rgba(255, 255, 255, .8); font-size: 12px; margin-top: 22px; letter-spacing: 1px; }

/* ============ 小区列表页 ============ */
#view-communities { background: var(--bg); min-height: 100dvh; padding-bottom: 30px; }
.ctn-header {
  background: linear-gradient(135deg, var(--primary) 0%, #7048e8 100%);
  padding: calc(16px + env(safe-area-inset-top)) 18px 18px;
  color: #fff;
}
.ctn-top { display: flex; align-items: center; justify-content: space-between; }
.ctn-title { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.ctn-user { font-size: 12px; opacity: .85; margin-top: 4px; }
.logout-btn {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 12px;
  backdrop-filter: blur(4px);
}
.logout-btn:active { background: rgba(255, 255, 255, .3); }

.search-block {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  padding: 12px 14px 10px;
}
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border-radius: 999px;
  padding: 0 14px;
  height: 42px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.search-bar input {
  flex: 1; border: none; background: transparent;
  font-size: 14px; color: var(--text);
}
.search-bar input::placeholder { color: var(--text-3); }
.letter-bar {
  display: flex; gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.letter-bar::-webkit-scrollbar { display: none; }
.letter-chip {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: #fff;
  color: var(--text-2);
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--line);
  transition: all .15s;
}
.letter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.community-list { padding: 2px 14px 0; }
.community-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .1s;
  animation: fadeUp .25s ease both;
}
.community-card:active { transform: scale(.985); }
.comm-avatar {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 700;
}
.comm-info { flex: 1; min-width: 0; }
.comm-name { font-size: 16px; font-weight: 700; }
.comm-meta { font-size: 12px; color: var(--text-3); margin: 3px 0 8px; }
.comm-meta .comm-py { color: var(--primary); font-weight: 600; }
.comm-stats { display: flex; gap: 12px; }
.stat { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); font-weight: 600; }
.comm-arrow { color: var(--text-3); font-size: 22px; font-weight: 300; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-none { background: #fff; border: 1.5px solid #cbd5e1; }
.dot-our { background: var(--status-our); }
.dot-other { background: var(--status-other); }
.dot-done { background: var(--status-done); }

.empty {
  text-align: center; color: var(--text-3);
  padding: 48px 20px; font-size: 14px; line-height: 1.9;
}
.empty.small { padding: 24px; }

/* 只读标记：无该楼栋编辑权限时提示（可见与可编辑分离） */
.ro-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #f1f3f5;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 楼栋详情页 ============ */
#view-building { height: 100vh; height: 100dvh; display: none; flex-direction: column; background: var(--bg); }
#view-building.active { display: flex; }

.page-header {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
  box-shadow: 0 1px 0 var(--line);
}
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:active { background: var(--bg); }
.header-title { flex: 1; min-width: 0; }
.ht-main { font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 楼栋副标题：位置信息 + 本栋装修情况（我方 / 其他公司 / 未装…），窄屏自动换行 */
#building-name {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px;
  white-space: normal; overflow: visible;
}
#building-name .b-loc { white-space: nowrap; }
#building-name .b-stats { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
#building-name .b-stat { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-variant-numeric: tabular-nums; }
#building-name .b-stat b { margin-left: 1px; font-weight: 800; }
#building-name .b-stat .dot { width: 7px; height: 7px; }
#building-name .b-stat.s-our { color: #8a5b0a; }
#building-name .b-stat.s-other { color: #b02a2a; }
#building-name .b-stat.s-done { color: #1f7a34; }
#building-name .b-stat.s-none { color: #475569; }
#building-name .b-stat.s-pending { color: var(--pending-soft-tx); }
.header-space { width: 38px; flex: none; }
.header-action {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px; font-weight: 600;
}
.header-action:active { opacity: .85; }

.stats-bar { display: flex; gap: 8px; padding: 10px 12px 0; }

.building-layout { flex: 1; display: flex; min-height: 0; margin-top: 10px; }
.building-side {
  flex: none; width: 50px;
  background: var(--card);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: none;
}
.building-side::-webkit-scrollbar { display: none; }
.building-item {
  width: 100%; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-2);
  position: relative;
  transition: color .15s;
}
.building-item:active { color: var(--primary); }
.building-item.active { color: var(--primary); font-weight: 800; background: var(--primary-soft); }
.building-item.active::before {
  content: ''; position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}

.grid-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.grid { min-width: max-content; padding: 2px 8px 46px; }
.grid-header-row, .grid-row { display: flex; gap: 6px; }
.grid-header-row { margin-bottom: 6px; }
.grid-corner {
  position: sticky; left: 0; top: 0; z-index: 10;
  flex: none; width: 34px;
  height: 30px;
  background: var(--bg);
}
.grid-header-cell {
  position: sticky; top: 0; z-index: 5;
  flex: none; width: 80px; height: 30px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: var(--text);
}
.grid-row { margin-bottom: 5px; }
.grid-floor {
  position: sticky; left: 0; z-index: 5;
  flex: none; width: 34px;
  padding: 0;
  background: var(--bg);
  border: none;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text-2); font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s, background .15s;
}
.grid-floor:active { color: var(--primary); background: var(--primary-soft); }
/* 只读（无该楼栋编辑权限）：楼层号与房间格子不可点 */
.grid.readonly .grid-floor { cursor: default; color: var(--text-3); opacity: .6; }
.grid.readonly .grid-floor:active { color: var(--text-3); background: transparent; }
.grid.readonly .grid-cell { cursor: default; }
.grid.readonly .grid-cell:active { transform: none; }
.grid-cell {
  flex: none; width: 78px; height: 52px;
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  cursor: pointer;
  user-select: none;
  transition: transform .1s;
}
.grid-cell:active { transform: scale(.92); }
.cell-code { font-size: 13px; font-weight: 800; line-height: 1.2; }
.cell-note {
  font-size: 10px;
  max-width: 88%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: .85;
}

/* 状态配色 */
.grid-cell.status-none { background: #ffffff; border: 1.5px solid var(--border); color: #334155; }
.grid-cell.status-our   { background: #fff4c2; border: 1.5px solid var(--status-our);   color: #8a5b0a; }
.grid-cell.status-other { background: #ffe2e2; border: 1.5px solid var(--status-other); color: #b02a2a; }
.grid-cell.status-done  { background: #d8f5dd; border: 1.5px solid var(--status-done);  color: #1f7a34; }

/* ============ 底部导航 ============ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: var(--beian-h); z-index: 40;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, .06);
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 56px;
  color: var(--text-3);
  font-size: 11px;
  transition: color .15s;
}
.tab-item.active { color: var(--primary); font-weight: 700; }
.tabbar-space { height: 64px; }

/* ============ 修改记录页 ============ */
#view-records { background: var(--bg); min-height: 100dvh; }
.date-nav {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 14px 4px;
}
.date-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.date-btn:active { background: var(--bg); }
.date-label {
  min-width: 170px;
  padding: 9px 14px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--text);
  text-align: center;
}
.records-summary { padding: 10px 14px 0; }
.summary-total {
  background: linear-gradient(135deg, var(--primary), #7048e8);
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
}
.summary-total b { font-size: 20px; margin: 0 2px; }
.summary-users {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 10px;
}
.summary-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px; color: var(--text-2);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.summary-chip:active { background: var(--bg); opacity: .7; }
.summary-chip b { font-size: 15px; color: var(--primary); font-weight: 800; }
.summary-clear {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 10px; padding: 6px 14px;
  border: 1px solid var(--primary); border-radius: 999px;
  background: #fff; color: var(--primary);
  font-size: 12px; cursor: pointer;
}
.summary-clear:active { opacity: .7; }

.records-list { padding: 12px 14px 0; }
.log-item {
  display: flex; align-items: stretch; gap: 10px;
  background: var(--card);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .1s;
}
.log-item:active { transform: scale(.985); }
.log-bar { flex: none; width: 4px; border-radius: 4px; }
.log-bar.bar-none { background: #cbd5e1; }
.log-bar.bar-our { background: var(--status-our); }
.log-bar.bar-other { background: var(--status-other); }
.log-bar.bar-done { background: var(--status-done); }
.log-body { flex: 1; min-width: 0; }
.log-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 14px; font-weight: 700;
}
.log-time { font-size: 11px; color: var(--text-3); font-weight: 400; flex: none; }
/* 记录条目里的位置简称：1-1-1502，等宽数字更易对齐阅读 */
.log-place { color: var(--primary); font-variant-numeric: tabular-nums; }
.log-change2 { margin-top: 4px; font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.log-note {
  margin-top: 5px;
  font-size: 12px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 状态徽标 */
.st {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  border-radius: 6px; padding: 2px 7px;
}
.st-none { background: #f1f5f9; color: #64748b; }
.st-our { background: #fff4c2; color: #8a5b0a; }
.st-other { background: #ffe2e2; color: #b02a2a; }
.st-done { background: #d8f5dd; color: #1f7a34; }

/* ============ 我的页 ============ */
.me-page { background: var(--bg); min-height: 100dvh; }
.me-profile {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, var(--primary), #7048e8);
  padding: calc(20px + env(safe-area-inset-top)) 18px 24px;
  color: #fff;
}
.me-avatar {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  border: 2px solid rgba(255, 255, 255, .4);
}
.me-name-row { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; }
.me-id { font-size: 12px; opacity: .8; margin-top: 4px; }
.role-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  flex: none;
}
.role-badge.user { background: #e8eaf6; color: #5c6bc0; }
.role-badge.manager { background: #fff3bf; color: #9a6700; }
.role-badge.admin { background: #ffe3e3; color: #c92a2a; }
.me-profile .role-badge { background: rgba(255, 255, 255, .22); color: #fff; }

.me-today {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  margin: -12px 14px 0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  position: relative;
}
.me-today-num { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1; }
.me-today-label { font-size: 13px; color: var(--text-2); }
.me-today-arrow { margin-left: auto; color: var(--text-3); font-size: 22px; }

.me-menu {
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.me-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform .1s;
}
.me-item:active { transform: scale(.985); }
.me-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex: none;
}
.me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.me-text b { font-size: 15px; color: var(--text); }
.me-text i { font-style: normal; font-size: 12px; color: var(--text-3); }
.me-arrow { color: var(--text-3); font-size: 20px; }

/* ============ 管理页 ============ */
#view-admin-communities, #view-admin-users { background: var(--bg); min-height: 100dvh; }
.admin-list { padding: 12px 14px; }
.admin-community-item, .admin-user-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.admin-user-item .user-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #7048e8);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; flex: none;
}
.mini-btn {
  flex: none;
  padding: 7px 13px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px; font-weight: 700;
  transition: opacity .15s;
}
.mini-btn:active { opacity: .75; }
.mini-btn.danger { background: #ffe3e3; color: var(--danger); }
.mini-btn-ghost { background: #f1f3f5; color: var(--text-2); }
.admin-user-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }

/* ============ 编辑权限页（原楼层分配页） ============ */
#view-admin-assign { background: var(--bg); min-height: 100dvh; }
.assign-page { padding: 12px 14px; }
.assign-tip {
  font-size: 12px; line-height: 1.5;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 10px;
}
.assign-users { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.assign-user-chip {
  flex: none;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
}
.assign-user-chip .au-name { font-size: 13px; font-weight: 700; color: var(--text); }
.assign-user-chip .au-sub { font-size: 11px; color: var(--text-3); }
.assign-user-chip.active { border-color: var(--primary); background: var(--primary-soft); }
.assign-user-chip.active .au-name,
.assign-user-chip.active .au-sub { color: var(--primary); }

.assign-note {
  background: var(--card); border-radius: 12px; padding: 14px;
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  box-shadow: var(--shadow);
}
.assign-comm {
  background: var(--card); border-radius: 14px; padding: 12px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.assign-comm-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 2px 0;
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.assign-comm-arrow {
  flex: none; margin-right: 6px;
  font-size: 15px; line-height: 1; color: var(--text-3);
  transition: transform .18s;
}
.assign-comm.open .assign-comm-arrow { transform: rotate(90deg); }
.assign-comm-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 800; color: var(--text); }
.assign-comm-count { flex: none; font-size: 12px; font-weight: 700; color: var(--text-3); }
.assign-comm.all-on { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--primary); }
.assign-comm.all-on .assign-comm-name { color: var(--primary); }
.assign-comm-body { display: none; }
.assign-comm.open .assign-comm-body { display: block; }
.assign-bd {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  text-align: left;
  transition: all .15s;
}
.assign-bd.on {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.assign-bd-check {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.assign-bd.on .assign-bd-check { border-color: var(--primary); background: var(--primary); color: #fff; }
.assign-bd-name { flex: none; font-size: 13px; font-weight: 800; color: var(--text); }
.assign-bd-units { flex: 1; min-width: 0; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-bd-empty { margin-top: 6px; font-size: 12px; color: var(--text-3); }

/* ============ 小区编辑页 ============ */
#view-admin-community-edit, #view-admin-companies { background: var(--bg); min-height: 100dvh; }
.admin-edit { padding: 14px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.form-row input {
  width: 100%; height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  background: #fff;
}
.form-row input:focus { border-color: var(--primary); }
.form-inline { display: flex; gap: 8px; align-items: center; }
.form-inline input { flex: 1; }
.form-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 800;
  color: var(--text);
  margin: 6px 0 10px;
}
.admin-building-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

.edit-tip {
  margin: 8px 0 4px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fff8e1;
  color: #8a6d1c;
  font-size: 12px;
  line-height: 1.6;
}
.edit-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn {
  flex: 1; height: 46px;
  border-radius: 12px;
  font-size: 15px; font-weight: 700;
  transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(79, 110, 247, .3); }
.btn-primary:disabled { opacity: .6; }
.btn-ghost { background: #fff; color: var(--text-2); border: 1px solid var(--border); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #ffc9c9; }

/* ============ 公司管理页 ============ */
.admin-company-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border-radius: 12px;
  padding: 13px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

/* ============ 弹层通用 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, .45);
  display: none;
  align-items: flex-end;
}
.modal-mask.open { display: flex; }
.modal-sheet {
  width: 100%;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
  animation: slideUp .25s cubic-bezier(.32, .72, .28, 1);
}
@keyframes slideUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 38px; height: 4px; border-radius: 4px; background: #e2e8f0; margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; }
.sheet-title { font-size: 17px; font-weight: 800; }
.sheet-room { font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.sheet-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.sheet-close {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.sheet-close:active { background: var(--border); }

.status-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 4px; }
.status-option {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  background: #fff;
  transition: all .15s;
}
.status-option .so-label { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.status-option .so-label::before { content: ''; flex: none; width: 12px; height: 12px; border-radius: 4px; }
.status-option.none .so-label::before { background: #fff; border: 1.5px solid #cbd5e1; }
.status-option.our .so-label::before { background: var(--status-our); }
.status-option.other .so-label::before { background: var(--status-other); }
.status-option.done .so-label::before { background: var(--status-done); }
.status-option .so-desc { display: none; }
.status-option.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.status-option.active .so-label::after { content: '✓'; margin-left: auto; color: var(--primary); font-weight: 800; font-size: 15px; }

/* 公司选择 */
.company-select { margin-top: 12px; }
.company-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.company-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 13px; color: var(--text);
  transition: all .15s;
}
.company-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

/* 客户信息 */
.customer-wrap { display: none; margin-top: 14px; }
.customer-inputs { display: flex; gap: 8px; }
.customer-inputs input {
  flex: 1; min-width: 0; height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
}
.customer-inputs input:focus { border-color: var(--primary); }
.customer-inputs input::placeholder { color: var(--text-3); }

.note-wrap { margin-top: 14px; }
.note-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.note-wrap textarea {
  width: 100%; min-height: 76px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  resize: none;
  line-height: 1.5;
  color: var(--text);
  transition: border-color .15s;
}
.note-wrap textarea:focus { border-color: var(--primary); }
.note-count { text-align: right; font-size: 11px; color: var(--text-3); margin-top: 4px; }

.modal-meta { font-size: 11px; color: var(--text-3); margin: 10px 0 14px; }
.confirm-text { font-size: 15px; color: var(--text-2); line-height: 1.6; padding: 16px 0 18px; }
.modal-actions { display: flex; gap: 10px; }

/* 记录详情 */
.log-change {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0;
}
.log-change .arrow { color: var(--text-3); font-size: 16px; }
.log-block {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.log-block .note-title { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.log-text { font-size: 14px; color: var(--text); line-height: 1.6; word-break: break-all; }

/* ============ Toast ============ */
#toast {
  position: fixed; left: 50%; bottom: 90px; z-index: 99;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15, 23, 42, .88);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: all .25s;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ v3 追加：未定状态（灰） ============ */
:root {
  --status-pending: #98a2ad;      /* 灰 */
  --pending-soft-bg: #eceff2;
  --pending-soft-tx: #4b5560;
  --pending-border: #b6bfc9;
}
.dot-pending { background: var(--status-pending); }
.grid-cell.status-pending {
  background: var(--pending-soft-bg);
  border: 1.5px solid var(--pending-border);
  color: var(--pending-soft-tx);
}
.st-pending { background: var(--pending-soft-bg); color: var(--pending-soft-tx); }
.bar-pending { background: var(--status-pending); }
.status-option.pending .so-label::before { background: var(--status-pending); }

/* 5 个统计标签换行显示 */
.stats-bar { flex-wrap: wrap; }

/* ============ v3 追加：底部单元栏（屏幕正下方，多单元时显示） ============ */
.unit-bar {
  flex: none;
  display: none;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card);
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.unit-bar::-webkit-scrollbar { display: none; }
.unit-bar .unit-item {
  flex: none;
  min-width: 66px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  white-space: nowrap;
  transition: all .15s;
}
.unit-bar .unit-item:active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.unit-bar .unit-item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(79, 110, 247, .3);
}

/* ============ v3 追加：每层增减房间（点击楼层号弹出） ============ */
.floor-opts { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 6px; }
.floor-opt {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  text-align: left;
  transition: all .15s;
}
.floor-opt:active { transform: scale(.98); }
.floor-opt:disabled { opacity: .45; cursor: not-allowed; }
.floor-opt:disabled:active { transform: none; }
.floor-opt.opt-plus { border-color: #b2e0b7; background: #f6fef7; }
.floor-opt.opt-minus { border-color: #ffc9c9; background: #fff5f5; }
.floor-opt .fo-icon {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
}
.floor-opt.opt-plus .fo-icon { background: #e6f7e9; color: #2f9e44; }
.floor-opt.opt-minus .fo-icon { background: #ffe3e3; color: var(--danger); }
.floor-opt .fo-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.floor-opt .fo-text b { font-size: 15px; color: var(--text); }
.floor-opt .fo-text i { font-style: normal; font-size: 12px; color: var(--text-3); }

/* 小区修改记录弹层列表 */
.cidlog-list { margin: 6px 0 2px; }

/* ============ v3 追加：小区卡片「网站链接」 ============ */
/* 卡片右侧操作区：按钮多于一行时整体换到下一行并靠右 */
.community-card { flex-wrap: wrap; }
.comm-right {
  flex: none;
  display: flex; align-items: center; justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px; margin-left: auto;
}
.comm-link {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(79, 110, 247, .22);
  flex: none;
  transition: transform .12s, opacity .15s;
}
.comm-link:active { transform: scale(.9); opacity: .8; }
.comm-link svg { display: block; }

/* ============ v3 追加：网站弹层（全屏 iframe） ============ */
#site-modal { align-items: center; justify-content: center; padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); }
.site-panel {
  width: 100%; max-width: 860px;
  height: min(92dvh, 920px);
  background: var(--card);
  border-radius: 18px;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .35);
  animation: fadeUp .22s ease both;
}
.site-bar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 10px 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.site-title {
  flex: 1; min-width: 0;
  font-size: 16px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.site-btn {
  min-width: 36px; height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  color: var(--text-2);
  font-size: 13px; font-weight: 600;
  transition: opacity .15s;
}
.site-btn:active { opacity: .75; }
.site-btn svg { display: block; }
#site-iframe { flex: 1; width: 100%; border: none; background: #fff; }

/* ============ v3 追加：楼栋表单单元配置 ============ */
.bf-unit-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 8px;
}
.bf-unit-row input {
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}
.bf-unit-row input:focus { border-color: var(--primary); }
.bf-u-name { flex: 1; }
.bf-u-lbl { flex: none; font-size: 12px; color: var(--text-2); }
.bf-u-floors { flex: none; width: 54px; }
.bf-u-per { flex: none; width: 60px; }
.bf-unit-row .mini-btn { padding: 7px 11px; }

/* ============ v3 追加：表单提示 ============ */
.form-tip {
  font-size: 12px;
  background: #eef3fd;
  border: 1px solid #dbe4fb;
  color: #4c6ef5;
  border-radius: 10px;
  padding: 8px 11px;
  margin: 2px 0 12px;
  line-height: 1.55;
}

/* ============ 状态 / 标签 文案设置（管理员，只改文字） ============ */
.label-body { margin: 6px 0 14px; }
.label-sec { margin-bottom: 14px; }
.label-sec-title { font-size: 12.5px; font-weight: 800; color: var(--text-2); margin-bottom: 8px; }
.label-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
/* 图标预览格：颜色与图标都来自系统固定样式，用户改不动 */
.label-prev {
  flex: none; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 10px; background: #fff;
}
.label-prev .dot { width: 14px; height: 14px; }
.label-ico { font-style: normal; font-size: 15px; line-height: 1; }
.label-ico.t-vip { color: #f08c00; }
.label-ico.t-visit { color: #7048e8; }
.label-ico.t-arrive { color: #e8590c; }
.label-ico.t-baobei { color: #1c7ed6; }
.label-input {
  flex: 1; min-width: 0; height: 40px;
  border: 1.5px solid var(--border); border-radius: 11px;
  padding: 0 12px; font-size: 14px; background: #fff;
}
.label-input:focus { border-color: var(--primary); }

/* ============ 户型图（楼栋图片库） ============ */
body.lock { overflow: hidden; height: 100%; }

/* 楼栋页右上角入口按钮 */
.fp-entry {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity .15s;
}
.fp-entry:active { opacity: .8; }
.fp-entry svg { display: block; flex: none; }

/* 全屏户型图面板 */
.fp-cover { align-items: center; }
.fp-panel {
  width: 100%;
  max-width: 560px;
  height: 100%;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.fp-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
  box-shadow: 0 1px 0 var(--line);
}
.fp-title-box { flex: 1; min-width: 0; }
.fp-title { font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.fp-upload {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(79, 110, 247, .28);
  transition: opacity .15s;
}
.fp-upload:active { opacity: .85; }
.fp-upload svg { display: block; }
.fp-close {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.fp-close:active { background: var(--border); }
.fp-close svg { display: block; }

.fp-grid {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-content: start;
  padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
}
.fp-item { display: flex; flex-direction: column; gap: 4px; animation: fadeUp .22s ease both; }
.fp-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #eef1f5;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.fp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }
.fp-thumb:active img { opacity: .8; }
.fp-del {
  position: absolute;
  top: 6px; right: 6px;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: rgba(15, 23, 42, .55);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .25);
}
.fp-del:active { background: var(--danger); }
.fp-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px;
  font-size: 10px;
  color: var(--text-3);
}
.fp-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-meta .fp-name { flex: 1 1 auto; min-width: 0; font-weight: 700; }

.fp-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-3);
  padding: 60px 20px;
  font-size: 13px;
  line-height: 1.9;
}
.fp-empty-icon { font-size: 44px; margin-bottom: 8px; }
.fp-empty p { color: var(--text-2); font-size: 15px; font-weight: 700; margin-bottom: 2px; }

/* 大图查看 */
.fp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  display: none;
}
.fp-lightbox.open { display: block; }
.fpl-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
#fpl-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.fpl-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 3;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.fpl-close:active { background: rgba(255, 255, 255, .32); }
.fpl-close svg { display: block; }
.fpl-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.fpl-nav:active { background: rgba(255, 255, 255, .3); }
.fpl-prev { left: 10px; }
.fpl-next { right: 10px; }
.fpl-info {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  z-index: 3;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, .8);
  padding: 22px 24px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .4));
  pointer-events: none;
}

/* 删除确认框必须盖在户型图面板/大图之上 */
#confirm-modal { z-index: 96; }

/* 卡片信息行左侧的户型名称 */
.fp-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

/* 户型图上传面板（底部抽屉，先命名再选图） */
.fp-upload-modal { align-items: flex-end; }
.fp-upload-modal .fp-panel {
  height: auto;
  max-height: 92%;
  max-width: 560px;
  border-radius: 18px 18px 0 0;
  animation: fpUp .28s ease both;
}
@keyframes fpUp {
  from { transform: translateY(80px); opacity: .3; }
  to   { transform: translateY(0);   opacity: 1; }
}
.fpu-body {
  padding: 16px 16px 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.fpu-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.fpu-label span { color: var(--text-3); font-weight: 400; font-size: 11px; }
.fpu-name-input {
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 15px;
  color: var(--text-1);
  -webkit-appearance: none;
}
.fpu-name-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.fpu-tip { font-size: 11px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.fpu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.fpu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  animation: fadeUp .2s ease both;
}
.fpu-item img {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
}
.fpu-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.fpu-name-ed {
  box-sizing: border-box;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: var(--bg);
  font-size: 13px;
  color: var(--text-1);
}
.fpu-name-ed:focus { outline: none; box-shadow: 0 0 0 2px var(--primary-soft); }
.fpu-item-del {
  font-size: 11px;
  color: var(--danger);
  padding: 0;
  min-height: 20px;
}
.fpu-foot {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--card);
  box-shadow: 0 -1px 0 var(--line);
}
.fpu-pick {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}
.fpu-pick svg { display: block; }
.fpu-go {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(79, 110, 247, .28);
}
.fpu-go:disabled { opacity: .45; box-shadow: none; }
.fpu-go:disabled:active { transform: none; }

/* ============ v4 追加：客户到店情况（重点客户 ★ / 预约 ☾ / 进店客户 ☀ / 报备 ▲） ============ */

/* 网格格子：右上角标签图标（不占正文空间，仅浮在角上） */
.grid-cell { position: relative; }
.cell-tags {
  position: absolute;
  top: 3px; right: 4px;
  display: flex;
  gap: 2px;
  line-height: 1;
  pointer-events: none;
}
.cell-tag { font-style: normal; font-size: 11px; line-height: 1; }
.cell-tag.t-vip { color: #f08c00; }     /* 重点客户 · 星 */
.cell-tag.t-visit { color: #7048e8; }   /* 预约 · 月牙 */
.cell-tag.t-arrive { color: #e8590c; }  /* 进店客户 · 小太阳 */
.cell-tag.t-baobei { color: #1c7ed6; }  /* 报备 · 三角形 */

/* 筛选时不匹配的房间：外框照常占位显示（保留网格形状），
   但房间号、状态配色、角标标记一律不显示 */
.grid-cell.filtered-out {
  background: #fff;
  border: 1.5px solid var(--border);
  color: transparent;
  cursor: default;
  pointer-events: none;
}
.grid-cell.filtered-out .cell-code,
.grid-cell.filtered-out .cell-note,
.grid-cell.filtered-out .cell-tags { visibility: hidden; }

/* 弹窗里的「客户到店情况」多选标签 */
.tag-select { margin-top: 14px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 13px; color: var(--text-2); font-weight: 600;
  transition: all .15s;
}
.tag-chip .tag-ico { font-style: normal; font-size: 14px; line-height: 1; }
.tag-chip.t-vip .tag-ico { color: #f08c00; }
.tag-chip.t-visit .tag-ico { color: #7048e8; }
.tag-chip.t-arrive .tag-ico { color: #e8590c; }
.tag-chip.t-baobei .tag-ico { color: #1c7ed6; }

/* ☾(U+263E) 在部分设备字体下会渲染成偏大的空心轮廓，这里统一用 CSS 绘制实心月牙：
   原字符设为透明，保留它原有的行内占位（不改 display/尺寸，避免基线错位导致跑到文字下面），
   实心月牙再用绝对定位居中覆盖在字符位置上 */
.tag-pill.t-visit .tag-ico,
.fs-opt.t-visit .tag-ico,
.tag-chip.t-visit .tag-ico,
.label-ico.t-visit,
.cell-tag.t-visit {
  position: relative;
  -webkit-text-fill-color: transparent;
}
.tag-pill.t-visit .tag-ico::before,
.fs-opt.t-visit .tag-ico::before,
.tag-chip.t-visit .tag-ico::before,
.label-ico.t-visit::before,
.cell-tag.t-visit::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: .8em; height: .8em;          /* 用 em 跟随各处字号，尺寸与原月牙字符相当 */
  margin: -.4em 0 0 -.4em;
  border-radius: 50%;
  box-shadow: inset .25em 0 0 0 currentColor;   /* 阴影右移 => 实心部分在左，空的一侧朝右 */
}
.tag-chip.t-vip.active { border-color: #f08c00; background: #fff4e0; color: #8a5b0a; font-weight: 700; }
.tag-chip.t-visit.active { border-color: #7048e8; background: #f0ecfe; color: #5b3fc4; font-weight: 700; }
.tag-chip.t-arrive.active { border-color: #e8590c; background: #fff0e6; color: #a63d0a; font-weight: 700; }
.tag-chip.t-baobei.active { border-color: #1c7ed6; background: #e7f2fd; color: #1864ab; font-weight: 700; }

/* ============ v5 追加：装修公司"我方"标记 + 联系方式预览 + 管理提示 ============ */
.ours-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  background: #fff4c2;
  color: #8a5b0a;
  border: 1px solid #f0c84a;
  vertical-align: middle;
}
.ours-btn {
  background: #fff4c2 !important;
  color: #8a5b0a !important;
  border-color: #f0c84a !important;
}
.comm-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.4;
}
.admin-tip {
  font-size: 12px;
  color: var(--text-2);
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  border-radius: 4px;
  margin: 8px 0;
  line-height: 1.5;
}
.form-check label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}
.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* ============ 筛选栏（单行「筛选住户」+ 筛选面板，最多选 9 个） ============ */
/* 摘要条：单行入口，点击展开筛选面板 */
.stats-bar {
  flex: none;
  gap: 6px;
  padding: 8px 12px 0;
}
.fs-row {
  display: flex; align-items: center; gap: 6px 7px;
  flex-wrap: wrap;
  width: 100%; min-height: 38px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 13.5px; font-weight: 700; color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.fs-row:active { background: var(--bg); }
.fs-entry { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.fs-row svg { flex: none; color: var(--text-2); }
.fs-label { flex: none; }
.fs-badge {
  flex: none; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 800;
}
.fs-hint { flex: 1; font-size: 12px; font-weight: 500; color: var(--text-3); }
.fs-arrow { flex: none; margin-left: auto; font-size: 9px; color: var(--text-3); }

/* 已选条件：小标签，可多行排布（最多 9 个），点 × 直接移除 */
.fs-chips { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.fs-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 4px 0 8px;
  max-width: 100%;
  border-radius: 7px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 11.5px; font-weight: 700;
}
.fs-chip-txt { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.fs-chip .tag-ico { font-style: normal; font-size: 11px; line-height: 1; }
.fs-chip .cp-dot { width: 8px; height: 8px; }
.fs-chip .cp-name,
.fs-chip .fs-chip-txt > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 96px; }
.fs-chip-st { background: var(--primary-soft); color: var(--primary); }
.fs-chip-tag { background: #fff4e0; color: #8a5b0a; }
.fs-chip-cp { background: #f8f9fa; color: var(--text-2); border: 1px solid var(--line); }
.fs-chip-n {
  padding: 0 1px 0 3px;
  font-size: 11px; font-weight: 800;
  opacity: .75;
}
.fs-chip-x {
  padding: 0 3px;
  font-size: 13px; font-weight: 700; line-height: 1;
  opacity: .5;
}
.fs-chip-x:active { opacity: 1; }
/* 命中总数：跟在「已选/9」徽标后面 */
.fs-total { flex: none; font-size: 12px; font-weight: 600; color: var(--text-2); }
.fs-total b { font-size: 13px; font-weight: 800; color: var(--primary); }
.fs-clear {
  flex: none;
  padding: 2px 7px;
  border-radius: 7px;
  background: #f1f3f5; color: var(--text-2);
  font-size: 11.5px; font-weight: 700;
}

/* 筛选面板：选项每行一个 */
.filter-sheet { display: flex; flex-direction: column; max-height: 84vh; overflow: hidden; }
.filter-head-actions { display: flex; align-items: center; gap: 8px; }
.filter-clear-btn {
  height: 32px; padding: 0 12px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 700;
}
.filter-clear-btn:active { background: var(--border); }
.filter-opts { flex: 1; min-height: 0; overflow-y: auto; margin: 12px 0; }
.fs-sec { margin-bottom: 14px; }
.fs-sec-title { font-size: 12px; font-weight: 800; color: var(--text-2); margin-bottom: 6px; }
.fs-opt {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 44px; padding: 0 12px;
  margin-bottom: 6px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: #fff;
  font-size: 14px; font-weight: 600; color: var(--text);
  text-align: left;
}
.fs-opt:active { background: var(--bg); }
.fs-opt-label { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; }
.fs-opt-label .dot { flex: none; }
.fs-opt-label .tag-ico { font-style: normal; font-size: 13px; line-height: 1; }
.fs-opt-label .cp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-opt-count { flex: none; font-size: 12px; font-weight: 700; color: var(--text-3); }
.fs-opt-tick { flex: none; width: 16px; color: var(--primary); font-weight: 800; opacity: 0; }
.fs-opt.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.fs-opt.active .fs-opt-count { color: var(--primary); }
.fs-opt.active .fs-opt-tick { opacity: 1; }
.fs-opt.disabled { opacity: .4; }
.fs-none { font-size: 12.5px; color: var(--text-3); padding: 6px 2px; }

/* ============ 公司标识色 ============ */
/* 圆形色点：筛选面板 / 公司管理列表 / 弹窗 chips / 日志 */
.cp-dot {
  display: inline-block;
  flex: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #adb5bd;
  vertical-align: -1px;
}
/* 格子备注里的公司名：加粗 + 全不透明，区别于灰色备注文字 */
.cell-note .cell-cp { font-weight: 800; opacity: 1; }
/* 房间弹窗公司 chips：色点 + 选中态用该公司标识色 */
.company-chip { display: inline-flex; align-items: center; gap: 6px; }
.company-chip.active {
  border-color: var(--cp, var(--primary));
  color: var(--cp, var(--primary));
  background: #fff;
}
/* 日志弹窗公司行：色点与文字对齐 */
.log-text .cp-dot { margin-right: 4px; }

/* 公司表单：颜色选择器（预设色板 + 自定义） */
.cf-color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cf-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--c, #adb5bd);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .06), 0 0 0 1.5px var(--border);
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s, box-shadow .12s;
}
.cf-swatch.active {
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .06), 0 0 0 2.5px var(--primary);
  transform: scale(1.15);
}
/* 「自动」：非纯色块，显示 A 字样代表按公司名自动分配 */
.cf-swatch.cf-auto {
  background: conic-gradient(#1c7ed6, #7048e8, #9c36b5, #e64980, #f76707, #5c940d, #1c7ed6);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
/* 自定义：原生取色器叠在色块上（点击弹系统取色面板） */
.cf-swatch.cf-custom { position: relative; overflow: hidden; display: inline-flex; }
.cf-swatch.cf-custom input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none; padding: 0;
}

/* 公司表单：房间显示/隐藏 分段选择 */
.cf-seg {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.cf-seg-item {
  flex: 1;
  height: 42px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  cursor: pointer;
}
.cf-seg-item + .cf-seg-item { border-left: 1.5px solid var(--border); }
.cf-seg-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

/* 「房间隐藏」小标识（公司管理列表） */
.hide-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #f1f3f5;
  color: #868e96;
  font-size: 10.5px; font-weight: 700;
  vertical-align: 1px;
}

/* ============ 小区统计弹层（到店情况 / 装修公司，跨全部楼栋） ============ */
.cstat-body { margin: 4px 0 8px; }
/* 全小区合计 */
.cstat-sum {
  background: var(--primary-soft);
  border: 1px solid rgba(79, 110, 247, .18);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
.cstat-sum-title { font-size: 12.5px; font-weight: 800; color: var(--primary); margin-bottom: 9px; }
/* 到店情况：四格统计 */
.cstat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cstat-cell {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 4px;
}
.cstat-cell b { font-size: 17px; font-weight: 800; color: var(--text); line-height: 1; }
/* 文案可被管理员自定义，长度不定；超过一格时省略号兜底，避免撑破四宫格 */
.cstat-cell .cstat-lb { font-size: 11px; color: var(--text-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cstat-ico { font-style: normal; font-size: 13px; line-height: 1; }
.cstat-cell.t-vip .cstat-ico { color: #f08c00; }
.cstat-cell.t-visit .cstat-ico { color: #7048e8; }
.cstat-cell.t-arrive .cstat-ico { color: #e8590c; }
.cstat-cell.t-baobei .cstat-ico { color: #1c7ed6; }
.cstat-cell.zero { opacity: .48; }
.cstat-cell.zero b { color: var(--text-3); }

/* 每个楼栋一段 */
.cstat-list { display: flex; flex-direction: column; gap: 10px; }
.cstat-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
}
.cstat-row-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; }
.cstat-bd { font-size: 13.5px; font-weight: 800; color: var(--text); }
.cstat-bd-meta { font-size: 11.5px; color: var(--text-3); }
.cstat-none { font-size: 12.5px; color: var(--text-3); padding: 4px 0; }

/* 装修公司药丸（带公司标识色） */
.cstat-cps { display: flex; flex-wrap: wrap; gap: 6px; }
.cstat-cp {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #f8f9fa;
  font-size: 12.5px; font-weight: 700;
}
.cstat-cp b { font-size: 13px; font-weight: 800; }
