/* 全局样式 */
:root {
    --primary-color: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #334155;
    padding-top: 72px; /* 为固定导航栏留出空间 */
}

/* 隐藏浏览器默认的全屏退出按钮 */
::backdrop {
    background-color: transparent;
}

:fullscreen::backdrop,
:-webkit-full-screen::backdrop,
:-moz-full-screen::backdrop,
:-ms-fullscreen::backdrop {
    background-color: transparent;
}

/* 隐藏全屏时的默认退出按钮 */
video::-webkit-media-controls-fullscreen-button,
video::-webkit-media-controls-panel,
*::-webkit-full-screen-ancestor:not(iframe) {
    display: none !important;
}

/* 导航栏 */
.bg-dark-custom {
    background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff !important;
    pointer-events: none; /* 禁止点击 */
}

.navbar-brand img {
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

/* LOGO白色圆角底框样式 */
.logo-with-bg {
    background: white;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.logo-with-bg-small {
    background: white;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 系统标题样式 */
.system-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
}

/* 公司名称样式 */
.company-name {
    font-size: 1.05rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
    line-height: 1;
}

/* 天气信息样式 */
.weather-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.weather-info:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.weather-info i {
    margin-right: 4px;
    color: #fbbf24;
}

/* 天气详情弹窗 */
.weather-detail {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 16px;
    min-width: 280px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideDown 0.3s ease;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-info:hover .weather-detail {
    display: block;
}

/* 天气详情项 */
.weather-detail-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    transition: all 0.2s ease;
}

.weather-detail-item:last-child {
    margin-bottom: 0;
}

.weather-detail-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(3px);
}

.weather-detail-item i {
    width: 24px;
    margin-right: 10px;
    color: #fbbf24;
    font-size: 14px;
}

.weather-detail-item span {
    flex: 1;
    font-weight: 500;
}

/* 下滑动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 小三角指示符 */
.weather-detail::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #667eea;
}

/* 统计卡片 */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: visible;
    z-index: 1; /* 确保不被其他元素遮挡 */
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--card-color) 0%, transparent 100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
    z-index: 100; /* 悬停时提升层级 */
}

/* 自定义 Tooltip 容器 */
.tooltip-container {
    position: relative;
    z-index: 2; /* 提高容器层级 */
}

/* 移动端点击时提升卡片层级 */
.stat-card:active,
.stat-card:focus-within {
    z-index: 100;
}

.custom-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 99999; /* 超高层级，确保在最上层 */
    min-width: 320px;
    max-width: 350px;
    text-align: left;
    animation: fadeInUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none; /* 防止tooltip阻挡点击 */
}

.tooltip-container:hover .custom-tooltip {
    display: block;
}

/* 移动端触摸显示tooltip */
@media (max-width: 991px) {
    .tooltip-container {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
    }
    
    /* 移动端点击显示tooltip */
    .tooltip-container.active .custom-tooltip {
        display: block;
    }
    
    .custom-tooltip {
        position: fixed; /* 使用fixed定位，避免被遮挡 */
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin-top: 0;
        max-width: 90vw;
        min-width: 280px;
        z-index: 99999;
        pointer-events: auto; /* 允许点击关闭 */
        animation: fadeInScale 0.3s ease;
    }
    
    .custom-tooltip::before {
        display: none; /* 移动端隐藏小三角 */
    }
    
    /* 添加半透明遮罩效果 */
    .tooltip-container.active::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 99998;
        animation: fadeIn 0.3s ease;
    }
    
    /* 确保tooltip在遮罩之上 */
    .tooltip-container.active .custom-tooltip {
        z-index: 99999;
    }
}

/* 移动端tooltip动画 */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 小三角指示符（指向上方） */
.custom-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #667eea;
}

