/* ==================== CSS 变量定义 ==================== */
:root {
    /* 品牌主色 */
    --color-primary: #dc3545;
    --color-primary-dark: #c82333;
    --color-primary-darker: #a71d2a;
    --color-secondary: #0066cc;
    --color-secondary-dark: #0055aa;
    --color-accent: #3498db;
    --color-accent-dark: #2980b9;

    /* 功能色 */
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #17a2b8;

    /* 中性色 */
    --color-text: #333;
    --color-text-light: #555;
    --color-text-muted: #666;
    --color-text-faint: #999;
    --color-white: #ffffff;
    --color-bg-light: #f8f9fa;
    --color-border: #ddd;

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 40px;

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* 阴影 */
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.3);

    /* 字号 */
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 20px;
    --font-size-xl: 24px;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 强制横屏样式（由JS添加） */
body.is-landscape {
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 页面头部 */
header {
    position: relative;
    text-align: center;
    margin-bottom: 0;
    padding: 30px 0;
    background: #dc3545;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    min-height: 80px;
}

header h1 {
    font-size: clamp(18px, 4vw, 32px);
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0 150px;
}

/* 顶部导航按钮容器 */
.header-nav {
    position: absolute;
    right: 15px;
    bottom: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 顶部用户信息显示 */
.header-user-info {
    position: absolute;
    left: 15px;
    bottom: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 13px;
}

.header-user-info .user-name {
    font-weight: 700;
    font-size: 14px;
}

.header-user-info .user-level {
    font-size: 12px;
    opacity: 0.9;
}

/* 鸟瞰图区域 */
.overview {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.map-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    font-size: 0;
    line-height: 0;
}

.map-container img {
    width: 66.67%;
    max-width: 66.67%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 4px solid rgba(255, 255, 255, 0.8);
    box-sizing: border-box;
    object-fit: contain;
}

.draggable-buttons {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    pointer-events: none;
}

.draggable-btn {
    position: absolute;
    padding: 15px 17px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 11px;
    cursor: move;
    pointer-events: auto;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 11px rgba(220, 53, 69, 0.4);
    user-select: none;
    z-index: 10;
    min-width: 64px;
    max-width: 160px;
    text-align: center;
    white-space: nowrap;
    transform: translate(-50%, -50%);
}

.draggable-btn:hover {
    background: linear-gradient(135deg, #c82333, #a71d2a);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.5);
}

/* 状态颜色 - 故障（红色） */
.draggable-btn.status-fault,
.draggable-btn.status-故障 {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.draggable-btn.status-fault:hover,
.draggable-btn.status-故障:hover {
    background: linear-gradient(135deg, #c82333, #a71d2a);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.5);
}

/* 状态颜色 - 维修中（棕色） */
.draggable-btn.status-repair,
.draggable-btn.status-维修中 {
    background: linear-gradient(135deg, #8B4513, #6B3510);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.4);
}

.draggable-btn.status-repair:hover,
.draggable-btn.status-维修中:hover {
    background: linear-gradient(135deg, #6B3510, #5a2d0d);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.5);
}

/* 状态颜色 - 待修（黄色） */
.draggable-btn.status-pending,
.draggable-btn.status-待修 {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.draggable-btn.status-pending:hover,
.draggable-btn.status-待修:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.5);
}

.draggable-btn.editing {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    padding: 12px 11px;
}

.draggable-btn input {
    background: transparent;
    border: none;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    outline: none;
}

.draggable-btn.dragging {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 100;
}

/* 平面图设备按钮样式 */
.point-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
    border: none;
}

/* 平面图设备按钮 - 状态颜色 - 故障（红色） */
.point-btn.status-fault,
.point-btn.status-故障 {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* 平面图设备按钮 - 状态颜色 - 维修中（棕色） */
.point-btn.status-repair,
.point-btn.status-维修中 {
    background: linear-gradient(135deg, #8B4513, #6B3510);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.4);
}

/* 平面图设备按钮 - 状态颜色 - 待修（黄色） */
.point-btn.status-pending,
.point-btn.status-待修 {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

/* 四大板块并排容器 */
.four-sections-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

.four-sections-container .section-card {
    margin-bottom: 0;
}

.four-sections-container h2 {
    font-size: 20px;
}

.four-sections-container .emergency-box,
.four-sections-container .report-box,
.four-sections-container .sys-btn {
    padding: 12px 8px;
    font-size: 12px;
}

@media (max-width: 1200px) {
    .four-sections-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .four-sections-container {
        grid-template-columns: 1fr;
    }
}

/* 自定义下拉菜单样式 */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    width: 100%;
    padding: 16px 40px 16px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    background-color: #fff;
    border: 2px solid #3498db;
    border-radius: 8px;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.custom-select:hover {
    border-color: #2980b9;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.custom-select:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.custom-select-wrapper::after {
    content: '\25BC';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #3498db;
    pointer-events: none;
}

.custom-select option {
    padding: 10px;
    font-size: 16px;
    background-color: #fff;
    color: #333;
}

.custom-select option:hover {
    background-color: #e8f4fc;
}

.building-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    table-layout: fixed;
}

.building-table td {
    border: none;
    padding: 6px 8px;
    text-align: left;
    font-size: 14px;
    color: #333;
    font-weight: bold;
    line-height: 1.2;
}

.building-table tr:first-child td {
    font-weight: bold;
}

.aerial-view {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f0fa 50%, #f0f7ff 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 102, 204, 0.15);
}

.aerial-view h1 {
    font-size: 28px;
    color: #dc3545;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.aerial-view img {
    width: 100%;
    max-width: 533px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 4px solid rgba(255, 255, 255, 0.8);
    object-fit: contain;
}

/* 板块通用样式 */
.section-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s, box-shadow 0.3s;
}

.section-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.section-card h2 {
    font-size: 20px;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
    position: relative;
}

.section-card h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #e74c3c);
    border-radius: 2px;
}

/* 楼栋网格 */
.building-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    max-width: 980px;
    margin: 0 auto;
}

.building-btn {
    display: block;
    padding: 14px 10px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    border: none;
}

.building-btn:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* 系统网格 */
.button-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 980px;
    margin: 0 auto;
}

.sys-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 14px 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.sys-btn:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

/* 应急处置网格 */
.emergency-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 980px;
    margin: 0 auto;
}

.emergency-box {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    text-align: center;
    padding: 16px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    display: block;
}

.emergency-box:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    color: white;
    text-decoration: none;
}

/* 数据报表按钮样式 */
.report-box {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-align: center;
    padding: 16px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    display: block;
}

.report-box:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    color: white;
    text-decoration: none;
}

