/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 按钮基础样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    background: #3a56e4;
    color: white;
    box-shadow: 0 2px 8px rgba(58, 86, 228, 0.2);
}

.btn:hover {
    background: #2a46d0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 86, 228, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
    background: #545b62;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-success {
    background: #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.btn-success:hover {
    background: #43a047;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-danger {
    background: #f44336;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2);
}

.btn-danger:hover {
    background: #d32f2f;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* 输入框基础样式 */
.form-control {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #e1e5e9;
    border-radius: 24px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: #3a56e4;
    box-shadow: 0 0 0 3px rgba(58, 86, 228, 0.1);
}

.form-control::placeholder {
    color: #999;
    font-weight: 400;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e1e5e9;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 100%);
}

.card-body {
    padding: 30px;
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #fff;
    margin: 3% auto;
    padding: 0;
    border-radius: 12px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, #3a56e4, #667eea);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header .close {
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.modal-header .close:hover {
    opacity: 0.7;
}

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

/* 帮助文档样式 */
.help-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.help-section h4 {
    color: #3a56e4;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section ul {
    list-style: none;
    padding-left: 0;
}

.help-section li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}

.help-section li:before {
    content: "•";
    color: #3a56e4;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.help-section strong {
    color: #2d3748;
    font-weight: 600;
}

/* 免责声明样式 */
.disclaimer-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.disclaimer-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.disclaimer-section h4 {
    color: #e53e3e;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.disclaimer-section p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #4a5568;
}

.disclaimer-section ul {
    list-style: none;
    padding-left: 0;
}

.disclaimer-section li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
    color: #4a5568;
}

.disclaimer-section li:before {
    content: "•";
    color: #e53e3e;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* 滚动条样式 */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* 加载动画 */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 40px;
    text-align: center;
    color: #666;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e1e5e9;
    border-top: 3px solid #3a56e4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 错误提示 */
.error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    color: #c53030;
    margin: 20px 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .dashboard-card {
        padding: 20px;
    }
    
    .dashboard-value {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        padding: 16px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .header-left h1 {
        font-size: 28px;
    }
    
    .header-left h1::before {
        font-size: 24px;
    }
    
    .header-left h1::after {
        left: 36px;
    }
    
    .header-links {
        align-self: flex-end;
    }
    
    .header-links a span {
        display: none;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .dashboard-card {
        padding: 16px;
        gap: 16px;
    }
    
    .dashboard-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .dashboard-value {
        font-size: 28px;
    }
    
    .control-panel {
        margin-bottom: 24px;
    }
    
    .search-section {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }
    
    .search-container {
        min-width: auto;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
    }
    
    .info-section {
        flex-direction: column;
        gap: 16px;
        padding: 16px 20px;
    }
    
    .status-legend {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .legend-item {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .filter-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .filter-header {
        padding: 20px;
    }
    
    .filter-body {
        padding: 20px;
    }
    
    .servers-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .header-left h1 {
        font-size: 24px;
    }
    
    .header-left h1::before {
        font-size: 20px;
    }
    
    .header-left h1::after {
        left: 32px;
    }
    
    .dashboard-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .dashboard-content {
        margin-top: 8px;
    }
    
    .search-input {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .action-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .action-btn span {
        display: none;
    }
    
    .status-legend {
        justify-content: center;
    }
    
    .filter-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        max-height: none;
    }
    
    .filter-modal {
        align-items: flex-start;
    }
}
