/**
 * 智能域名速度测试系统 - 顶级专业UI设计
 * Premium Design System - 20年以上设计经验级别
 * 响应式：PC / 平板 / 手机 全适配
 */

/* 使用系统字体，避免外部依赖导致加载失败 */

:root {
    /* 高端渐变色系 - Cyberpunk Premium */
    --primary-start: #667eea;
    --primary-end: #764ba2;
    --secondary-start: #00d4ff;
    --secondary-end: #0066ff;
    --accent: #f093fb;
    
    /* 霓虹光效 */
    --neon-cyan: #00f2ff;
    --neon-purple: #a855f7;
    --neon-pink: #ec4899;
    --neon-green: #10b981;
    
    /* 高级背景系统 */
    --bg-primary: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --bg-overlay: radial-gradient(ellipse at top left, rgba(102, 126, 234, 0.2), transparent 50%),
                   radial-gradient(ellipse at bottom right, rgba(236, 72, 153, 0.15), transparent 50%);
    
    /* 玻璃拟态系统 */
    --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.18);
    
    /* 专业级阴影 */
    --shadow-float: 0 20px 60px -10px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 30px 80px -10px rgba(102, 126, 234, 0.4);
    --shadow-glow-blue: 0 0 60px rgba(0, 212, 255, 0.5);
    --shadow-glow-purple: 0 0 60px rgba(168, 85, 247, 0.5);
    
    /* 文字层级 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-tertiary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* 速度等级专业渐变 */
    --speed-ultra: linear-gradient(135deg, #00f2ff 0%, #10b981 100%);
    --speed-fast: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --speed-normal: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --speed-slow: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    --speed-bad: linear-gradient(135deg, #ff0844 0%, #c2185b 100%);
}

/* 全局重置与基础 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    position: relative;
    overflow-x: hidden;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    pointer-events: none;
    z-index: 1;
}

/* 高级粒子系统 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: float-particle 20s infinite ease-in-out;
}

@keyframes float-particle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    50% {
        transform: translate(var(--tx), var(--ty)) scale(1.5);
        opacity: 0.8;
    }
    90% {
        opacity: 0.6;
    }
}

/* 主容器 */
.container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 顶级LOGO与标题 */
.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 1s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    font-size: 72px;
    margin-bottom: 20px;
    animation: float-logo 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(102, 126, 234, 0.5));
}

@keyframes float-logo {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #667eea 0%, #00d4ff 50%, #f093fb 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 18px;
    color: var(--text-tertiary);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* 顶级卡片容器 - 垂直列表模式 */
.speed-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

/* 高端速度卡片 - 横向布局 */
.speed-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1.5px solid var(--glass-border);
    border-radius: 20px;
    padding: 28px 36px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: var(--shadow-float);
    min-height: 120px;
}

/* 卡片光晕背景 */
.speed-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(102, 126, 234, 0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.speed-card:hover::before {
    opacity: 1;
}

/* 顶部高光条 */
.speed-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.speed-card:hover::after {
    opacity: 1;
}

.speed-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--glass-highlight);
    box-shadow: var(--shadow-hover);
}

/* 卡片头部 - 横向布局版 */
.card-header {
    flex: 1;
    margin-right: 20px;
}

.domain-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.domain-name::before {
    content: '🌐';
    font-size: 24px;
    animation: rotate-icon 10s linear infinite;
}

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

