/* 传感器报警管理样式 */

#alert-management-app {
    min-height: calc(100vh - 200px);
    background: #f0f2f5;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 顶部标题栏 */
.alert-header {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-left h1 {
    margin: 0;
    font-size: 24px;
    color: #1890ff;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 4px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-value {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.stat-value.alert-open {
    color: #ff4d4f;
}

.stat-value.alert-acknowledged {
    color: #faad14;
}

.header-right {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.btn-primary, .btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #d9d9d9;
}

.btn-secondary:hover {
    background: #e6f7ff;
    border-color: #1890ff;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 筛选工具栏 */
.filter-toolbar {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="date"] {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

.filter-group input[type="text"] {
    width: 150px;
}

.filter-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

/* 统计图表区域 */
.statistics-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.chart-container {
    width: 100%;
    height: 250px;
}

@media (max-width: 1200px) {
    .statistics-panel {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .statistics-panel {
        grid-template-columns: 1fr;
    }
}

/* 报警列表面板 */
.alert-list-panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.panel-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.alert-table-container {
    overflow-x: auto;
}

.alert-table {
    width: 100%;
    border-collapse: collapse;
}

.alert-table thead {
    background: #fafafa;
}

.alert-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    border-bottom: 2px solid #e8e8e8;
    white-space: nowrap;
}

.alert-table td {
    padding: 12px;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.alert-table tbody tr:hover {
    background: #f5f5f5;
}

.alert-table tbody tr.loading-row {
    text-align: center;
}

.loading-spinner {
    padding: 20px;
    color: #999;
}

/* 报警级别标签 */
.alert-level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.alert-level.info {
    background: #e6f7ff;
    color: #1890ff;
}

.alert-level.warning {
    background: #fff7e6;
    color: #faad14;
}

.alert-level.critical {
    background: #fff1f0;
    color: #ff4d4f;
}

.alert-level.urgent {
    background: #ff4d4f;
    color: #fff;
}

/* 报警状态标签 */
.alert-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.alert-status.open {
    background: #fff1f0;
    color: #ff4d4f;
}

.alert-status.acknowledged {
    background: #fff7e6;
    color: #faad14;
}

.alert-status.resolved {
    background: #f6ffed;
    color: #52c41a;
}

.alert-status.closed {
    background: #f5f5f5;
    color: #999;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 6px;
}

.action-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.view {
    background: #e6f7ff;
    color: #1890ff;
}

.action-btn.view:hover {
    background: #bae7ff;
}

.action-btn.acknowledge {
    background: #fff7e6;
    color: #faad14;
}

.action-btn.acknowledge:hover {
    background: #ffe58f;
}

.action-btn.resolve {
    background: #f6ffed;
    color: #52c41a;
}

.action-btn.resolve:hover {
    background: #d9f7be;
}

.action-btn.close {
    background: #f5f5f5;
    color: #666;
}

.action-btn.close:hover {
    background: #e8e8e8;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

#page-info {
    font-size: 14px;
    color: #666;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    zoom: var(--dynamic-zoom, 0.85);
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content.large-modal {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* 详情展示 */
.detail-section {
    margin-bottom: 20px;
}

.detail-section h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.detail-row {
    display: flex;
    margin-bottom: 12px;
}

.detail-label {
    width: 120px;
    font-weight: 500;
    color: #666;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    color: #333;
    text-align: left;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.form-group label .required {
    color: #ff4d4f;
    margin-left: 4px;
}

.form-group textarea,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 条件配置面板 */
.condition-config-panel {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
}

.condition-config-panel .form-group {
    margin-bottom: 15px;
}

.condition-config-panel .form-group:last-child {
    margin-bottom: 0;
}

/* 规则表格 */
.rule-toolbar {
    margin-bottom: 15px;
}

.rule-list-container {
    overflow-x: auto;
}

.rule-table {
    width: 100%;
    border-collapse: collapse;
}

.rule-table thead {
    background: #fafafa;
}

.rule-table th,
.rule-table td {
    padding: 12px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.rule-table th {
    font-weight: 600;
    color: #333;
}

.rule-table tbody tr:hover {
    background: #f5f5f5;
}

/* 启用状态开关 */
.enabled-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.enabled-badge.enabled {
    background: #f6ffed;
    color: #52c41a;
}

.enabled-badge.disabled {
    background: #f5f5f5;
    color: #999;
}

/* 小型模态框（确认/提示对话框） */
.modal-content.small-modal {
    max-width: 400px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

/* 确认对话框特殊样式 */
#confirm-dialog .modal-body p,
#alert-dialog .modal-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

#confirm-dialog .modal-header h2,
#alert-dialog .modal-header h2 {
    font-size: 16px;
    font-weight: 500;
}

/* 对话框按钮 */
#confirm-dialog-ok,
#confirm-dialog-cancel,
#alert-dialog-ok {
    min-width: 80px;
    padding: 6px 16px;
}

