/* ==================== 登录认证样式 ==================== */

/* 登录弹窗 - 最高优先级显示 */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    /* 最高优先级，确保登录框始终在最顶层 */
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.auth-modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.auth-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.auth-modal-close:hover {
    color: var(--text-primary);
}

/* 表单样式 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.auth-form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.auth-submit-btn {
    padding: 14px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* 登录提示 */
.auth-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 15px;
}

.auth-hint a {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.auth-hint a:hover {
    text-decoration: underline;
}

/* 需要登录才能看的区域 - 初始隐藏，由JS控制显示 */
/* 注意：这里不设置 display: none，因为JS需要能够控制显示状态 */
/* 初始隐藏状态由 initAuth() 函数设置 */

/* 未登录时显示的提示 */
.auth-guest-notice {
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 10px 0;
}

.auth-guest-notice .login-link {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}

/* 登录状态栏 */
.login-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 20px;
}

.login-status .user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.login-status .user-info {
    flex: 1;
}

.login-status .user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.login-status .user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-status .logout-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.login-status .logout-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* 密码强度指示 */
.password-strength {
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    margin-top: 5px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s;
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: #ef4444;
}

.password-strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.password-strength-bar.strong {
    width: 100%;
    background: #10b981;
}