.domain-url {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* 专业级速度显示 - 横向紧凑版 */
.speed-display {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.speed-value-container {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.speed-value {
    font-size: 56px;
    font-weight: 800;
    font-family: 'SF Mono', 'Courier New', monospace;
    letter-spacing: -2px;
    line-height: 1;
    background: linear-gradient(135deg, #ffffff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    display: inline-block;
}

/* 数字滚动效果 */
.speed-value.counting {
    animation: number-pulse 0.1s ease-in-out;
}

@keyframes number-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.speed-unit {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-left: 8px;
    letter-spacing: 1px;
}

/* 状态标签 */
.speed-label {
    position: relative;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* 推荐线路卡片 */
.speed-card.recommended {
    border: 2px solid var(--neon-cyan);
    box-shadow: var(--shadow-glow-blue);
    animation: recommended-pulse 2s ease-in-out infinite;
}

@keyframes recommended-pulse {
    0%, 100% {
        box-shadow: 0 0 40px rgba(0, 242, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 60px rgba(0, 242, 255, 0.6);
    }
}

.speed-card.recommended::before {
    opacity: 1;
    background: radial-gradient(circle at top left, rgba(0, 242, 255, 0.3), transparent 60%);
}

/* 推荐徽章 */
.recommended-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #00f2ff, #10b981);
    color: #000;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 0 18px 0 18px;
    box-shadow: 0 4px 15px rgba(0, 242, 255, 0.5);
    z-index: 10;
    animation: badge-shine 2s ease-in-out infinite;
}

@keyframes badge-shine {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* 检测中动画 */
.speed-card.testing {
    animation: testing-wave 1.5s ease-in-out infinite;
}

@keyframes testing-wave {
    0%, 100% {
        border-color: rgba(102, 126, 234, 0.3);
    }
    50% {
        border-color: rgba(0, 212, 255, 0.6);
    }
}

.speed-card.testing .speed-display {
    background: linear-gradient(90deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(0, 212, 255, 0.15) 50%, 
        rgba(102, 126, 234, 0.1) 100%);
    background-size: 200% 100%;
    animation: gradient-flow 2s linear infinite;
}

@keyframes gradient-flow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 状态消息 */
.status-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 40px;
    margin-bottom: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-float);
}

/* 加载动画 */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--neon-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 倒计时区域 */
.countdown {
    text-align: center;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    border: 2px solid var(--neon-cyan);
    border-radius: 24px;
    box-shadow: var(--shadow-glow-blue);
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.countdown p {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.countdown-num {
    font-size: 80px;
    font-weight: 900;
    background: linear-gradient(135deg, #00f2ff, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin: 20px 0;
    animation: countdown-pulse 1s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(0, 242, 255, 0.5));
}

@keyframes countdown-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* 按钮系统 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    text-transform: uppercase;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--glass-border);
}

.btn-secondary:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

/* 页脚 */
.footer {
    margin-top: auto;
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== 响应式设计 ===== */

/* 平板 */
@media (max-width: 1024px) {
    .title {
        font-size: 40px;
    }
    
    .speed-cards {
        gap: 18px;
    }
    
    .speed-card {
        padding: 24px 28px;
    }
    
    .speed-value {
        font-size: 48px;
    }
}

/* 手机 */
@media (max-width: 768px) {
    .container {
        padding: 30px 16px;
    }
    
    .header {
        margin-bottom: 40px;
    }
    
    .logo {
        font-size: 56px;
    }
    
    .title {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .speed-cards {
        gap: 16px;
    }
    
    .speed-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 20px;
        min-height: auto;
    }
    
    .card-header {
        margin-right: 0;
        margin-bottom: 20px;
        width: 100%;
    }
    
    .speed-display {
        width: 100%;
        justify-content: space-between;
    }
    
    .speed-value {
        font-size: 48px;
    }
    
    .countdown-num {
        font-size: 64px;
    }
    
    .domain-name {
        font-size: 18px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .logo {
        font-size: 48px;
    }
    
    .title {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .speed-card {
        padding: 20px 16px;
        border-radius: 16px;
    }
    
    .speed-value {
        font-size: 44px;
    }
    
    .speed-label {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    .countdown-num {
        font-size: 56px;
    }
}

/* 高分辨率屏幕优化 */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .title {
        font-size: 56px;
    }
    
    .speed-value {
        font-size: 64px;
    }
}

/* 深色模式优化 */
@media (prefers-color-scheme: dark) {
    body {
        background: var(--bg-primary);
    }
}

/* 减弱动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
