/* ========================================
   电子围栏管理页面样式（深色科技风）
   ======================================== */

/* ========================================
   报警横幅
   ======================================== */
.alert-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3000;
    background: linear-gradient(
        135deg,
        rgba(255, 69, 69, 0.95) 0%,
        rgba(255, 107, 107, 0.95) 100%
    );
    box-shadow: 0 4px 20px rgba(255, 69, 69, 0.5);
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.alert-banner.hidden {
    display: none;
}

.alert-banner-slide-in {
    animation: slideDown 0.5s ease;
}

.alert-banner-fade-out {
    animation: fadeOut 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.alert-banner-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.alert-banner-icon {
    font-size: 32px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.alert-banner-info {
    flex: 1;
    color: white;
}

.alert-banner-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

.alert-banner-message {
    font-size: 14px;
    opacity: 0.95;
}

.alert-banner-actions {
    display: flex;
    gap: 12px;
}

.alert-banner-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.alert-banner-btn-view {
    background: rgba(255, 255, 255, 0.95);
    color: rgba(255, 69, 69, 1);
}

.alert-banner-btn-view:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.alert-banner-btn-dismiss {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.alert-banner-btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}




/* 电子围栏主区域 */
.geofence-main {
    padding: 30px 40px;
    max-width: 100%;
    margin: 0 auto;
}

/* 工具栏 */
.geofence-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(
        135deg,
        rgba(15, 17, 23, 0.9) 0%,
        rgba(26, 31, 46, 0.95) 100%
    );
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.geofence-toolbar .btn-primary,
.geofence-toolbar .btn-secondary {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.geofence-toolbar .btn-primary {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.3) 0%,
        rgba(139, 92, 246, 0.25) 100%
    );
    color: rgba(255, 255, 255, 0.95);
}

.geofence-toolbar .btn-primary:hover {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.4) 0%,
        rgba(139, 92, 246, 0.35) 100%
    );
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

.geofence-toolbar .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
}

.geofence-toolbar .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* 围栏列表容器 */
.geofence-content {
    background: transparent;
    padding: 0;
    min-height: calc(100vh - 300px);
}

.fence-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    align-items: start;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    padding-right: 10px;
}

/* 自定义滚动条样式 */
.fence-list::-webkit-scrollbar {
    width: 8px;
}

.fence-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.fence-list::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(59, 130, 246, 0.6) 0%,
        rgba(139, 92, 246, 0.6) 100%
    );
    border-radius: 4px;
}

.fence-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        rgba(59, 130, 246, 0.8) 0%,
        rgba(139, 92, 246, 0.8) 100%
    );
}

/* 当屏幕较小时，自动调整列数 */
@media (max-width: 1400px) {
    .fence-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 加载提示 */
.loading-hint {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

.loading-hint p {
    margin: 0;
}

/* 空提示 */
.empty-fence-hint {
    grid-column: 1 / -1;
    text-align: center;
    padding: 120px 20px;
}

.empty-fence-hint p {
    margin: 0;
}

.empty-fence-hint p:first-child {
    font-size: 80px;
    margin-bottom: 25px;
    opacity: 0.4;
}

.empty-fence-title {
    font-size: 24px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px !important;
}

.empty-fence-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
}

/* 围栏卡片 */
.fence-card {
    background: linear-gradient(
        135deg,
        rgba(15, 17, 23, 0.95) 0%,
        rgba(26, 31, 46, 0.95) 100%
    );
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.fence-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(59, 130, 246, 0.8) 0%,
        rgba(139, 92, 246, 0.8) 100%
    );
}

.fence-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.5);
}

/* 围栏卡片头部 */
.fence-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fence-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.fence-status-icon {
    font-size: 20px;
}

.fence-name {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

/* 自定义开关（统一网页风格） */
.fence-switch {
    position: relative;
}

.fence-toggle-checkbox {
    display: none;
}

.fence-toggle-label {
    display: block;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.fence-toggle-label::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.7) 100%
    );
    border-radius: 50%;
    top: 2px;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.fence-toggle-checkbox:checked + .fence-toggle-label {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.6) 0%,
        rgba(139, 92, 246, 0.5) 100%
    );
    border-color: rgba(59, 130, 246, 0.5);
}

.fence-toggle-checkbox:checked + .fence-toggle-label::after {
    transform: translateX(23px);
}

/* 围栏卡片主体 */
.fence-card-body {
    padding: 15px 0;
    flex: 1;
}

.fence-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.info-label {
    color: rgba(255, 255, 255, 0.6);
}

.info-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.fence-description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* 围栏卡片底部操作按钮 */
.fence-card-footer {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.fence-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fence-btn-view {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.25) 0%,
        rgba(139, 92, 246, 0.2) 100%
    );
    color: rgba(255, 255, 255, 0.95);
}

