/* ============================================
   用户认证相关样式
   ============================================ */

/* 顶部用户区域 */
.header {
    position: relative;
    z-index: 100;
    overflow: visible !important;
}

.header-user-area {
    position: absolute;
    top: 20px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 99999;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

.user-info-area {
    display: none;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    z-index: 99999;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-nickname {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用户下拉菜单 */
.user-menu-dropdown {
    position: fixed;
    top: auto;
    right: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 99999;
    overflow: hidden;
    animation: menuSlideDown 0.2s ease;
}

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

.user-menu-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
}

.user-menu-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.user-menu-role {
    font-size: 12px;
    color: #667eea;
    margin-top: 4px;
}

.user-menu-divider {
    height: 1px;
    background: #f0f0f0;
}

.user-menu-item {
    padding: 12px 20px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu-item:hover {
    background: #f8f9ff;
}

.user-menu-logout {
    color: #e74c3c;
}

.user-menu-logout:hover {
    background: #fff5f5;
}

/* 登录/注册弹窗 */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.auth-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 420px;
    z-index: 9999;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}

.auth-modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.auth-modal h2 {
    text-align: center;
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.auth-modal .auth-subtitle {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 28px;
}

.auth-input-group {
    margin-bottom: 16px;
}

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

.auth-input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    outline: none;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

.auth-input-group input::placeholder {
    color: #ccc;
}

.auth-error {
    color: #e74c3c;
    font-size: 13px;
    text-align: center;
    margin-bottom: 12px;
    min-height: 20px;
}

.auth-submit-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

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

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #999;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

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

/* Toast提示 */
.auth-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(44, 62, 80, 0.9);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.auth-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 响应式 */
@media (max-width: 768px) {
    .header-user-area {
        top: 15px;
        right: 15px;
    }
    
    .auth-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
    
    .auth-modal {
        padding: 30px 24px;
        width: 92%;
    }
    
    .user-nickname {
        display: none;
    }
}


/* ====== 验证码发送按钮 ====== */
.auth-send-code-btn {
    white-space: nowrap;
    padding: 0 16px;
    height: 42px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 110px;
}
.auth-send-code-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}
.auth-send-code-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}
