/* ============================================
   红心守护管理端 — 2025-2026 现代极简风格
   设计准则: 浅色侧栏 · Bento卡片 · SaaS留白
   ============================================ */

/* === 全局重置 === */
html, body, #app {
    height: 100%; margin: 0; padding: 0;
    background: #f7f8fa;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #111827;
    font-size: 14px;
    line-height: 1.6;
}

/* === 滚动条美化 === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ==========================================
   登录页 — 新拟态渐变蓝
   ========================================== */
.deng-lu-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; width: 100%;
    background: linear-gradient(150deg, #f0f7ff 0%, #dceeff 30%, #a8c8f0 60%, #5C8FE6 100%);
    position: relative; overflow: hidden;
}
.deng-lu-container::before {
    content: ''; position: absolute; top: -30%; left: -15%;
    width: 700px; height: 700px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 65%);
    pointer-events: none;
}
.deng-lu-container::after {
    content: ''; position: absolute; bottom: -20%; right: -10%;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(92,143,230,0.12) 0%, transparent 65%);
    pointer-events: none;
}
.deng-lu-card {
    width: 420px; padding: 36px 32px 28px;
    border-radius: 20px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 40px rgba(28,52,84,0.12), 0 2px 8px rgba(28,52,84,0.06);
    border: 1px solid rgba(255,255,255,0.6);
    position: relative; z-index: 1;
}
.deng-lu-card .el-card__body { padding: 0; }

/* === 主布局 === */
.el-container { height: 100%; }

/* Element Plus collapse mode 适配 */
.el-menu--collapse { width: 64px !important; }
.el-menu--collapse .el-menu-item { padding: 0 !important; justify-content: center; }
.el-menu--collapse .el-menu-item .el-icon { margin-right: 0 !important; }

/* ==========================================
   侧边栏 — 2025白色SaaS风格
   ========================================== */
.el-aside {
    background: #ffffff !important;
    border-right: 1px solid #eef0f2;
    box-shadow: 2px 0 12px rgba(0,0,0,0.03);
    overflow-y: auto !important;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid #f0f1f3;
}
.sidebar-brand-icon {
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-size: 17px; font-weight: 700; color: #111827;
    letter-spacing: 0.5px;
}
.sidebar-brand-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #5C8FE6, #4A7AD4);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(92,143,230,0.25);
}

