:root {
    --primary: #C41E3A;
    --primary-dark: #A01830;
    --primary-light: #F8E8EC;
    --primary-gradient: linear-gradient(135deg, #C41E3A 0%, #E85D75 100%);
    --bg: #F5F6FA;
    --sidebar-bg: #FFFFFF;
    --sidebar-hover: #FFF5F6;
    --sidebar-active-bg: #C41E3A;
    --sidebar-text: #5A5A6E;
    --sidebar-border: #F0F0F5;
    --card-bg: #FFFFFF;
    --text-primary: #2D3436;
    --text-muted: #8B8FA3;
    --border: #E8ECF1;
    --shadow: 0 2px 12px rgba(196, 30, 58, 0.06);
    --shadow-lg: 0 8px 32px rgba(196, 30, 58, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ========== 侧边栏 ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    text-align: center;
}

.sidebar-header img {
    border-radius: var(--radius-sm);
}

.sidebar-header h5 {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
    margin-top: 8px;
    margin-bottom: 2px;
}

.sidebar-header small {
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav li a.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.sidebar-nav li a.nav-link:hover {
    color: var(--primary);
    background: var(--sidebar-hover);
    border-left-color: var(--primary);
}

.sidebar-nav li a.nav-link.active {
    color: #fff;
    background: var(--primary);
    border-left-color: var(--primary);
    border-radius: 0;
}

.sidebar-nav li a.nav-link i {
    font-size: 17px;
    width: 20px;
    text-align: center;
}

.nav-section {
    padding: 20px 24px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.user-info i {
    color: var(--primary);
    font-size: 20px;
}

.user-info small {
    color: var(--text-muted);
    margin-left: auto;
    font-size: 12px;
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* ========== 主内容区 ========== */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 20px;
}

.topbar-right .text-muted {
    font-size: 13px;
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: 6px;
    color: var(--primary);
    font-weight: 500;
}

/* ========== 页面头部 ========== */
.page-header {
    margin-bottom: 24px;
}

.page-header h4 {
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    font-size: 20px;
}

/* ========== 卡片 ========== */
.card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    font-weight: 600;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ========== 统计卡片 ========== */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
}

.stat-number {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ========== 表格 ========== */
.table {
    font-size: 14px;
    margin-bottom: 0;
}

.table thead th {
    background: #FAFBFD;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
    padding: 12px 16px;
    text-transform: none;
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: var(--border);
}

.table-hover tbody tr:hover {
    background: #FFF9FA;
}

/* ========== 按钮 ========== */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-outline-danger {
    border-radius: var(--radius-sm);
}

.btn-outline-success {
    border-radius: var(--radius-sm);
}

.btn-outline-secondary {
    border-radius: var(--radius-sm);
}

.btn-outline-warning {
    border-radius: var(--radius-sm);
}

.btn-outline-info {
    border-radius: var(--radius-sm);
}

/* ========== 登录页 ========== */
.login-body {
    background: linear-gradient(160deg, #FFF 0%, #FFF5F6 40%, #FFE8EC 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(196, 30, 58, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.login-body::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(196, 30, 58, 0.04) 0%, transparent 70%);
    border-radius: 50%;
}

.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(196, 30, 58, 0.1), 0 0 0 1px rgba(196, 30, 58, 0.05);
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 44px 40px 28px;
}

.login-logo-default {
    width: 72px;
    height: 72px;
    background: var(--primary-gradient);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(196, 30, 58, 0.3);
}

.login-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 2px;
}

.login-form {
    padding: 0 40px 32px;
}

.login-form .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-form .form-control {
    border-radius: 10px;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    font-size: 14px;
    transition: all 0.2s ease;
    background: #FAFBFD;
}

.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.08);
    background: #fff;
}

.login-form .input-group-text {
    border-radius: 10px 0 0 10px;
    background: #FAFBFD;
    border: 1.5px solid var(--border);
    border-right: none;
    color: var(--text-muted);
    font-size: 16px;
    padding: 12px 14px;
}

.login-form .input-group .form-control {
    border-radius: 0 10px 10px 0;
    border-left: none;
}

.login-form .input-group .form-control:focus {
    border-left: none;
}

.btn-login {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 4px;
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.35);
    transition: all 0.3s ease;
}