/* Tooltip 动画（从上往下） */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.card-primary::before { --card-color: var(--primary-color); }
.card-success::before { --card-color: var(--success-color); }
.card-warning::before { --card-color: var(--warning-color); }
.card-info::before { --card-color: var(--info-color); }
/* 已完工小区卡片 - 紫色 */
.card-completed::before { --card-color: #8b5cf6; } /* 紫色用于已完工 */
.card-accepted::before { --card-color: #059669; } /* 深绿色用于已验收 */

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.card-primary .stat-icon { background: linear-gradient(135deg, var(--primary-color), #3b82f6); }
.card-success .stat-icon { background: linear-gradient(135deg, var(--success-color), #34d399); }
.card-warning .stat-icon { background: linear-gradient(135deg, var(--warning-color), #fbbf24); }
.card-info .stat-icon { background: linear-gradient(135deg, var(--info-color), #22d3ee); }
/* 已完工小区图标渐变 - 紫色 */
.card-completed .stat-icon { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.card-accepted .stat-icon { background: linear-gradient(135deg, #059669, #10b981); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    margin-top: 5px;
}

/* 图表卡片 */
.chart-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    height: 100%;
}

.chart-header {
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.chart-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
}

.chart-header i {
    color: var(--primary-color);
    margin-right: 8px;
}

/* 筛选卡片 */
.filter-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

/* 筛选区域标签样式 */
.filter-card .form-label {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 5px;
    display: block;
}

/* 操作按钮行 - 自动平均分布 */
.filter-card .row:last-child {
    display: flex;
    flex-wrap: wrap;
}

.filter-card .row:last-child > div {
    flex: 1;
    min-width: 200px;
}

/* 桌面端按钮平均分布 */
@media (min-width: 768px) {
    .filter-card .row:last-child > div {
        flex: 1 1 0;
        max-width: none;
    }
}

/* 表格卡片 */
.table-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

/* 表格响应式容器 */
.table-responsive {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    /* 防止滚动条闪动 */
    will-change: scroll-position;
}

/* 表格容器允许子元素溢出 */
.table-responsive .table {
    overflow: visible;
    /* 防止表格重绘导致滚动条闪动 */
    transform: translateZ(0);
    /* 确保表格有最小宽度 */
    width: max-content;
    min-width: 100%;
}

.table-responsive tbody {
    overflow: visible;
}

.table-responsive tbody tr {
    overflow: visible;
}

.table-responsive tbody td {
    overflow: visible;
}

/* 固定列样式 - 序号和小区名称 */
.table thead th:nth-child(1),
.table thead th:nth-child(2),
.table tbody td:nth-child(1),
.table tbody td:nth-child(2) {
    position: sticky;
    background: white;
    z-index: 10;
    /* 使用硬件加速，防止闪动 */
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* 防止子像素渲染问题 */
    -webkit-font-smoothing: antialiased;
    /* 防止模糊 */
    perspective: 1000px;
}

/* 序号列固定在最左侧 */
.table thead th:nth-child(1),
.table tbody td:nth-child(1) {
    left: 0;
    /* 使用更轻的阴影，减少重绘 */
    box-shadow: 1px 0 2px rgba(0, 0, 0, 0.05);
}

/* 小区名称列固定在序号列右侧 */
.table thead th:nth-child(2),
.table tbody td:nth-child(2) {
    left: 40px; /* 序号列宽度 */
    /* 使用更轻的阴影，减少重绘 */
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.06);
}

/* 表头固定列背景色 */
.table thead th:nth-child(1),
.table thead th:nth-child(2) {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

/* 斑马纹行的固定列背景色 - 使用完全不透明的颜色 */
.table-striped tbody tr:nth-of-type(odd) td:nth-child(1),
.table-striped tbody tr:nth-of-type(odd) td:nth-child(2) {
    background-color: #fafbfc; /* 完全不透明的浅色 */
}

.table-striped tbody tr:nth-of-type(even) td:nth-child(1),
.table-striped tbody tr:nth-of-type(even) td:nth-child(2) {
    background-color: #f1f5f9; /* 完全不透明的稍深色 */
}

/* 鼠标悬停时固定列也要变色 - 使用完全不透明的颜色 */
.table tbody tr:hover td:nth-child(1),
.table tbody tr:hover td:nth-child(2) {
    background-color: #dbeafe !important; /* 完全不透明的蓝色 */
}

/* 固定列视觉提示 - 添加右边框 */
.table thead th:nth-child(2),
.table tbody td:nth-child(2) {
    border-right: 2px solid #cbd5e1;
}

/* 可点击表格行样式 */
.project-row-clickable {
    transition: all 0.2s ease;
}

.project-row-clickable:hover {
    background-color: #f0f9ff !important;
    transform: translateX(3px);
    box-shadow: -3px 0 0 0 #2563eb;
}

/* 可点击行悬停时固定列也使用不透明背景 */
.project-row-clickable:hover td:nth-child(1),
.project-row-clickable:hover td:nth-child(2) {
    background-color: #f0f9ff !important;
}

.project-row-clickable:active {
    transform: translateX(1px);
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.table thead th {
    font-size: 12px;
    font-weight: 600;
    color: var(--dark-color);
    border: none;
    padding: 10px 4px;
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 表头固定后的阴影效果 */
.table-responsive.scrolled .table thead th {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table tbody td {
    padding: 8px 4px;
    vertical-align: middle;
    font-size: 12px;
    text-align: center;
    height: 52px;
    line-height: 1.2;
}

/* 斑马纹效果，方便查看 */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(248, 250, 252, 0.5);
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: rgba(241, 245, 249, 0.5);
}

.table tbody tr {
    transition: all 0.2s ease;
}

/* 鼠标悬停淡蓝色背景，更显眼 */
.table tbody tr:hover {
    background-color: #dbeafe !important; /* 完全不透明的淡蓝色 */
    transform: scale(1.002);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

/* 进度条 */
.progress-cell {
    min-width: 95px;
}

.progress {
    height: 16px;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.progress-bar {
    font-size: 10px;
    font-weight: 600;
    transition: width 0.6s ease;
    line-height: 16px;
}

/* 已施工栋数徽章 */
.badge {
    font-size: 10px;
    padding: 2px 5px;
    font-weight: 600;
    white-space: nowrap;
}

/* 已施工栋数自定义颜色：醒目的蓝绿色 */
.bg-info-custom {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4) !important;
    color: white;
    box-shadow: 0 1px 3px rgba(6, 182, 212, 0.3);
}

/* 备注栏样式 */
.remarks-cell {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remarks-cell:hover {
    background-color: rgba(254, 249, 195, 0.3);
}

/* 小区名称栏样式 */
.community-name-cell {
    max-width: 120px;
    min-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-name-cell strong {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.community-name-cell:hover {
    background-color: rgba(224, 242, 254, 0.4);
}

.progress-bar-success { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-bar-warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-bar-danger { background: linear-gradient(90deg, #ef4444, #f87171); }
.progress-bar-info { background: linear-gradient(90deg, #06b6d4, #22d3ee); }

/* 按钮样式 */
.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #f87171);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #22d3ee);
    border: none;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

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

/* 表单样式 */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--dark-color);
    margin-bottom: 5px;
}

/* 模态框 */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom: 2px solid #cbd5e1;
}

.modal-title {
    font-weight: 600;
    color: var(--dark-color);
}

/* 徽章样式 */
.badge {
    padding: 5px 10px;
    font-weight: 500;
    border-radius: 6px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .system-title {
        font-size: 1.15rem;
    }
    
    .company-name {
        font-size: 0.95rem;
    }
}

@media (max-width: 991px) {
    body {
        padding-top: 60px;
    }
    
    .navbar-brand img {
        height: 50px !important;
        margin-right: 8px !important;
    }
    
    .system-title {
        font-size: 0.95rem;
        line-height: 1.2;
    }
    
    .company-name {
        font-size: 0.85rem;
        margin-top: 1px;
    }
    
    .weather-info {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    #fullscreenBtn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    #fullscreenText {
        display: none;
    }
    
    .stat-card {
        margin-bottom: 15px;
        padding: 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    .chart-card {
        margin-bottom: 15px;
        padding: 15px;
    }
    
    .chart-header h5 {
        font-size: 15px;
    }
    
    #progressChart,
    #contractorChart {
        height: 300px !important;
    }
    
    .filter-card {
        padding: 15px;
    }
    
    .filter-card .col-md-3,
    .filter-card .col-md-2 {
        margin-bottom: 10px;
    }
    
    .table-card {
        padding: 10px;
    }
    
    .table {
        font-size: 11px;
    }
    
    .table thead th {
        padding: 8px 3px;
        font-size: 11px;
    }
    
    .table tbody td {
        padding: 6px 3px;
        font-size: 11px;
        height: auto;
    }
    
    /* 移动端固定列宽度调整 */
    .table thead th:nth-child(1),
    .table tbody td:nth-child(1) {
        left: 0;
        min-width: 35px;
        width: 35px;
    }
    
    .table thead th:nth-child(2),
    .table tbody td:nth-child(2) {
        left: 35px;
        min-width: 90px;
        max-width: 90px;
    }
    
    .progress {
        height: 14px;
    }
    
    .progress-bar {
        font-size: 9px;
        line-height: 14px;
    }
    
    .badge {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .btn-sm {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    .community-name-cell,
    .remarks-cell {
        max-width: 100px;
        min-width: 80px;
    }
    
    .footer {
        padding: 12px 0;
        margin-top: 30px;
    }
    
    .footer p {
        font-size: 12px;
        flex-direction: column;
        gap: 8px !important;
    }
    
    .footer img {
        height: 36px !important;
    }
    
    .footer strong {
        font-size: 0.9rem;
    }
    
    /* 模态框优化 */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-body .row .col-md-3,
    .modal-body .row .col-md-4,
    .modal-body .row .col-md-6 {
        margin-bottom: 10px;
    }
    
    .modal-body h6 {
        font-size: 14px;
        margin-top: 15px;
        margin-bottom: 10px;
    }
    
    /* Tooltip 移动端优化 */
    .custom-tooltip {
        min-width: 280px;
        max-width: 90vw;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .weather-detail {
        min-width: 240px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 55px;
    }
    
    .navbar-brand {
        font-size: 0.85rem;
    }
    
    .navbar-brand img {
        height: 42px !important;
        margin-right: 6px !important;
    }
    
    .system-title {
        font-size: 0.8rem;
    }
    
    .company-name {
        font-size: 0.75rem;
    }
    
    .weather-info {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    #fullscreenBtn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .stat-card {
        padding: 12px;
        gap: 10px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .chart-card {
        padding: 12px;
    }
    
    #progressChart,
    #contractorChart {
        height: 250px !important;
    }
    
    .table {
        font-size: 10px;
    }
    
    .table thead th {
        padding: 6px 2px;
        font-size: 10px;
        line-height: 1.1;
    }
    
    .table tbody td {
        padding: 5px 2px;
        font-size: 10px;
    }
    
    /* 768px固定列宽度调整 */
    .table thead th:nth-child(1),
    .table tbody td:nth-child(1) {
        left: 0;
        min-width: 32px;
        width: 32px;
    }
    
    .table thead th:nth-child(2),
    .table tbody td:nth-child(2) {
        left: 32px;
        min-width: 80px;
        max-width: 80px;
    }
    
    .progress {
        height: 12px;
    }
    
    .progress-bar {
        font-size: 8px;
        line-height: 12px;
    }
    
    .badge {
        font-size: 8px;
        padding: 1px 3px;
    }
    
    .btn-sm {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    .community-name-cell,
    .remarks-cell {
        max-width: 80px;
        min-width: 60px;
    }
    
    .footer {
        padding: 10px 0;
        margin-top: 20px;
    }
    
    .footer p {
        font-size: 11px;
    }
    
    .footer img {
        height: 32px !important;
    }
    
    /* 表格横向滚动提示 */
    .table-responsive::after {
        content: '← 左右滑动查看更多 →';
        display: block;
        text-align: center;
        padding: 8px;
        font-size: 11px;
        color: #64748b;
        background: #f8fafc;
        border-top: 1px solid #e2e8f0;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 50px;
    }
    
    .navbar {
        padding: 8px 10px;
    }
    
    .navbar-brand {
        font-size: 0.75rem;
    }
    
    .navbar-brand img {
        height: 36px !important;
        margin-right: 5px !important;
    }
    
    .system-title {
        font-size: 0.7rem;
        line-height: 1.1;
    }
    
    .company-name {
        font-size: 0.65rem;
    }
    
    .navbar-text {
        gap: 8px !important;
    }
    
    .weather-info {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    #fullscreenBtn {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .container-fluid {
        padding: 10px;
    }
    
    .stat-card {
        padding: 10px;
        gap: 8px;
        flex-direction: row;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .chart-card {
        padding: 10px;
    }
    
    .chart-header {
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    
    .chart-header h5 {
        font-size: 13px;
    }
    
    #progressChart,
    #contractorChart {
        height: 220px !important;
    }
    
    .filter-card {
        padding: 10px;
    }
    
    .filter-card .btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .table-card {
        padding: 5px;
    }
    
    .table {
        font-size: 9px;
    }
    
    .table thead th {
        padding: 5px 1px;
        font-size: 9px;
    }
    
    .table tbody td {
        padding: 4px 1px;
        font-size: 9px;
    }
    
    /* 576px固定列宽度调整 */
    .table thead th:nth-child(1),
    .table tbody td:nth-child(1) {
        left: 0;
        min-width: 28px;
        width: 28px;
    }
    
    .table thead th:nth-child(2),
    .table tbody td:nth-child(2) {
        left: 28px;
        min-width: 70px;
        max-width: 70px;
    }
    
    .progress {
        height: 10px;
        min-width: 50px;
    }
    
    .progress-bar {
        font-size: 7px;
        line-height: 10px;
    }
    
    .badge {
        font-size: 7px;
        padding: 1px 2px;
    }
    
    .btn-sm {
        padding: 2px 4px;
        font-size: 9px;
    }
    
    .community-name-cell,
    .remarks-cell {
        max-width: 60px;
        min-width: 50px;
        font-size: 9px;
    }
    
    .footer {
        padding: 8px 0;
        margin-top: 15px;
    }
    
    .footer p {
        font-size: 10px;
    }
    
    .footer img {
        height: 28px !important;
    }
    
    .footer strong {
        font-size: 0.8rem;
    }
    
    /* 模态框全屏显示 */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }
    
    .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    .modal-body {
        overflow-y: auto;
        padding: 10px;
    }
    
    .modal-body .form-label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .modal-body .form-control,
    .modal-body .form-select {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .modal-body h6 {
        font-size: 13px;
        margin-top: 12px;
        margin-bottom: 8px;
    }
    
    /* Tooltip 小屏幕优化 */
    .custom-tooltip {
        min-width: 260px;
        padding: 10px;
        font-size: 11px;
    }
    
    .weather-detail {
        min-width: 220px;
        padding: 12px;
    }
    
    .weather-detail-item {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    /* 隐藏部分不重要的列以节省空间 */
    .table th:nth-child(3),
    .table td:nth-child(3) {
        display: none;
    }
}

/* 大屏幕上5个卡片平均分布 */
@media (min-width: 992px) {
    .row .col-lg-2:nth-child(1) { flex: 0 0 20%; max-width: 20%; }
    .row .col-lg-2:nth-child(2) { flex: 0 0 20%; max-width: 20%; }
    .row .col-lg-2:nth-child(3) { flex: 0 0 20%; max-width: 20%; }
    .row .col-lg-2:nth-child(4) { flex: 0 0 20%; max-width: 20%; }
    .row .col-lg-2:nth-child(5) { flex: 0 0 20%; max-width: 20%; }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 页脚样式 */
.footer {
    background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 15px 0;
    margin-top: 50px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    border-top: 3px solid rgba(102, 126, 234, 0.5);
}

.footer p {
    margin: 0;
    line-height: 1.5;
}

.footer strong {
    font-size: 1rem;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.footer img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.footer i {
    margin-right: 6px;
    color: #fbbf24;
}

.footer .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* 移动端触摸滚动优化 */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 移动端输入框优化 */
@media (max-width: 768px) {
    input[type="text"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important; /* 防止iOS自动缩放 */
    }
}

/* 移动端按钮点击反馈 */
@media (max-width: 768px) {
    .btn:active {
        transform: scale(0.95);
    }
    
    .stat-card:active {
        transform: translateY(-3px);
    }
}

/* 移动端模态框滚动优化 */
@media (max-width: 576px) {
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* 移动端地图容器优化 */
@media (max-width: 768px) {
    #mapContainer {
        height: 400px !important;
    }
}

@media (max-width: 576px) {
    #mapContainer {
        height: 300px !important;
    }
}
