* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00f6ff;
    --secondary-color: #0099ff;
    --success-color: #00ff88;
    --warning-color: #ffaa00;
    --danger-color: #ff3b30;
    --bg-dark: #0a0e27;
    --bg-darker: #060a1a;
    --bg-card: rgba(15, 25, 45, 0.85);
    --border-color: rgba(0, 246, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #b0c4de;
    --shadow-glow: 0 0 20px rgba(0, 246, 255, 0.3);
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1f3a 50%, var(--bg-darker) 100%);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* 头部导航 */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(10, 14, 39, 0.95);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 10px rgba(0, 246, 255, 0.6));
    animation: logoGlow 2s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 246, 255, 0.6)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 246, 255, 0.9)); }
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.logo-text span {
    font-size: 11px;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.system-time {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 20px;
    font-size: 13px;
    color: var(--success-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--success-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.header-btn {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(0, 246, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-btn:hover {
    background: rgba(0, 246, 255, 0.2);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.header-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(0, 246, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: rgba(0, 246, 255, 0.2);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.username {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    fill: var(--text-secondary);
    transition: transform 0.3s ease;
}

.user-profile:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    width: 240px;
    height: calc(100vh - 70px);
    background: rgba(10, 14, 39, 0.95);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.nav-menu {
    padding: 20px 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    background: rgba(0, 246, 255, 0.1);
    color: var(--primary-color);
}

.nav-item:hover::before, .nav-item.active::before {
    transform: scaleY(1);
}

.nav-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}

.nav-item span:not(.nav-badge) {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.nav-badge {
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-toggle {
    width: 100%;
    padding: 12px;
    background: rgba(0, 246, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(0, 246, 255, 0.2);
    box-shadow: var(--shadow-glow);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* 主内容区 */
.main-content {
    margin-left: 240px;
    margin-top: 70px;
    padding: 30px;
    min-height: calc(100vh - 70px);
    transition: margin-left 0.3s ease;
}

.page-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(0, 246, 255, 0.2);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: linear-gradient(135deg, rgba(0, 153, 255, 0.2) 0%, rgba(0, 246, 255, 0.2) 100%);
    box-shadow: 0 0 20px rgba(0, 153, 255, 0.3);
}

.stat-icon.red {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.2) 0%, rgba(255, 100, 100, 0.2) 100%);
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.3);
}

.stat-icon.green {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 200, 100, 0.2) 100%);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.stat-icon.purple {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2) 0%, rgba(186, 85, 211, 0.2) 100%);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.stat-icon svg {
    width: 30px;
    height: 30px;
    fill: var(--primary-color);
}

.stat-icon.red svg {
    fill: var(--danger-color);
}

.stat-icon.green svg {
    fill: var(--success-color);
}

.stat-icon.purple svg {
    fill: #ba55d3;
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 5px;
}

.stat-value .number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Arial', sans-serif;
}

.stat-value .unit {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
}

.stat-trend.up {
    color: var(--success-color);
}

.stat-trend.down {
    color: var(--danger-color);
}

.stat-trend svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* 图表区域 */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.chart-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(0, 246, 255, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    background: rgba(0, 246, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: rgba(0, 246, 255, 0.2);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    fill: var(--primary-color);
}

.chart-container {
    height: 300px;
    position: relative;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* 告警列表卡片 */
.alert-list-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
}

.btn-primary {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(0, 153, 255, 0.5);
    transform: translateY(-2px);
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(10, 20, 40, 0.5);
    border: 1px solid var(--border-color);
    border-left: 3px solid;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.alert-item:hover {
    background: rgba(10, 20, 40, 0.8);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.alert-item.critical {
    border-left-color: var(--danger-color);
}

.alert-item.warning {
    border-left-color: var(--warning-color);
}

.alert-item.info {
    border-left-color: var(--primary-color);
}

.alert-level {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-level.critical {
    background: rgba(255, 59, 48, 0.2);
}

.alert-level.warning {
    background: rgba(255, 170, 0, 0.2);
}

.alert-level.info {
    background: rgba(0, 246, 255, 0.2);
}

.alert-level svg {
    width: 20px;
    height: 20px;
}

.alert-level.critical svg {
    fill: var(--danger-color);
}

.alert-level.warning svg {
    fill: var(--warning-color);
}

.alert-level.info svg {
    fill: var(--primary-color);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alert-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.alert-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7),
                0 0 80px rgba(0, 246, 255, 0.3);
    animation: slideUp 0.4s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 59, 48, 0.2);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    fill: var(--danger-color);
}

.modal-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
}

.btn-danger {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--danger-color) 0%, #ff6b6b 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.5);
    transform: translateY(-2px);
}

/* 表单样式 */
.form-row {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(10, 20, 40, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 246, 255, 0.3);
    background: rgba(10, 20, 40, 0.8);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(0, 246, 255, 0.05);
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    color: var(--text-secondary);
    font-size: 14px;
}

.data-table tbody tr {
    transition: all 0.3s ease;
    cursor: pointer;
}

.data-table tbody tr:hover {
    background: rgba(0, 246, 255, 0.05);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 246, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .header-center {
        display: none;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 20, 40, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}
