/**
 * 登录页完整样式 - 从原项目迁移
 * 包含所有背景效果、动画、样式
 */

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== CSS 变量 ========== */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1425;
    --bg-card: rgba(33, 38, 46, 0.95);
    --bg-elevated: #30363d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-color: #58a6ff;
    --accent-hover: #79c0ff;
    --accent-glow: rgba(88, 166, 255, 0.3);
    --success-color: #3fb950;
    --error-color: #f85149;
    --warning-color: #d29922;
    --border-color: rgba(48, 54, 61, 0.5);
    --input-bg: rgba(13, 17, 23, 0.8);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(88, 166, 255, 0.4);
}

/* ========== Body 样式 ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* ========== 登录容器 ========== */
.login-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 0;
}

/* ========== 系统标题 ========== */
.system-title {
    font-size: 64px;
    font-weight: 800;
    margin-bottom: 40px;
    text-align: center;
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #7eb4e8 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShine 3s ease-in-out infinite, glowPulse 2s ease-in-out infinite;
    text-shadow: 
        0 0 20px rgba(88, 166, 255, 0.5),
        0 0 40px rgba(88, 166, 255, 0.3),
        0 0 60px rgba(88, 166, 255, 0.2),
        0 0 80px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 0 30px rgba(88, 166, 255, 0.5));
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
}

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

@keyframes glowPulse {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 30px rgba(88, 166, 255, 0.5));
    }
    50% {
        opacity: 0.9;
        filter: drop-shadow(0 0 50px rgba(88, 166, 255, 0.8));
    }
}

/* ========== 蓝天效果 ========== */
.blue-sky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    background: linear-gradient(
        to bottom,
        rgba(0, 119, 194, 0.7) 0%,
        rgba(0, 162, 232, 0.6) 15%,
        rgba(91, 192, 222, 0.55) 30%,
        rgba(173, 216, 230, 0.5) 45%,
        rgba(255, 255, 255, 0.4) 55%,
        rgba(255, 220, 150, 0.3) 65%,
        rgba(255, 180, 100, 0.2) 75%,
        transparent 100%
    );
    z-index: -2;
    pointer-events: none;
    animation: skyDynamics 20s ease-in-out infinite;
    box-shadow: inset 0 -100px 80px rgba(0, 0, 0, 0.1);
    filter: brightness(1.3) contrast(1.2);
}

.blue-sky::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 35%),
        radial-gradient(ellipse at 80% 35%, rgba(255, 255, 255, 0.22) 0%, transparent 45%),
        radial-gradient(ellipse at 35% 40%, rgba(255, 255, 255, 0.18) 0%, transparent 50%);
    animation: cloudMove 60s linear infinite;
    filter: blur(3px);
}

.blue-sky::after {
    content: '';
    position: absolute;
    top: 8%;
    right: 12%;
    width: 180px;
    height: 180px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 240, 0.6) 0%, rgba(255, 250, 200, 0.3) 40%, transparent 70%);
    filter: blur(15px);
    animation: sunGlow 20s ease-in-out infinite;
}

@keyframes skyDynamics {
    0%, 100% {
        opacity: 0.95;
        filter: brightness(1.2) contrast(1.15);
    }
    50% {
        opacity: 1;
        filter: brightness(1.35) contrast(1.25);
    }
}

@keyframes cloudMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes sunGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ========== 动态背景效果 ========== */
.login-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    animation: backgroundFlow 15s ease-in-out infinite;
    z-index: -2;
    pointer-events: none;
}

.login-container::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.015) 0%,
        transparent 70%
    );
    animation: waveFlow 20s linear infinite;
    z-index: -2;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes backgroundFlow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(2%, 3%) scale(1.05);
    }
    50% {
        transform: translate(-1%, 2%) scale(1.03);
    }
    75% {
        transform: translate(3%, -2%) scale(1.04);
    }
}

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

/* ========== 长城背景图 ========== */
.great-wall-bg {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    background-image: url('../images/logo_b.jpg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
    filter: brightness(0.8) contrast(1.2) saturate(0.9);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0) 100%);
}

/* ========== 金光呼吸效果 ========== */
.golden-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 215, 0, 0.08) 0%,
        rgba(255, 200, 0, 0.04) 30%,
        rgba(255, 180, 0, 0.02) 50%,
        transparent 70%
    );
    animation: goldenBreathe 8s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes goldenBreathe {
    0% {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(20px);
    }
    30% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
        filter: blur(30px);
    }
    70% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: scale(1.1);
        filter: blur(40px);
    }
}

