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

body, html {
    height: 100%;
    font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, Tahoma, sans-serif;
    overflow: hidden;
}

.login-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    z-index: 0;
}

.login-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../image/1689244536251726.jpg') center center;
    background-size: cover;
    opacity: 0.3;
}

.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.login-box {
    position: relative;
    z-index: 1;
    width: 420px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 35px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    animation: slideUp 0.5s ease-out;
}

/* 右上角切换标签 */
.login-switch-label {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.switch-link {
    color: #667eea;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.switch-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

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

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-header .logo {
    margin-bottom: 12px;
}

.login-header .logo img {
    width: 70px;
    height: auto;
}

.login-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 6px;
    font-weight: 600;
}

.login-header p {
    font-size: 13px;
    color: #666;
}

.login-subtitle {
    font-size: 13px;
    color: #666;
    transition: opacity 0.3s ease;
}

/* 登录内容区域容器 - 防止布局跳动 */
.login-content-wrapper {
    position: relative;
    width: 100%;
    min-height: 350px;
}

/* 登录内容区域 - 使用绝对定位重叠，避免布局跳动 */
.login-form {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s ease;
    pointer-events: auto;
}

.login-form:not(.active) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease 0s, visibility 0s ease 0.3s;
}

.qrcode-login {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease 0s, visibility 0s ease 0.3s;
    pointer-events: none;
}

.qrcode-login.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease 0.15s, visibility 0s ease 0s;
}

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

.form-group {
    margin-bottom: 18px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 0 15px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.input-wrapper:focus-within {
    background: #fff;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-icon {
    font-size: 18px;
    margin-right: 12px;
    color: #999;
}

.input-wrapper input {
    flex: 1;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #333;
    outline: none;
}

.input-wrapper input::placeholder {
    color: #999;
}

.password-toggle {
    cursor: pointer;
    font-size: 18px;
    color: #999;
    padding: 5px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #667eea;
}

.form-options {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    margin-bottom: 12px;
    font-size: 14px;
}

.back-home {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.back-home:hover {
    color: #764ba2;
    text-decoration: underline;
}

.back-home:before {
    content: '←';
    font-size: 16px;
}

.error-message {
    min-height: 20px;
    color: #ff4757;
    font-size: 13px;
    margin-bottom: 10px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

.login-btn {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: inline-block;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: #999;
}

/* 扫码登录区域样式 */
.qrcode-container {
    text-align: center;
}

.qrcode-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qrcode-image {
    width: 200px;
    height: 200px;
    min-width: 200px;
    min-height: 200px;
    border: 4px solid #f5f5f5;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qrcode-image canvas,
.qrcode-image img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.qrcode-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qrcode-loading p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.qrcode-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.95);
    border-radius: 12px;
    color: #fff;
}

.overlay-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.qrcode-overlay p {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.qrcode-tips {
    margin-bottom: 20px;
    text-align: center;
}

.tips-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.refresh-qrcode {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    cursor: pointer;
    margin-left: 8px;
}

.refresh-qrcode:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 注册表单样式 */
.register-form {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease 0s, visibility 0s ease 0.3s;
    pointer-events: none;
}

.register-form.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease 0.15s, visibility 0s ease 0s;
}

/* 注册表单输入框间距 */
.register-form .form-group {
    margin-bottom: 12px;
}

/* 验证码输入框容器 */
.verify-code-wrapper {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.verify-code-wrapper .input-wrapper {
    flex: 1;
    margin-bottom: 0;
}

/* 发送验证码按钮 */
.send-code-btn {
    min-width: 100px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 15px;
    white-space: nowrap;
}

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

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

.send-code-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 返回扫码登录链接 */
.back-to-qrcode {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.back-to-qrcode:hover {
    color: #764ba2;
    text-decoration: underline;
}

.back-to-qrcode:before {
    content: '←';
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .login-box {
        width: 90%;
        padding: 40px 30px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .login-switch-label {
        top: 15px;
        right: 15px;
    }
    
    .switch-link {
        font-size: 13px;
    }
    
    .qrcode-image {
        width: 180px;
        height: 180px;
    }
    
    .qrcode-wrapper {
        padding: 15px;
    }
}

