body { 
    font-family: Arial, sans-serif; 
    max-width: 800px; 
    margin: 0 auto; 
    padding: 20px; 
    line-height: 1.6;
}

h1, h2, h3, h4 {
    color: #333;
}

.status { 
    padding: 10px; 
    border-radius: 5px; 
    margin-bottom: 20px; 
    font-weight: bold;
}

.running { 
    background-color: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb;
}

.stopped { 
    background-color: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb;
}

.card { 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    padding: 15px; 
    margin-bottom: 20px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button { 
    padding: 10px 15px; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    margin-right: 10px; 
    font-weight: bold;
    transition: background-color 0.3s ease;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.start { 
    background-color: #28a745; 
    color: white; 
}

.start:hover:not([disabled]) {
    background-color: #218838;
}

.stop { 
    background-color: #dc3545; 
    color: white; 
}

.stop:hover:not([disabled]) {
    background-color: #c82333;
}

.save { 
    background-color: #17a2b8; 
    color: white; 
}

.save:hover:not([disabled]) {
    background-color: #138496;
}

.add {
    background-color: #007bff;
    color: white;
}

.add:hover:not([disabled]) {
    background-color: #0069d9;
}

.edit-group {
    background-color: #ffc107;
    color: #212529;
    padding: 5px 10px;
    font-size: 0.9em;
}

.edit-group:hover:not([disabled]) {
    background-color: #e0a800;
}

.delete-group {
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
    font-size: 0.9em;
}

.delete-group:hover:not([disabled]) {
    background-color: #c82333;
}

/* Toggle group button */
.toggle-group {
    background-color: #6c757d;
    color: white;
    padding: 5px 10px;
    font-size: 0.9em;
}

.toggle-group[data-enabled="true"] {
    background-color: #28a745;
}

.toggle-group[data-enabled="false"] {
    background-color: #dc3545;
}

.toggle-group:hover:not([disabled]) {
    opacity: 0.9;
}

/* Status badge for enabled/disabled groups */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 8px;
}

.status-badge.enabled {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.disabled {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 15px;
}

th, td { 
    text-align: left; 
    padding: 8px; 
    border-bottom: 1px solid #ddd; 
}

th {
    background-color: #f8f9fa;
}

pre { 
    background-color: #f8f9fa; 
    padding: 10px; 
    border-radius: 5px; 
    overflow: auto; 
    border: 1px solid #eee;
    font-family: monospace;
    font-size: 14px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.form-group small {
    display: block;
    color: #6c757d;
    font-size: 0.85em;
    margin-top: 4px;
}

.button-group {
    margin: 15px 0;
    display: flex;
    gap: 10px;
}

/* 转发组样式 */
.forwarding-group {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    overflow: hidden;
}

.group-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.group-header h3 {
    margin: 0;
}

.group-actions {
    display: flex;
    gap: 5px;
}

.group-details {
    padding: 10px 15px;
}

.detail-item {
    margin-bottom: 5px;
}

.header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-with-button h2 {
    margin: 0;
}

/* 组统计卡片 */
#groupStats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
}

.group-stat-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
}

/* 模态对话框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 5px;
    width: 80%;
    max-width: 600px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

@media (max-width: 700px) {
    #groupStats {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* 表格设置控件样式 */
.table-settings {
    margin: 10px 0;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-settings label {
    margin-right: 5px;
    font-weight: bold;
}

.row-selector {
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-controls button {
    padding: 4px 10px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.pagination-controls button:hover:not([disabled]) {
    background-color: #5a6268;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9em;
    color: #495057;
    min-width: 100px;
    text-align: center;
}

/* 表格工具栏 */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* 搜索框 */
.table-search {
    padding: 5px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: 200px;
}