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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
}

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

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

/* 结果卡片网格布局 */
.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.ping-card::before {
    background: linear-gradient(90deg, #f093fb, #f5576c);
}

.jitter-card::before {
    background: linear-gradient(90deg, #4facfe, #00f2fe);
}

.download-card::before {
    background: linear-gradient(90deg, #43e97b, #38f9d7);
}

.upload-card::before {
    background: linear-gradient(90deg, #fa709a, #fee140);
}

.result-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.result-value {
    font-size: 2.5em;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 5px;
}

.result-unit {
    font-size: 0.9em;
    color: #999;
}

/* 进度条 */
.progress-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* 状态信息 */
.status {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
    min-height: 30px;
}

/* 控制按钮 */
.controls {
    text-align: center;
    margin-bottom: 40px;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 150px;
    min-height: 50px;
}

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

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: scale(1.05);
}

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

/* 信息区域 */
.info-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.info-section h2 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

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

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.info-label {
    font-weight: 600;
    color: #666;
}

.info-value {
    color: #333;
    font-weight: 500;
}

/* 分享区域 */
.share-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.share-section h2 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.share-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#share-text {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: monospace;
    font-size: 0.9em;
    resize: vertical;
}

/* 页脚 */
footer {
    text-align: center;
    color: #999;
    font-size: 0.9em;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* 响应式设计 - 平板设备 */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .results {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .result-value {
        font-size: 2em;
    }

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

/* 响应式设计 - 手机设备 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px 15px;
        border-radius: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1em;
    }

    .results {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .result-card {
        padding: 20px;
    }

    .result-value {
        font-size: 2em;
    }

    .btn {
        width: 100%;
        padding: 15px;
    }

    .info-item {
        flex-direction: column;
        gap: 5px;
    }

    .info-label,
    .info-value {
        text-align: center;
    }
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

