/* ================================
   通用登录/注册弹窗样式
   ================================ */

/* 遮罩层 */
.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.auth-modal-overlay.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 弹窗主体 */
.auth-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.auth-modal.show {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 关闭按钮 */
.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #666;
}

.auth-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

/* Logo区域 */
.auth-modal-logo {
    text-align: center;
    margin-bottom: 25px;
}

.auth-modal-logo h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.auth-modal-logo p {
    font-size: 14px;
    color: #666;
}

/* Tab切换 */
.auth-modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: #f5f7fa;
    padding: 5px;
    border-radius: 10px;
}

.auth-tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

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

/* 表单面板 */
.auth-form-panel {
    display: none;
}

.auth-form-panel.active {
    display: block;
    animation: fadeInPanel 0.3s ease;
}

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

/* 输入组 */
.auth-input-group {
    margin-bottom: 18px;
}

.auth-input-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.auth-input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

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

.auth-input-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #999;
}

/* 密码包装器 */
.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper input {
    padding-right: 45px;
}

.auth-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    user-select: none;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.auth-toggle-password:hover {
    opacity: 1;
}

/* 密码强度 */
.auth-password-strength {
    margin-top: 6px;
}

.auth-strength-bar {
    height: 4px;
    background: #e1e8ed;
    border-radius: 2px;
    overflow: hidden;
}

.auth-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
    border-radius: 2px;
}

.auth-strength-fill.weak {
    width: 33%;
    background: #ff4757;
}

.auth-strength-fill.medium {
    width: 66%;
    background: #ffa502;
}

.auth-strength-fill.strong {
    width: 100%;
    background: #26de81;
}

.auth-strength-text {
    display: inline-block;
    margin-top: 3px;
    font-size: 12px;
    color: #999;
}

/* 表单选项 */
.auth-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    font-size: 13px;
}

.auth-remember-me {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: #666;
}

.auth-remember-me input {
    cursor: pointer;
}

.auth-forgot-password {
    color: #667eea;
    text-decoration: none;
}

.auth-forgot-password:hover {
    text-decoration: underline;
}

/* 协议 */
.auth-agreement {
    margin-bottom: 18px;
}

.auth-agreement label {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.auth-agreement input {
    margin-top: 2px;
    cursor: pointer;
}

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

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

/* 提交按钮 */
.auth-submit-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

/* 底部信息 */
.auth-modal-footer {
    margin-top: 20px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e1e8ed;
}

.auth-modal-footer p {
    color: #666;
    font-size: 13px;
}

.auth-modal-footer strong {
    color: #667eea;
}

/* Toast提示 */
.auth-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s;
    pointer-events: none;
    z-index: 10000;
}

.auth-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.auth-toast.success { background: #26de81; }
.auth-toast.error { background: #ff4757; }
.auth-toast.warning { background: #ffa502; }

/* 响应式 */
@media (max-width: 480px) {
    .auth-modal {
        padding: 30px 20px;
        width: 95%;
    }

    .auth-modal-logo h2 {
        font-size: 20px;
    }
}
