/* ============================================================
 * auth-common.css — 经纬文献库 统一登录/注册 公共样式
 * 所有页面引入此文件即可共享统一的登录按钮、弹窗、徽章样式
 * ============================================================ */

/* ========== 1. 顶部栏按钮 — 对齐 Element Plus el-button ========== */
.auth-login-btn,
.auth-register-btn,
.auth-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    height: 32px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
    line-height: 1;
    box-sizing: border-box;
    white-space: nowrap;
    user-select: none;
}

/* 登录按钮 — 对齐 el-button type="primary" size="small" */
.auth-login-btn {
    background: #409eff;
    color: #fff;
    border: 1px solid #409eff;
}
.auth-login-btn:hover {
    background: #66b1ff;
    border-color: #66b1ff;
    color: #fff;
}
.auth-login-btn:active {
    background: #3a8ee6;
    border-color: #3a8ee6;
}

/* 注册按钮 — 对齐 el-button default size="small" */
.auth-register-btn {
    background: #fff;
    color: #606266;
    border: 1px solid #dcdfe6;
}
.auth-register-btn:hover {
    background: #ecf5ff;
    color: #409eff;
    border-color: #c6e2ff;
}
.auth-register-btn:active {
    color: #3a8ee6;
    border-color: #3a8ee6;
}

/* 退出按钮 — 对齐 el-button default size="small"，hover 变红 */
.auth-logout-btn {
    background: #fff;
    color: #606266;
    border: 1px solid #dcdfe6;
}
.auth-logout-btn:hover {
    background: #fef0f0;
    color: #f56c6c;
    border-color: #fbc4c4;
}
.auth-logout-btn:active {
    color: #dd6161;
    border-color: #dd6161;
}

/* ========== 2. 用户信息 & 会员徽章 ========== */
.auth-user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.auth-user-name {
    font-weight: 500;
    color: #303133;
    font-size: 0.9rem;
}
.auth-member-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 500;
}
.auth-member-badge.free {
    background: #f4f4f5;
    color: #909399;
}
.auth-member-badge.premium {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    color: white;
}

/* ========== 3. 认证弹窗（el-dialog 覆盖） ========== */
.auth-dialog .el-dialog__header {
    padding: 0;
    margin: 0;
}
.auth-dialog .el-dialog__body {
    padding: 1.5rem 2rem;
}
.auth-dialog .el-dialog__footer {
    padding: 0 2rem 1.5rem;
}

/* 渐变头部 */
.auth-dialog-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.8rem 2rem;
    text-align: center;
    color: white;
    border-radius: 16px 16px 0 0;
    margin: -20px -20px 0 -20px;
}
.auth-dialog-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}
.auth-dialog-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ========== 4. 登录方式切换 Tab ========== */
.auth-login-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    background: #f5f7fa;
    border-radius: 12px;
    padding: 4px;
}
.auth-login-tab {
    flex: 1;
    padding: 0.9rem;
    text-align: center;
    cursor: pointer;
    color: #606266;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s;
}
.auth-login-tab:hover {
    color: #667eea;
}
.auth-login-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ========== 5. 表单样式 ========== */
.auth-form {
    margin-top: 0.5rem;
}
.auth-form .el-form-item {
    margin-bottom: 1.2rem;
}
.auth-form .el-form-item__label {
    font-weight: 600;
    color: #303133;
}

/* 验证码输入组 */
.auth-sms-input-group {
    display: flex;
    gap: 0.6rem;
}
.auth-sms-input-group .el-input {
    flex: 1;
}
.auth-sms-input-group .el-button {
    width: 120px;
    flex-shrink: 0;
}

/* 表单附加行（记住我 / 忘记密码） */
.auth-form-extra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.auth-forgot-link {
    font-size: 0.85rem;
    color: #667eea;
    text-decoration: none;
}
.auth-forgot-link:hover {
    text-decoration: underline;
}

/* ========== 6. 社交登录 ========== */
.auth-social-divider {
    display: flex;
    align-items: center;
    margin: 1.2rem 0;
    color: #909399;
    font-size: 0.85rem;
}
.auth-social-divider::before,
.auth-social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e4e7ed, transparent);
}
.auth-social-divider span {
    padding: 0 1rem;
}
.auth-social-btns {
    display: flex;
    justify-content: center;
    gap: 1rem;
}
.auth-social-btn.wechat {
    color: #07c160;
    border-color: #07c160;
}
.auth-social-btn.wechat:hover {
    background: #07c160;
    color: white;
}
.auth-social-btn.qq {
    color: #12B7F5;
    border-color: #12B7F5;
}
.auth-social-btn.qq:hover {
    background: #12B7F5;
    color: white;
}

/* ========== 7. 提交按钮 ========== */
.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
}
.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* ========== 8. 弹窗底部链接 ========== */
.auth-footer-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #909399;
}
.auth-footer-link a {
    color: #667eea;
    text-decoration: none;
}
.auth-footer-link a:hover {
    text-decoration: underline;
}

/* ========== 9. 未登录拦截弹窗（原生 JS 创建） ========== */
.auth-guard-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2147483647;
    display: none;
    align-items: center;
    justify-content: center;
}
.auth-guard-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.auth-guard-icon {
    font-size: 48px;
    color: #f56c6c;
    margin-bottom: 16px;
    line-height: 1;
}
.auth-guard-title {
    font-size: 20px;
    color: #303133;
    margin: 0 0 12px 0;
}
.auth-guard-msg {
    font-size: 14px;
    color: #606266;
    line-height: 1.6;
    margin: 0 0 24px 0;
}
.auth-guard-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.auth-guard-cancel {
    padding: 10px 24px;
    border: 1px solid #dcdfe6;
    background: #fff;
    color: #606266;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.auth-guard-go {
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