/* 返回按钮 */
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 13px !important;
    font-weight: 600;
    transition: box-shadow 0.3s, background 0.3s;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    white-space: nowrap;
    height: 32px !important;
    max-height: 32px;
    line-height: 32px;
    flex-shrink: 0;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    zoom: 1 !important;
    transform: scale(1);
    -webkit-transform: scale(1);
    box-sizing: border-box !important;
}

.nav-btn:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .building-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 22px;
    }
    
    .building-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .button-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .emergency-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-card {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .building-grid,
    .button-grid,
    .emergency-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 18px;
    }
    
    .section-card h2 {
        font-size: 17px;
    }
}

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

.section-card {
    animation: fadeInUp 0.6s ease-out;
}

.section-card:nth-child(2) { animation-delay: 0.1s; }
.section-card:nth-child(3) { animation-delay: 0.2s; }
.section-card:nth-child(4) { animation-delay: 0.3s; }
.section-card:nth-child(5) { animation-delay: 0.4s; }

/* 按钮点击效果 */
button:active,
a:active {
    transform: scale(0.95);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* 平面图页面样式 */
.floor-plan-container {
    position: relative;
    display: block;
    margin: 20px auto;
    width: 100%;
    max-width: 1200px;
    cursor: grab;
}

.floor-plan-container img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border: 4px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* 楼层标签样式 */
.floor-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px;
    margin-bottom: 12px;
}

.tab-btn {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #3498db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #3498db;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #3498db;
    color: white;
}

.tab-btn.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-color: #2980b9;
}

/* 系统按钮紧凑排列 */
.system-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin-bottom: 20px;
    width: 100%;
}

.system-selector-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.system-selector-btn:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-1px);
}

