/* 用户认证与个人档案控件样式 (User Auth & Profile Widget) */

.user-auth-widget {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
}

.user-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-auth-btn:hover {
    background: #ffffff;
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.user-auth-icon {
    font-size: 14px;
}

.user-auth-text {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 已登录状态下拉卡片 */
.user-profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    padding: 12px;
    z-index: 1000;
    animation: authFadeIn 0.2s ease-out forwards;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    margin-bottom: 8px;
}

.user-avatar-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.user-info-text {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-status-tag {
    font-size: 11px;
    color: #10b981;
    font-weight: 500;
}

.user-profile-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.user-menu-item:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}

.user-menu-item--logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

/* 登录/注册模态弹窗 */
.user-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.user-auth-card {
    width: 90%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: authCardPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.user-auth-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.user-auth-card__title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.user-auth-card__close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.user-auth-card__close:hover {
    color: #0f172a;
}

.user-auth-card__desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.user-auth-form-group {
    margin-bottom: 14px;
}

.user-auth-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.user-auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    font-size: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
}

.user-auth-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.user-auth-error {
    font-size: 12px;
    color: #ef4444;
    background: #fef2f2;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.user-auth-actions {
    margin-top: 18px;
}

.user-auth-submit-btn {
    width: 100%;
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    transition: all 0.2s ease;
}

.user-auth-submit-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

.user-auth-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 14px;
    text-align: center;
    line-height: 1.4;
}
