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

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --success-color: #00C853;
    --warning-color: #FF9800;
    --error-color: #F44336;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #e0e0e0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.4;
    min-height: 100vh;
    padding: 10px;
    margin: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    opacity: 0.95 !important;
}

/* 紧凑布局样式 */
.compact-layout {
    padding: 0;
}

.compact-header {
    text-align: left;
    color: white;
    margin-bottom: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 30px 20px;
}

header h1 {
    font-size: 1.8em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.compact-header h1 {
    font-size: 1.5em;
    margin: 0;
}

.header-left {
    flex: 0 0 auto;
}

.header-left .subtitle {
    font-size: 0.85em;
    margin: 5px 0 0 0;
    opacity: 0.85;
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-language {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    padding: 8px 20px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
}

.btn-language:hover {
    background: white;
    border-color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-screenshot, .btn-export {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-screenshot:hover, .btn-export:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 主内容区域 - 双列布局 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.column-left, .column-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 紧凑卡片样式 */
.card.compact {
    padding: 15px;
    margin-bottom: 0;
    border-radius: 8px;
}

.card.compact h2 {
    font-size: 1.1em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

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

.card h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.info-item {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.info-item strong {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.info-item span {
    font-size: 1.1em;
    color: var(--text-primary);
    font-weight: 500;
}

.btn {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

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

.btn-success {
    background: var(--success-color);
    color: white;
    width: 100%;
}

.btn-success:hover {
    background: #00B248;
}

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

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

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.test-results {
    margin-top: 20px;
}

.result-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid var(--border-color);
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.result-item.success {
    border-left-color: var(--success-color);
    background: #E8F5E9;
}

.result-item.warning {
    border-left-color: var(--warning-color);
    background: #FFF3E0;
}

.result-item.error {
    border-left-color: var(--error-color);
    background: #FFEBEE;
}

.result-name {
    font-weight: 600;
    flex: 1;
    min-width: 200px;
}

.result-value {
    font-weight: 500;
    color: var(--text-secondary);
}

.result-speed {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-left: 10px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.score-container {
    text-align: center;
    padding: 30px;
}

.score-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    font-weight: bold;
    color: white;
    position: relative;
}

.score-excellent {
    background: linear-gradient(135deg, #00C853 0%, #4CAF50 100%);
}

.score-good {
    background: linear-gradient(135deg, #64B5F6 0%, #2196F3 100%);
}

.score-fair {
    background: linear-gradient(135deg, #FFB74D 0%, #FF9800 100%);
}

.score-poor {
    background: linear-gradient(135deg, #E57373 0%, #F44336 100%);
}

.score-label {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

footer {
    text-align: center;
    color: white;
    padding: 30px 20px;
    margin-top: 40px;
    opacity: 0.8;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background: var(--success-color);
    box-shadow: 0 0 5px var(--success-color);
}

.status-slow {
    background: var(--warning-color);
    box-shadow: 0 0 5px var(--warning-color);
}

.status-offline {
    background: var(--error-color);
    box-shadow: 0 0 5px var(--error-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .card {
        padding: 20px;
    }

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

    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-speed {
        margin-left: 0;
        margin-top: 10px;
    }
    .card.compact {
        max-width: 100%;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

/* ==================== 紧凑布局样式 ==================== */

/* 紧凑信息网格 */
.info-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 0.85em;
}

.info-grid-compact .info-item {
    padding: 8px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.info-grid-compact .info-item strong {
    font-size: 0.75em;
    margin-bottom: 3px;
}

.info-grid-compact .info-item span {
    font-size: 0.9em;
}

/* 紧凑测试结果 */
.test-results-compact {
    font-size: 0.85em;
}

.test-results-compact .result-item {
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 0.9em;
}

.test-results-compact .result-name {
    font-size: 0.9em;
}

.test-results-compact .result-speed {
    padding: 3px 8px;
    font-size: 0.8em;
}

/* 紧凑评分容器 */
.score-container-compact {
    text-align: center;
    padding: 15px;
}

.score-container-compact .score-circle {
    width: 100px;
    height: 100px;
    margin: 10px auto;
    font-size: 2em;
}

.score-container-compact .score-label {
    font-size: 1em;
    margin-top: 5px;
}

/* 紧凑页脚 */
.compact-footer {
    text-align: center;
    color: white;
    padding: 10px;
    opacity: 0.8;
    font-size: 0.85em;
}

/* 加载状态优化 */
.loading {
    text-align: center;
    padding: 10px;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9em;
}

/* Traceroute 特殊样式 */
.result-item.timeout {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-left: 4px solid #fdcb6e;
}

.result-item.timeout .result-name {
    color: #d63031;
}

/* 代码块样式 */
code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    color: #e91e63;
}

/* 链接样式 */
a {
    color: #2196f3;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 响应式布局 - 小屏幕单列显示 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .compact-header {
        flex-direction: column;
        gap: 10px;
    }

    .action-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* 响应式布局 - 中等屏幕 */
@media (max-width: 1400px) {
    .info-grid-compact {
        grid-template-columns: 1fr;
    }
}

/* 打印样式优化 */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .compact-header {
        background: #667eea;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .action-buttons {
        display: none;
    }

    .card.compact {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* 诊断模块样式 */
kbd {
    display: inline-block;
    padding: 3px 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    background: linear-gradient(to bottom, #fcfcfc 0%, #e0e0e0 100%);
    border: 1px solid #aaa;
    border-radius: 3px;
    box-shadow: 0 2px 2px rgba(0,0,0,0.1), inset 0 1px 0 #fff;
    margin: 0 2px;
}

code {
    font-family: 'Courier New', Monaco, monospace;
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #c7254e;
    border: 1px solid #f0f0f0;
}

/* 加载动画增强 */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 按钮hover效果增强 */
button {
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 文本框样式增强 */
/* 原始 CSS 文件内容 */