/* 侧边栏菜单 */
.sidebar-menu {
    border-right: none !important;
    background: transparent !important;
    padding: 12px 10px;
}
.sidebar-menu .el-menu-item {
    color: #4b5563 !important;
    height: 44px; line-height: 44px;
    margin: 2px 0; padding: 0 14px !important;
    border-radius: 10px;
    font-size: 14px; font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
    display: flex; align-items: center;
}
.sidebar-menu .el-menu-item:hover {
    background: #f3f5f7 !important;
    color: #111827 !important;
}
.sidebar-menu .el-menu-item.is-active {
    background: rgba(92,143,230,0.08) !important;
    color: #5C8FE6 !important;
    font-weight: 600;
}
.sidebar-menu .el-menu-item .el-icon {
    color: inherit; font-size: 20px;
    margin-right: 12px;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.sidebar-menu .el-menu-item.is-active .el-icon {
    opacity: 1;
}

/* ==========================================
   顶栏 — 轻量透明
   ========================================== */
.el-header {
    background: #ffffff !important;
    border-bottom: 1px solid #eef0f2;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px !important;
    height: 56px !important;
    flex-shrink: 0;
}
.header-avatar {
    width: 32px; height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e8f0fe, #d4e4fc);
    display: flex; align-items: center; justify-content: center;
    color: #5C8FE6; font-weight: 600; font-size: 14px;
}

/* 面包屑 */
.el-breadcrumb { font-size: 13px; }
.el-breadcrumb__inner { color: #9ca3af !important; font-weight: 400; }
.el-breadcrumb__inner.is-link { color: #6b7280 !important; }
.el-breadcrumb__inner.is-link:hover { color: #5C8FE6 !important; }

/* ==========================================
   内容区
   ========================================== */
.el-main {
    padding: 24px 28px;
    background: #f7f8fa;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* ==========================================
   卡片 — Bento 2025风格
   ========================================== */
.el-card {
    border-radius: 16px !important;
    border: 1px solid #eef0f2 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.02);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    margin-bottom: 20px;
}
.el-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
}
.el-card__header {
    padding: 18px 24px 0;
    border-bottom: none;
    font-size: 16px; font-weight: 600;
    color: #111827;
}
.el-card__body { padding: 20px 24px 24px; }

/* 统计卡片(首页) */
.overview-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.overview-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}
.overview-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.overview-grid--main { grid-template-columns: 2fr 1fr; }
.overview-chart { height: 280px; }
.gauge-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.gauge-item {
    position: relative;
    height: 118px;
    text-align: center;
}
.gauge-item canvas {
    width: 100% !important;
    height: 88px !important;
}
.gauge-value {
    position: absolute;
    left: 0; right: 0; top: 48px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}
.gauge-label {
    margin-top: 2px;
    font-size: 12px;
    color: #9ca3af;
}
.stat-card {
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #eef0f2;
    background: #ffffff;
    transition: all 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(92,143,230,0.08);
}
.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}
.stat-card .stat-value {
    font-size: 28px; font-weight: 700; color: #111827;
    line-height: 1.2; margin-bottom: 4px;
}
.stat-card .stat-label {
    font-size: 13px; color: #9ca3af; font-weight: 400;
}
.stat-card--mini-chart {
    position: relative;
    overflow: hidden;
}
.mini-trend {
    position: absolute;
    right: 18px; bottom: 18px;
    width: 82px; height: 36px;
    opacity: .78;
}

/* 首页仪表盘：同一排最多两个 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.dashboard-panel .el-card__header { padding-bottom: 0; }
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.dashboard-metric {
    border: 1px solid #eef0f2;
    border-radius: 12px;
    background: #fafbfc;
    padding: 14px 16px;
}
.dashboard-metric__value {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}
.dashboard-metric__label {
    font-size: 12px;
    color: #9ca3af;
}

/* ==========================================
   表格 — 现代简洁
   ========================================== */
.el-table {
    --el-table-border-color: #f0f1f3;
    border-radius: 8px;
    font-size: 13px;
}
.el-table th.el-table__cell {
    background: #fafbfc;
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0.3px;
    padding: 14px 0;
    border-bottom: 1px solid #eef0f2;
}
.el-table td.el-table__cell {
    padding: 12px 0;
    border-bottom: 1px solid #f5f6f8;
    color: #374151;
}
.el-table .el-table__row:hover > td.el-table__cell {
    background: #fafbfd;
}

/* ==========================================
   表单 / 输入框 — 圆角现代风
   ========================================== */
.el-input__wrapper, .el-textarea__inner {
    border-radius: 10px !important;
    box-shadow: none !important;
    border: 1px solid #e0e2e6;
    transition: all 0.15s;
}
.el-input__wrapper:hover, .el-textarea__inner:hover {
    border-color: #c4c9d0;
}
.el-input.is-focus .el-input__wrapper,
.el-textarea.is-focus .el-textarea__inner {
    border-color: #5C8FE6 !important;
    box-shadow: 0 0 0 3px rgba(92,143,230,0.1) !important;
}
.el-select .el-input__wrapper { border-radius: 10px !important; }
.el-input__inner { font-size: 14px; color: #111827; }
.el-input__inner::placeholder { color: #c4c9d0; }

/* ==========================================
   按钮 — Outline优先
   ========================================== */
.el-button {
    border-radius: 10px !important;
    font-weight: 500; font-size: 14px;
    padding: 8px 18px;
    transition: all 0.15s;
    letter-spacing: 0.2px;
}
.el-button--default {
    border-color: #e0e2e6;
    color: #374151;
}
.el-button--default:hover {
    background: #f5f6f8;
    border-color: #c4c9d0;
}
.el-button--primary {
    background: #5C8FE6;
    border-color: #5C8FE6;
    box-shadow: 0 2px 8px rgba(92,143,230,0.25);
}
.el-button--primary:hover {
    background: #4A7AD4;
    border-color: #4A7AD4;
    box-shadow: 0 4px 14px rgba(92,143,230,0.35);
}
.el-button--small { padding: 5px 12px; font-size: 13px; border-radius: 8px !important; }
.el-button--large { padding: 10px 24px; font-size: 15px; border-radius: 12px !important; }

/* ==========================================
   弹窗 — 大圆角
   ========================================== */
.el-dialog {
    border-radius: 20px !important;
    overflow: hidden;
}
.el-dialog__header {
    padding: 22px 28px 0;
    border-bottom: none;
}
.el-dialog__headerbtn { top: 24px; right: 28px; }
.el-dialog__title { font-size: 18px; font-weight: 700; color: #111827; }
.el-dialog__body { padding: 20px 28px 8px; }
.el-dialog__footer {
    padding: 12px 28px 22px;
    border-top: none;
}

/* ==========================================
   标签 / 状态
   ========================================== */
.el-tag {
    border-radius: 8px; font-weight: 500;
    padding: 2px 10px; font-size: 12px;
    border: none;
}
.el-tag--success { background: #ecfdf5; color: #059669; }
.el-tag--warning { background: #fffbeb; color: #d97706; }
.el-tag--danger { background: #fef2f2; color: #dc2626; }
.el-tag--info { background: #f3f4f6; color: #6b7280; }

/* ==========================================
   分页
   ========================================== */
.el-pagination {
    margin-top: 20px;
    justify-content: flex-end;
    font-size: 13px;
}
.el-pager li {
    border-radius: 8px !important;
    font-weight: 500;
}
.el-pager li.is-active {
    background: #5C8FE6 !important;
    color: #fff !important;
}

/* ==========================================
   表单内联
   ========================================== */
.el-form--inline .el-form-item { margin-right: 16px; margin-bottom: 0; }
.el-form-item__label { color: #374151; font-weight: 500; font-size: 13px; }
.el-form-item { margin-bottom: 20px; }

/* ==========================================
   Element Plus 主色覆盖
   ========================================== */
:root {
    --el-color-primary: #5C8FE6;
    --el-color-primary-light-3: #7BA7F2;
    --el-color-primary-light-5: #9DC3F7;
    --el-color-primary-light-7: #C4DFFB;
    --el-color-primary-light-8: #D9ECFD;
    --el-color-primary-light-9: #ECF5FF;
    --el-color-primary-dark-2: #4A7AD4;
    --el-border-radius-base: 10px;
    --el-border-color: #e0e2e6;
    --el-border-color-light: #eef0f2;
    --el-bg-color: #ffffff;
    --el-fill-color-blank: #ffffff;
}

/* ==========================================
   Tabs 优化
   ========================================== */
.el-tabs__header { margin-bottom: 16px; }
.el-tabs__item {
    font-size: 14px; font-weight: 500;
    color: #6b7280;
    padding: 0 20px;
    height: 40px; line-height: 40px;
}
.el-tabs__item.is-active { color: #5C8FE6; font-weight: 600; }
.el-tabs__active-bar { background: #5C8FE6; border-radius: 2px; }
.el-tabs__nav-wrap::after { height: 1px; background: #eef0f2; }

/* ==========================================
   消息通知
   ========================================== */
.el-message { border-radius: 12px; border: none; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.el-message--success { background: #f0fdf4; color: #166534; }
.el-message--error { background: #fef2f2; color: #991b1b; }
.el-message--warning { background: #fffbeb; color: #92400e; }

/* ==========================================
   AED 地图管理 — 2026 交互地图
   ========================================== */

/* 地图外层：铺满 el-main */
.el-main:has(.aed-map-wrapper) {
    padding: 0 !important;
    overflow: hidden;
    min-height: 0;
}
.aed-map-wrapper {
    position: relative;
    width: 100%; height: 100%; min-height: 0;
}

/* 地图容器 */
.aed-map {
    width: 100%; height: 100%;
    background: #eef2f6;
}
.aed-location-button {
    position: absolute;
    left: 16px; top: 16px;
    z-index: 12;
    height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 12px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    color: #374151;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
    font-weight: 600;
}
.aed-location-button:hover { color: #5C8FE6; background: #fff; }
.wo-de-marker {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(92,143,230,.16);
    display: grid; place-items: center;
    border: 1px solid rgba(92,143,230,.25);
}
.wo-de-marker div {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #5C8FE6;
    box-shadow: 0 0 0 4px rgba(92,143,230,.18);
}

/* 右侧玻璃拟态面板 */
.aed-panel {
    position: absolute;
    right: 16px; top: 16px; bottom: 16px;
    width: 230px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid rgba(255,255,255,0.6);
    display: flex; flex-direction: column;
    z-index: 10;
    transition: width 0.3s ease, height 0.3s ease;
    overflow: hidden;
}
.aed-panel--collapsed {
    width: 36px; height: 36px;
    border-radius: 10px;
}
.aed-panel__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #f0f1f3;
    flex-shrink: 0;
    font-size: 13px;
}
.aed-panel--collapsed .aed-panel__header {
    border-bottom: none;
    padding: 8px;
    justify-content: center;
}
.aed-panel__body {
    flex: 1; overflow-y: auto;
    padding: 10px 10px 12px;
}
.aed-panel__body .el-button { font-size: 12px; }

/* 城市分组 */
.aed-city-groups { display: flex; flex-direction: column; gap: 4px; }
.aed-city-group { }
.aed-city-name {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 6px;
    font-size: 13px; font-weight: 600; color: #374151;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
    user-select: none;
}
.aed-city-name:hover { background: #f5f6f8; }
.aed-device-list { padding-left: 18px; }
.aed-device-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.aed-device-item:hover { background: #f7f9fc; border-color: #e8ecf2; }
.aed-device-item--active { background: rgba(92,143,230,0.06) !important; border-color: rgba(92,143,230,0.2) !important; }

/* AED Marker — 红心脉冲动画 */
.aed-marker {
    position: relative;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
}
.aed-marker__inner {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5C8FE6, #4A7AD4);
    box-shadow: 0 4px 12px rgba(92,143,230,0.4);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px; font-weight: 700;
    position: relative; z-index: 2;
    transition: transform 0.2s;
}
.aed-marker:hover .aed-marker__inner { transform: scale(1.15); }
.aed-marker--offline .aed-marker__inner {
    background: #9ca3af;
    box-shadow: 0 4px 12px rgba(156,163,175,0.3);
}
.aed-marker__pulse {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(92,143,230,0.15);
    animation: aedPulse 2s ease-out infinite;
    z-index: 1;
    pointer-events: none;
}
@keyframes aedPulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

/* 信息窗 */
.aed-infowin {
    min-width: 200px; max-width: 260px;
    padding: 4px;
}
.aed-infowin__btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #e0e2e6;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}
.aed-infowin__btn:hover { background: #f5f6f8; }
.aed-infowin__btn--edit { color: #5C8FE6; border-color: #5C8FE6; }
.aed-infowin__btn--edit:hover { background: rgba(92,143,230,0.06); }
.aed-infowin__btn--del { color: #ef4444; border-color: #ef4444; }
.aed-infowin__btn--del:hover { background: rgba(239,68,68,0.06); }

/* 高德地图右键菜单覆盖 */
.amap-context-menu { border-radius: 10px !important; border: 1px solid #eef0f2 !important; box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important; overflow: hidden; }
.amap-context-menu-item { font-size: 13px !important; padding: 10px 16px !important; }
.amap-context-menu-item:hover { background: #f5f7fa !important; }

/* 高德信息窗覆盖 */
.amap-info-content { padding: 0 !important; }
.amap-info-sharp { display: none; }
.amap-info-close { top: 8px !important; right: 8px !important; }
