/* ========================================
   农业四情监测平台 - 全局样式
   ======================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: 230px; background: linear-gradient(180deg, #1a3c2a 0%, #0d2818 100%);
    color: #c8d6cf; flex-shrink: 0; position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 100; overflow-y: auto; overflow-x: hidden; transition: width 0.3s;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex; flex-direction: column;
}
.sidebar::-webkit-scrollbar {
    display: none;
}
.sidebar-logo {
    padding: 44px 20px 22px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .logo-icon { font-size: 32px; margin-bottom: 6px; }
.sidebar-logo h2 { font-size: 17px; color: #fff; font-weight: 600; letter-spacing: 2px; white-space: nowrap; }
.sidebar-logo p { font-size: 11px; color: #6b9e7a; margin-top: 2px; }
.sidebar-logo .top-version {
    font-size: 12px; font-weight: 600; color: #4ae08a; margin-top: 3px; letter-spacing: 2px;
}

.sidebar-menu { padding: 10px 0; }
.sidebar-menu .menu-group { padding: 12px 20px 6px; font-size: 11px; color: #5a8a6a; text-transform: uppercase; letter-spacing: 1px; }
.sidebar-menu a {
    display: flex; align-items: center; padding: 11px 20px; color: #b0c7b8;
    text-decoration: none; font-size: 14px; transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-menu a i { width: 22px; margin-right: 10px; font-size: 16px; text-align: center; }
.sidebar-menu a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-menu a.active { background: rgba(74, 144, 106, 0.3); color: #5ce0a0; border-left-color: #4ae08a; font-weight: 600; }

/* 侧边栏收缩按钮 */
.sidebar-toggle-btn {
    position: absolute; top: 16px; right: 12px; z-index: 2;
    background: rgba(255,255,255,0.10); border: none; color: #fff;
    width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
    font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,0.22); }

/* 手风琴菜单 */
.sidebar-nav { padding: 6px 0; flex: 1 0 auto; }
.menu-link, .menu-group-toggle {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px; color: #b0c7b8; text-decoration: none; font-size: 14px;
    cursor: pointer; border-left: 3px solid transparent;
    transition: background .2s, color .2s; user-select: none;
}
.menu-link:hover, .menu-group-toggle:hover { background: rgba(255,255,255,0.06); color: #fff; }
.menu-link.active {
    background: rgba(74, 144, 106, 0.3); color: #5ce0a0;
    border-left-color: #4ae08a; font-weight: 600;
}
.menu-icon { width: 22px; text-align: center; font-size: 16px; flex-shrink: 0; }
.menu-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-caret { font-size: 10px; transition: transform .2s; }
.menu-group-item.expanded > .menu-group-toggle .menu-caret { transform: rotate(90deg); }
.menu-sub { display: none; background: rgba(0,0,0,0.18); }
.menu-group-item.expanded > .menu-sub { display: block; }
.menu-sub-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 20px 9px 52px; color: #9fb6a8; text-decoration: none;
    font-size: 13px; border-left: 3px solid transparent; transition: all .2s;
}
.menu-sub-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.menu-sub-link.active {
    background: rgba(74, 144, 106, 0.3); color: #5ce0a0;
    border-left-color: #4ae08a; font-weight: 600;
}

