/* TestNow - 紧凑版样式 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --radius: 6px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.5;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

/* 头部导航 */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo { text-decoration: none; }
.logo-text { font-size: 24px; font-weight: 800; color: var(--primary); }
.logo-slogan { font-size: 10px; color: var(--gray-400); margin-left: 4px; }

.nav { display: flex; gap: 16px; }
.nav a { color: var(--gray-600); text-decoration: none; font-size: 13px; }
.nav a:hover { color: var(--primary); }

/* 紧凑型 Hero */
.hero-compact {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 16px;
    text-align: center;
}

.hero-compact h1 {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.search-compact {
    display: flex;
    max-width: 600px;
    margin: 0 auto 16px;
    background: white;
    border-radius: 8px;
    padding: 4px;
}

.search-compact input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 15px;
    outline: none;
}

.search-compact button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}

.search-compact button:hover { background: var(--primary-dark); }

/* 快捷链接 */
.quick-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.link-item {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
}

.link-item:hover { background: rgba(255,255,255,0.25); }
.link-item.highlight { background: var(--primary); font-weight: 600; }

/* 紧凑工具卡片 */
.tools-compact { padding: 24px 16px; background: white; }

.tools-grid-compact {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.tool-card-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.tool-card-compact:hover {
    border-color: var(--primary);
    background: white;
}

.tool-card-compact.featured {
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
    border: 2px solid var(--primary);
}

.tool-card-compact .icon { font-size: 24px; }
.tool-card-compact .info h3 { font-size: 14px; font-weight: 600; }
.tool-card-compact .info p { font-size: 12px; color: var(--gray-500); }

/* 特点行 */
.features-compact { padding: 16px; background: var(--gray-100); text-align: center; }

.features-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 13px;
    color: var(--gray-600);
}

/* 工具页面样式 */
.tool-page { background: white; min-height: 100vh; }

.tool-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px 16px;
    text-align: center;
}

.tool-hero-icon { font-size: 36px; margin-bottom: 8px; }
.tool-hero h1 { font-size: 24px; margin-bottom: 4px; }
.tool-hero p { opacity: 0.9; font-size: 14px; }

.tool-form-section {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.tool-form-section label { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; }
.tool-form-section input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 12px;
}

.tool-form-section input:focus { border-color: var(--primary); outline: none; }
.tool-form-section button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
}

/* 结果页面 */
.result-page {
    max-width: 800px;
    margin: 24px auto;
    padding: 20px;
}

.result-header { text-align: center; margin-bottom: 20px; }
.result-url { font-size: 16px; color: var(--gray-600); }

/* 评分展示 */
.score-display { text-align: center; margin-bottom: 24px; }

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 32px;
    font-weight: 800;
    color: white;
}

.score-circle.excellent { background: var(--success); }
.score-circle.good { background: var(--primary); }
.score-circle.average { background: var(--warning); }
.score-circle.poor { background: var(--danger); }

.score-level { font-size: 14px; font-weight: 600; }

/* 结果详情 */
.result-details {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.result-details h3 { font-size: 14px; margin-bottom: 12px; color: var(--gray-800); }

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 13px;
}

.detail-item:last-child { border-bottom: none; }
.detail-label { color: var(--gray-600); }
.detail-value { font-weight: 600; }
.detail-value.good { color: var(--success); }
.detail-value.warning { color: var(--warning); }
.detail-value.danger { color: var(--danger); }

/* 建议 */
.recommendations { margin-bottom: 16px; }
.recommendations h3 { font-size: 14px; margin-bottom: 12px; }

.rec-item {
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    font-size: 13px;
}

.rec-item.success { background: rgba(16,185,129,0.1); border: 1px solid var(--success); }
.rec-item.info { background: rgba(59,130,246,0.1); border: 1px solid var(--primary); }
.rec-item.warning { background: rgba(245,158,11,0.1); border: 1px solid var(--warning); }
.rec-item.danger { background: rgba(239,68,68,0.1); border: 1px solid var(--danger); }

.rec-icon { font-size: 18px; }
.rec-content h4 { font-size: 13px; margin-bottom: 2px; }
.rec-content p { font-size: 12px; color: var(--gray-600); }

/* 工具互导 */
.cross-tools {
    background: var(--gray-50);
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 16px;
}

