/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
}

body {
    background: #0b1a30;
    color: #e0f0ff;
}

/* ========== 登录页面 ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 20% 20%, #1a3a5a, #0a1a2f);
    margin: 0;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: rgba(10, 25, 45, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 24px;
    padding: 40px 35px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 255, 255, 0.4);
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-brand {
    text-align: center;
    margin-bottom: 30px;
}

.login-brand h1 {
    font-size: 32px;
    background: linear-gradient(135deg, #fff, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px cyan;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.login-brand p {
    color: #a0c0ff;
    font-size: 16px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0,255,255,0.5);
}

/* 登录表单横向布局 */
.login-form .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(0, 30, 50, 0.5);
    border-radius: 12px;
    padding: 5px 15px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.login-form .form-group:focus-within {
    border-color: cyan;
    box-shadow: 0 0 10px cyan;
}

.login-form .form-group label {
    width: 70px;
    color: #00ffff;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 0 5px cyan;
    margin-bottom: 0;
    letter-spacing: 0.5px;
}

.login-form .form-group input {
    flex: 1;
    height: 48px;
    background: transparent !important;
    border: none !important;
    padding: 0 10px;
    color: #fff;
    font-size: 15px;
    outline: none;
    box-shadow: none !important;
}

.login-form .form-group input::placeholder {
    color: #6b8c9c;
    font-size: 14px;
}

.btn-login {
    width: 100%;
    height: 52px;
    background: linear-gradient(145deg, #00c8ff, #0077ff);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
    margin-top: 25px;
    text-transform: uppercase;
}

.btn-login:hover {
    background: linear-gradient(145deg, #00a0ff, #0055cc);
    box-shadow: 0 8px 25px rgba(0, 255, 255, 0.7);
    transform: translateY(-2px);
}

.error-message {
    background: rgba(255, 77, 77, 0.15);
    border: 1px solid #ff4d4d;
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 25px;
    color: #ff8a8a;
    text-align: center;
    font-size: 14px;
    backdrop-filter: blur(4px);
}

/* ========== 后台主布局 ========== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(5, 20, 35, 0.9);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(0,255,255,0.2);
}

.sidebar-header h2 {
    font-size: 22px;
    color: #fff;
    text-shadow: 0 0 10px cyan;
}

.sidebar-header p {
    color: #a0c0ff;
    font-size: 14px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: block;
    padding: 12px 20px;
    color: #c0d8ff;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(0, 255, 255, 0.1);
    border-left-color: cyan;
    color: #fff;
    box-shadow: 0 0 15px rgba(0,255,255,0.3);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(0,255,255,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #a0c0ff;
}

.logout-btn {
    color: #ff4d4d;
    text-decoration: none;
    border: 1px solid #ff4d4d;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    transition: 0.3s;
}

.logout-btn:hover {
    background: #ff4d4d;
    color: #fff;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* ========== 页面标题 ========== */
.page-title {
    font-size: 28px;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 0 0 10px cyan;
    border-bottom: 1px solid cyan;
    padding-bottom: 10px;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(10, 25, 45, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0,255,255,0.2);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.stat-icon {
    font-size: 40px;
}

.stat-content h3 {
    font-size: 16px;
    color: #a0c0ff;
    margin-bottom: 5px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px cyan;
}

/* ========== 表格 ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(10, 25, 45, 0.7);
    backdrop-filter: blur(5px);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.data-table th {
    background: rgba(0, 50, 80, 0.8);
    color: #00ffff;
    font-weight: 500;
    padding: 15px;
    text-align: left;
    font-size: 14px;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0,255,255,0.1);
    color: #c0d8ff;
}

.data-table tbody tr:hover {
    background: rgba(0, 150, 255, 0.15);
}

/* 操作按钮 */
.actions {
    display: flex;
    gap: 8px;
}

.btn-edit, .btn-delete, .btn-primary, .btn-secondary {
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    transition: 0.3s;
    border: 1px solid transparent;
}

.btn-edit {
    background: rgba(0, 255, 255, 0.1);
    color: cyan;
    border-color: cyan;
}

.btn-edit:hover {
    background: cyan;
    color: #0b1a30;
}

.btn-delete {
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border-color: #ff4d4d;
}

.btn-delete:hover {
    background: #ff4d4d;
    color: #fff;
}

.btn-primary {
    background: cyan;
    color: #0b1a30;
    padding: 8px 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    box-shadow: 0 0 15px cyan;
}

.btn-secondary {
    background: transparent;
    color: #a0c0ff;
    border-color: #a0c0ff;
    padding: 8px 16px;
}

.btn-secondary:hover {
    background: rgba(160, 192, 255, 0.2);
}

/* ========== 徽章 ========== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge.success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.badge.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.badge.danger {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
    border: 1px solid #ff4d4d;
}

.badge.secondary {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    padding: 6px 12px;
    background: rgba(10, 25, 45, 0.7);
    border: 1px solid cyan;
    border-radius: 6px;
    color: cyan;
    text-decoration: none;
}

.pagination a.active,
.pagination a:hover {
    background: cyan;
    color: #0b1a30;
}

/* ========== 表单 ========== */
.form {
    max-width: 600px;
    background: rgba(10, 25, 45, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid cyan;
    border-radius: 16px;
    padding: 30px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #a0c0ff;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 40, 70, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: cyan;
    box-shadow: 0 0 10px cyan;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #a0c0ff;
    font-size: 12px;
}

/* ========== 模块头部 ========== */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* ========== 筛选条 ========== */
.filter-bar {
    background: rgba(10, 25, 45, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid cyan;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.filter-bar form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
    background: rgba(0, 40, 70, 0.8);
    border: 1px solid cyan;
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    min-width: 150px;
}

/* ========== 最新报警区块 ========== */
.recent-alarms h2 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 20px;
    border-left: 4px solid cyan;
    padding-left: 10px;
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .admin-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0,255,255,0.2);
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        flex-direction: column;
    }
    /* 登录页移动端适配 */
    .login-form .form-group {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }
    .login-form .form-group label {
        width: auto;
        margin-bottom: 8px;
    }
    .login-form .form-group input {
        width: 100%;
        background: rgba(0, 40, 70, 0.7) !important;
        border-radius: 8px;
        padding: 12px;
    }
    .success-message {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid #2ecc71;
    border-radius: 8px;
    padding: 10px;
    color: #2ecc71;
    margin-bottom: 20px;
}
}