.btn-login:hover {
    box-shadow: 0 8px 28px rgba(196, 30, 58, 0.45);
    transform: translateY(-1px);
    background: var(--primary-gradient);
}

.login-footer {
    text-align: center;
    padding: 20px 40px 28px;
    font-size: 12px;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: var(--primary);
}

/* ========== 强制改密码页 ========== */
.login-card .alert {
    border-radius: 10px;
    margin: 0 40px 16px;
    font-size: 14px;
}

/* ========== Badge ========== */
.badge {
    font-weight: 600;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
}

/* ========== 表单 ========== */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.08);
}

.form-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

/* ========== 分页 ========== */
.page-link {
    color: var(--primary);
    border-radius: 8px !important;
    margin: 0 2px;
    border: none;
    font-weight: 500;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

/* ========== Alert ========== */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
}

.alert-success {
    background: #F0FFF4;
    color: #22543D;
}

.alert-danger {
    background: #FFF5F5;
    color: #9B1C1C;
}

.alert-warning {
    background: #FFFBEB;
    color: #92400E;
}

.alert-info {
    background: #EBF8FF;
    color: #2B6CB0;
}


/* ========== 动画 ========== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.stat-card {
    animation: fadeUp 0.35s ease;
}

.stat-card:nth-child(2) {
    animation-delay: 0.05s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(5) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(6) {
    animation-delay: 0.25s;
}

/* ==================== 移动端响应式 ==================== */