/* 整条侧边栏收起态（只显示图标） */
body.sidebar-collapsed .sidebar { width: 64px; }
body.sidebar-collapsed .sidebar .sidebar-logo h2,
body.sidebar-collapsed .sidebar .sidebar-logo p,
body.sidebar-collapsed .menu-label,
body.sidebar-collapsed .menu-caret { display: none; }
/* 收起态：展开组（含当前选中的二级菜单）的子菜单以图标形式显示 */
body.sidebar-collapsed .menu-group-item.expanded .menu-sub { display: block; }
body.sidebar-collapsed .menu-sub { padding-left: 0; }
body.sidebar-collapsed .menu-sub-link { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .sidebar-toggle-btn { right: 18px; }
body.sidebar-collapsed .menu-link,
body.sidebar-collapsed .menu-group-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .main { margin-left: 64px; }

/* 主内容区 */
.main { margin-left: 230px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* 顶栏 */
.header {
    height: 56px; background: #fff; display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 99;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-left .breadcrumb { font-size: 14px; color: #888; }
.header-left .breadcrumb span { color: #333; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 20px; }
.header-right .notify-badge { position: relative; cursor: pointer; font-size: 18px; color: #666; }
.header-right .notify-badge .badge {
    position: absolute; top: -6px; right: -8px; background: #e74c3c; color: #fff;
    border-radius: 10px; padding: 1px 6px; font-size: 10px; min-width: 18px; text-align: center;
}
.header-right .user-info { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.header-right .user-info .avatar {
    width: 34px; height: 34px; border-radius: 50%; background: #4a906a; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600;
}
.header-right .user-info .user-arrow { font-size: 10px; color: #999; }
.header-right .user-menu {
    position: absolute; top: 60px; right: 20px; background: #fff;
    border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    min-width: 140px; display: none; z-index: 100;
}
.header-right .user-menu.show { display: block; }
.header-right .user-menu .menu-item {
    padding: 10px 16px; font-size: 13px; color: #555; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
}
.header-right .user-menu .menu-item:hover { background: #f5f7fa; }

/* 内容区 */
.content { padding: 20px 24px; flex: 1; }

/* 统计卡片 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: #fff; border-radius: 16px; padding: 24px; display: flex; align-items: center;
    gap: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); transition: all 0.3s; cursor: pointer;
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #4a906a 0%, #5ce0a0 50%, #4a906a 100%);
}
.stat-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 12px 35px rgba(0,0,0,0.12); 
}
.stat-card .card-icon {
    width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center;
    justify-content: center; font-size: 26px; flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.stat-card .card-info h3 { font-size: 28px; font-weight: 700; margin-bottom: 4px; color: #2c3e50; }
.stat-card .card-info p { font-size: 13px; color: #78909c; }

/* 颜色方案 */
.icon-green { background: #e8f5e9; color: #2e7d32; }
.icon-blue { background: #e3f2fd; color: #1565c0; }
.icon-orange { background: #fff3e0; color: #ef6c00; }
.icon-purple { background: #f3e5f5; color: #7b1fa2; }
.icon-red { background: #ffebee; color: #c62828; }
.icon-cyan { background: #e0f7fa; color: #00838f; }

/* 卡片面板 */
.panel { 
    background: #fff; border-radius: 16px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03); 
    margin-bottom: 20px; 
    overflow: hidden;
    transition: box-shadow 0.3s;
}
.panel:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.05);
}
.panel-header {
    padding: 16px 24px; border-bottom: 1px solid #f5f5f5; display: flex;
    align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600;
    background: linear-gradient(135deg, #fafbfc 0%, #fff 100%);
}
.panel-header .panel-title { display: flex; align-items: center; gap: 10px; color: #2c3e50; }
.panel-header .panel-title::before {
    content: ''; width: 4px; height: 18px; 
    background: linear-gradient(180deg, #4a906a 0%, #3a7a5a 100%); 
    border-radius: 2px; display: inline-block;
}
.panel-body { padding: 24px; }

/* 栅格布局 */
.row { display: flex; gap: 20px; flex-wrap: wrap; }
.col-8 { flex: 0 0 calc(66.66% - 14px); }
.col-4 { flex: 0 0 calc(33.33% - 13px); }
.col-6 { flex: 0 0 calc(50% - 10px); }
.col-12 { flex: 0 0 100%; }

/* 图表容器 */
.chart-box { width: 100%; height: 320px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #fff; }
table th, table td { padding: 14px 16px; text-align: left; font-size: 13px; }
table th { 
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); 
    font-weight: 600; color: #475569; white-space: nowrap;
    position: relative;
}
table th::after {
    content: ''; position: absolute; bottom: 0; left: 16px; right: 16px;
    height: 2px; background: linear-gradient(90deg, transparent, #4a906a, transparent);
}
table tbody tr { transition: all 0.2s; }
table tbody tr:hover { background: #f0fdf4; transform: scale(1.002); }
table tbody tr:nth-child(even) { background: #fafbfc; }
table tbody tr:nth-child(even):hover { background: #f0fdf4; }
table tbody td { border-bottom: 1px solid #f1f5f9; }
table tbody tr:last-child td { border-bottom: none; }

/* 标签/徽章 */
.tag {
    display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500;
}
.tag-success { background: #e8f5e9; color: #2e7d32; }
.tag-warning { background: #fff3e0; color: #ef6c00; }
.tag-danger { background: #ffebee; color: #c62828; }
.tag-info { background: #e3f2fd; color: #1565c0; }
.tag-purple { background: #f3e5f5; color: #7b1fa2; }
.tag-default { background: #f5f5f5; color: #757575; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; gap: 4px; padding: 9px 18px; border-radius: 8px;
    border: none; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.3s; text-decoration: none;
    position: relative; overflow: hidden;
}
.btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}
.btn:hover::before { left: 100%; }
.btn-primary { 
    background: linear-gradient(135deg, #4a906a 0%, #3a7a5a 100%); 
    color: #fff; 
    box-shadow: 0 2px 8px rgba(74,144,106,0.3);
}
.btn-primary:hover { 
    background: linear-gradient(135deg, #3a7a5a 0%, #2d664a 100%); 
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(74,144,106,0.4);
}
.btn-info { 
    background: linear-gradient(135deg, #1890ff 0%, #1677d9 100%); 
    color: #fff;
    box-shadow: 0 2px 8px rgba(24,144,255,0.3);
}
.btn-info:hover { 
    background: linear-gradient(135deg, #1677d9 0%, #0d5cb6 100%); 
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(24,144,255,0.4);
}
.btn-warning { 
    background: linear-gradient(135deg, #fa8c16 0%, #e0780e 100%); 
    color: #fff;
    box-shadow: 0 2px 8px rgba(250,140,22,0.3);
}
.btn-warning:hover { 
    background: linear-gradient(135deg, #e0780e 0%, #c4680c 100%); 
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(250,140,22,0.4);
}
.btn-danger { 
    background: linear-gradient(135deg, #e74c3c 0%, #d63c2c 100%); 
    color: #fff;
    box-shadow: 0 2px 8px rgba(231,76,60,0.3);
}
.btn-danger:hover { 
    background: linear-gradient(135deg, #d63c2c 0%, #c03020 100%); 
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(231,76,60,0.4);
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-sm:hover { transform: translateY(0); }
.btn-outline {
    background: #fff; color: #4a906a; border: 1px solid #4a906a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.btn-outline:hover { 
    background: #f0faf4; 
    border-color: #3a7a5a;
    box-shadow: 0 2px 8px rgba(74,144,106,0.15);
}

/* 搜索栏 */
.search-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search-bar input, .search-bar select {
    padding: 7px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; outline: none; min-width: 150px;
}
.search-bar input:focus, .search-bar select:focus { border-color: #4a906a; box-shadow: 0 0 0 2px rgba(74,144,106,0.1); }

/* 分页 */
.pagination { display: flex; justify-content: flex-end; gap: 6px; margin-top: 16px; }
.pagination button {
    padding: 6px 12px; border: 1px solid #d9d9d9; background: #fff; border-radius: 4px;
    cursor: pointer; font-size: 13px;
}
.pagination button.active { background: #4a906a; color: #fff; border-color: #4a906a; }
.pagination button:hover:not(.active) { border-color: #4a906a; color: #4a906a; }
.pagination span { line-height: 30px; margin: 0 4px; font-size: 13px; color: #666; }

/* 弹窗 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); z-index: 1000; justify-content: center; align-items: center; animation: fadeIn 0.2s ease; }
.modal-overlay.show { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal {
    background: #fff; border-radius: 16px; width: 560px; max-width: 92vw; max-height: 82vh;
    overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.1);
    animation: slideUp 0.25s ease;
}
.modal-header { 
    padding: 18px 24px; border-bottom: 1px solid #f5f5f5; 
    display: flex; justify-content: space-between; align-items: center; 
    font-weight: 600; font-size: 16px; color: #2c3e50;
    background: linear-gradient(135deg, #fafbfc 0%, #fff 100%);
}
.modal-close { 
    cursor: pointer; font-size: 20px; color: #999; background: none; border: none; 
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; transition: all 0.2s;
}
.modal-close:hover { color: #333; background: #f5f5f5; }
.modal-body { padding: 24px; max-height: 60vh; overflow-y: auto; }
.modal-footer { 
    padding: 16px 24px; border-top: 1px solid #f5f5f5; 
    display: flex; justify-content: flex-end; gap: 12px;
    background: #fafbfc;
}

/* 表单 */
.form-group { margin-bottom: 18px; }
.form-group label { 
    display: block; margin-bottom: 6px; font-size: 13px; color: #475569; font-weight: 500;
    position: relative;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1.5px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; outline: none; font-family: inherit;
    transition: all 0.3s; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { 
    border-color: #4a906a; 
    box-shadow: 0 0 0 3px rgba(74,144,106,0.1), 0 2px 8px rgba(74,144,106,0.1); 
    border-width: 2px;
}
.form-group input:hover, .form-group select:hover, .form-group textarea:hover { 
    border-color: #cbd5e1; 
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 复选框美化 */
.form-group input[type="checkbox"] {
    width: auto; padding: 0; border: none; box-shadow: none;
    appearance: none; -webkit-appearance: none;
    width: 18px; height: 18px; border: 2px solid #e2e8f0;
    border-radius: 4px; cursor: pointer;
    position: relative; display: inline-flex; align-items: center; justify-content: center;
}
.form-group input[type="checkbox"]:checked {
    background: #4a906a; border-color: #4a906a;
}
.form-group input[type="checkbox"]:checked::after {
    content: '\2713'; color: #fff; font-size: 12px; font-weight: bold;
}
.form-group input[type="checkbox"]:hover {
    border-color: #4a906a;
}

/* 视频网格 */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.video-card {
    background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: transform 0.2s;
}
.video-card:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.video-card .video-preview {
    height: 200px; background: #1a1a2e; display: flex; align-items: center;
    justify-content: center; color: #555; font-size: 48px; position: relative;
}
.video-card .video-preview .play-icon {
    position: absolute; width: 50px; height: 50px; background: rgba(255,255,255,0.2);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff; cursor: pointer;
}
.video-card .video-info { padding: 14px 16px; }
.video-card .video-info h4 { font-size: 14px; margin-bottom: 4px; }
.video-card .video-info p { font-size: 12px; color: #999; }

/* 通知列表 */
.notify-item {
    padding: 14px 16px; border-bottom: 1px solid #f5f5f5; display: flex; gap: 12px;
    cursor: pointer; transition: background 0.2s;
}
.notify-item:hover { background: #fafbfc; }
.notify-item.unread { background: #f6ffed; }
.notify-item .notify-dot {
    width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0;
}
.notify-item .notify-content { flex: 1; }
.notify-item .notify-content .title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.notify-item .notify-content .desc { font-size: 12px; color: #999; line-height: 1.6; }
.notify-item .notify-content .time { font-size: 11px; color: #bbb; margin-top: 4px; }

.dot-danger { background: #e74c3c; }
.dot-warning { background: #fa8c16; }
.dot-info { background: #1890ff; }

/* 应对措施 */
.notify-item .notify-content .measure-box {
    margin-top: 8px; padding: 10px 14px;
    background: #fff7e6; border-left: 3px solid #fa8c16;
    border-radius: 4px;
}
.notify-item .notify-content .measure-title {
    font-size: 12px; font-weight: 600; color: #fa8c16; margin-bottom: 4px;
}
.notify-item .notify-content .measure-text {
    font-size: 12px; color: #666; line-height: 1.8;
}

/* 设备状态 */
.status-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px;
}
.status-online { background: #52c41a; box-shadow: 0 0 6px rgba(82,196,26,0.5); }
.status-offline { background: #bfbfbf; }
.status-error { background: #e74c3c; }

/* 响应式 */
@media (max-width: 992px) {
    .col-8, .col-4, .col-6 { flex: 0 0 100%; }
    .sidebar { width: 64px; }
    .sidebar .sidebar-logo h2,
    .sidebar .sidebar-logo p,
    .sidebar .menu-label,
    .sidebar .menu-caret { display: none; }
    .sidebar .menu-link,
    .sidebar .menu-group-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
    .sidebar .menu-group-item.expanded .menu-sub { display: block; }
    .sidebar .menu-sub { padding-left: 0; }
    .sidebar .menu-sub-link { justify-content: center; padding-left: 0; padding-right: 0; }
    .main { margin-left: 64px; }
}

/* 登录页 */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a3c2a 0%, #0d2818 40%, #1a4a30 100%);
    position: relative; overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute; width: 600px; height: 600px;
    border-radius: 50%; background: rgba(255,255,255,0.03); top: -200px; right: -100px;
}
.login-page::after {
    content: ''; position: absolute; width: 400px; height: 400px;
    border-radius: 50%; background: rgba(255,255,255,0.03); bottom: -150px; left: -100px;
}
.login-box {
    background: #fff; border-radius: 16px; padding: 40px; width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); position: relative; z-index: 1;
}
.login-box h2 { text-align: center; color: #1a3c2a; margin-bottom: 8px; font-size: 22px; }
.login-box .subtitle { text-align: center; color: #999; font-size: 13px; margin-bottom: 30px; }
.login-box .form-group { margin-bottom: 20px; }
.login-box .btn-login { width: 100%; padding: 10px; font-size: 15px; margin-top: 10px; }
.login-box .error-msg { color: #e74c3c; font-size: 12px; text-align: center; margin-top: 8px; display: none; }

/* 设备信息卡片 */
.device-card {
    display: flex; align-items: center; padding: 14px 0; border-bottom: 1px solid #f5f5f5;
}
.device-card:last-child { border-bottom: none; }
.device-card .dev-icon {
    width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center;
    justify-content: center; font-size: 20px; margin-right: 14px; flex-shrink: 0;
}
.device-card .dev-info { flex: 1; }
.device-card .dev-info h4 { font-size: 14px; margin-bottom: 2px; }
.device-card .dev-info p { font-size: 12px; color: #999; }

/* 数据数值展示 */
.data-display { display: flex; flex-wrap: wrap; gap: 12px; }
.data-item {
    text-align: center; padding: 14px 20px; background: #f8fbf9; border-radius: 8px;
    min-width: 100px; flex: 1;
}
.data-item .val { font-size: 26px; font-weight: 700; color: #1a3c2a; }
.data-item .label { font-size: 12px; color: #999; margin-top: 4px; }

/* 图片占位 */
.img-placeholder {
    width: 100%; height: 180px; background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-size: 42px; color: #6b9e7a;
}

/* 树形选择 */
.tree-select { padding: 4px 0; }
.tree-select .tree-item { padding: 8px 16px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.tree-select .tree-item:hover { background: #f5f5f5; }
.tree-select .tree-item.active { color: #4a906a; font-weight: 600; }

/* ========================================
   新主页布局样式
   ======================================== */
.dashboard-top-bar {
    display: flex; gap: 12px; padding: 16px 24px; background: #fff;
    border-radius: 12px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.dashboard-top-bar .top-card {
    flex: 1; display: flex; align-items: center; gap: 12px; padding: 14px 20px;
    border-radius: 10px; cursor: pointer; transition: transform 0.2s;
}
.dashboard-top-bar .top-card:hover { transform: translateY(-2px); }
.dashboard-top-bar .top-card .top-icon {
    width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center;
    justify-content: center; font-size: 20px; flex-shrink: 0;
}
.dashboard-top-bar .top-card .top-info h3 { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.dashboard-top-bar .top-card .top-info p { font-size: 12px; opacity: 0.8; }
.top-card-green { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); }
.top-card-green .top-icon { background: rgba(74,144,106,0.15); color: #4a906a; }
.top-card-green .top-info h3 { color: #2e7d32; }
.top-card-blue { background: linear-gradient(135deg, #e3f2fd, #e3f5ff); }
.top-card-blue .top-icon { background: rgba(24,144,255,0.15); color: #1890ff; }
.top-card-blue .top-info h3 { color: #1565c0; }
.top-card-orange { background: linear-gradient(135deg, #fff3e0, #fff8e1); }
.top-card-orange .top-icon { background: rgba(250,140,22,0.15); color: #fa8c16; }
.top-card-orange .top-info h3 { color: #ef6c00; }
.top-card-red { background: linear-gradient(135deg, #ffebee, #ffeced); }
.top-card-red .top-icon { background: rgba(231,76,60,0.15); color: #e74c3c; }
.top-card-red .top-info h3 { color: #c62828; }
.top-card-purple { background: linear-gradient(135deg, #f3e5f5, #f5e9f9); }
.top-card-purple .top-icon { background: rgba(123,31,162,0.15); color: #7b1fa2; }
.top-card-purple .top-info h3 { color: #6a1b9a; }
.top-card-cyan { background: linear-gradient(135deg, #e0f7fa, #e0f9ff); }
.top-card-cyan .top-icon { background: rgba(0,131,143,0.15); color: #00838f; }
.top-card-cyan .top-info h3 { color: #006064; }

.dashboard-main-grid {
    display: grid; grid-template-columns: 320px 1fr 300px; gap: 16px;
    min-height: 0;
}

/* 监控主页：铺满整屏 100% 视口，页面无上下/左右滚动条（各内部面板自行滚动） */
body.dashboard-page { height: 100vh; overflow: hidden; }
body.dashboard-page .layout { height: 100vh; }
body.dashboard-page .main { height: 100vh; overflow: hidden; }
body.dashboard-page .content {
    flex: 1; min-height: 0; overflow: hidden;
    display: flex; flex-direction: column;
}
body.dashboard-page .dashboard-top-bar { flex-shrink: 0; }
body.dashboard-page .dashboard-main-grid { flex: 1; min-height: 0; height: auto; }
body.dashboard-page .right-panel { overflow-y: auto; min-height: 0; }

.device-panel {
    background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden; display: flex; flex-direction: column; height: 100%;
}
.device-panel .panel-header {
    padding: 14px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; justify-content: space-between;
}
.device-panel .panel-header .panel-title { color: #333; }
.device-panel .panel-header .panel-count {
    background: #f0f0f0; color: #666; padding: 2px 10px; border-radius: 10px; font-size: 12px;
}
.device-panel .device-list { padding: 8px 0; overflow-y: auto; flex: 1; }
.device-panel .device-list .device-item {
    display: flex; align-items: center; padding: 10px 16px; cursor: pointer;
    transition: background 0.2s; border-left: 3px solid transparent;
}
.device-panel .device-list .device-item:hover { background: #f8faf9; }
.device-panel .device-list .device-item.active { background: #f0faf4; border-left-color: #4a906a; }
.device-panel .device-list .device-item .device-dot {
    width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; flex-shrink: 0;
}
.device-panel .device-list .device-item .device-name {
    font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.device-panel .device-list .device-item .device-status {
    font-size: 11px; padding: 2px 8px; border-radius: 8px; flex-shrink: 0;
}
.device-status-online { background: #e8f5e9; color: #2e7d32; }
.device-status-offline { background: #f5f5f5; color: #999; }

.project-group { margin-bottom: 4px; }
.project-header {
    display: flex; align-items: center; padding: 8px 12px;
    background: #f8f9fa; border-radius: 8px; cursor: pointer;
    font-size: 13px; font-weight: 500; color: #555;
    transition: all 0.2s;
}
.project-header:hover { background: #eef2f7; }
.project-expand { margin-right: 8px; font-size: 10px; color: #999; }
.project-name { flex: 1; }
.project-count {
    font-size: 11px; color: #999; background: #fff;
    padding: 2px 8px; border-radius: 10px;
}
.project-devices { padding-left: 20px; overflow: hidden; }
.project-devices.hidden { display: none; }

.map-panel {
    background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden; display: flex; flex-direction: column; height: 100%;
}
.map-panel .panel-header {
    padding: 14px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; justify-content: space-between;
}
.map-panel .panel-header .panel-title { color: #333; }
.map-panel .map-container {
    flex: 1; position: relative; overflow: hidden; width: 100%; height: 100%;
}
.map-panel .map-container .map-bg {
    width: 100%; height: 100%; background-size: cover; background-position: center;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 500"><path fill="%23c9daf8" d="M0,250 C200,200 400,300 600,250 C800,200 800,250 800,250 L800,500 L0,500 Z"/><path fill="%23d4e6f1" d="M0,250 C200,300 400,200 600,250 C800,300 800,250 800,250 L800,500 L0,500 Z"/><path fill="none" stroke="%239fb3c8" stroke-width="1" d="M100,100 L100,400 M200,100 L200,400 M300,100 L300,400 M400,100 L400,400 M500,100 L500,400 M600,100 L600,400 M700,100 L700,400 M0,125 L800,125 M0,250 L800,250 M0,375 L800,375"/><circle cx="400" cy="280" r="8" fill="%2352c41a" opacity="0.8"/><text x="400" y="260" font-size="12" fill="%23333" text-anchor="middle">监测站</text></svg>');
}
.map-panel .map-container .map-marker {
    position: absolute; width: 36px; height: 36px; background: #52c41a;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(82,196,26,0.4);
    transition: transform 0.2s;
}
.map-panel .map-container .map-marker:hover { transform: scale(1.2); }
.map-panel .map-container .map-marker.warning { background: #fa8c16; }
.map-panel .map-container .map-marker.error { background: #e74c3c; }
.map-panel .map-container .map-tooltip {
    position: absolute; background: rgba(255,255,255,0.95); padding: 10px 14px;
    border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.1); font-size: 12px;
    pointer-events: none; display: none; z-index: 10;
}

.right-panel {
    display: flex; flex-direction: column; gap: 16px; height: 100%;
}
.right-panel .info-card {
    background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}
.right-panel .info-card .card-header {
    padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 13px; font-weight: 600;
    color: #333; display: flex; align-items: center; gap: 8px;
}
.right-panel .info-card .card-header::before {
    content: ''; width: 3px; height: 14px; background: #4a906a; border-radius: 2px;
}
.right-panel .info-card .card-body { padding: 14px 16px; }

.info-row {
    display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f8f8f8;
    font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row .label { color: #999; }
.info-row .value { color: #333; font-weight: 500; }

.control-switch {
    display: flex; justify-content: space-between; align-items: center; padding: 10px 0;
    border-bottom: 1px solid #f8f8f8;
}
.control-switch:last-child { border-bottom: none; }
.control-switch .switch-label { font-size: 13px; color: #333; }
.control-switch .switch-btn {
    width: 44px; height: 24px; background: #f0f0f0; border-radius: 12px;
    position: relative; cursor: pointer; transition: background 0.3s;
}
.control-switch .switch-btn.active { background: #4a906a; }
.control-switch .switch-btn::after {
    content: ''; position: absolute; width: 20px; height: 20px;
    background: #fff; border-radius: 50%; top: 2px; left: 2px;
    transition: left 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.control-switch .switch-btn.active::after { left: 22px; }

.dashboard-bottom {
    margin-top: 16px;
}
.dashboard-bottom .data-panel {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.dashboard-bottom .data-card {
    background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 16px 20px;
}
.dashboard-bottom .data-card .data-title { font-size: 12px; color: #999; margin-bottom: 8px; }
.dashboard-bottom .data-card .data-value { font-size: 28px; font-weight: 700; color: #333; }
.dashboard-bottom .data-card .data-unit { font-size: 13px; color: #999; margin-left: 4px; }

.quick-actions {
    display: flex; gap: 12px; margin-top: 16px;
}
.quick-actions .action-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 20px; background: #fff; border-radius: 10px;
    cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-size: 14px; font-weight: 500; color: #333;
}
.quick-actions .action-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.quick-actions .action-btn .action-icon { font-size: 18px; }

.top-card-gray { background: linear-gradient(135deg, #f5f5f5, #fafafa); }
.top-card-gray .top-icon { background: rgba(100,100,100,0.12); color: #555; }
.top-card-gray .top-info h3 { color: #333; }

/* 卡片显示/隐藏控制 */
.top-card-toggle { position: relative; }
.card-toggle-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    background: #fff; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 6px 0; min-width: 150px; display: none; z-index: 50;
    border: 1px solid #f0f0f0;
}
.card-toggle-menu.show { display: block; animation: fadeIn 0.15s ease; }
.card-toggle-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 14px;
    cursor: pointer; font-size: 12px; color: #555; transition: background 0.15s;
    white-space: nowrap;
}
.card-toggle-item:hover { background: #f5f7fa; }
.card-toggle-item input[type="checkbox"] {
    width: 14px; height: 14px; accent-color: #4a906a; cursor: pointer;
    margin: 0; flex-shrink: 0;
}

@media (max-width: 1200px) {
    .dashboard-main-grid { grid-template-columns: 1fr; }
    .device-panel, .map-panel, .right-panel { min-height: auto; }
    .dashboard-bottom .data-panel { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .dashboard-top-bar { flex-direction: column; }
    .dashboard-top-bar .top-card { justify-content: center; }
    .dashboard-bottom .data-panel { grid-template-columns: 1fr; }
    .quick-actions { flex-direction: column; }
}

/* 地图设备名称标签 */
.map-device-label {
    padding: 2px 7px;
    background: rgba(13, 40, 24, 0.78);
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 5px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.25);
}
