/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 20%, 
        #f093fb 40%, 
        #f5576c 60%, 
        #4facfe 80%,
        #6a11cb 100%);
    background-size: 500% 500%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    animation: backgroundGradient 20s ease infinite;
}

@keyframes backgroundGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 背景动画效果 - 主光晕 */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: glowRotate 20s linear infinite;
    pointer-events: none;
}

@keyframes glowRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 背景动画效果 - 彩色光斑 */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(120, 119, 198, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(255, 119, 198, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 30% 70%, rgba(120, 219, 255, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(255, 219, 120, 0.3) 0%, transparent 50%);
    animation: gradientShift 12s ease-in-out infinite;
    filter: blur(40px);
}

@keyframes gradientShift {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
    33% {
        transform: scale(1.1) rotate(120deg);
        opacity: 0.6;
    }
    66% {
        transform: scale(1.05) rotate(240deg);
        opacity: 0.7;
    }
}

/* 浮动粒子效果 - 使用额外的div */
.particle-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.2) 2px, transparent 2px),
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.15) 3px, transparent 3px),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12) 2px, transparent 2px),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 200px 200px, 150px 150px, 250px 250px, 180px 180px, 300px 300px, 220px 220px;
    animation: floatParticles 30s linear infinite;
    pointer-events: none;
}

@keyframes floatParticles {
    0% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-30px) rotate(90deg) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-60px) rotate(180deg) scale(1.05);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-30px) rotate(270deg) scale(0.95);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0px) rotate(360deg) scale(1);
        opacity: 0.4;
    }
}

/* 新增：动态光斑效果 */
.light-spot {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: lightSpotMove 20s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes lightSpotMove {
    0% {
        transform: translate(-50px, -50px) scale(0.8);
        opacity: 0.3;
    }
    25% {
        transform: translate(calc(100vw - 150px), 100px) scale(1.2);
        opacity: 0.5;
    }
    50% {
        transform: translate(200px, calc(100vh - 200px)) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translate(calc(100vw - 300px), 300px) scale(1.1);
        opacity: 0.6;
    }
    100% {
        transform: translate(100px, 100px) scale(1);
        opacity: 0.3;
    }
}

/* 登录容器 */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    min-width: 300px;
}

/* 机构图标 */
.org-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}

.org-logo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

/* 登录框 */
.login-box {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 45px 35px;
    box-shadow: 
        0 35px 70px rgba(0, 0, 0, 0.2),
        0 15px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 登录框发光效果 */
.login-box::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #ff6b6b);
    background-size: 600% 600%;
    z-index: -1;
    filter: blur(30px);
    opacity: 0.4;
    animation: glowing 8s ease infinite;
    transition: opacity 0.3s ease;
}

.login-box:hover::before {
    opacity: 0.5;
}

@keyframes glowing {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 登录头部 */
.login-header {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
}

.login-header h2 {
    color: #333;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 0 0px rgba(102, 126, 234, 0.3));
    }
    100% {
        filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.6));
    }
}

.login-header p {
    color: #888;
    font-size: 15px;
    font-weight: 400;
    position: relative;
    display: inline-block;
}

.login-header p::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #f5576c);
    animation: underlineExpand 2s ease-in-out infinite alternate;
}

@keyframes underlineExpand {
    0% {
        width: 0;
        left: 0;
    }
    100% {
        width: 100%;
        left: 0;
    }
}

/* 表单组 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

/* EasyUI 输入框样式调整 */
.textbox, .passwordbox {
    width: 100% !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.textbox .textbox-text {
    height: 44px;
    line-height: 44px;
    font-size: 15px;
    border-radius: 0px !important;
    border: none !important;
    border-bottom: 2px solid #e0e0e0 !important;
    transition: all 0.3s ease !important;
    background: transparent !important;
}

.textbox .textbox-text:focus {
    border-color: #667eea !important;
    box-shadow: none !important;
    border-bottom-width: 3px !important;
}

.textbox:hover .textbox-text {
    border-color: #b0b0b0 !important;
}

/* EasyUI 图标垂直居中 */
.textbox .textbox-icon, .passwordbox .textbox-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    width: 30px !important;
}

