* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: #ffffff;
    padding: 20px 30px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 20px;
    color: #007bff;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #6c757d;
}

.status-dot.online {
    background-color: #28a745;
}

.status-dot.offline {
    background-color: #dc3545;
}

.config-section {
    background: #ffffff;
    padding: 20px 30px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.config-section h2 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #007bff;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.config-item:last-child {
    border-bottom: none;
}

.config-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #495057;
    font-size: 14px;
}

.config-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.config-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 14px;
}

.config-value {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #212529;
    font-weight: 500;
    font-size: 14px;
}

code.config-value {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 13px;
}

.toolbar {
    background: #ffffff;
    padding: 15px 30px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    background-color: #f8f9fa;
}

.btn-primary {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.messages-section {
    background: #ffffff;
    padding: 20px 30px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.messages-section h2 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #007bff;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

.messages-list {
    max-height: 600px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 14px;
}

.message-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.message-card:hover {
    border-color: #007bff;
    background-color: #e9ecef;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-id {
    font-weight: 600;
    color: #007bff;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.message-time {
    color: #6c757d;
    font-size: 12px;
}

.message-preview {
    background: #ffffff;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

#loginModal {
    display: flex;
}

#loginModal {
    display: flex;
}

#advancedSettingsModal,
#messageModal {
    display: none;
}

#advancedSettingsModal.active,
#messageModal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 4px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #dee2e6;
}

.modal-large {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #007bff;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h2 {
    margin-bottom: 0;
    font-size: 18px;
    font-weight: 600;
    color: #007bff;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.close-btn:hover {
    background-color: #e9ecef;
    color: #212529;
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

#loginForm input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
    transition: border-color 0.15s ease;
}

#loginForm input[type="password"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#loginForm button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: #ffffff;
    border: 1px solid #007bff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

#loginForm button:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
    padding: 8px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.message-detail {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-item.full-width {
    flex-direction: column;
    gap: 8px;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #6c757d;
    min-width: 120px;
    font-size: 14px;
}

.detail-value {
    color: #212529;
    word-break: break-word;
    font-size: 14px;
}

.json-content {
    background: #212529;
    color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #343a40;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .config-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .modal-content {
        padding: 20px;
    }
}

/* 高级设置样式 */
.btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.settings-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    background-color: #e9ecef;
}

.tab-btn.active {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.settings-content {
    margin-bottom: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.setting-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.setting-group textarea,
.setting-group input[type="text"],
.setting-group input[type="email"],
.setting-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
    transition: border-color 0.15s ease;
}

.setting-group textarea:focus,
.setting-group input[type="text"]:focus,
.setting-group input[type="email"]:focus,
.setting-group input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.setting-group textarea {
    resize: vertical;
    min-height: 80px;
}

.filter-rule {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
}

.filter-rule-fields {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.filter-rule-fields input[type="text"],
.filter-rule-fields select {
    flex: 1;
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

.filter-rule-fields select {
    cursor: pointer;
}

.filter-rule-fields .btn {
    padding: 6px 12px;
    font-size: 12px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 768px) {
    .settings-tabs {
        flex-wrap: wrap;
    }

    .filter-rule-fields {
        flex-direction: column;
    }

    .filter-rule-fields input[type="text"],
    .filter-rule-fields select {
        width: 100%;
    }
}