/* 现代化加载界面样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eabe66 0%, #764ba2 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    animation: backgroundShift 8s ease-in-out infinite;
}

.loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-container {
    text-align: center;
    max-width: 400px;
    padding: 2.5rem;
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.loading-logo {
    position: relative;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(255, 255, 255, 0.1);
    animation: logoFloat 3s ease-in-out infinite;
    display: none;
    transition: all 0.3s ease;
}

.loading-logo-img.loaded {
    display: block;
    animation: logoFloat 3s ease-in-out infinite, logoAppear 0.6s ease-out;
}

.loading-logo-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: logoFloat 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

.loading-logo-placeholder.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.restaurant-icon {
    color: rgba(255, 255, 255, 0.8);
    animation: iconRotate 4s linear infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.loading-content {
    color: white;
}

.loading-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.5px;
    animation: textGlow 2s ease-in-out infinite alternate;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.loading-subtitle {
    font-size: 1rem;
    margin: 0 0 2rem 0;
    opacity: 0.8;
    font-weight: 300;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 2rem auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: 0s;
    border-top-color: #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.5s;
    border-top-color: #4ecdc4;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

.spinner-ring:nth-child(3) {
    animation-delay: 1s;
    border-top-color: #45b7d1;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    box-shadow: 0 0 10px rgba(69, 183, 209, 0.3);
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite both;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dot:nth-child(1) { 
    animation-delay: -0.32s; 
    background: #ff6b6b;
}
.dot:nth-child(2) { 
    animation-delay: -0.16s; 
    background: #4ecdc4;
}
.dot:nth-child(3) { 
    animation-delay: 0s; 
    background: #45b7d1;
}

.loading-progress {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: gradientShift 2s ease-in-out infinite;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.progress-text {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.7;
    animation: textPulse 2s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* 动画定义 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-12px);
    }
}

@keyframes logoAppear {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

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

@keyframes textGlow {
    from {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(255, 255, 255, 0.3);
    }
    to {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.6), 0 0 30px rgba(255, 255, 255, 0.4);
    }
}

@keyframes backgroundShift {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(-20px) translateY(-20px);
    }
    50% {
        transform: translateX(20px) translateY(-10px);
    }
    75% {
        transform: translateX(-10px) translateY(20px);
    }
}

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

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8) translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2) translateY(-10px);
        opacity: 1;
    }
}

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

@keyframes textPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .loading-container {
        padding: 2rem 1.5rem;
        max-width: 320px;
        margin: 1rem;
    }
    
    .loading-title {
        font-size: 1.5rem;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
    }
    
    .loading-logo-img,
    .loading-logo-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .restaurant-icon {
        width: 45px;
        height: 45px;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .loading-container {
        padding: 1.5rem 1rem;
        max-width: 280px;
        border-radius: 16px;
    }
    
    .loading-title {
        font-size: 1.3rem;
    }
    
    .loading-subtitle {
        font-size: 0.8rem;
    }
    
    .loading-logo-img,
    .loading-logo-placeholder {
        width: 50px;
        height: 50px;
    }
    
    .restaurant-icon {
        width: 35px;
        height: 35px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .loading-overlay {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .loading-container {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .loading-overlay {
        background: #000;
    }
    
    .loading-container {
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .loading-title,
    .loading-subtitle,
    .progress-text {
        text-shadow: none;
    }
}

/* 减少动画效果（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    .loading-overlay,
    .loading-container,
    .loading-logo-img,
    .loading-logo-placeholder,
    .restaurant-icon,
    .loading-title,
    .spinner-ring,
    .dot,
    .progress-fill,
    .progress-text {
        animation: none;
    }
    
    .loading-overlay {
        transition: opacity 0.3s ease;
    }
    
    .loading-container {
        transform: none;
    }
    
    .progress-fill {
        transition: width 0.5s ease;
    }
} 