/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 登录界面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

.login-card h2 {
    margin-bottom: 30px;
    color: #4a5568;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.error-message {
    color: #e53e3e;
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
}

/* 主界面样式 */
.main-container {
    min-height: 100vh;
    padding: 20px;
}

.header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    color: #4a5568;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 15px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-info:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(66, 153, 225, 0.3);
}

.btn-detail {
    background: #4299e1;
    color: white;
    padding: 8px 16px;
    font-size: 12px;
}

.btn-detail:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

/* 表格容器 */
.table-container {
    background: white;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 筛选面板 */
.filter-panel {
    padding: 20px 30px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.filter-group select,
.filter-group input {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#resetFilters {
    margin-left: auto;
    padding: 10px 20px;
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#resetFilters:hover {
    background: #edf2f7;
    transform: translateY(-1px);
}

.table-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.table-header h2 {
    color: #4a5568;
    font-weight: 600;
}

.table-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #718096;
}

.table-stats span {
    font-weight: 600;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #f8fafc;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: #f7fafc;
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 状态标识样式 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-online {
    background: #c6f6d5;
    color: #22543d;
}

.status-offline {
    background: #fed7d7;
    color: #742a2a;
}

.status-unknown {
    background: #e2e8f0;
    color: #4a5568;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: #38a169;
}

.status-dot.offline {
    background: #e53e3e;
}

.status-dot.unknown {
    background: #a0aec0;
}

/* 风控值颜色 */
.risk-low {
    color: #38a169;
    font-weight: 600;
}

.risk-medium {
    color: #d69e2e;
    font-weight: 600;
}

.risk-high {
    color: #e53e3e;
    font-weight: 600;
}

.risk-extreme {
    color: #9b2c2c;
    font-weight: 600;
}

/* IP类型颜色 */
.ip-type-native {
    color: #38a169;
    font-weight: 600;
}

.ip-type-broadcast {
    color: #3182ce;
    font-weight: 600;
}

.ip-type-idc {
    color: #805ad5;
    font-weight: 600;
}

.ip-type-residential {
    color: #d69e2e;
    font-weight: 600;
}

/* 共享人数颜色 */
.share-excellent {
    color: #38a169;
    font-weight: 600;
}

.share-good {
    color: #3182ce;
    font-weight: 600;
}

.share-fair {
    color: #d69e2e;
    font-weight: 600;
}

.share-poor {
    color: #e53e3e;
    font-weight: 600;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: white;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.show .modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.detail-modal {
    max-width: 600px;
}

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #4a5568;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #4a5568;
}

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

.subscribe-item {
    margin-bottom: 25px;
}

.subscribe-item label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a5568;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: #f7fafc;
}

.copy-btn {
    padding: 12px 20px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: #38a169;
}

/* 详情样式 */
.detail-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
}

.detail-item strong {
    color: #4a5568;
    display: inline-block;
    width: 120px;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* IP地址视觉美化 */
.ip-address {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #2d3748;
    font-weight: 500;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.ip-address:hover {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    border-color: #cbd5e0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* 悬停显示订阅地址 */
.hover-reveal-input {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: transparent;
    text-shadow: 0 0 8px rgba(45, 55, 72, 0.5);
    transition: all 0.3s ease;
    cursor: help;
}

.hover-reveal-input:hover {
    background: white;
    color: #2d3748;
    text-shadow: none;
    cursor: text;
}

.hover-reveal-input::placeholder {
    color: #a0aec0;
    text-shadow: none;
}

/* 服务状态徽章样式 */
.service-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.service-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    border: 1px solid;
    transition: all 0.3s ease;
    cursor: help;
}

.service-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.service-online {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    color: #155724;
}

.service-offline {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
    color: #721c24;
}

.service-unknown {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    border-color: #6c757d;
    color: #383d41;
}

/* 测试命令样式 */
.test-command-warning {
    margin-bottom: 20px;
}

.test-command-item {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.test-command-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.test-command-item h4 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 16px;
}

.test-command-item p {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 14px;
}

.command-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.command-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: white;
    color: #2d3748;
}

.command-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}



/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .table-header {
        flex-direction: column;
        text-align: center;
    }
    
    .table-stats {
        justify-content: center;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .data-table {
        font-size: 11px;
    }
    
    .status-indicator {
        font-size: 10px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}