:root {
    --primary-color: #2D3748;    /* 深灰蓝 */
    --accent-color: #ED8936;     /* 浅橙 */
    --bg-color: #F7FAFC;         /* 浅灰 */
    --card-bg: #FFFFFF;          /* 纯白 */
    --text-main: #2D3748;
    --text-muted: #718096;
    --border-color: #E2E8F0;
    --sidebar-width: 240px;
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* --- Layout --- */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-color);
    color: #FFFFFF;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #A0AEC0;
    font-weight: 500;
}

.sidebar-nav li a i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

.sidebar-nav li a:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav li a.active {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
    border-right: 3px solid var(--accent-color);
}

.nav-label {
    padding: 20px 24px 8px;
    font-size: 12px;
    color: #4A5568;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: 64px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.top-bar .user-info {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar .time {
    color: var(--text-muted);
    font-size: 12px;
}

.content-wrapper {
    padding: 32px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* --- Components --- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    margin-bottom: 24px;
}

h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-info h3 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-info .value {
    font-size: 24px;
    font-weight: 700;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.1s, background 0.2s;
    gap: 8px;
}

.btn:hover {
    transform: scale(1.02);
}

.btn-primary {
    background: var(--accent-color);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: #DD6B20;
}

.btn-outline {
    border-color: var(--border-color);
    background: transparent;
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #FFFFFF;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent-color);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-up { background: #C6F6D5; color: #22543D; }
.badge-down { background: #FED7D7; color: #822727; }
.badge-unknown { background: #EDF2F7; color: #4A5568; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
    .top-bar {
        padding: 0 16px;
    }
    .content-wrapper {
        padding: 16px;
    }
}

/* --- Utility Classes --- */

/* Text Colors */
.text-accent { color: var(--accent-color); }
.text-primary { color: var(--primary-color); }
.text-muted { color: var(--text-muted); }
.text-success { color: #38A169; }
.text-danger { color: #E53E3E; }
.text-warning { color: #DD6B20; }
.text-info { color: #4299E1; }
.text-gray { color: #666; }
.text-gray-light { color: #95a5a6; }
.text-white { color: white; }
.text-required { color: #e74c3c; }
.text-monospace { font-family: 'Courier New', monospace; }

/* Background Colors */
.bg-gray { background: #eee; }
.bg-gray-light { background: #f8f9fa; }
.bg-white { background: white; }
.bg-success-light { background: #C6F6D5; }
.bg-danger-light { background: #FED7D7; }
.bg-warning-light { background: #FEFCBF; }
.bg-info-light { background: #BEE3F8; }

/* Font Weights */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Font Sizes */
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 13px; }
.text-lg { font-size: 14px; }
.text-xl { font-size: 16px; }
.text-2xl { font-size: 18px; }
.text-3xl { font-size: 28px; }

/* Display & Layout */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-start { display: flex; align-items: center; justify-content: flex-start; }
.flex-end { display: flex; align-items: center; justify-content: flex-end; }
.flex-column { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-2rem { gap: 2rem; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* Alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }

/* Spacing */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-8 { margin-left: 10px; }
.ml-12 { margin-left: 12px; }
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-600 { max-width: 600px; }
.max-w-700 { max-width: 700px; }
.max-w-900 { max-width: 900px; }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

/* Border Radius */
.rounded { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-full { border-radius: 50%; }

/* Border */
.border { border: 1px solid var(--border-color); }
.border-gray { border: 1px solid #dee2e6; }
.border-danger { border: 1px solid #FED7D7; }

/* Cursor */
.pointer { cursor: pointer; }
.not-allowed { cursor: not-allowed; }

/* Opacity */
.opacity-30 { opacity: 0.3; }
.opacity-50 { opacity: 0.5; }

/* Overflow */
.truncate {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Component Specific Styles */

/* User Avatar */
.user-avatar {
    width: 32px;
    height: 32px;
    background: #E2E8F0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--primary-color);
}

/* Alert Box */
.alert-box {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid;
}
.alert-success {
    background: #C6F6D5;
    color: #22543D;
    border-color: #9AE6B4;
}
.alert-error {
    background: #FED7D7;
    color: #822727;
    border-color: #FEB2B2;
}

/* Alert Container */
.alerting-box {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #FEE 0%, #FED7D7 100%);
    border: 2px solid #E53E3E;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

/* Success Msg */
.success-msg {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* Info Box */
.info-box {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}
.info-box-yellow {
    background: #FFF4E5;
    border: 1px solid #FFE0B2;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 1rem;
}

/* Type Badge */
.type-badge {
    font-size: 11px;
    background: #EDF2F7;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    color: #4A5568;
}

/* Status Text */
.status-text-up { color: #2ecc71; }
.status-text-down { color: #e74c3c; }
.status-text-unknown { color: #95a5a6; }

/* Response Time Colors */
.rt-fast { color: #2ecc71; }
.rt-medium { color: #f39c12; }
.rt-slow { color: #e74c3c; }

/* Public/Private Badge */
.badge-public { color: #38A169; }
.badge-private { color: var(--text-muted); }

/* Small Badge */
.small-badge {
    color: #E53E3E;
    font-size: 10px;
    display: block;
    margin-top: 4px;
    font-weight: bold;
}

/* Card with no padding */
.card-no-padding {
    padding: 0;
    overflow: hidden;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Compact Button */
.btn-compact {
    padding: 6px 10px;
    font-size: 12px;
}

/* Table Cell Truncate */
.table-cell-truncate {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Typo Badge */
.typo-badge-bad {
    background: #FADBD8;
    color: #C0392B;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.typo-badge-good {
    background: #EAFAF1;
    color: #1E8449;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Stat Card Centered */
.stat-card-centered {
    text-align: center;
}
.stat-card-centered .stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
}
.stat-card-centered .stat-value {
    font-size: 28px;
    font-weight: 700;
}

/* Info Grid Item */
.info-grid-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
}
.info-grid-item .info-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}
.info-grid-item .info-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Filter Form */
.filter-form {
    background: #F7FAFC;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.filter-form-danger {
    background: #FFF5F5;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #FED7D7;
}

/* Filter Label */
.filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4A5568;
    margin-bottom: 6px;
}
.filter-label-danger {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #C53030;
    margin-bottom: 6px;
}

/* Filter Select */
.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}
.filter-select-danger {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #FED7D7;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Filter Input */
.filter-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 14px;
}
.filter-input-danger {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #FED7D7;
    border-radius: 6px;
    font-size: 14px;
}

/* Filter Button */
.filter-btn {
    padding: 8px 16px;
    background: #4299E1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}
.filter-btn-danger {
    padding: 8px 16px;
    background: #E53E3E;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

/* Clear Filters Link */
.clear-filters {
    padding: 8px 16px;
    background: #E2E8F0;
    color: #4A5568;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

/* Active Filters Info */
.active-filters-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E2E8F0;
    font-size: 13px;
    color: #718096;
}
.active-filters-info-danger {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #FED7D7;
    font-size: 13px;
    color: #C53030;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.pagination-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pagination-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.per-page-select {
    padding: 6px 32px 6px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: all 0.3s;
}
.per-page-select:focus {
    border-color: #4299E1;
}

/* Pagination Buttons */
.pagination-btn {
    padding: 8px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    color: #4A5568;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pagination-btn:hover {
    border-color: #4299E1;
    color: #4299E1;
}
.pagination-btn.disabled {
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    color: #CBD5E0;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: not-allowed;
}

/* Page Number */
.page-number {
    padding: 8px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    color: #4A5568;
    text-decoration: none;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
    transition: all 0.3s;
}
.page-number:hover {
    border-color: #4299E1;
    color: #4299E1;
}
.page-number.active {
    padding: 8px 12px;
    border: 2px solid #4299E1;
    background: #4299E1;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

/* Ellipsis */
.page-ellipsis {
    padding: 8px 4px;
    color: #A0AEC0;
}

/* Small Help Text */
.help-text {
    color: #666;
    display: block;
    margin-top: 0.5rem;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Alert Box Icon */
.alert-icon-large {
    font-size: 32px;
}
.alert-icon-medium {
    font-size: 36px;
}
.alert-icon-small {
    font-size: 48px;
}

/* Export Buttons */
.btn-export-html {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn-export-html:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.btn-export-excel {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}
.btn-export-excel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}
.btn-export-csv {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}
.btn-export-csv:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Monitor Info Bar */
.monitor-info-bar {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
}
.monitor-info-item span:first-child {
    color: #666;
    font-size: 0.9rem;
}
.monitor-info-item div:last-child {
    font-weight: 600;
}

/* Settings Form Grid */
.settings-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Alert Settings Box */
.alert-settings-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* Input Disabled */
.input-disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Close Button */
.btn-close-alert {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
}

/* Animation Keyframes */
@keyframes pulse-alert {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(229, 62, 62, 0); }
}

/* Form Label Bold */
.label-bold {
    font-weight: 600;
}

/* Small Text */
.small-text {
    font-size: 12px;
}

/* Link No Underline */
.link-no-underline {
    text-decoration: none;
}

/* Button Gray */
.btn-gray {
    background: #eee;
    color: #333;
}

/* Button Orange */
.btn-orange {
    background: #FF9800;
    color: white;
}

/* Submit Button Large */
.btn-submit-large {
    width: auto;
    padding: 0.75rem 2.5rem;
}

/* Back Button */
.btn-back {
    background: #eee;
    color: #333;
    margin-right: 1rem;
}

/* Auth Page Specific */
.auth-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
}

.auth-box {
    background: #FFFFFF;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
}
