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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: #ffffff;
    color: #333;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.nav-links {
    margin-top: 20px;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    margin: 0 15px;
    padding: 8px 16px;
    border-radius: 6px;
    background: #e9ecef;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: #dee2e6;
}

.content {
    padding: 30px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.router-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
}

.btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-danger {
    background: #dc3545;
}

.btn-warning {
    background: #fd7e14;
    color: white;
}

.btn-success {
    background: #28a745;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

tr:hover {
    background: #f8f9fa;
}

.stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    text-align: center;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
}

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

.close:hover {
    color: #000;
}

.sort-link {
    color: #667eea;
    text-decoration: none;
}

.sort-link:hover {
    text-decoration: underline;
}

.port-link {
    color: #28a745;
    text-decoration: none;
    font-weight: bold;
}

.port-link:hover {
    text-decoration: underline;
}

.static-info {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.protocol-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.protocol-tcp {
    background: #007bff;
}

.protocol-udp {
    background: #28a745;
}

.protocol-tcpudp {
    background: #ffc107;
    color: #333;
}



/* 美化下拉框样式 */
.custom-select {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 300px;
}

.custom-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #007bff;
    color: white;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 12px 40px 12px 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.custom-select select:hover {
    background: #0056b3;
    border-color: rgba(255, 255, 255, 0.3);
}

.custom-select select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.custom-select::after {
    content: '▼';
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: white;
    font-size: 12px;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.custom-select:hover::after {
    transform: translateY(-50%) scale(1.1);
}

/* 删除确认弹窗样式 */
.delete-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.delete-confirm-content {
    background: white;
    border-radius: 8px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.delete-confirm-header {
    text-align: center;
    padding: 30px 30px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.delete-confirm-header svg {
    margin-bottom: 15px;
}

.delete-confirm-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.delete-confirm-body {
    padding: 20px 30px;
    text-align: center;
}

.delete-confirm-body p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.delete-confirm-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        justify-content: center;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 10px 5px;
    }
    
    
    
    .custom-select {
        max-width: 100%;
    }
    
    .custom-select select {
        font-size: 14px;
        padding: 10px 35px 10px 14px;
    }
    
    .delete-confirm-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .delete-confirm-footer {
        flex-direction: column;
    }
}