.system-selector-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* 页面头部布局 */
.floor-tabs-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.back-home {
    flex-shrink: 0;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
    background: linear-gradient(135deg, #c82333 0%, #a71d2a 100%);
}

.back-to-top.show {
    display: flex;
}

/* ==================== 移动端响应式样式 ==================== */
@media only screen and (max-width: 768px) {
    /* 基础容器调整 */
    .container {
        padding: 10px;
    }
    
    /* 页面头部调整 */
    header {
        padding: 20px 10px;
        border-radius: 12px 12px 0 0;
        min-height: auto;
    }
    
    header h1 {
        font-size: 18px;
        letter-spacing: 1px;
        margin: 0 70px;
    }
    
    /* 鸟瞰图区域调整 */
    .overview, .aerial-view {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 0 0 12px 12px;
    }
    
    .aerial-view h1 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .aerial-view img, .overview img {
        border-radius: 8px;
        border-width: 2px;
    }
    
    /* 楼栋外观图与设备状态栏响应式布局 */
    .aerial-content-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .device-status-bar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
        padding: 10px;
    }
    
    .status-bar-title {
        width: 100%;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    
    .status-item {
        flex: 1;
        min-width: 80px;
        margin-bottom: 0;
    }
    
    /* 板块通用样式调整 */
    .section-card {
        padding: 15px;
        border-radius: 12px;
        margin-bottom: 15px;
    }
    
    /* 按钮调整 */
    .building-btn, .floor-btn, .system-btn, .emergency-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-width: 120px;
    }
    
    /* 消防应急处置板块网格调整 */
    .emergency-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    /* 编辑面板调整 */
    .edit-panel {
        width: 140px;
        padding: 10px;
        right: -150px;
    }
    
    .edit-panel h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .edit-panel-trigger {
        width: 35px;
        height: 120px;
    }
    
    /* 返回顶部按钮调整 */
    .back-to-top {
        right: 15px;
        bottom: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /* 页面头部用户信息调整 */
    .header-user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 8px 12px;
    }
    
    .header-btn, .nav-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 60px;
        max-width: 100px;
        height: 30px;
        line-height: 18px;
    }
    
    .header-nav {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* 模态框调整 */
    .modal-content {
        width: 90%;
        max-width: 350px;
        padding: 25px 20px;
        margin: 20px auto;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .form-group input, .form-group select {
        padding: 10px;
        font-size: 14px;
    }
    
    .btn-primary, .btn-add, .btn-change {
        padding: 12px;
        font-size: 14px;
    }
    
    /* 用户管理面板调整 */
    .user-management-panel {
        width: 90%;
        max-width: 400px;
        max-height: 85vh;
    }
    
    .user-management-panel .panel-content {
        padding: 15px;
    }
    
    /* 楼层标签调整 */
    .floor-tabs {
        gap: 6px;
    }
    
    .tab-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    /* 楼层按钮调整 */
    .floor-buttons {
        gap: 8px;
    }
    
    .floor-btn {
        padding: 15px 20px;
        font-size: 14px;
    }
    
    /* 系统导航调整 */
    .system-navigation {
        padding: 8px;
        gap: 6px;
    }
    
    .system-selector-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* 图片容器调整 */
    .image-container {
        padding: 10px;
        margin-top: 10px;
    }
    
    /* 系统图调整 */
    .system-image {
        max-width: 100%;
    }
    
    /* 视频模态框调整 */
    .video-modal {
        padding: 10px;
    }
    
    .video-modal-content {
        width: 95%;
        max-width: 500px;
        padding: 15px;
    }
    
    /* 弹出窗口调整 */
    .popup-overlay {
        padding: 10px;
    }
    
    .popup-content {
        max-width: 95%;
        max-height: 90vh;
        padding: 15px;
    }
    
    /* 登录模态框调整 */
    .login-modal {
        padding: 30px 20px;
        width: 90%;
        max-width: 350px;
    }
    
    .login-modal h2 {
        font-size: 20px;
    }
    
    /* 细节按钮调整 */
    .detail-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* 超小屏幕手机适配 */
@media only screen and (max-width: 480px) {
    header h1 {
        font-size: 18px;
    }
    
    .aerial-view h1 {
        font-size: 16px;
    }
    
    .building-btn, .floor-btn, .system-btn, .emergency-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 100px;
    }
    
    .emergency-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tab-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .floor-buttons {
        gap: 6px;
    }
    
    .floor-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    /* 设备状态栏超小屏幕适配 */
    .device-status-bar {
        padding: 8px;
    }
    
    .status-bar-title {
        font-size: 12px;
        padding-bottom: 6px;
        margin-bottom: 6px;
    }
    
    .status-label {
        font-size: 11px;
    }
    
    .status-count {
        font-size: 14px;
        padding: 1px 6px;
    }
}

@media only screen and (min-aspect-ratio: 13/9) {
    body.is-landscape {
        width: 100vw;
        height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }
}

/* 横屏适配：根据宽高比判断，兼容各种全面屏手机 */
@media only screen and (min-aspect-ratio: 13/9) and (max-height: 700px) {
    header {
        padding: 10px 15px;
        min-height: 60px;
    }
    
    header h1 {
        font-size: 16px;
        margin: 0 60px;
        letter-spacing: 1px;
    }
    
    .overview, .aerial-view {
        padding: 10px 15px;
        margin-bottom: 10px;
    }
    
    .aerial-view h1 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .aerial-view img, .overview img {
        border-radius: 6px;
        border-width: 2px;
    }
    
    .section-card {
        padding: 12px 15px;
        margin-bottom: 10px;
        border-radius: 10px;
    }
    
    .section-card h2 {
        font-size: 14px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .building-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .building-btn {
        padding: 10px 6px;
        font-size: 12px;
        border-radius: 6px;
    }
    
    .button-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .sys-btn {
        padding: 10px 8px;
        font-size: 12px;
        border-radius: 6px;
    }
    
    .emergency-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .emergency-box, .report-box {
        padding: 10px 8px;
        font-size: 12px;
        border-radius: 6px;
    }
    
    .four-sections-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .four-sections-container .emergency-box,
    .four-sections-container .report-box,
    .four-sections-container .sys-btn {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    .header-user-info {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .header-user-info .user-name {
        font-size: 12px;
    }
    
    .header-nav {
        gap: 5px;
        bottom: 8px;
    }
    
    .nav-btn {
        padding: 4px 10px;
        font-size: 11px !important;
        width: 70px;
        height: 26px !important;
        line-height: 26px;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
        right: 15px;
        bottom: 15px;
    }
}

.floor-plans h2 {
    color: white;
    font-size: 16px;
    margin: 5px 0;
}
