/* 域名检测导航站 - 全新现代化设计 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientMove 20s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 动态背景 */
@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 浮动粒子效果 */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    filter: blur(60px);
    animation: float 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

body::before {
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

body::after {
    bottom: -100px;
    right: -100px;
    animation-delay: 5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px) saturate(180%);
    border-radius: 32px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 56px 48px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin: 20px auto;
}

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

.header {
    margin-bottom: 48px;
}

.header h1 {
    font-size: 52px;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
    margin-bottom: 16px;
    letter-spacing: -1px;
    line-height: 1.2;
}

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

.subtitle {
    color: #64748b;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    opacity: 0.9;
}

.status-box {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
}

/* 加载动画 - 全新设计 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.spinner {
    width: 80px;
    height: 80px;
    position: relative;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 6px solid transparent;
}

.spinner::before {
    width: 80px;
    height: 80px;
    border-top: 6px solid #667eea;
    border-right: 6px solid #667eea;
    animation: spin 1s linear infinite;
}

.spinner::after {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-bottom: 6px solid #764ba2;
    border-left: 6px solid #764ba2;
    animation: spinReverse 0.8s linear infinite;
}

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

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

.loading p {
    color: #475569;
    font-size: 20px;
    font-weight: 600;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.progress-bar {
    width: 280px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progressMove 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

@keyframes progressMove {
    0% { width: 0%; background-position: 0% 0%; }
    50% { width: 75%; background-position: 100% 0%; }
    100% { width: 100%; background-position: 200% 0%; }
}

/* 成功状态 - 全新设计 */
.success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% {
        transform: scale(0.2) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.15) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.success-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 64px;
    font-weight: bold;
    line-height: 1;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(16, 185, 129, 0.4),
        0 0 0 20px rgba(16, 185, 129, 0.1),
        0 0 0 40px rgba(16, 185, 129, 0.05);
    animation: iconBounce 0.8s ease-out;
    position: relative;
    margin: 0 auto;
}

.success-icon::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    font-weight: bold;
    line-height: 1;
    margin: 0;
    padding: 0;
    width: auto;
    height: auto;
    z-index: 2;
    display: block;
}

.success-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #10b981;
    opacity: 0;
    animation: ripple 1s ease-out;
    z-index: 1;
}

@keyframes iconBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.success h2 {
    color: #10b981;
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.success p {
    color: #64748b;
    font-size: 18px;
    margin: 0;
    font-weight: 500;
}

/* 错误状态 */
.error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    animation: errorShake 0.6s ease-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.error-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 64px;
    font-weight: bold;
    line-height: 1;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(239, 68, 68, 0.4),
        0 0 0 20px rgba(239, 68, 68, 0.1),
        0 0 0 40px rgba(239, 68, 68, 0.05);
    margin: 0 auto;
    position: relative;
}

.error-icon::after {
    content: '✗';
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    font-weight: bold;
    width: 64px;
    height: 64px;
    z-index: 2;
}

.error h2 {
    color: #ef4444;
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.error p {
    color: #64748b;
    font-size: 18px;
    margin: 0 0 12px 0;
    font-weight: 500;
    line-height: 1.6;
}

/* 按钮 - 全新设计 */
.btn-primary, .btn-secondary, .btn-link {
    padding: 16px 40px;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    min-width: 160px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
    transform: translateY(0);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.8s, height 0.8s;
}

.btn-primary:hover::before {
    width: 400px;
    height: 400px;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(-2px);
}

#enterBtn {
    margin-top: 20px;
}

.btn-secondary {
    background: white;
    color: #475569;
    border: 2px solid #e2e8f0;
    margin-right: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.btn-link {
    background: transparent;
    color: #667eea;
    padding: 12px 32px;
    min-width: auto;
    font-weight: 600;
}

.btn-link:hover {
    color: #764ba2;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* 信息提示框 */
.info-box {
    margin-top: 32px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 16px;
    font-size: 15px;
    color: #475569;
    border: 2px solid rgba(102, 126, 234, 0.2);
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 640px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .container {
        padding: 32px 20px;
        border-radius: 24px;
        margin: 0 auto;
    }
    
    .header {
        margin-bottom: 32px;
    }
    
    .header h1 {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .routes-container {
        margin-top: 24px;
        padding: 20px;
    }
    
    .routes-list {
        grid-template-columns: 1fr;
    }
    
    .status-box {
        min-height: 300px;
    }
    
    .success-icon, .error-icon {
        width: 100px;
        height: 100px;
        font-size: 56px;
    }
    
    .success h2, .error h2 {
        font-size: 28px;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        margin-bottom: 12px;
        margin-right: 0;
    }
    
    .btn-link {
        width: 100%;
        display: block;
    }
    
    .progress-bar {
        width: 100%;
        max-width: 280px;
    }
}

/* 线路选择界面 */
.routes-container {
    margin-top: 32px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.4s ease-out;
}

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

.routes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.routes-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.btn-close:hover {
    background: #e2e8f0;
    color: #475569;
    transform: rotate(90deg);
}

.routes-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.route-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.route-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.route-item.recommended {
    border-color: #f5576c;
    background: linear-gradient(135deg, rgba(245, 87, 108, 0.1) 0%, rgba(240, 147, 251, 0.1) 100%);
}

.route-item.available {
    border-color: #10b981;
}

.route-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.route-info {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.route-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.route-tag.recommend {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.route-tag.fast {
    background: #10b981;
    color: white;
}

.route-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #bdbdbd;
    display: inline-block;
    margin-left: 4px;
}

.route-status.available {
    background: #10b981;
}

.show-routes-btn {
    margin-top: 20px;
    text-align: center;
}
