/**
 * 登录/注册/找回密码页面样式
 * 包含背景、容器、表单、按钮、提示信息等样式
 */

/* ==================== 基础样式 ==================== */
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

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

body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Microsoft YaHei', sans-serif;
    position: relative;
    padding: 20px;
    overflow-x: hidden;
}

/* ==================== 背景图片层 ==================== */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/login-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

/* ==================== 蒙版层 ==================== */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.85) 0%, rgba(118, 75, 162, 0.85) 100%);
    z-index: -1;
}

/* ==================== 登录容器 ==================== */
.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
}

/* ==================== 登录头部 ==================== */
.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header p {
    opacity: 0.9;
    font-size: 14px;
}

/* ==================== 登录主体 ==================== */
.login-body {
    padding: 30px 30px 10px;
}

/* ==================== 登录标签 ==================== */
.login-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    background: #f5f5f5;
    padding: 5px;
    border-radius: 10px;
}

.tab-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 15px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==================== 标签内容 ==================== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== 表单选项 ==================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #606266;
    cursor: pointer;
    font-size: 14px;
}

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

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

.forgot-link:hover {
    text-decoration: underline;
}

/* ==================== 按钮全宽 ==================== */
.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

/* ==================== 微信登录内容 ==================== */
.wechat-login-content {
    text-align: center;
}

.qrcode-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qrcode-container {
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #606266;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.is-error {
    border-color: #f56c6c;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group .form-control {
    flex: 1;
}

.error-message {
    color: #f56c6c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.btn-code {
    background: #667eea;
    color: white;
    white-space: nowrap;
    min-width: 100px;
}

.btn-code:disabled {
    background: #c0c4cc;
}

/* ==================== 登录选项 ==================== */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    font-size: 14px;
}

.login-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #606266;
    cursor: pointer;
}

.login-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.login-options a {
    color: #667eea;
    text-decoration: none;
}

/* ==================== 登录底部 ==================== */
.login-footer {
    text-align: center;
    margin-top: 10px;
    padding-top: 10px;
    padding-bottom: 15px;
    border-top: 1px solid #e4e7ed;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

/* ==================== 提示信息 ==================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

/* ==================== 协议提示 ==================== */
.agreement {
    font-size: 12px;
    color: #909399;
    margin-top: 10px;
    margin-bottom: 0;
    text-align: center;
}

.agreement a {
    color: #667eea;
    text-decoration: none;
}

.agreement a:hover {
    text-decoration: underline;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background: #67c23a;
}

.toast.error {
    background: #f56c6c;
}

.pending-notice {
    background: #fdf6ec;
    border: 1px solid #f5dab1;
    color: #e6a23c;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 15px;
    display: none;
}

.pending-notice.show {
    display: block;
}

/* ==================== 分隔线 ==================== */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #909399;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e4e7ed;
}

.divider span {
    padding: 0 15px;
}

/* ==================== 管理员链接 ==================== */
.admin-link {
    text-align: center;
    margin-top: 15px;
}

.admin-link a {
    color: #909399;
    text-decoration: none;
    font-size: 13px;
}

.admin-link a:hover {
    color: #667eea;
}

/* ==================== 微信登录样式 ==================== */
.wechat-login-section {
    text-align: center;
}

.btn-wechat {
    width: 100%;
    background: #07c160;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
}

.btn-wechat:hover {
    background: #06ad56;
}

#wechatQrCode {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e4e7ed;
}

.qrcode-container {
    position: relative;
    width: 300px;
    height: 400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    border: 1px solid #e4e7ed;
    overflow: hidden;
}

.qr-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    color: #909399;
    font-size: 13px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e4e7ed;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 8px;
}

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

#qrFrame {
    width: 100%;
    height: 100%;
    border: none;
}

.qr-tips {
    margin: 15px 0;
    text-align: center;
}

.qr-tips p {
    margin: 5px 0;
    font-size: 13px;
    color: #606266;
}

#qrStatus {
    color: #07c160;
    font-weight: 500;
}

.qr-countdown {
    font-size: 12px;
    color: #909399;
}

.qr-countdown span {
    color: #f56c6c;
    font-weight: 600;
    font-family: monospace;
}

.btn-secondary {
    background: #909399;
    color: white;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #73767a;
}

/* ==================== 响应式 ==================== */
@media (max-width: 480px) {
    .login-container {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .login-body {
        padding: 20px;
    }

    .qrcode-container {
        width: 280px;
        height: 380px;
    }

    .tab-btn {
        font-size: 14px;
        padding: 12px 10px;
    }

    .login-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

/* ==================== 图形验证码 ==================== */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.captcha-image {
    border: 2px solid #e0e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s;
    width: 120px;
    height: 40px;
    background: #ffffff;
    padding: 3px;
}

.captcha-image:hover {
    border-color: #667eea;
}

.captcha-input {
    flex: 1;
    max-width: 150px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 3px;
}

.captcha-refresh {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e5e5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.captcha-refresh:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.captcha-refresh:active {
    transform: scale(0.95);
}

/* ==================== 响应式验证码 ==================== */
@media (max-width: 480px) {
    .captcha-container {
        flex-direction: column;
        gap: 10px;
    }

    .captcha-image {
        width: 100%;
        height: auto;
    }

    .captcha-input {
        max-width: none;
        width: 100%;
        text-align: center;
    }

    .captcha-refresh {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
}

/* ==================== 加载动画 ==================== */
.captcha-loading {
    position: relative;
}

.captcha-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==================== 错误状态 ==================== */
.captcha-container.is-error .captcha-image {
    border-color: #dc3545;
}

.captcha-container.is-error .captcha-input {
    border-color: #dc3545;
}

.captcha-container.is-error .captcha-refresh {
    border-color: #dc3545;
}
}