/* ========== 粒子效果 ========== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 20s infinite;
    opacity: 0;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; animation-delay: 6s; }
.particle:nth-child(5) { left: 50%; animation-delay: 8s; }
.particle:nth-child(6) { left: 60%; animation-delay: 10s; }
.particle:nth-child(7) { left: 70%; animation-delay: 12s; }
.particle:nth-child(8) { left: 80%; animation-delay: 14s; }
.particle:nth-child(9) { left: 90%; animation-delay: 16s; }
.particle:nth-child(10) { left: 95%; animation-delay: 18s; }

@keyframes float {
    0% {
        bottom: -10px;
        opacity: 0;
        transform: translateX(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        bottom: 100vh;
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ========== 登录框 ========== */
.auth-box {
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    padding: 20px 60px;
    width: 100%;
    max-width: 750px;
    box-shadow: none;
    border: none;
    position: relative;
    overflow: hidden;
    animation: boxFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

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

/* ========== 登录头部 ========== */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #7eb4e8 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShine 3s ease-in-out infinite, glowPulse 2s ease-in-out infinite;
    text-shadow: 
        0 0 20px rgba(88, 166, 255, 0.5),
        0 0 40px rgba(88, 166, 255, 0.3),
        0 0 60px rgba(88, 166, 255, 0.2),
        0 0 80px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 0 30px rgba(88, 166, 255, 0.5));
    letter-spacing: 2px;
    position: relative;
}

/* 标题下方蓝色滑动线条 */
.login-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 200%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(88, 166, 255, 0.2),
        rgba(88, 166, 255, 0.6),
        rgba(88, 166, 255, 0.2),
        transparent
    );
    transform: translateX(-50%);
    animation: titleLineSlide 3s ease-in-out infinite;
    filter: blur(1px);
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

/* ========== 表单样式 ========== */
.login-form {
    margin-bottom: 20px;
}

/* 横向表单布局 */
.form-row {
    display: flex;
    gap: 60px;
    align-items: flex-end;
    justify-content: center;
}

.form-row .form-group {
    flex: 0 0 150px;
    margin-bottom: 0;
}

.form-row .form-group:last-child {
    flex: 0 0 100px;
}

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

.form-input {
    width: 100%;
    padding: 12px 0;
    background: transparent !important;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    -webkit-box-reflect: none;
    box-shadow: none;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.12) inset !important;
    box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.12) inset !important;
    background: rgba(15, 23, 42, 0.12) !important;
    transition: background-color 5000s ease-in-out 0s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.form-input:focus {
    outline: none;
    border-bottom: 2px solid rgba(88, 166, 255, 0.8);
    box-shadow: 0 1px 0 0 rgba(88, 166, 255, 0.8);
    background: transparent !important;
}

.form-input:hover:not(:focus) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* 登录按钮 */
.login-btn {
    width: 100%;
    padding: 12px 0;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.6) 0%, rgba(31, 111, 235, 0.6) 100%);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(88, 166, 255, 0.5);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    height: 42px;
}

.login-btn:hover {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.8) 0%, rgba(31, 111, 235, 0.8) 100%);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.5);
    border-color: rgba(88, 166, 255, 0.8);
}

.login-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(88, 166, 255, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, #79c0ff 0%, #388bfd 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(88, 166, 255, 0.4), var(--shadow-glow);
}

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

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

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 错误/成功提示 */
.error-message,
.success-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: alertFadeIn 1s ease-in-out forwards;
    background: rgba(0, 0, 0, 0.3) !important;
    cursor: pointer;
    opacity: 1;
    pointer-events: auto;
}

.error-message.fade-out,
.success-message.fade-out {
    animation: fadeOutSlow 2s ease-out forwards !important;
    pointer-events: none;
}

@keyframes fadeOutSlow {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.error-message-text,
.success-message-text {
    padding: 40px 60px;
    border-radius: 10px;
    font-size: 32px;
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
    text-align: center;
    font-weight: bold;
    letter-spacing: 2px;
    background: transparent;
    pointer-events: none;
    margin-top: 80px;
}

.error-message-text {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5), 0 0 20px rgba(255, 107, 107, 0.3), 0 0 30px rgba(255, 255, 255, 0.2);
}

.success-message-text {
    color: #6bff6b;
    text-shadow: 0 0 10px rgba(107, 255, 107, 0.5), 0 0 20px rgba(107, 255, 107, 0.3), 0 0 30px rgba(255, 255, 255, 0.2);
}

@keyframes alertFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* 错误显示时隐藏表单 */
.auth-box.show-error .login-form,
.auth-box.show-success .login-form {
    display: none;
}

/* ========== 加载动画 ========== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px 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);
    }
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .system-title {
        font-size: 36px;
        margin-bottom: 30px;
    }
    
    .auth-box {
        padding: 36px 28px;
        max-width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .form-row .form-group {
        width: 100%;
    }
    
    .form-row .form-group:last-child {
        flex: none;
        width: 100%;
    }
    
    .form-input {
        padding: 13px 0;
    }
    
    .login-btn {
        padding: 15px 0;
        height: auto;
    }
}
