/* =========================================================
   出租房管理系统 - 现代科技主题 (Tech Edition)
   ========================================================= */

/* ---- 设计令牌 ---- */
:root{
  /* 背景层 */
  --bg:           #f5f7fa;
  --surface:      #ffffff;
  --surface-2:    #f7f9fc;
  --surface-3:    #eef2f7;

  /* 描边 */
  --border:        rgba(15,23,42,.07);
  --border-strong: rgba(15,23,42,.12);

  /* 文字 */
  --text:        #0b1220;
  --text-2:      #334155;
  --text-muted:  #64748b;
  --text-soft:   #94a3b8;

  /* 品牌色 - 蓝 / 青科技渐变 */
  --brand:        #2563eb;          /* blue-600 */
  --brand-2:      #1d4ed8;          /* blue-700 */
  --brand-soft:   rgba(37,99,235,.10);
  --brand-softer: rgba(37,99,235,.05);
  --accent:       #06b6d4;          /* cyan-500 */

  --grad-brand:   linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  --grad-brand-h: linear-gradient(135deg, #1d4ed8 0%, #0891b2 100%);
  --grad-text:    linear-gradient(120deg, #2563eb 0%, #06b6d4 60%, #22d3ee 100%);

  --success: #10b981;
  --success-soft: rgba(16,185,129,.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245,158,11,.14);
  --danger:  #ef4444;
  --danger-soft: rgba(239,68,68,.12);
  --info:    #06b6d4;
  --info-soft: rgba(6,182,212,.12);

  /* 深色导航 */
  --nav-bg:   linear-gradient(110deg, #0b1426 0%, #0f1e3a 55%, #112347 100%);
  --nav-text: #c7d2e1;

  /* 形状 */
  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius:    14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* 阴影（扁平、克制） */
  --shadow-1: 0 1px 2px rgba(15,23,42,.04);
  --shadow-2: 0 4px 16px -6px rgba(15,23,42,.14);
  --shadow-3: 0 16px 40px -12px rgba(15,23,42,.22);
  --shadow-ring: 0 0 0 3px rgba(37,99,235,.18);
  --glow-brand: 0 4px 14px -4px rgba(37,99,235,.35);
  --glow-cyan:  0 4px 14px -4px rgba(6,182,212,.32);

  /* 后台布局尺寸 */
  --sidebar-w: 236px;
  --topbar-h:  58px;
}

/* ---- 全局 ---- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
}

body{
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC',
               'HarmonyOS Sans SC', 'Microsoft YaHei', 'Segoe UI',
               'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'tnum';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0;
  line-height: 1.55;
  color: var(--text);
  font-size: 14px;
}

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-2); }

.link-dark { color: var(--text) !important; }
.link-dark:hover { color: var(--brand) !important; }

::selection { background: rgba(37,99,235,.18); color: var(--brand-2); }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c2cdde; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #9aa8bf; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 文字渐变工具 */
.text-gradient{
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---- 顶部导航：深色玻璃 ---- */
.navbar.bg-app{
  background: var(--nav-bg) !important;
  -webkit-backdrop-filter: saturate(160%) blur(12px);
          backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(120,160,255,.14);
  box-shadow: 0 8px 30px -16px rgba(2,8,23,.8);
  min-height: 62px;
  position: sticky; top: 0; z-index: 1030;
}
/* 顶部高光 + 底部渐变发光线 */
.navbar.bg-app::after{
  content:''; position:absolute; left:0; right:0; bottom:-1px; height:1px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,.7), rgba(34,211,238,.7), transparent);
  opacity:.7;
}

.navbar.bg-app .navbar-brand{
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.015em;
  font-size: 1.04rem;
  display: inline-flex; align-items: center;
}
.navbar.bg-app .navbar-brand .bi{
  color: #fff;
  background: var(--grad-brand);
  padding: 7px;
  border-radius: 10px;
  font-size: 1rem;
  margin-right: .5rem !important;
  box-shadow: var(--glow-brand);
}

.navbar.bg-app .nav-link{
  color: var(--nav-text) !important;
  font-weight: 500;
  font-size: .92rem;
  padding: .45rem .85rem;
  border-radius: 10px;
  margin: 0 2px;
  transition: background .18s, color .18s, box-shadow .18s;
}
.navbar.bg-app .nav-link:hover{
  color: #fff !important;
  background: rgba(255,255,255,.08);
}
.navbar.bg-app .nav-link.active{
  color: #fff !important;
  background: var(--grad-brand);
  box-shadow: var(--glow-brand);
}
.navbar.bg-app .nav-link .bi{ opacity: .9; }

.navbar.bg-app .navbar-toggler{
  border: 1px solid rgba(255,255,255,.18);
  padding: .35rem .55rem;
}
.navbar.bg-app .navbar-toggler:focus{ box-shadow: none; }
.navbar.bg-app .navbar-toggler-icon{
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23c7d2e1' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M3 7h18M3 12h18M3 17h18'/%3E%3C/svg%3E");
}

.navbar.bg-app .dropdown-menu{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  padding: .4rem;
  margin-top: .5rem;
  background: rgba(255,255,255,.98);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.navbar.bg-app .dropdown-item{
  border-radius: var(--radius-sm);
  font-size: .9rem;
  padding: .45rem .65rem;
}
.navbar.bg-app .dropdown-item:hover{ background: var(--brand-softer); color: var(--brand-2); }

/* ---- 卡片 / 表面 ---- */
.card{
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover{
  box-shadow: var(--shadow-2);
}
/* 标题栏：白底深色（扁平后台风格） */
.card-header{
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .95rem;
  padding: .8rem 1.1rem;
  color: var(--text);
}
.card-header .bi{ color: var(--brand); margin-right: .35rem; }
.card-header .text-muted{ color: var(--text-muted) !important; }
.card-header.text-danger{ color: #dc2626 !important; }
.card-header.text-danger .bi{ color: #dc2626; }
.card-body{ padding: 1rem 1.1rem; }

/* soft-head 兼容（标题栏现已统一为白底，无需额外处理） */
.card.soft-head > .card-header{ background: var(--surface); color: var(--text); }

/* ---- 表格 ---- */
.table{
  margin-bottom: 0;
  color: var(--text);
  --bs-table-bg: transparent;
}
.table thead th{
  background: var(--surface-2) !important;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  white-space: nowrap;
  padding: .7rem .8rem;
}
.table tbody td{
  border-bottom: 1px solid var(--border);
  padding: .8rem .8rem;
  font-size: .9rem;
  vertical-align: middle;
  color: var(--text-2);
  font-weight: 400;
}
.table tbody td.cell-name{ color: var(--text); font-weight: 400; }
.table thead th .sort-link{
  color: inherit; text-decoration: none; white-space: nowrap; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.table thead th .sort-link:hover{ color: var(--primary, #2563eb); }
.table thead th .sort-link i{ font-size: .72rem; opacity: .45; }
.table thead th .sort-link.active{ color: var(--primary, #2563eb); }
.table thead th .sort-link.active i{ opacity: 1; }
.hz-timeline{ line-height: 1.55; color: var(--text); white-space: normal; min-width: 220px; }
.hz-t-found{ color: #dc2626; font-weight: 600; }
.hz-t-doing{ color: #ea580c; font-weight: 600; }
.hz-t-done{ color: #16a34a; font-weight: 600; }
.hz-t-sep{ color: var(--muted); font-weight: 400; }
.hz-cat{ display: inline-block; padding: .15rem .45rem; border-radius: .35rem; font-size: .78rem; line-height: 1.35; white-space: nowrap; }
.hz-cat-major{ background: rgba(220,38,38,.1); color: #b91c1c; }
.hz-cat-general{ background: rgba(234,88,12,.12); color: #c2410c; }
.btn.hz-filter-major{
  border-color: rgba(220,38,38,.35);
  color: #dc2626;
  background: #fff;
}
.btn.hz-filter-major:hover,
.btn.hz-filter-major.active{
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.btn.hz-filter-general{
  border-color: rgba(234,88,12,.4);
  color: #ea580c;
  background: #fff;
}
.btn.hz-filter-general:hover,
.btn.hz-filter-general.active{
  background: #ea580c;
  border-color: #ea580c;
  color: #fff;
}
.table tbody tr:last-child td{ border-bottom: 0; }
.table tbody tr{ transition: background .12s; }
.table-hover > tbody > tr:hover > td{ background: var(--surface-2); }

/* ---- 徽章：评级 ---- */
.badge-rating{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.55rem;
  padding: 0 .55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .02em;
  border: 1px solid transparent;
  background: var(--surface-3);
  color: var(--text-soft);
}
/* 评级标签配色与统计饼图一致：A 绿 / B 蓝 / C 橙 / D 红 / 未评 灰 */
.badge-rating.A{ background: #16a34a; color: #fff; border-color: #16a34a; box-shadow: 0 2px 8px -2px rgba(22,163,74,.45); }
.badge-rating.B{ background: #0ea5e9; color: #fff; border-color: #0ea5e9; box-shadow: 0 2px 8px -2px rgba(14,165,233,.45); }
.badge-rating.C{ background: #f59e0b; color: #fff; border-color: #f59e0b; box-shadow: 0 2px 8px -2px rgba(245,158,11,.45); }
.badge-rating.D{ background: #ef4444; color: #fff; border-color: #ef4444; box-shadow: 0 2px 8px -2px rgba(239,68,68,.45); }
.badge-rating.NA{ background: #94a3b8; color: #fff; border-color: #94a3b8; }

/* Bootstrap subtle 徽章微调 */
.badge.bg-success-subtle{ background: #e6f9ee !important; color: #16a34a !important; border: 1px solid #a7e8c4; border-radius: 999px; font-weight: 500; padding: .25rem .55rem; }
.badge.bg-secondary-subtle{ background: #eef1f6 !important; color: #5b6675 !important; border: 1px solid #d4dbe6; border-radius: 999px; font-weight: 500; padding: .25rem .55rem; }
.badge.bg-primary-subtle{ background: #e8f0fe !important; color: #1d6dfb !important; border: 1px solid #b9d0fb; border-radius: 999px; font-weight: 500; }
.badge.bg-info-subtle{ background: #e2f6fb !important; color: #0891b2 !important; border: 1px solid #a5e4f0; border-radius: 999px; }
.badge.bg-warning-subtle{ background: #fff3e0 !important; color: #ea7a0c !important; border: 1px solid #ffd591; border-radius: 999px; }
.badge.bg-danger-subtle{ background: #ffeaea !important; color: #e0352b !important; border: 1px solid #ffb3b3; border-radius: 999px; }
/* 实色徽章（角色等）：鲜艳填充 + 白字 */
.badge.bg-primary{ background: var(--brand) !important; color: #fff !important; border: 1px solid var(--brand); border-radius: 999px; font-weight: 600; box-shadow: 0 2px 8px -2px rgba(37,99,235,.45); }
.badge.bg-info{ background: #0891b2 !important; color: #fff !important; border: 1px solid #0891b2; border-radius: 999px; font-weight: 600; box-shadow: 0 2px 8px -2px rgba(8,145,178,.45); }
.badge.bg-secondary{ background: #64748b !important; color: #fff !important; border: 1px solid #64748b; border-radius: 999px; font-weight: 600; box-shadow: 0 2px 8px -2px rgba(100,116,139,.4); }
.badge.bg-danger{ background: var(--danger) !important; box-shadow: 0 2px 8px -2px rgba(239,68,68,.6); }

/* 标签/徽章统一为效果图风格：圆角矩形 + 浅底 + 同色描边 + 中等字重 */
.badge.bg-success-subtle,
.badge.bg-secondary-subtle,
.badge.bg-primary-subtle,
.badge.bg-info-subtle,
.badge.bg-warning-subtle,
.badge.bg-danger-subtle{
  display: inline-block;
  border-radius: 8px;
  border-width: 1px;
  border-style: solid;
  font-weight: 500;
  font-size: .76rem;
  line-height: 1.4;
  padding: .26rem .66rem;
  letter-spacing: .01em;
}
/* 描边颜色与各色底色匹配（效果图风格） */
.badge.bg-primary-subtle{ border-color: #b9d0fb !important; }
.badge.bg-info-subtle{ border-color: #a5e4f0 !important; }
.badge.bg-success-subtle{ border-color: #a7e8c4 !important; }
.badge.bg-warning-subtle{ border-color: #ffd591 !important; }
.badge.bg-danger-subtle{ border-color: #ffb3b3 !important; }
.badge.bg-secondary-subtle{ border-color: #d4dbe6 !important; }

/* ---- 按钮 ---- */
.btn{
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .88rem;
  padding: .45rem .9rem;
  transition: all .18s cubic-bezier(.4,0,.2,1);
  border: 1px solid transparent;
}
.btn-sm{ padding: .3rem .65rem; font-size: .8rem; border-radius: 7px; }
.btn-lg{ padding: .65rem 1.2rem; font-size: 1rem; border-radius: var(--radius); }

.btn-primary{
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover{
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
}

.btn-success{ background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover{ background: #059669; border-color: #059669; color: #fff; }

.btn-warning{ background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover{ background: #d97706; border-color: #d97706; color: #fff; }

.btn-danger{ background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover{ background: #dc2626; border-color: #dc2626; color: #fff; }

.btn-light{
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-2);
}
.btn-light:hover{ background: var(--surface-2); border-color: var(--brand); color: var(--brand-2); }

.btn-outline-primary{ border-color: rgba(37,99,235,.35); color: var(--brand-2); background: transparent; }
.btn-outline-primary:hover{ background: var(--brand-soft); border-color: var(--brand); color: var(--brand-2); box-shadow: 0 4px 14px -6px rgba(37,99,235,.5); }

.btn-outline-success{ border-color: rgba(16,185,129,.35); color: #047857; background: transparent; }
.btn-outline-success:hover{ background: var(--success-soft); border-color: var(--success); color: #047857; box-shadow: 0 4px 14px -6px rgba(16,185,129,.5); }

.btn-outline-secondary{ border-color: var(--border-strong); color: var(--text-muted); }
.btn-outline-secondary:hover{ background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

.btn-outline-warning{ border-color: rgba(245,158,11,.40); color: #b45309; }
.btn-outline-warning:hover{ background: var(--warning-soft); color: #b45309; box-shadow: 0 4px 14px -6px rgba(245,158,11,.5); }

.btn:focus, .btn:focus-visible{ box-shadow: var(--shadow-ring); }

/* ---- 表单控件 ---- */
.form-control, .form-select{
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .9rem;
  padding: .5rem .75rem;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-control:hover, .form-select:hover{ border-color: #b6c0d0; }
.form-control:focus, .form-select:focus{
  border-color: var(--brand);
  box-shadow: var(--shadow-ring);
  background: var(--surface);
}
.form-control::placeholder{ color: var(--text-soft); }
.form-label{ font-weight: 500; color: var(--text-2); font-size: .85rem; }
.form-text{ color: var(--text-soft); font-size: .8rem; }

.input-group-text{
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}

.form-check-input{
  border-color: var(--border-strong);
  cursor: pointer;
}
.form-check-input:checked{ background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus{ box-shadow: var(--shadow-ring); border-color: var(--brand); }

/* ---- 描述键值 ---- */
.kv{
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: .55rem 1rem;
  font-size: .92rem;
}
.kv dt{ color: var(--text-muted); font-weight: 500; }
.kv dd{ margin: 0; color: var(--text); }
code{ color: var(--brand-2); background: var(--brand-softer); padding: .08rem .4rem; border-radius: 6px; font-size: .86em; }

/* ---- 筛选栏 ---- */
.filter-bar{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-1);
}
.filter-bar .form-control,
.filter-bar .form-select{ font-size: .88rem; }

/* ---- 分页 ---- */
.pagination{ gap: 4px; }
.page-link{
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) !important;
  color: var(--text-2);
  font-size: .85rem;
  padding: .4rem .75rem;
  background: var(--surface);
  transition: all .15s;
}
.page-link:hover{ background: var(--brand-softer); color: var(--brand-2); border-color: rgba(37,99,235,.25); }
.page-item.active .page-link{
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.page-item.disabled .page-link{ background: var(--surface-2); color: var(--text-soft); }

/* ---- 左侧村社树 ---- */
.list-layout{ align-items: flex-start; }
.village-tree{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.village-tree-inner{
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-bottom: .25rem;
}
.village-tree-inner::-webkit-scrollbar{ width: 6px; }
.village-tree-inner::-webkit-scrollbar-thumb{ background: #d0d8e4; border-radius: 3px; }

#listMainPanel.is-loading{
  opacity: .55;
  pointer-events: none;
  transition: opacity .15s;
}

@media (min-width: 992px){
  .village-tree-col{ position: sticky; top: calc(var(--topbar-h) + 14px); }
}

.tree-section{ padding: .35rem 0; border-bottom: 1px solid var(--border); }
.tree-section:last-child{ border-bottom: 0; }

#treeSearch{
  background: var(--surface-2);
  border-color: var(--border);
  padding: .45rem .7rem;
  font-size: .85rem;
}
#treeSearch:focus{ background: var(--surface); }

.tree-link{
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .95rem;
  color: var(--text-2);
  text-decoration: none;
  font-size: .88rem;
  line-height: 1.2;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.tree-link:hover{
  background: var(--brand-softer);
  color: var(--text);
}
.tree-link .t-name{ flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-link .t-name > .bi,
.tree-link > .bi{ font-size: .9rem; margin-right: .3rem; color: #3b82f6; opacity: 1; }
.tree-link.active .t-name > .bi,
.tree-link.active > .bi{ color: #2563eb; }
.tree-link .cnt{
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 600;
  padding: .08rem .5rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.tree-link.active{
  background: linear-gradient(90deg, var(--brand-soft) 0%, transparent 100%);
  color: var(--brand-2);
  font-weight: 600;
  border-left-color: var(--brand);
}
.tree-link.active .cnt{ background: var(--brand); color: #fff; }
.tree-link.text-warning{ color: #b45309 !important; }
.tree-link.text-warning .cnt{ background: var(--warning-soft); color: #b45309; }
.tree-link.text-warning.active{
  background: linear-gradient(90deg, var(--warning-soft) 0%, transparent 100%);
  border-left-color: var(--warning);
  color: #b45309 !important;
}
.tree-link.text-warning.active .cnt{ background: var(--warning); color: #fff; }
.tree-hidden{ display: none !important; }

/* 二级网格菜单 */
.tree-row{ display: flex; align-items: stretch; }
.tree-row .tree-link{ flex: 1; min-width: 0; padding-left: .25rem; }
.tree-toggle{
  flex: 0 0 26px; width: 26px;
  border: 0; background: transparent;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.tree-toggle:hover{ color: var(--brand); }
.tree-toggle .bi{ font-size: .78rem; transition: transform .18s ease; }
.tree-toggle[aria-expanded="true"] .bi{ transform: rotate(90deg); }
.tree-toggle-placeholder{ flex: 0 0 26px; width: 26px; }
.tree-children{ background: rgba(37,99,235,.025); }
.tree-link.tree-sub{
  padding-top: .4rem; padding-bottom: .4rem;
  padding-left: 2.1rem;
  font-size: .82rem;
  color: var(--text-muted);
}
.tree-link.tree-sub .bi{ font-size: .82rem; opacity: 1; color: #3b82f6; }
.tree-link.tree-sub.active{ color: var(--brand-2); }

/* ---- 照片画廊 ---- */
.photo-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  gap: .65rem;
}
.photo-grid .ph{
  position: relative;
  aspect-ratio: 1/1;
  background: var(--surface-3);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .15s, box-shadow .15s;
}
.photo-grid .ph:hover{ transform: translateY(-3px); box-shadow: var(--shadow-2); }
.photo-grid .ph img{ width: 100%; height: 100%; object-fit: cover; }
.photo-grid .ph .cap{
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  color: #fff; font-size: .75rem; padding: 1.5rem .55rem .45rem;
}
.photo-grid .ph .del{
  position: absolute; top: 6px; right: 6px;
  background: rgba(239,68,68,.92); color: #fff;
  border: 0; width: 24px; height: 24px;
  border-radius: 50%; font-size: .8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .15s;
}
.photo-grid .ph:hover .del{ opacity: 1; }

/* ---- 仪表盘 KPI 卡（图标方块 + 数字 + 副信息） ---- */
.dash-welcome{ color: var(--text-muted); font-size: .88rem; margin: 0 0 1rem; }
.kpi-card{
  height: 100%;
  display: flex; align-items: flex-start; gap: .9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 1.05rem 1.15rem;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.kpi-card:hover{ box-shadow: var(--shadow-2); border-color: rgba(37,99,235,.16); }
.kpi-icon{
  flex: 0 0 auto;
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.kpi-main{ min-width: 0; flex: 1 1 auto; }
.kpi-label{ font-size: .82rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value{
  font-size: 1.7rem; font-weight: 800; color: var(--text);
  line-height: 1.15; letter-spacing: -.02em; margin-top: .1rem;
  font-variant-numeric: tabular-nums;
}
.kpi-value .unit{ font-size: .85rem; font-weight: 600; color: var(--text-muted); margin-left: .15rem; }
.kpi-sub{
  font-size: .76rem; color: var(--text-muted); margin-top: .25rem;
  line-height: 1.4; word-break: break-all;
}
.kpi-sub.up{ color: #059669; }
@media (max-width: 575.98px){
  .kpi-value{ font-size: 1.4rem; }
  .kpi-icon{ width: 40px; height: 40px; font-size: 1.1rem; }
}

/* ---- 统计卡 / 仪表盘 ---- */
.stat-card{
  position: relative;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(6,182,212,.06), transparent 45%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.stat-card::before{
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  background: var(--brand); opacity:.85;
}
.stat-card:hover{ box-shadow: var(--shadow-2); border-color: rgba(37,99,235,.18); }
.stat-card .label{
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .01em;
}
.stat-card .value{
  font-size: 1.9rem;
  font-weight: 800;
  margin-top: .35rem;
  line-height: 1.1;
  font-feature-settings: 'tnum';
  color: var(--text);
}
.stat-card .value small{
  font-weight: 500; font-size: .82rem;
  color: var(--text-muted);
}

/* ECharts 图表容器 */
.echart-pie,
.echart-bar{
  width: 100%;
  height: 266px;
  min-height: 196px;
}
.echart-bar .chart-fallback{
  height: auto;
  min-height: 0;
  max-height: 266px;
  overflow-y: auto;
}
.pie-fallback{
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  min-height: 196px;
}
.pie-fallback-chart{
  flex: 0 0 148px;
  width: 148px;
}
.pie-fallback-chart svg{
  width: 100%;
  height: auto;
  display: block;
}
.pie-fallback-legend{
  flex: 1 1 auto;
  min-width: 0;
  max-height: 266px;
  overflow-y: auto;
  font-size: .78rem;
}
.pie-legend-item{
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  margin-bottom: .38rem;
  line-height: 1.35;
}
.pie-legend-dot{
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: .28rem;
}
.pie-legend-name{
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-2);
  word-break: break-all;
}
.pie-legend-val{
  flex: 0 0 auto;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 420px){
  .pie-fallback{ flex-direction: column; align-items: center; }
  .pie-fallback-chart{ width: 168px; }
  .pie-fallback-legend{ width: 100%; max-height: 180px; }
}

.bar{
  display: flex;
  height: 7px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span{
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* ---- 走访/编辑表单 ---- */
.mobile-form .form-label{ font-weight: 500; margin-bottom: .25rem; font-size: .88rem; color: var(--text-2); }

/* 按内容宽度自适应、自动换行的字段网格 */
.field-grid{ display: flex; flex-wrap: wrap; gap: .9rem 1rem; }
.field-grid .fld{ display: flex; flex-direction: column; flex: 0 0 auto; max-width: 100%; }
.field-grid .fld > .form-label{ margin-bottom: .25rem; }
.field-grid .fld .form-control,
.field-grid .fld .form-select,
.field-grid .fld textarea{ width: 100%; }
.fld.w-xxs { width: 96px; }
.fld.w-xs  { width: 118px; }
.fld.w-sm  { width: 150px; }
.fld.w-md  { width: 190px; }
.fld.w-tel { width: 200px; }
.fld.w-lg  { width: 240px; }
.fld.w-xl  { width: 340px; }
.fld.w-addr{ width: 520px; }
.fld.w-full{ width: 100%; flex: 1 1 100%; }
.fld.grow  { flex: 1 1 auto; }
@media (max-width: 575.98px){
  .field-grid .fld{ width: 100% !important; flex: 1 1 100%; }
}
.mobile-form .form-control,
.mobile-form .form-select,
.mobile-form textarea{ font-size: 1rem; }

.geo-status{
  background: var(--info-soft);
  border: 1px dashed rgba(6,182,212,.45);
  border-radius: var(--radius-sm);
  padding: .65rem .8rem;
  font-size: .85rem;
  color: #0c4a6e;
}
.geo-status.success{ background: var(--success-soft); border-color: rgba(16,185,129,.45); color: #065f46; }
.geo-status.error{ background: var(--danger-soft); border-color: rgba(239,68,68,.45); color: #991b1b; }

/* ---- 模态框 ---- */
.modal-content{
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.modal-header{
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.modal-header .modal-title .bi{ color: var(--brand); }
.modal-footer{ border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-backdrop.show{ opacity: .55; background: #0b1426; }

/* ---- 登录页 ---- */
.login-wrap{
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(900px 640px at 80% -10%, rgba(37,99,235,.28), transparent 60%),
    radial-gradient(760px 540px at -10% 110%, rgba(6,182,212,.22), transparent 60%),
    linear-gradient(135deg, #0a1322 0%, #0d1b34 60%, #0a1730 100%);
  position: relative;
  overflow: hidden;
}
.login-wrap::before{
  content:''; position:absolute; inset:0;
  background-image:
    linear-gradient(rgba(120,160,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,160,255,.06) 1px, transparent 1px);
  background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%);
          mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%);
}
.login-card{
  position: relative;
  max-width: 410px; width: 100%;
  background: rgba(255,255,255,.96);
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-lg);
  padding: 2.4rem 2.1rem;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
.login-card h1{
  font-size: 1.18rem;
  text-align: center;
  margin-bottom: 1.7rem;
  font-weight: 700;
  letter-spacing: -.015em;
}
.login-card h1 .login-icon{
  display: inline-block;
  font-size: 1rem;
  margin-right: .35rem;
  vertical-align: middle;
}
.login-card h1 .bi{
  color: #fff;
  background: var(--brand);
  background: var(--grad-brand);
  padding: 9px;
  border-radius: 12px;
  font-size: 1rem;
  margin-right: .35rem;
  box-shadow: var(--glow-brand);
}
.login-card .mb-3{ margin-bottom: 1rem; }
.login-card .w-100{ width: 100%; }
.login-card .py-2{ padding-top: .5rem; padding-bottom: .5rem; }
.login-card .fw-semibold{ font-weight: 600; }
.login-card .alert-danger{
  background: var(--danger-soft);
  border: 1px solid rgba(239,68,68,.22);
  color: #b91c1c;
  border-radius: var(--radius-sm);
  font-size: .9rem;
}

/* ---- 警告条 ---- */
.alert{
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .9rem;
  padding: .75rem 1rem;
  box-shadow: var(--shadow-1);
}
.alert-success{ background: var(--success-soft); border-color: rgba(16,185,129,.22); color: #047857; }
.alert-danger{  background: var(--danger-soft);  border-color: rgba(239,68,68,.22); color: #b91c1c; }
.alert-warning{ background: var(--warning-soft); border-color: rgba(245,158,11,.25); color: #b45309; }
.alert-info{    background: var(--info-soft);    border-color: rgba(6,182,212,.22); color: #0369a1; }

/* ---- 文字工具类 ---- */
.text-muted { color: var(--text-muted) !important; }
.text-dark  { color: var(--text) !important; }
.small      { font-size: .82rem; }

/* footer */
footer{
  color: var(--text-soft);
  font-size: .78rem;
  padding: 2.5rem 0 1.5rem !important;
}

/* ---- 列表行号微调 ---- */
.table td.text-muted.small{ font-variant-numeric: tabular-nums; color: var(--text-soft); }

/* ---- 响应式 ---- */
@media (max-width: 991.98px){
  .navbar-collapse{
    padding: .5rem 0;
    border-top: 1px solid rgba(255,255,255,.10);
    margin-top: .4rem;
  }
}
@media (max-width: 576px){
  .kv{ grid-template-columns: 100px 1fr; gap: .4rem .8rem; }
  .table tbody td{ font-size: .82rem; padding: .55rem .5rem; }
  .table thead th{ font-size: .68rem; padding: .55rem .5rem; }
  .stat-card .value{ font-size: 1.55rem; }
  .card-body{ padding: .85rem .9rem; }
  .card-header{ padding: .75rem .9rem; }
}

/* 弹窗（iframe）嵌入模式 */
body.embed{
  background: #fff;
  background-image: none;
}
body.embed > main{
  padding-top: .5rem !important;
}
.frame-modal-iframe{
  width: 100%;
  height: 60vh;        /* 初始值，加载后按内容自适应 */
  max-height: 86vh;    /* 最高值，超出则内部滚动 */
  border: 0;
  display: block;
  background: #fff;
  transition: height .15s ease;
}
@media (max-width: 576px){
  .frame-modal-iframe{ height: 70vh; max-height: 88vh; }
}

/* =========================================================
   后台框架：左侧边栏 + 顶部条
   ========================================================= */
.bare-main{ min-height: 100vh; }

.app-shell{ display: flex; min-height: 100vh; }

/* ---- 侧边栏 ---- */
.sidebar{
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--nav-bg);
  color: var(--nav-text);
  display: flex; flex-direction: column;
  z-index: 1045;
  border-right: 1px solid rgba(120,160,255,.10);
  box-shadow: 4px 0 24px -16px rgba(2,8,23,.85);
}
.sidebar-brand{
  flex: 0 0 auto;
  display: flex; align-items: center; gap: .6rem;
  min-height: var(--topbar-h);
  padding: .55rem 1rem;
  color: #fff; font-weight: 700; font-size: 1.02rem;
  letter-spacing: -.01em;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .brand-logo{
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-brand);
  border-radius: 9px;
  color: #fff; font-size: 1rem;
  box-shadow: var(--glow-brand);
}
.sidebar-brand .brand-text{ display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand .brand-title{ font-size: 1.08rem; font-weight: 800; line-height: 1.2; letter-spacing: .02em; }
.sidebar-brand .brand-sub{ font-size: .74rem; font-weight: 500; line-height: 1.25; color: rgba(199,210,225,.7); white-space: normal; word-break: break-word; margin-top: 2px; }

.sidebar-nav{ flex: 1 1 auto; overflow-y: auto; padding: .7rem .6rem 1rem; }
.sidebar-nav::-webkit-scrollbar{ width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.14); border-radius: 3px; }

.nav-group-label{
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(199,210,225,.45);
  padding: .85rem .75rem .3rem;
  font-weight: 600;
}
.side-link{
  display: flex; align-items: center; gap: .7rem;
  padding: .58rem .75rem; margin: .12rem 0;
  border-radius: 10px;
  color: var(--nav-text); font-size: .9rem; font-weight: 500;
  text-decoration: none;
  transition: background .16s, color .16s, box-shadow .16s;
}
.side-link .bi{ font-size: 1.05rem; width: 1.25rem; text-align: center; opacity: .92; flex: 0 0 auto; }
.side-link > span:not(.side-badge){ flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-link:hover{ background: rgba(255,255,255,.07); color: #fff; }
.side-link:hover .bi{ opacity: 1; }
.side-link.active{ background: var(--brand); color: #fff; }
.side-link.active .bi{ opacity: 1; }
.side-link-sub{
  padding-left: 2.4rem;
  font-size: .92rem;
  opacity: .92;
}
.side-link-sub .bi{ font-size: .98rem; }
.side-link-sub.active{ opacity: 1; }
.side-badge{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  line-height: 1;
  background: var(--danger); color: #fff;
  font-size: .68rem; font-weight: 700;
  padding: .12rem .38rem; border-radius: 999px;
  box-shadow: 0 2px 8px -2px rgba(239,68,68,.6);
}
.sidebar-foot{ flex: 0 0 auto; padding: .55rem .6rem; border-top: 1px solid rgba(255,255,255,.08); }
.side-logout:hover{ background: rgba(239,68,68,.16); color: #fecaca; }
.side-logout:hover .bi{ color: #fecaca; }

.sidebar-overlay{ display: none; }

/* ---- 主区域 ---- */
.app-main{
  margin-left: var(--sidebar-w);
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.topbar{
  position: sticky; top: 0; z-index: 1020;
  height: var(--topbar-h);
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
          backdrop-filter: blur(10px) saturate(160%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .8rem;
  padding: 0 1.1rem;
}
.topbar-toggle{
  border: 0; background: transparent;
  font-size: 1.45rem; line-height: 1;
  color: var(--text-2); padding: .1rem .25rem;
}
.topbar-title h1{ font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--text); letter-spacing: -.01em; }
.topbar-spacer{ flex: 1 1 auto; }
.topbar-actions{ display: flex; align-items: center; gap: .35rem; }

.topbar-bell{
  position: relative;
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 1.1rem;
}
.topbar-bell:hover{ background: var(--surface-3); color: var(--brand); }
.bell-dot{
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 700; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.topbar-user .user-btn{
  display: flex; align-items: center; gap: .5rem;
  border: 0; background: transparent;
  padding: .25rem .45rem; border-radius: 10px;
}
.topbar-user .user-btn:hover{ background: var(--surface-3); }
.topbar-user .user-btn::after{ display: none; }
.user-avatar{
  flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow-brand);
}
.user-meta{ display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.user-name{ font-size: .85rem; font-weight: 600; color: var(--text); }
.user-role{ font-size: .7rem; color: var(--text-muted); }
.user-caret{ font-size: .7rem; color: var(--text-muted); }

.app-content{ flex: 1 1 auto; padding: 1.25rem; }
.app-footer{ flex: 0 0 auto; text-align: center; color: var(--text-soft); font-size: .78rem; padding: 1.2rem 1rem 1.6rem; }

@media (max-width: 991.98px){
  .sidebar{ transform: translateX(-100%); transition: transform .25s ease; }
  body.sidebar-open .sidebar{ transform: none; }
  .app-main{ margin-left: 0; }
  body.sidebar-open .sidebar-overlay{
    display: block; position: fixed; inset: 0;
    background: rgba(2,8,23,.5); z-index: 1044;
  }
  .topbar-user .user-meta{ display: none; }
}
@media (max-width: 575.98px){
  .app-content{ padding: .9rem; }
}

/* =========================================================
   房屋详情：概要卡 + 信息分区
   ========================================================= */
.detail-crumb{
  display: flex; align-items: center; gap: .5rem;
  font-size: .9rem; color: var(--text-muted);
}
.detail-crumb a{ color: var(--text-2); }
.detail-crumb a:hover{ color: var(--brand); }
.detail-crumb .crumb-back{
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text-2);
}
.detail-crumb .crumb-back:hover{ background: var(--brand-soft); color: var(--brand-2); border-color: var(--brand); }
.detail-crumb .sep{ font-size: .7rem; color: var(--text-soft); }
.detail-crumb .cur{ color: var(--text); font-weight: 600; }

@media (min-width: 992px){
  .detail-summary{ position: sticky; top: calc(var(--topbar-h) + 14px); }
}
.detail-summary{ overflow: hidden; }
.detail-summary .ds-cover{
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #e7eefb, #eef3fb);
}
.detail-summary .ds-cover > a, .detail-summary .ds-cover img{ display: block; width: 100%; height: 100%; }
.detail-summary .ds-cover img{ object-fit: cover; }
.ds-cover-empty{
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; color: var(--text-soft);
}
.ds-cover-empty .bi{ font-size: 2.4rem; opacity: .6; }
.ds-cover-empty span{ font-size: .82rem; }
.ds-rating{
  position: absolute; top: .6rem; left: .6rem;
  box-shadow: 0 4px 12px -4px rgba(15,23,42,.4);
}
.ds-count{
  position: absolute; bottom: .6rem; right: .6rem;
  background: rgba(15,23,42,.62); color: #fff;
  font-size: .72rem; font-weight: 600;
  padding: .12rem .5rem; border-radius: 999px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.detail-summary .ds-title{ font-weight: 800; font-size: 1.25rem; margin-bottom: .9rem; letter-spacing: -.01em; }
.detail-summary .ds-kv{ grid-template-columns: 92px 1fr; gap: .5rem .8rem; font-size: .88rem; }
.detail-summary .ds-actions{
  display: flex; gap: .5rem; margin-top: 1.1rem;
}
.detail-summary .ds-actions .btn-primary{ flex: 1 1 auto; }
.detail-summary .ds-actions .dropdown .btn{ white-space: nowrap; }

/* 信息网格：每行两组 标签/值 */
.info-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2.2rem;
}
.info-grid .it{
  display: flex; align-items: baseline; gap: .9rem;
  padding: .62rem 0;
  border-bottom: 1px dashed var(--border-strong);
  min-width: 0;
}
.info-grid .it.wide{ grid-column: 1 / -1; }
.info-grid .it .k{ flex: 0 0 auto; min-width: 76px; color: var(--text-muted); font-size: .86rem; }
.info-grid .it .v{ flex: 1 1 auto; min-width: 0; color: var(--text); font-weight: 600; font-size: .9rem; word-break: break-word; }
@media (max-width: 767.98px){
  .info-grid{ grid-template-columns: 1fr; gap: 0; }
}

/* 出租房列表地图模式 */
.list-map{
  height: min(68vh, 620px);
  min-height: 360px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  z-index: 0;
}
.list-map-popup{ min-width: 180px; max-width: 260px; }
.list-map-popup .btn{
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  text-decoration: none;
}
/* Leaflet 弹窗内 a 标签默认蓝色/青色，需覆盖为按钮白字 */
.leaflet-popup-content .list-map-popup a.btn-primary{
  color: #fff;
}
.leaflet-popup-content .list-map-popup a.btn-primary:hover,
.leaflet-popup-content .list-map-popup a.btn-primary:focus{
  color: #fff;
  text-decoration: none;
}
@media (max-width: 576px){
  .list-map{ height: 52vh; min-height: 280px; }
}

/* 详情页内嵌地图 */
.detail-map{
  height: 320px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  z-index: 0;
}
@media (max-width: 576px){
  .detail-map{ height: 240px; }
}

/* 地图选点 */
.map-picker .map-box{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem;
  background: #fff;
}
.map-picker .map-toolbar{
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.map-picker .map-coord{ font-variant-numeric: tabular-nums; }
.map-picker .leaflet-map{
  height: 440px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 0;
}
.map-picker .btn-group .btn.active{
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
}
@media (max-width: 576px){
  .map-picker .leaflet-map{ height: 320px; }
}
/* 采集坐标弹窗：固定头/尾，仅中间区域滚动，保证"保存坐标"按钮始终可见 */
#geoModal .modal-dialog{
  height: calc(100% - 1rem);
  max-height: calc(100% - 1rem);
  margin-top: .5rem; margin-bottom: .5rem;
}
#geoModal .modal-content{ max-height: 100%; overflow: hidden; }
#geoModal .modal-body{ overflow-y: auto; }
.modal .map-picker .leaflet-map{ height: 320px; }

/* 详情页：出租房照片相册 */
.detail-photos{ display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.detail-photos .dp-wrap,
.visit-photos .vp-wrap{ position: relative; display: block; }
.detail-photos .dp-del-form,
.visit-photos .dp-del-form{ position: absolute; top: 4px; right: 4px; z-index: 2; margin: 0; }
.detail-photos .dp-del,
.visit-photos .dp-del{
  width: 26px; height: 26px; padding: 0; border: none; border-radius: 50%;
  background: rgba(15,23,42,.72); color: #fff; font-size: 1.1rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.detail-photos .dp-del:hover,
.visit-photos .dp-del:hover{ background: #dc2626; }
.detail-photos .dp-item{
  position: relative; display: block; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden;
  background: #f1f5f9; border: 1px solid var(--border, #e5e9f0);
}
.detail-photos .dp-item img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-photos .dp-cap{
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px;
  font-size: .72rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 走访记录内的走访照片 */
.visit-photos{ display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.visit-photos .vp-label{ font-size: .74rem; color: #0ea5e9; margin-right: 2px; }
.visit-photos .vp-wrap{ width: 76px; height: 76px; }
.visit-photos a{ display: block; width: 100%; height: 100%; border-radius: 8px; overflow: hidden; border: 1px solid var(--border, #e5e9f0); }
.visit-photos img{ width: 100%; height: 100%; object-fit: cover; display: block; }
/* 走访记录列表：走访照片缩略图 */
.visit-thumbs{ display: inline-flex; align-items: center; gap: 4px; }
.visit-thumbs a{ display: block; width: 40px; height: 40px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border, #e5e9f0); }
.visit-thumbs img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.visit-thumbs .more{ font-size: .72rem; color: var(--muted, #94a3b8); }
.visit-photos a, .visit-thumbs a, .detail-photos .dp-item{ cursor: zoom-in; }

/* 本月村社走访：等宽网格，整齐排列 */
.novisit-villages{
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.novisit-villages .nv-chip{
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 8px 8px 14px; border-radius: 10px;
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  font-size: .86rem; text-decoration: none; transition: all .15s; overflow: hidden;
}
.novisit-villages .nv-chip:hover{ background: #ffedd5; border-color: #fdba74; }
.novisit-villages .nv-name{ font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.novisit-villages .nv-cnt{
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 22px; padding: 0 6px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
  background: #f97316; color: #fff; font-size: .76rem; font-weight: 600;
}
.novisit-villages .nv-chip.done{ background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.novisit-villages .nv-chip.done:hover{ background: #d1fae5; border-color: #6ee7b7; }
.novisit-villages .nv-chip.done .nv-cnt{ background: #10b981; }
.nv-collapsible{ transition: max-height .25s ease; }
.nv-collapsible.nv-collapsed{ overflow: hidden; position: relative; }
.nv-toggle-wrap{ text-align: center; margin-top: 10px; }
.nv-toggle-btn{
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  border-radius: 999px; padding: 4px 16px; font-size: .82rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
}
.nv-toggle-btn:hover{ color: var(--primary, #2563eb); border-color: var(--primary, #2563eb); background: #eff6ff; }

/* 图片放大弹窗 */
.photo-lightbox{ position: fixed; inset: 0; z-index: 20000; display: none; align-items: center; justify-content: center; background: rgba(15,23,42,.9); }
.photo-lightbox.show{ display: flex; }
.photo-lightbox .pl-img{ max-width: 92vw; max-height: 86vh; border-radius: 8px; background: #fff; box-shadow: 0 14px 44px rgba(0,0,0,.55); }
.photo-lightbox .pl-close{ position: absolute; top: 14px; right: 22px; color: #fff; font-size: 40px; line-height: 1; cursor: pointer; opacity: .85; }
.photo-lightbox .pl-close:hover{ opacity: 1; }
.photo-lightbox .pl-nav{ position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 32px; cursor: pointer; padding: 14px 18px; opacity: .8; user-select: none; }
.photo-lightbox .pl-nav:hover{ opacity: 1; }
.photo-lightbox .pl-prev{ left: 6px; }
.photo-lightbox .pl-next{ right: 6px; }
.photo-lightbox .pl-cap{ position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; font-size: .85rem; padding: 0 16px; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
