/* ==================== 登录页面专属样式 ==================== */

/* 登录页面主体 */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* 背景动画效果 */
.login-body::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(88, 166, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: -250px;
    right: -250px;
    animation: float 20s infinite alternate;
}

.login-body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(35, 134, 54, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
    animation: float 15s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* 背景元素装饰 */
.Bottom-Background {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 登录卡片 */
.card-login {
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(48, 54, 61, 0.8);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 1px rgba(88, 166, 255, 0.2) inset;
    position: relative;
    overflow: hidden;
}

.card-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent,
        #58a6ff,
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 登录标题区 */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #58a6ff 0%, #79c0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(88, 166, 255, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(88, 166, 255, 0.6));
    }
}

.login-header p {
    color: #8b949e;
    font-size: 0.95rem;
    margin: 0;
}

/* 登录表单 */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-form .form-group {
    position: relative;
    margin-bottom: 0;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #c9d1d9;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.login-form .form-group:focus-within label {
    color: #58a6ff;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.875rem 2.75rem 0.875rem 1rem;
    background: rgba(13, 17, 23, 0.8);
    border: 2px solid #30363d;
    border-radius: 8px;
    color: #c9d1d9;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #58a6ff;
    background: rgba(13, 17, 23, 0.95);
    box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.1),
                0 0 20px rgba(88, 166, 255, 0.1);
}

.login-form input::placeholder {
    color: #6e7681;
}

/* 输入框图标 */
.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: #6e7681;
    pointer-events: none;
    transition: color 0.3s ease;
}

.login-form .form-group:focus-within .input-icon {
    color: #58a6ff;
}

/* 密码可见性切换按钮 */
.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6e7681;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10;
}

.toggle-password:hover {
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.1);
}

/* 密码提示 */
.password-hint {
    font-size: 0.8rem;
    color: #6e7681;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* MFA验证码部分 */
.mfa-section {
    display: none;
    margin-top: 0;
    animation: fadeInScale 0.4s ease-out;
}

.mfa-section.show {
    display: block;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 验证码部分 */
.captcha-section {
    display: none;
    margin-top: 0;
    animation: fadeInScale 0.4s ease-out;
}

.captcha-section.show {
    display: block;
}

.captcha-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.captcha-background {
    position: relative;
    width: 100%;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #30363d;
    background: #0d1117;
    transition: border-color 0.3s ease;
}

.captcha-background:hover {
    border-color: #58a6ff;
}

.captcha-slider-track {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
}

.captcha-slider {
    position: absolute;
    left: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #58a6ff 0%, #1f6feb 100%);
    border-radius: 8px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1.5rem;
}

.captcha-slider:hover {
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.4);
}

.captcha-slider:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.captcha-tips {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #8b949e;
}

/* 安全信息提示 */
.security-info {
    font-size: 0.85rem;
    color: #8b949e;
    margin-top: 0;
    padding: 1rem;
    background: rgba(88, 166, 255, 0.08);
    border-radius: 8px;
    border-left: 3px solid #58a6ff;
    line-height: 1.6;
}

.security-info strong {
    color: #58a6ff;
    display: block;
    margin-bottom: 0.5rem;
}

.security-info ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.security-info li {
    margin: 0.25rem 0;
}

/* 登录按钮 */
.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.3);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.login-btn:hover::before {
    width: 300px;
    height: 300px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35, 134, 54, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-btn .btn-text {
    position: relative;
    z-index: 1;
}

.btn-loader {
    display: none;
    position: relative;
    z-index: 1;
}

.login-btn:disabled .btn-text {
    display: none;
}

.login-btn:disabled .btn-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 状态消息 */
.status-message {
    display: none;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease-out;
    text-align: center;
}

.status-message.success {
    background: rgba(35, 134, 54, 0.15);
    color: #3fb950;
    border: 1px solid rgba(35, 134, 54, 0.3);
}

.status-message.error {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 响应式设计 ==================== */

/* 平板 */
@media (max-width: 768px) {
    .login-body::before,
    .login-body::after {
        display: none;
    }

    .card-login {
        padding: 2rem 1.5rem;
        border-radius: 12px;
    }

    .login-header h1 {
        font-size: 1.75rem;
    }

    .Bottom-Background {
        max-width: 400px;
    }
}

/* 手机 */
@media (max-width: 480px) {
    .login-body {
        padding: 0.75rem;
    }

    .card-login {
        padding: 1.75rem 1.25rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .login-header p {
        font-size: 0.85rem;
    }

    .login-form input[type="text"],
    .login-form input[type="password"] {
        padding: 0.75rem 2.5rem 0.75rem 0.875rem;
        font-size: 0.9rem;
    }

    .login-btn {
        padding: 0.875rem;
        font-size: 0.95rem;
    }

    .security-info {
        font-size: 0.8rem;
        padding: 0.875rem;
    }

    .captcha-container {
        max-width: 100%;
    }

    .captcha-background {
        height: 120px;
    }

    .captcha-slider {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .captcha-slider-track {
        height: 50px;
    }
}

/* 超小屏幕 */
@media (max-width: 360px) {
    .card-login {
        padding: 1.5rem 1rem;
    }

    .login-header h1 {
        font-size: 1.35rem;
    }
}

/* 黑暗模式优化 */
@media (prefers-color-scheme: dark) {
    .login-body {
        background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    }
}

/* 打印样式 */
@media print {
    .login-body::before,
    .login-body::after {
        display: none;
    }
}
