@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: #334155;
    line-height: 1.6;
    padding-top: 80px;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.nav-brand i {
    color: #3b82f6;
    margin-right: 0.75rem;
    font-size: 1.75rem;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item:hover {
    background: #f1f5f9;
    color: #334155;
}

.nav-item.active {
    background: #3b82f6;
    color: white;
}

.nav-item.active:hover {
    background: #2563eb;
}

/* 页面内容切换 */
.page-content {
    display: none;
}

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

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

.header {
    text-align: center;
    background: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.header h1 i {
    color: #3b82f6;
    margin-right: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: #64748b;
    font-weight: 400;
}

.proxy-config {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.proxy-config h2 {
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.proxy-config h2 i {
    color: #f59e0b;
    margin-right: 0.5rem;
}

.config-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.15s ease;
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.test-sections {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.test-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.test-section h3 {
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.test-section h3 i {
    margin-right: 0.5rem;
    color: #3b82f6;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

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

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.speed-controls,
.ip-controls,
.network-controls,
.ping-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ping-controls input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    min-width: 200px;
    background: white;
    transition: all 0.15s ease;
}

.ping-controls input::placeholder {
    color: #9ca3af;
}

.ping-controls input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.result-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    min-height: 50px;
    display: none;
    font-size: 0.875rem;
}

.result-container.show {
    display: block;
}

.success {
    background: #ecfdf5;
    border-left-color: #10b981;
    color: #047857;
}

.error {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #dc2626;
}

.info {
    background: #eff6ff;
    border-left-color: #3b82f6;
    color: #1d4ed8;
}

.progress-container {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.report-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.report-section h2 {
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.report-section h2 i {
    color: #10b981;
    margin-right: 0.5rem;
}

.footer {
    text-align: center;
    padding: 2rem;
    background: #1e293b;
    border-radius: 16px;
    color: #e2e8f0;
    font-size: 0.875rem;
}

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

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.loading-spinner i {
    font-size: 2rem;
    color: #3b82f6;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
}

.metric-card {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 0.5rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-card h4 {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.metric-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #1e293b;
}

.metric-card .unit {
    font-size: 0.875rem;
    color: #6b7280;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.chart-container {
    position: relative;
    height: 300px;
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.site-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.site-card {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    background: white;
    border: 1px solid #e2e8f0;
}

.site-card.accessible {
    border-left-color: #10b981;
}

.site-card.blocked {
    border-left-color: #ef4444;
}

.site-card h5 {
    margin-bottom: 0.5rem;
    color: #1e293b;
    font-weight: 500;
}

.site-card .response-time {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #0f172a;
        color: #e2e8f0;
    }

    .header,
    .proxy-config,
    .test-section,
    .report-section,
    .metric-card,
    .chart-container,
    .site-card {
        background: #1e293b;
        border-color: #334155;
    }

    .header h1,
    .proxy-config h2,
    .test-section h3,
    .report-section h2,
    .metric-card .value,
    .site-card h5 {
        color: #f1f5f9;
    }

    .form-group input,
    .form-group select,
    .ping-controls input {
        background: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }

    .form-group input::placeholder,
    .ping-controls input::placeholder {
        color: #94a3b8;
    }

    .result-container {
        background: #334155;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .config-form {
        grid-template-columns: 1fr;
    }

    .speed-controls,
    .ip-controls,
    .network-controls,
    .ping-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        margin: 0.25rem 0;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .nav-brand {
        font-size: 1.25rem;
    }

    .nav-menu {
        flex-direction: row;
        gap: 0.25rem;
    }

    .nav-item {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* 批量测试页面专用样式 */
.batch-config {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.batch-config h2, .batch-config h3 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.batch-config h2 {
    font-size: 1.5rem;
}

.batch-config h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
}

.batch-input-section textarea {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.batch-input-section textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.test-options {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.checkbox-label i {
    color: #3b82f6;
}

.batch-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.batch-progress {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.batch-progress h3 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.progress-info {
    space-y: 1rem;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transition: width 0.3s ease;
    border-radius: 6px;
}

.current-test {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    font-weight: 500;
    color: #374151;
}

.batch-results {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.batch-results h3 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.batch-result-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.batch-result-card.success {
    border-left: 4px solid #10b981;
}

.batch-result-card.error {
    border-left: 4px solid #ef4444;
}

.batch-result-card.warning {
    border-left: 4px solid #f59e0b;
}

.batch-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.proxy-info {
    font-weight: 600;
    color: #1e293b;
    font-family: 'Consolas', monospace;
    font-size: 0.875rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.test-results {
    space-y: 0.75rem;
}

.test-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.test-item .label {
    color: #64748b;
    font-weight: 500;
}

.test-item .value {
    font-weight: 600;
    color: #1e293b;
}

.test-item .value.success {
    color: #059669;
}

.test-item .value.error {
    color: #dc2626;
}

.test-item .value.warning {
    color: #d97706;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }

    .batch-actions {
        flex-direction: column;
    }

    .test-options {
        flex-direction: column;
        gap: 1rem;
    }

    .progress-stats {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}