/* 侧边栏遮罩 */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* 移动端侧边栏 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 1050;
        transition: left 0.3s ease;
        box-shadow: none;
    }

    .sidebar.mobile-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .topbar {
        padding: 0 12px;
    }

    .page-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start !important;
    }

    .page-header>div {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .page-header .btn {
        font-size: 13px;
        padding: 6px 12px;
    }

    h4 {
        font-size: 18px;
    }

    /* 表格优化 */
    .table-responsive {
        border: none;
    }

    .table {
        font-size: 13px;
    }

    .table th,
    .table td {
        padding: 8px 6px;
        white-space: nowrap;
    }

    .table .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }

    /* 表单优化 */
    .form-control,
    .form-select {
        font-size: 16px;
        /* 防止iOS缩放 */
        padding: 10px 12px;
    }

    .form-check-label {
        font-size: 14px;
    }

    .form-check-input {
        width: 18px;
        height: 18px;
    }

    /* 卡片优化 */
    .card {
        margin-bottom: 12px;
    }

    .card-body {
        padding: 12px;
    }

    .card-footer {
        padding: 10px 12px;
    }

    /* 分页优化 */
    .pagination {
        flex-wrap: wrap;
    }

    .page-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* 按钮优化 - 增大触控区域 */
    .btn {
        min-height: 40px;
    }

    .btn-sm {
        min-height: 36px;
    }

    /* 筛选表单 */
    .card-body .row.g-3 {
        gap: 8px !important;
    }

    .card-body .row.g-3 .col-md-4,
    .card-body .row.g-3 .col-md-3,
    .card-body .row.g-3 .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .card-body .row.g-2>[class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 8px;
    }

    /* 弹窗优化 */
    .modal-dialog {
        margin: 10px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-body .row .col-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* 导入映射表格 */
    .mapping-matched td,
    .mapping-unmatched td,
    .mapping-skip td {
        padding: 10px 8px;
    }

    .field-select {
        font-size: 14px;
    }

    /* 摘要栏 */
    .summary-bar {
        flex-wrap: wrap;
        gap: 12px !important;
        padding: 10px 14px !important;
    }

    /* 重复处理卡片 */
    .dup-section .row.g-3>[class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 8px;
    }

    /* 用户表单 */
    .form-row {
        grid-template-columns: 1fr !important;
    }

    .form-row.two-col {
        grid-template-columns: 1fr !important;
    }

    .community-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* 侧边栏导航触控优化 */
    .sidebar-nav .nav-link {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .modal-body .row .col-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .community-grid {
        grid-template-columns: 1fr !important;
    }

    .dup-section .row {
        gap: 6px;
    }

    .dup-section .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .btn-group-actions {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
}

/* ==================== 手机端表格列隐藏 ==================== */
@media (max-width: 768px) {

    /* 走访列表 - 保留: 勾选(1), 日期(3), 门牌号(8), 状态(9), 操作(13) */
    .homevisit-table th:nth-child(2),
    .homevisit-table td:nth-child(2),
    .homevisit-table th:nth-child(4),
    .homevisit-table td:nth-child(4),
    .homevisit-table th:nth-child(5),
    .homevisit-table td:nth-child(5),
    .homevisit-table th:nth-child(6),
    .homevisit-table td:nth-child(6),
    .homevisit-table th:nth-child(7),
    .homevisit-table td:nth-child(7),
    .homevisit-table th:nth-child(10),
    .homevisit-table td:nth-child(10),
    .homevisit-table th:nth-child(11),
    .homevisit-table td:nth-child(11),
    .homevisit-table th:nth-child(12),
    .homevisit-table td:nth-child(12) {
        display: none !important;
    }

    /* 一户一档 - 保留: 勾选(1), 门牌号(6), 状态(8), 走访次数(11) */
    .tracker-table th:nth-child(2),
    .tracker-table td:nth-child(2),
    .tracker-table th:nth-child(3),
    .tracker-table td:nth-child(3),
    .tracker-table th:nth-child(4),
    .tracker-table td:nth-child(4),
    .tracker-table th:nth-child(5),
    .tracker-table td:nth-child(5),
    .tracker-table th:nth-child(7),
    .tracker-table td:nth-child(7),
    .tracker-table th:nth-child(9),
    .tracker-table td:nth-child(9),
    .tracker-table th:nth-child(10),
    .tracker-table td:nth-child(10),
    .tracker-table th:nth-child(12),
    .tracker-table td:nth-child(12),
    .tracker-table th:nth-child(13),
    .tracker-table td:nth-child(13) {
        display: none !important;
    }

    /* 居民管理 - 保留: 勾选(1), 编辑(2), 姓名(9), 身份证(11), 联系电话(13) */
    .resident-table th:nth-child(3),
    .resident-table td:nth-child(3),
    .resident-table th:nth-child(4),
    .resident-table td:nth-child(4),
    .resident-table th:nth-child(5),
    .resident-table td:nth-child(5),
    .resident-table th:nth-child(6),
    .resident-table td:nth-child(6),
    .resident-table th:nth-child(7),
    .resident-table td:nth-child(7),
    .resident-table th:nth-child(8),
    .resident-table td:nth-child(8),
    .resident-table th:nth-child(10),
    .resident-table td:nth-child(10),
    .resident-table th:nth-child(12),
    .resident-table td:nth-child(12),
    .resident-table th:nth-child(14),
    .resident-table td:nth-child(14),
    .resident-table th:nth-child(15),
    .resident-table td:nth-child(15),
    .resident-table th:nth-child(16),
    .resident-table td:nth-child(16),
    .resident-table th:nth-child(17),
    .resident-table td:nth-child(17),
    .resident-table th:nth-child(18),
    .resident-table td:nth-child(18),
    .resident-table th:nth-child(19),
    .resident-table td:nth-child(19),
    .resident-table th:nth-child(20),
    .resident-table td:nth-child(20),
    .resident-table th:nth-child(21),
    .resident-table td:nth-child(21),
    .resident-table th:nth-child(22),
    .resident-table td:nth-child(22),
    .resident-table th:nth-child(23),
    .resident-table td:nth-child(23),
    .resident-table th:nth-child(24),
    .resident-table td:nth-child(24),
    .resident-table th:nth-child(25),
    .resident-table td:nth-child(25),
    .resident-table th:nth-child(26),
    .resident-table td:nth-child(26),
    .resident-table th:nth-child(27),
    .resident-table td:nth-child(27),
    .resident-table th:nth-child(28),
    .resident-table td:nth-child(28) {
        display: none !important;
    }

    /* 走访表单居民表 - 保留: 姓名(1), 身份证(3), 联系电话(5), 操作(18) */
    .res-table th:nth-child(2),
    .res-table td:nth-child(2),
    .res-table th:nth-child(4),
    .res-table td:nth-child(4),
    .res-table th:nth-child(6),
    .res-table td:nth-child(6),
    .res-table th:nth-child(7),
    .res-table td:nth-child(7),
    .res-table th:nth-child(8),
    .res-table td:nth-child(8),
    .res-table th:nth-child(9),
    .res-table td:nth-child(9),
    .res-table th:nth-child(10),
    .res-table td:nth-child(10),
    .res-table th:nth-child(11),
    .res-table td:nth-child(11),
    .res-table th:nth-child(12),
    .res-table td:nth-child(12),
    .res-table th:nth-child(13),
    .res-table td:nth-child(13),
    .res-table th:nth-child(14),
    .res-table td:nth-child(14),
    .res-table th:nth-child(15),
    .res-table td:nth-child(15),
    .res-table th:nth-child(16),
    .res-table td:nth-child(16),
    .res-table th:nth-child(17),
    .res-table td:nth-child(17) {
        display: none !important;
    }

    /* 走访表单移动端优化 */
    .visit-form-section .row>[class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 8px;
    }

    .visit-form-section .row {
        gap: 0 !important;
    }

    /* 走访表单提交按钮 */
    .visit-submit-btns {
        flex-direction: column;
    }

    .visit-submit-btns .btn,
    .visit-submit-btns a {
        width: 100%;
        text-align: center;
    }

    /* 筛选弹窗表单 */
    .filter-form .col-md-4,
    .filter-form .col-md-3,
    .filter-form .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 8px;
    }

    /* 操作按钮组 */
    .action-btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .action-btn-group .btn {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        font-size: 12px;
        padding: 6px 8px;
    }

    /* 表格行高优化 */
    .data-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .data-table thead th {
        padding: 10px 8px;
        font-size: 12px;
    }

    /* Badge在表格中 */
    .data-table .badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* 走访表单 - 级联选择器 */
    .cascade-selects .col-md,
    .cascade-selects .col-lg {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* 统计卡片 */
    .stat-card {
        padding: 14px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 10px;
    }

    .stat-number {
        font-size: 22px;
    }

    .stat-label {
        font-size: 12px;
    }

    /* 详情弹窗 */
    .detail-content table th,
    .detail-content table td {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* 小屏手机补充 */
@media (max-width: 480px) {

    /* 走访列表 - 更小屏幕再多隐藏门牌号 */
    .homevisit-table th:nth-child(8),
    .homevisit-table td:nth-child(8) {
        display: none !important;
    }

    /* 操作按钮改为竖排 */
    .action-btn-group {
        flex-direction: column;
    }
}

/* ====== 手机端卡片视图 ====== */
.mobile-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
    border: 1px solid #f0f0f0;
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.mobile-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d3436;
}

.mobile-card-badges {
    display: flex;
    gap: 4px;
    align-items: center;
}

.mobile-card-addr {
    font-size: 13px;
    color: #888;
    margin-bottom: 6px;
}

.mobile-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    font-size: 13px;
    color: #555;
}

.mobile-card-grid .mc-label {
    color: #999;
    margin-right: 4px;
}

.mobile-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

/* FAB 悬浮按钮 */
.fab-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C41E3A, #E85D75);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(196, 30, 58, 0.4);
    z-index: 100;
    text-decoration: none;
    transition: all .2s ease;
    border: none;
}

.fab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.5);
    color: #fff;
}

/* 级联筛选移动端 */
.cf-addr-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .cf-addr-panel {
        display: none !important;
    }

    .cf-addr-panel.cf-show {
        display: flex !important;
    }

    .cf-addr-panel select {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        font-size: 14px;
    }
}

/* 居民管理筛选移动端 */
.resident-addr-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .resident-addr-panel {
        display: none !important;
    }

    .resident-addr-panel.ra-show {
        display: flex !important;
    }

    .resident-addr-panel select {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        font-size: 14px;
    }

    /* 居民管理表格区域解除固定高度 */
    .mobile-scroll-override .table-scroll {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }
}