.cross-tools h3 { font-size: 14px; margin-bottom: 12px; }

.cross-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.cross-tool-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: white;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-700);
    font-size: 12px;
}

.cross-tool-link:hover { background: var(--primary); color: white; }

/* 分享链接 */
.share-section {
    background: var(--primary);
    color: white;
    padding: 12px;
    border-radius: var(--radius);
    margin-top: 12px;
    text-align: center;
}

.share-section h4 { font-size: 13px; margin-bottom: 6px; }
.share-url { background: rgba(255,255,255,0.2); padding: 8px; border-radius: 4px; font-size: 12px; }

/* 进度条 */
.progress-bar { height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; }
.progress-fill.excellent { background: var(--success); }
.progress-fill.good { background: var(--primary); }
.progress-fill.average { background: var(--warning); }
.progress-fill.poor { background: var(--danger); }

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 8px; border-bottom: 1px solid var(--gray-200); }
.data-table th { background: var(--gray-100); font-weight: 600; }

/* 错误提示 */
.error-message {
    background: rgba(239,68,68,0.1);
    border: 2px solid var(--danger);
    padding: 16px;
    border-radius: var(--radius);
    color: var(--danger);
    text-align: center;
    margin: 16px 0;
}

/* 底部 */
.footer {
    background: var(--gray-800);
    color: white;
    padding: 24px 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.footer-brand h3 { font-size: 20px; color: var(--primary); }
.footer-brand p { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

.footer-links h4 { font-size: 12px; margin-bottom: 8px; color: var(--gray-200); }
.footer-links a { color: var(--gray-400); text-decoration: none; font-size: 12px; display: block; margin-bottom: 4px; }
.footer-links a:hover { color: white; }

.footer-bottom { border-top: 1px solid var(--gray-700); padding-top: 12px; text-align: center; font-size: 12px; color: var(--gray-400); }

/* 响应式 */
@media (max-width: 900px) {
    .tools-grid-compact { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 8px; text-align: center; }
    .nav { gap: 12px; }
    .hero-compact { padding: 24px 12px; }
    .hero-compact h1 { font-size: 22px; }
    .search-compact { flex-direction: column; }
    .quick-links { gap: 6px; }
    .tools-grid-compact { grid-template-columns: repeat(2, 1fr); }
    .features-row { flex-wrap: wrap; gap: 12px; }
    .cross-tools-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .score-circle { width: 80px; height: 80px; font-size: 28px; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* SpeedTest 测速样式 */
.speedtest-hero {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}

.speedtest-container {
    max-width: 600px;
    margin: 24px auto;
    padding: 20px;
}

.speedtest-meters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.meter-card {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.meter-icon {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 12px;
}

.meter-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--gray-200);
    margin: 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.meter-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, var(--success) 0%, var(--primary) 100%);
    transition: height 0.3s ease;
    height: 0;
    border-radius: 50% 50% 0 0;
}

.meter-progress.upload {
    background: linear-gradient(180deg, #f97316 0%, #6366f1 100%);
}

.meter-value {
    position: relative;
    z-index: 1;
    font-size: 24px;
    font-weight: bold;
    color: var(--gray-800);
}

.meter-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 8px;
}

.latency-section {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.latency-item {
    text-align: center;
}

.latency-icon {
    font-size: 20px;
}

.latency-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: var(--gray-800);
    margin: 4px 0;
}

.latency-label {
    font-size: 12px;
    color: var(--gray-500);
}

.speedtest-action {
    text-align: center;
    margin-bottom: 24px;
}

.start-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.start-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

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

.status-text {
    font-size: 14px;
    color: var(--gray-600);
    margin-top: 12px;
}

.result-card {
    background: white;
    border: 2px solid var(--success);
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

.result-card h3 {
    text-align: center;
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--success);
}

.result-items {
    margin-bottom: 12px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--gray-600);
    font-size: 14px;
}

.result-value {
    font-weight: bold;
    font-size: 14px;
    color: var(--primary);
}

.result-note {
    text-align: center;
    font-size: 12px;
    color: var(--gray-500);
}

@media (max-width: 480px) {
    .speedtest-meters { grid-template-columns: 1fr; }
    .meter-circle { width: 100px; height: 100px; }
    .latency-section { gap: 16px; }
    .start-btn { padding: 12px 32px; font-size: 16px; }
}