/**
 * 扫码登录功能样式
 */

/* 登录遮罩层 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

/* 登录模态框 */
.login-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

/* 登录标题 */
.login-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    position: relative;
}

.login-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
}

/* 二维码容器 */
.qr-code-container {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.qr-code-container img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 登录提示 */
.login-tips {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

/* 加载状态 */
.login-loading {
    color: #007bff;
    font-style: italic;
    font-size: 16px;
    padding: 20px;
}

.login-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

/* 成功状态 */
.login-success {
    color: #28a745;
    font-weight: 600;
    font-size: 16px;
    padding: 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
}

.login-success::before {
    content: '✓';
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    line-height: 24px;
    margin-right: 10px;
    vertical-align: middle;
}

/* 错误状态 */
.login-error {
    color: #dc3545;
    font-weight: 500;
    font-size: 14px;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 10px 0;
}

.login-error::before {
    content: '✗';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    line-height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

/* 关闭按钮 */
.login-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.login-close:hover {
    background: #f0f0f0;
    color: #666;
}

/* 刷新按钮 */
.login-refresh {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    transition: background-color 0.2s ease;
}

.login-refresh:hover {
    background: #0056b3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-modal {
        min-width: 280px;
        padding: 25px 20px;
        margin: 20px;
    }
    
    .login-title {
        font-size: 20px;
    }
    
    .qr-code-container img {
        max-width: 180px;
    }
    
    .login-tips {
        font-size: 13px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .login-modal {
        min-width: 260px;
        padding: 20px 15px;
    }
    
    .login-title {
        font-size: 18px;
    }
    
    .qr-code-container img {
        max-width: 160px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 登录状态指示器 */
.login-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

.login-status-indicator.online {
    background: #28a745;
}

.login-status-indicator.offline {
    background: #dc3545;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* 登录进度条 */
.login-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 15px 0;
}

.login-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progressAnimation 2s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

/* 登录统计信息 */
.login-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
}

.login-stat-item {
    text-align: center;
}

.login-stat-number {
    font-size: 18px;
    font-weight: 600;
    color: #007bff;
    display: block;
}

.login-stat-label {
    margin-top: 5px;
}
