/* 登录页面 - 轻快科技感设计 */
:root {
    --primary-gradient: linear-gradient(135deg, #6B73FF 0%, #00D4FF 100%);
    --secondary-gradient: linear-gradient(135deg, #FFD8A9 0%, #FFB6D9 100%);
    --tech-gradient: linear-gradient(135deg, #A8EDEA 0%, #FED6E3 100%);
    --light-bg: #F7F9FC;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(107, 115, 255, 0.2);
    --text-dark: #2D3748;
    --text-muted: #718096;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    background: var(--light-bg);
    color: var(--text-dark);
}

/* 动态背景 */
.login-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.login-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #E0F7FA 0%, #F3E5F5 50%, #FFF9C4 100%);
    overflow: hidden;
}

/* 动态粒子效果 */
.login-background::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(102, 126, 234, 0.4), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(118, 75, 162, 0.4), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(79, 172, 254, 0.3), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(0, 242, 254, 0.3), transparent);
    background-size: 200px 200px, 300px 300px, 250px 250px, 350px 350px;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 光晕效果 */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: orbFloat 8s ease-in-out infinite;
}

.glow-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-gradient);
    top: -100px;
    left: -100px;
}

.glow-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--tech-gradient);
    bottom: -50px;
    right: -50px;
    animation-delay: -4s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
}

/* 网格线背景 */
.grid-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* 登录卡片 */
.login-card {
    position: relative;
    width: 450px;
    padding: 50px 45px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--card-border);
    box-shadow: 
        0 20px 60px 0 rgba(107, 115, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.9);
    z-index: 10;
    animation: cardSlideUp 0.8s ease-out;
}

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

/* Logo区域 */
.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--primary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    animation: logoFloat 3s ease-in-out infinite;
}

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

.login-logo h2 {
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
}

/* 表单样式 */
.login-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    z-index: 1;
}

.form-control {
    width: 100%;
    padding: 15px 18px 15px 50px;
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    color: var(--text-dark);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    background: #FFFFFF;
    border-color: #6B73FF;
    box-shadow: 0 0 0 4px rgba(107, 115, 255, 0.1);
}

.form-control::placeholder {
    color: #CBD5E0;
}

/* 记住密码 */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.form-check label {
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.forgot-link:hover {
    color: #764ba2;
}

/* 登录按钮 */
.btn-login {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

/* 错误提示 */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}

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

.alert-danger {
    background: rgba(245, 87, 108, 0.1);
    border: 1px solid rgba(245, 87, 108, 0.3);
    color: #f5576c;
}

.alert-success {
    background: rgba(80, 250, 123, 0.1);
    border: 1px solid rgba(80, 250, 123, 0.3);
    color: #50fa7b;
}

/* 底部装饰 */
.login-footer {
    margin-top: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.version-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 12px;
    margin-top: 10px;
}

/* 响应式设计 */
@media (max-width: 576px) {
    .login-card {
        width: 90%;
        padding: 40px 25px;
        margin: 20px;
    }

    .login-logo h2 {
        font-size: 24px;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
}

/* Loading动画 */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* 数据流动画效果 */
.data-stream {
    position: absolute;
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #667eea, transparent);
    animation: streamFlow 3s linear infinite;
    opacity: 0.5;
}

.data-stream:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.data-stream:nth-child(2) {
    left: 30%;
    animation-delay: 1s;
}

.data-stream:nth-child(3) {
    left: 50%;
    animation-delay: 2s;
}

.data-stream:nth-child(4) {
    left: 70%;
    animation-delay: 1.5s;
}

.data-stream:nth-child(5) {
    left: 90%;
    animation-delay: 0.5s;
}

@keyframes streamFlow {
    0% {
        top: -100px;
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ========== 验证码样式 - 优化版 ========== */
.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-input {
    flex: 1; /* 自动填充剩余空间 */
    max-width: 180px; /* 限制最大宽度 */
    min-width: 120px; /* 保证最小宽度 */
}

.captcha-input .input-wrapper {
    padding: 0; /* 移除多余的padding */
}

.captcha-input .input-wrapper i {
    display: none; /* 隐藏图标，节省空间 */
}

.captcha-input .form-control {
    text-transform: uppercase;
    letter-spacing: 5px;
    font-weight: 700;
    text-align: center;
    font-size: 20px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    border-radius: 10px;
    height: 45px; /* 与验证码图片同高 */
}

.captcha-input .form-control:focus {
    background: rgba(255, 255, 255, 1);
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    letter-spacing: 6px;
}

.captcha-image {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.captcha-image img {
    width: 130px;
    height: 45px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f5faff 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.captcha-image img:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
}

.captcha-image img:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.btn-refresh-captcha {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

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

.btn-refresh-captcha:hover::before {
    width: 100px;
    height: 100px;
}

.btn-refresh-captcha:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-refresh-captcha:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-refresh-captcha i {
    transition: transform 0.5s ease;
    position: relative;
    z-index: 1;
}

.btn-refresh-captcha:hover i {
    transform: rotate(180deg);
}

/* 验证码提示文字 */
.form-group label[for="captcha"] {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label[for="captcha"] i {
    color: #667eea;
}

/* 验证码标签优化 */
.form-group label[for="captcha"] {
    margin-bottom: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .captcha-input {
        max-width: 150px;
        min-width: 110px;
    }
    
    .captcha-input .form-control {
        font-size: 18px;
        letter-spacing: 4px;
    }
    
    .captcha-image img {
        width: 110px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .captcha-wrapper {
        gap: 10px;
    }
    
    .captcha-input {
        max-width: 120px;
        min-width: 100px;
    }
    
    .captcha-input .form-control {
        font-size: 16px;
        letter-spacing: 3px;
        padding: 8px 6px;
        height: 40px;
    }
    
    .captcha-image img {
        width: 110px;
        height: 38px;
    }
    
    .btn-refresh-captcha {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
}

/* 验证码加载动画 */
@keyframes captcha-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.captcha-image img.loading {
    animation: captcha-pulse 1s ease-in-out infinite;
}