.textbox .textbox-icon:before, .passwordbox .textbox-icon:before {
    line-height: 1 !important;
    font-size: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 修复图标容器高度和位置 */
.textbox .textbox-addon, .passwordbox .textbox-addon {
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
}

.textbox .textbox-addon .textbox-icon, .passwordbox .textbox-addon .textbox-icon {
    top: 0 !important;
    margin-top: 0 !important;
}

/* 修复输入框整体高度 */
.textbox, .passwordbox {
    height: 42px !important;
}

.textbox .textbox-text, .passwordbox .textbox-text {
    height: 40px !important;
    line-height: 40px !important;
    padding: 0 10px !important;
}

.textbox .textbox-icon-disabled, .passwordbox .textbox-icon-disabled {
    opacity: 0.5 !important;
}

/* 修复右侧图标位置 */
.textbox .textbox-addon-right, .passwordbox .textbox-addon-right {
    right: 0 !important;
}

/* 修复图标悬停效果 */
.textbox .textbox-icon:hover, .passwordbox .textbox-icon:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* 验证码组 */
.captcha-group {
    margin-bottom: 25px;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-input {
    flex: 1;
}

.captcha-image {
    width: 110px;
    height: 44px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.captcha-image:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.captcha-image:active {
    transform: translateY(0);
}

#captchaCanvas {
    width: 100%;
    height: 100%;
}

.captcha-refresh {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.captcha-refresh:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.captcha-refresh:active {
    transform: rotate(90deg) scale(0.95);
}

.icon-reload:before {
    content: "↻";
    font-size: 16px;
}

/* 记住密码组 */
.remember-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.forgot-password {
    color: #1e88e5;
    text-decoration: none;
    font-size: 13px;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* 自定义登录按钮 */
.custom-login-btn {
    width: 100% !important;
    height: 48px !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #667eea) !important;
    background-size: 300% 300% !important;
    border: none !important;
    border-radius: 12px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    cursor: pointer;
    gap: 1px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* EasyUI 按钮文字和图标居中 */
.login-btn .l-btn-left {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    gap: 0 !important;  /* 完全移除间距 */
}

.login-btn .l-btn-text {
    line-height: 1 !important;
    margin: 0 !important;
    margin-left: -4px !important;  /* 负边距让文字靠近图标 */
    padding: 0 !important;
    color: white !important;
}

.login-btn .l-btn-icon {
    line-height: 1 !important;
    margin: 0 !important;
    margin-right: -4px !important;  /* 负边距让图标靠近文字 */
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 强制覆盖EasyUI所有可能的间距 */
.login-btn .l-btn-left .l-btn-icon,
.login-btn .l-btn-left .l-btn-icon-top,
.login-btn .l-btn-left .l-btn-icon-bottom {
    margin: 0 !important;
    padding: 0 !important;
    margin-right: -4px !important;
}

.login-btn .l-btn-left .l-btn-text,
.login-btn .l-btn-left .l-btn-empty {
    margin: 0 !important;
    padding: 0 !important;
    margin-left: -4px !important;
}

.login-btn::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 ease;
}

.custom-login-btn:hover {
    background-position: 100% 0% !important;
    transform: translateY(-3px) !important;
    box-shadow: 
        0 15px 35px rgba(102, 126, 234, 0.5),
        0 8px 20px rgba(118, 75, 162, 0.4) !important;
}

.custom-login-btn:active {
    transform: translateY(-1px) !important;
    box-shadow: 
        0 5px 15px rgba(102, 126, 234, 0.4) !important;
}

.custom-login-btn:hover::before {
    left: 100%;
}

/* 登录底部 */
.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer p {
    color: #666;
    font-size: 14px;
}

.register-link {
    color: #1e88e5;
    text-decoration: none;
    font-weight: 500;
}

.register-link:hover {
    text-decoration: underline;
}

/* 响应式设计 - 平板设备 */
@media (max-width: 1024px) {
    .login-wrapper {
        max-width: 380px;
    }
    
    .login-box {
        padding: 35px 25px;
    }
    
    .login-header h2 {
        font-size: 24px;
    }
}

/* 响应式设计 - 手机设备 */
@media (max-width: 768px) {
    .login-container {
        padding: 12px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .login-wrapper {
        max-width: 100%;
        min-width: unset;
    }
    
    .org-logo {
        margin-bottom: 18px;
    }
    
    .org-logo img {
        width: 96px;
        height: 96px;
    }
    
    .login-box {
        padding: 30px 20px;
        margin: 0;
        border-radius: 18px;
    }
    
    .login-header {
        margin-bottom: 25px;
    }
    
    .login-header h2 {
        font-size: 22px;
    }
    
    .login-header p {
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .captcha-container {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .captcha-image {
        width: 90px;
        height: 38px;
    }
    
    .textbox .textbox-text, .passwordbox .textbox-text {
        height: 42px;
        line-height: 42px;
        font-size: 14px;
    }
    
    .custom-login-btn {
        height: 46px !important;
        font-size: 16px !important;
    }
}

/* 响应式设计 - 小屏手机 */
@media (max-width: 480px) {
    .login-container {
        padding: 8px;
        padding-top: 30px;
    }
    
    .login-box {
        padding: 25px 15px;
        border-radius: 16px;
    }
    
    .login-header h2 {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .login-header p {
        font-size: 13px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .captcha-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .captcha-input {
        width: 100% !important;
    }
    
    .captcha-image {
        width: 100%;
        height: 42px;
        order: 2;
    }
    
    .captcha-refresh {
        width: 100%;
        height: 42px;
        order: 3;
        justify-content: center;
    }
    
    .custom-login-btn {
        height: 44px !important;
        font-size: 15px !important;
        border-radius: 10px !important;
    }
    
    /* 移动端优化：触摸友好的交互 */
    .textbox .textbox-text, .passwordbox .textbox-text {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border-radius: 10px !important;
    }
    
    /* 移动端输入框字体大小优化 */
    input[type="text"], input[type="password"], input[type="tel"] {
        font-size: 16px !important; /* 防止iOS自动缩放 */
    }
}

/* 动画效果 */
.login-box {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 抖动动画 */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* 自定义EasyUI图标 */
.icon-mobile:before {
    content: "📱";
}

.icon-lock:before {
    content: "🔒";
}

.icon-ok:before {
    content: "✓";
}

/* 错误状态样式 */
.validatebox-invalid {
    border-color: #f44336 !important;
}

.validatebox-tip {
    background: #f44336 !important;
    color: white !important;
    border: none !important;
}

/* 登录图标和文字 */
.login-icon {
    font-size: 18px;
    margin-right: 0;
    line-height: 1;
    color: #4CAF50; /* 绿色对号 */
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.login-text {
    line-height: 1;
    margin-left: 0;
}

/* 加载状态 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1e88e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}