.fence-btn-view:hover {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.35) 0%,
        rgba(139, 92, 246, 0.3) 100%
    );
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.fence-btn-edit {
    background: rgba(255, 165, 0, 0.15);
    color: rgba(255, 200, 100, 0.95);
}

.fence-btn-edit:hover {
    background: rgba(255, 165, 0, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.2);
}

.fence-btn-delete {
    background: rgba(255, 69, 69, 0.15);
    color: rgba(255, 120, 120, 0.95);
}

.fence-btn-delete:hover {
    background: rgba(255, 69, 69, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 69, 69, 0.2);
}

/* 地图预览 */
.fence-map-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    background: linear-gradient(
        135deg,
        rgba(15, 17, 23, 0.98) 0%,
        rgba(26, 31, 46, 0.98) 100%
    );
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(59, 130, 246, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.fence-map-preview.hidden {
    display: none;
}

.map-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.map-preview-header h3 {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-size: 18px;
}

.close-preview-btn {
    background: rgba(255, 69, 69, 0.15);
    border: 1px solid rgba(255, 69, 69, 0.3);
    color: rgba(255, 255, 255, 0.9);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-preview-btn:hover {
    background: rgba(255, 69, 69, 0.25);
    transform: scale(1.1);
}

.preview-map-container {
    flex: 1;
    position: relative;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

/* ========================================
   围栏绘制对话框
   ======================================== */
.fence-draw-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fence-draw-content {
    width: 95%;
    max-width: 1400px;
    height: 85vh;
    background: linear-gradient(
        135deg,
        rgba(15, 17, 23, 0.98) 0%,
        rgba(26, 31, 46, 0.98) 100%
    );
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(59, 130, 246, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fence-draw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fence-draw-header h3 {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.close-dialog-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 69, 69, 0.15);
    border: 1px solid rgba(255, 69, 69, 0.3);
    color: rgba(255, 255, 255, 0.9);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-dialog-btn:hover {
    background: rgba(255, 69, 69, 0.3);
    transform: scale(1.1);
}

.fence-draw-body {
    flex: 1;
    display: flex;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

/* 地图绘制区域 */
.fence-draw-map-container {
    flex: 2;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fence-draw-map {
    width: 100%;
    height: 100%;
}

.fence-draw-toolbar {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.draw-tool-btn {
    padding: 10px 18px;
    border-radius: 8px;
    background: linear-gradient(
        135deg,
        rgba(15, 17, 23, 0.95) 0%,
        rgba(26, 31, 46, 0.95) 100%
    );
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.draw-tool-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.3) 0%,
        rgba(139, 92, 246, 0.25) 100%
    );
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.draw-tool-btn-danger {
    border-color: rgba(255, 69, 69, 0.4);
}

.draw-tool-btn-danger:hover {
    background: rgba(255, 69, 69, 0.2);
    box-shadow: 0 6px 20px rgba(255, 69, 69, 0.3);
}

/* 围栏配置表单 */
.fence-draw-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.05) 0%,
        rgba(139, 92, 246, 0.03) 100%
    );
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    padding: 12px 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* 颜色选择器 */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker-group input[type="color"] {
    width: 50px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    cursor: pointer;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* 复选框样式 */
.form-group-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form-group-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-group-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: rgba(59, 130, 246, 0.8);
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-actions .btn-primary {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.4) 0%,
        rgba(139, 92, 246, 0.35) 100%
    );
    color: rgba(255, 255, 255, 0.95);
}

.form-actions .btn-primary:hover {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.5) 0%,
        rgba(139, 92, 246, 0.45) 100%
    );
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.form-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
}

.form-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ========================================
   报警历史对话框
   ======================================== */
.alert-history-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.alert-history-content {
    width: 90%;
    max-width: 900px;
    height: 80vh;
    background: linear-gradient(
        135deg,
        rgba(15, 17, 23, 0.98) 0%,
        rgba(26, 31, 46, 0.98) 100%
    );
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(59, 130, 246, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.alert-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-history-header h3 {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.alert-history-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 报警过滤栏 */
.alert-filter-bar {
    display: flex;
    gap: 10px;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-btn {
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.filter-btn.active {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.3) 0%,
        rgba(139, 92, 246, 0.25) 100%
    );
    border-color: rgba(59, 130, 246, 0.5);
    color: rgba(255, 255, 255, 0.95);
}

/* 报警列表 */
.alert-list {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.empty-alert-hint {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.empty-alert-hint p {
    font-size: 24px;
    margin: 0;
}

/* 报警项 */
.alert-item {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.05) 0%,
        rgba(139, 92, 246, 0.03) 100%
    );
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left-width: 4px;
    transition: all 0.3s ease;
}

.alert-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.alert-item.pending {
    background: linear-gradient(
        135deg,
        rgba(255, 165, 0, 0.1) 0%,
        rgba(255, 69, 69, 0.08) 100%
    );
}

.alert-item.acknowledged {
    opacity: 0.7;
}

.alert-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.alert-fence-name {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.alert-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.alert-item-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.alert-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.alert-label {
    color: rgba(255, 255, 255, 0.6);
}

.alert-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.alert-item-footer {
    display: flex;
    gap: 10px;
}

.alert-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-btn-ack {
    background: linear-gradient(
        135deg,
        rgba(76, 175, 80, 0.25) 0%,
        rgba(46, 125, 50, 0.2) 100%
    );
    color: rgba(200, 230, 201, 0.95);
}

.alert-btn-ack:hover {
    background: linear-gradient(
        135deg,
        rgba(76, 175, 80, 0.35) 0%,
        rgba(46, 125, 50, 0.3) 100%
    );
    transform: translateY(-2px);
}

.alert-btn-view {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.25) 0%,
        rgba(139, 92, 246, 0.2) 100%
    );
    color: rgba(255, 255, 255, 0.95);
}

.alert-btn-view:hover {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.35) 0%,
        rgba(139, 92, 246, 0.3) 100%
    );
    transform: translateY(-2px);
}

.alert-btn-delete {
    background: rgba(255, 69, 69, 0.15);
    color: rgba(255, 120, 120, 0.95);
}

.alert-btn-delete:hover {
    background: rgba(255, 69, 69, 0.25);
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .fence-draw-body {
        flex-direction: column;
    }

    .fence-draw-map-container {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .geofence-main {
        padding: 15px;
    }

    .geofence-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .geofence-toolbar .btn-primary,
    .geofence-toolbar .btn-secondary {
        width: 100%;
    }

    .fence-list {
        grid-template-columns: 1fr;
    }

    .fence-map-preview {
        width: 95%;
        height: 90vh;
    }

    .geofence-entry-btn {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }

    .fence-draw-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .fence-draw-toolbar {
        flex-direction: column;
        gap: 8px;
    }

    .draw-tool-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .alert-history-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .alert-filter-bar {
        flex-wrap: wrap;
        padding: 15px;
    }

    .alert-list {
        padding: 15px;
    }

    .alert-item-footer {
        flex-wrap: wrap;
    }
}

/* ========================================
   报警历史对话框样式
   ======================================== */
.alert-history-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.alert-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg,
        rgba(15, 17, 23, 0.9) 0%,
        rgba(26, 31, 46, 0.95) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.alert-filter-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 8px;
    background: rgba(15, 17, 23, 0.5);
    border-radius: 12px;
}

.alert-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.alert-tab:hover {
    background: rgba(59, 130, 246, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.alert-tab.active {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.3) 0%,
        rgba(139, 92, 246, 0.2) 100%);
    color: #ffffff;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.alert-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px;
}

.empty-alert-hint {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

.alert-card {
    background: linear-gradient(135deg,
        rgba(15, 17, 23, 0.9) 0%,
        rgba(26, 31, 46, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.alert-card.pending {
    border-left: 4px solid #ff6b6b;
}

.alert-card.acknowledged {
    border-left: 4px solid #00d084;
    opacity: 0.8;
}

.alert-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.alert-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
}

.alert-title {
    flex: 1;
}

.alert-title h4 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.alert-type {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.alert-status {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.alert-status.pending {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.alert-status.acknowledged {
    background: rgba(0, 208, 132, 0.2);
    color: #00d084;
    border: 1px solid rgba(0, 208, 132, 0.3);
}

.alert-card-body {
    margin-bottom: 16px;
}

.alert-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.alert-info-row:last-child {
    border-bottom: none;
}

.alert-info-row .info-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.alert-info-row .info-value {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.alert-card-footer {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.alert-btn-acknowledge {
    background: linear-gradient(135deg,
        rgba(0, 208, 132, 0.2) 0%,
        rgba(0, 176, 112, 0.15) 100%);
    color: #00d084;
    border: 1px solid rgba(0, 208, 132, 0.3);
}

.alert-btn-acknowledge:hover {
    background: linear-gradient(135deg,
        rgba(0, 208, 132, 0.3) 0%,
        rgba(0, 176, 112, 0.25) 100%);
    transform: translateY(-2px);
}

.alert-btn-delete {
    background: linear-gradient(135deg,
        rgba(255, 107, 107, 0.2) 0%,
        rgba(255, 82, 82, 0.15) 100%);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.alert-btn-delete:hover {
    background: linear-gradient(135deg,
        rgba(255, 107, 107, 0.3) 0%,
        rgba(255, 82, 82, 0.25) 100%);
    transform: translateY(-2px);
}
