/* ==================== 认证页面样式 ==================== */
.auth-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease;
}

.auth-title {
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    outline: none;
}

.form-input:focus {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #333;
    color: white;
}

.btn-primary:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.success-message {
    background: #efe;
    color: #3c3;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* ========== 登录对话框样式 ========== */
.auth-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

.auth-dialog {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 360px;
    max-width: 420px;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.auth-dialog h2 {
    margin: 0 0 32px 0;
    font-size: 28px;
    font-weight: 600;
    color: #222;
    text-align: center;
    letter-spacing: -0.5px;
}

.auth-form-group {
    margin-bottom: 24px;
}

.auth-form-group label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.auth-form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fafafa;
}

.auth-form-group input:focus {
    outline: none;
    border-color: #333;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #333 0%, #000 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.auth-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-error {
    color: #f44336;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
    padding: 10px;
    background: #ffebee;
    border-radius: 6px;
    font-weight: 500;
}

.auth-hint {
    color: #999;
    font-size: 13px;
    margin-top: 16px;
    text-align: center;
    line-height: 1.5;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 用户信息显示样式 ========== */
.user-info-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: absolute;
    right: 20px;
}

.user-info-display:hover {
    background: #f5f5f5;
    color: #333;
}

#usernameDisplay {
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用户菜单弹窗 */
.user-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    overflow: hidden;
    z-index: 1000;
    animation: menuSlideDown 0.2s ease-out;
}

.user-info-display:hover .user-menu {
    display: block !important;
}

.user-menu-item {
    padding: 14px 16px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease;
    font-size: 14px;
    display: block;
    text-align: left;
    background: none;
    border: none;
    width: 100%;
}

.user-menu-item:hover {
    background: #f8f8f8;
    color: #222;
}

.user-menu-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

@keyframes menuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .auth-dialog {
        margin: 0 16px;
        min-width: unset;
        max-width: unset;
        width: calc(100% - 32px);
        padding: 32px 24px;
    }

    .auth-dialog h2 {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .user-info-display {
        font-size: 12px;
        padding: 6px 10px;
    }

    #usernameDisplay {
        max-width: 100px;
    }

    .user-menu {
        right: 0;
        left: auto;
        min-width: 160px;
    }

    .user-menu-item {
        padding: 12px 14px;
        font-size: 13px;
    }
}