/* 登录弹窗样式 */
.layui-m-layerchild
{
    background-color: transparent !important;
}
/* 登录面板容器 */
#loginPanel {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

/* 登录窗口和注册窗口共同样式 */
#dlogin, #dsignup {
    width: 100%;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 登录框容器 */
.loginbox {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.loginbox::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12, #e74c3c);
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 标题样式 */
.loginbox::after {
    content: attr(data-title);
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: 600;
    color: #000;
    z-index: 1;
}

#dlogin .loginbox::after {
    content: '🔐 用户登录';
}

#dsignup .loginbox::after {
    content: '📝 用户注册';
}

/* 表单项容器 */
.loginbox dl {
    margin: 0 0 20px 0;
    position: relative;
}

.loginbox dl:first-of-type {
    margin-top: 25px;
}

.loginbox dd {
    margin: 0;
    position: relative;
}

/* 输入框样式 */
.loginbox input[type="text"],
.loginbox input[type="password"] {
    width: 100%;
    height: 50px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0 20px 0 50px;
    font-size: 16px;
    color: #000;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.loginbox input[type="text"]:focus,
.loginbox input[type="password"]:focus {
    border-color: #3498db;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.loginbox input[type="text"]:hover,
.loginbox input[type="password"]:hover {
    border-color: #bdc3c7;
    background: #fff;
}

/* 输入框图标 */
.loginbox dd::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* 邮箱图标 */
.loginbox dd:has(input[placeholder*="E-Mail"])::before {
    content: '📧';
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

/* 密码图标 */
.loginbox dd:has(input[type="password"])::before {
    content: '🔒';
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

/* 重复密码图标 */
.loginbox dd:has(input[placeholder*="Repeat"])::before {
    content: '🔐';
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

/* 获得焦点时图标颜色变化 */
.loginbox input:focus + *::before,
.loginbox dd:has(input:focus)::before {
    opacity: 1;
}

/* 登录按钮容器 */
.loginbtn {
    margin: 30px 0 25px 0;
    text-align: center;
}

/* 按钮样式 */
.loginbtn button {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loginbtn button::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.6s ease;
}

.loginbtn button:hover::before {
    left: 100%;
}

.loginbtn button:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.loginbtn button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

/* 加载状态 */
.loginbtn button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.loginbtn button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 切换链接文本 */
.loginbox p {
    text-align: center;
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.5;
}

.loginbox p a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    position: relative;
}

.loginbox p a:hover {
    color: #2980b9;
    background: rgba(52, 152, 219, 0.1);
    text-decoration: none;
}

.loginbox p a:active {
    transform: translateY(1px);
}

/* 错误信息 */
#loginmsg
{
    color: #ffffff !important;
    padding: 15px 0 5px 0 !important;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    background: rgba(231, 76, 60, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(231, 76, 60, 1);
    padding: 12px !important;
    margin-top: 15px;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

#loginmsg:not(:empty) {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 成功信息样式 */
#loginmsg.success {
    background: rgba(39, 174, 96, 0.6);
    border-color: rgba(39, 174, 96, 1);
}

/* 输入框验证状态 */
.loginbox input.error {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.loginbox input.success {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    #loginPanel {
        max-width: 350px;
        margin: 0 auto;
    }
    
    .loginbox {
        padding: 30px 25px;
        border-radius: 16px;
    }
    
    .loginbox input[type="text"],
    .loginbox input[type="password"] {
        height: 45px;
        font-size: 15px;
        padding: 0 18px 0 45px;
    }
    
    .loginbox dd::before {
        left: 16px;
        font-size: 14px;
    }
    
    .loginbtn button {
        height: 45px;
        font-size: 15px;
    }
    
    .loginbox p {
        font-size: 13px;
    }
    
    #loginmsg {
        font-size: 13px;
        padding: 10px !important;
    }
}

@media (max-width: 480px) {
    #loginPanel {
        max-width: 320px;
    }
    
    .loginbox {
        padding: 25px 20px;
        border-radius: 12px;
    }
    
    .loginbox input[type="text"],
    .loginbox input[type="password"] {
        height: 42px;
        font-size: 14px;
        padding: 0 16px 0 40px;
    }
    
    .loginbox dd::before {
        left: 14px;
        font-size: 12px;
    }
    
    .loginbtn button {
        height: 42px;
        font-size: 14px;
    }
    
    .loginbox p {
        font-size: 12px;
    }
    
    #loginmsg {
        font-size: 12px;
        padding: 8px !important;
    }
}

/* 深色主题兼容 */
@media (prefers-color-scheme: dark) {
    .loginbox {
        background: linear-gradient(135deg, #000 0%, #34495e 100%);
        border: 1px solid #4a5568;
    }
    
    .loginbox::after {
        color: #f7fafc;
    }
    
    .loginbox input[type="text"],
    .loginbox input[type="password"] {
        background: #4a5568;
        border-color: #718096;
        color: #f7fafc;
    }
    
    .loginbox input[type="text"]:focus,
    .loginbox input[type="password"]:focus {
        background: #2d3748;
        border-color: #4299e1;
        box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    }
    
    .loginbox p {
        color: #a0aec0;
    }
    
    .loginbox p a {
        color: #4299e1;
    }
    
    .loginbox p a:hover {
        color: #63b3ed;
        background: rgba(66, 153, 225, 0.1);
    }
}

/* 动画优化 */
.loginbox,
.loginbox input,
.loginbtn button {
    will-change: transform;
}

/* 无障碍优化 */
.loginbox input:focus,
.loginbtn button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 表单验证提示 */
.form-hint {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.form-hint.show {
    opacity: 1;
}

.form-hint.success {
    color: #27ae60;
}

.form-hint.error {
    color: #e74c3c;
}

/* 输入框获得焦点时的标签动画 */
.input-group {
    position: relative;
}

.input-group label {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: #95a5a6;
    font-size: 16px;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -8px;
    left: 20px;
    font-size: 12px;
    color: #3498db;
    background: #fff;
    padding: 0 5px;
} 